diff --git a/src/omv/boards/ARDUINO_GIGA/omv_boardconfig.h b/src/omv/boards/ARDUINO_GIGA/omv_boardconfig.h index 629462658..2728d734b 100644 --- a/src/omv/boards/ARDUINO_GIGA/omv_boardconfig.h +++ b/src/omv/boards/ARDUINO_GIGA/omv_boardconfig.h @@ -76,9 +76,6 @@ // Enable WiFi debug #define OMV_ENABLE_WIFIDBG (0) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (0) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (320 * 240 * 2) @@ -90,9 +87,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 256 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.0" - // USB IRQn. #define OMV_USB_IRQN (OTG_FS_IRQn) #define OMV_USB_ULPI (0) diff --git a/src/omv/boards/ARDUINO_NANO_RP2040_CONNECT/omv_boardconfig.h b/src/omv/boards/ARDUINO_NANO_RP2040_CONNECT/omv_boardconfig.h index 2cf20e6dd..51105dcd4 100644 --- a/src/omv/boards/ARDUINO_NANO_RP2040_CONNECT/omv_boardconfig.h +++ b/src/omv/boards/ARDUINO_NANO_RP2040_CONNECT/omv_boardconfig.h @@ -67,9 +67,6 @@ extern unsigned char *OMV_UNIQUE_ID_ADDR; // Unique address. #define OMV_ENABLE_TUSBDBG (1) #define OMV_TUSBDBG_PACKET (64) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (0) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (160 * 120) @@ -81,9 +78,6 @@ extern unsigned char *OMV_UNIQUE_ID_ADDR; // Unique address. // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 16 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB IRQn. #define OMV_USB_IRQN (USBCTRL_IRQ_IRQn) #define OMV_USB1_IRQ_HANDLER (USBD_IRQHandler) diff --git a/src/omv/boards/ARDUINO_NICLA_VISION/omv_boardconfig.h b/src/omv/boards/ARDUINO_NICLA_VISION/omv_boardconfig.h index f6b02f58d..dcb621df4 100644 --- a/src/omv/boards/ARDUINO_NICLA_VISION/omv_boardconfig.h +++ b/src/omv/boards/ARDUINO_NICLA_VISION/omv_boardconfig.h @@ -71,9 +71,6 @@ // Enable WiFi debug #define OMV_ENABLE_WIFIDBG (0) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (0) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (320 * 240 * 2) @@ -85,9 +82,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 16 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.0" - // USB IRQn. #define OMV_USB_IRQN (OTG_HS_IRQn) #define OMV_USB_ULPI (1) diff --git a/src/omv/boards/ARDUINO_PORTENTA_H7/omv_boardconfig.h b/src/omv/boards/ARDUINO_PORTENTA_H7/omv_boardconfig.h index 3e7560ca2..8d9634d5e 100644 --- a/src/omv/boards/ARDUINO_PORTENTA_H7/omv_boardconfig.h +++ b/src/omv/boards/ARDUINO_PORTENTA_H7/omv_boardconfig.h @@ -85,9 +85,6 @@ // Enable WiFi debug #define OMV_ENABLE_WIFIDBG (0) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (0) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (320 * 240 * 2) @@ -99,9 +96,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 256 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.0" - // USB IRQn. #define OMV_USB_IRQN (OTG_HS_IRQn) #define OMV_USB_ULPI (1) diff --git a/src/omv/boards/OPENMV1/omv_boardconfig.h b/src/omv/boards/OPENMV1/omv_boardconfig.h index cfe9fafeb..ae899785a 100644 --- a/src/omv/boards/OPENMV1/omv_boardconfig.h +++ b/src/omv/boards/OPENMV1/omv_boardconfig.h @@ -23,9 +23,6 @@ #define OMV_MAX_BLOB_FRAME FRAMESIZE_QCIF #define OMV_MAX_BLOB_FRAME_STR "QCIF" -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB IRQn. #define OMV_USB_IRQN (OTG_FS_IRQn) diff --git a/src/omv/boards/OPENMV2/omv_boardconfig.h b/src/omv/boards/OPENMV2/omv_boardconfig.h index 552696092..a8fbd9b41 100644 --- a/src/omv/boards/OPENMV2/omv_boardconfig.h +++ b/src/omv/boards/OPENMV2/omv_boardconfig.h @@ -18,9 +18,6 @@ #define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words. #define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs. -// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack. -#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt - #define OMV_XCLK_MCO (0U) #define OMV_XCLK_TIM (1U) @@ -57,9 +54,6 @@ // Enable sensor features #define OMV_ENABLE_OV5640_AF (0) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (1) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (160 * 120 * 2) @@ -71,9 +65,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 16 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB IRQn. #define OMV_USB_IRQN (OTG_FS_IRQn) diff --git a/src/omv/boards/OPENMV3/omv_boardconfig.h b/src/omv/boards/OPENMV3/omv_boardconfig.h index ad0bc1ade..96e06a9d7 100644 --- a/src/omv/boards/OPENMV3/omv_boardconfig.h +++ b/src/omv/boards/OPENMV3/omv_boardconfig.h @@ -18,9 +18,6 @@ #define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words. #define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs. -// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack. -#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt - #define OMV_XCLK_MCO (0U) #define OMV_XCLK_TIM (1U) @@ -57,9 +54,6 @@ // Enable sensor features #define OMV_ENABLE_OV5640_AF (0) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (1) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (160 * 120 * 2) @@ -71,9 +65,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 16 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB IRQn. #define OMV_USB_IRQN (OTG_FS_IRQn) diff --git a/src/omv/boards/OPENMV4/omv_boardconfig.h b/src/omv/boards/OPENMV4/omv_boardconfig.h index 72f74436c..326517158 100644 --- a/src/omv/boards/OPENMV4/omv_boardconfig.h +++ b/src/omv/boards/OPENMV4/omv_boardconfig.h @@ -18,9 +18,6 @@ #define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words. #define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs. -// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack. -#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt - #define OMV_XCLK_MCO (0U) #define OMV_XCLK_TIM (1U) @@ -85,9 +82,6 @@ // Enable WiFi debug #define OMV_ENABLE_WIFIDBG (1) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (1) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (320 * 240 * 2) @@ -99,9 +93,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 16 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB IRQn. #define OMV_USB_IRQN (OTG_FS_IRQn) diff --git a/src/omv/boards/OPENMV4P/omv_boardconfig.h b/src/omv/boards/OPENMV4P/omv_boardconfig.h index 89dcbf78d..746b57dc4 100644 --- a/src/omv/boards/OPENMV4P/omv_boardconfig.h +++ b/src/omv/boards/OPENMV4P/omv_boardconfig.h @@ -18,9 +18,6 @@ #define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words. #define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs. -// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer overlay stack. -#define OMV_SELF_TEST_SWD_ADDR *((uint32_t *) 0x24000018) - #define OMV_XCLK_MCO (0U) #define OMV_XCLK_TIM (1U) @@ -84,9 +81,6 @@ // Enable WiFi debug #define OMV_ENABLE_WIFIDBG (1) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (1) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (1920 * 1080 * 2) @@ -98,9 +92,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 256 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB IRQn. #define OMV_USB_IRQN (OTG_FS_IRQn) diff --git a/src/omv/boards/OPENMV4_PRO/omv_boardconfig.h b/src/omv/boards/OPENMV4_PRO/omv_boardconfig.h index 788e00d0d..2123832d0 100644 --- a/src/omv/boards/OPENMV4_PRO/omv_boardconfig.h +++ b/src/omv/boards/OPENMV4_PRO/omv_boardconfig.h @@ -18,9 +18,6 @@ #define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words. #define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs. -// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer overlay stack. -#define OMV_SELF_TEST_SWD_ADDR *((uint32_t *) 0x24000018) - #define OMV_XCLK_MCO (0U) #define OMV_XCLK_TIM (1U) @@ -85,9 +82,6 @@ // Enable WiFi debug #define OMV_ENABLE_WIFIDBG (0) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (0) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (1920 * 1080 * 2) @@ -99,9 +93,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 256 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB IRQn. #define OMV_USB_IRQN (OTG_HS_IRQn) #define OMV_USB_ULPI (1) diff --git a/src/omv/boards/OPENMVPT/omv_boardconfig.h b/src/omv/boards/OPENMVPT/omv_boardconfig.h index 1f1087c2d..12bd098b0 100644 --- a/src/omv/boards/OPENMVPT/omv_boardconfig.h +++ b/src/omv/boards/OPENMVPT/omv_boardconfig.h @@ -83,9 +83,6 @@ // Enable WiFi debug #define OMV_ENABLE_WIFIDBG (1) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (0) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (1920 * 1080 * 2) @@ -97,9 +94,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 256 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB IRQn. #define OMV_USB_IRQN (OTG_FS_IRQn) diff --git a/src/omv/boards/OPENMV_RT1060/omv_boardconfig.h b/src/omv/boards/OPENMV_RT1060/omv_boardconfig.h index a61ef7d27..d03dc0177 100644 --- a/src/omv/boards/OPENMV_RT1060/omv_boardconfig.h +++ b/src/omv/boards/OPENMV_RT1060/omv_boardconfig.h @@ -18,9 +18,6 @@ #define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words. #define OMV_UNIQUE_ID_OFFSET 12 // Bytes offset for multi-word UIDs. -// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack. -#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt - // Sensor external clock timer frequency. #define OMV_XCLK_FREQUENCY (12000000) @@ -69,9 +66,6 @@ #define OMV_ENABLE_TUSBDBG (1) #define OMV_TUSBDBG_PACKET (512) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (0) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (320 * 240 * 2) @@ -83,9 +77,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 16 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB config. #define OMV_USB_IRQN (USB_OTG1_IRQn) #define OMV_USB1_IRQ_HANDLER (USB_OTG1_IRQHandler) diff --git a/src/omv/boards/PICO/omv_boardconfig.h b/src/omv/boards/PICO/omv_boardconfig.h index 3e732aaf8..0d3016b1f 100644 --- a/src/omv/boards/PICO/omv_boardconfig.h +++ b/src/omv/boards/PICO/omv_boardconfig.h @@ -64,9 +64,6 @@ extern unsigned char *OMV_UNIQUE_ID_ADDR; // Unique ID address. // Enable WiFi debug #define OMV_ENABLE_WIFIDBG (0) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (0) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (160 * 120) @@ -78,9 +75,6 @@ extern unsigned char *OMV_UNIQUE_ID_ADDR; // Unique ID address. // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 16 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB IRQn. #define OMV_USB_IRQN (USBCTRL_IRQ_IRQn) #define OMV_USB1_IRQ_HANDLER (USBD_IRQHandler) diff --git a/src/omv/boards/arduino_nano_33_ble_sense/omv_boardconfig.h b/src/omv/boards/arduino_nano_33_ble_sense/omv_boardconfig.h index 8514f3a63..ddc1bc343 100644 --- a/src/omv/boards/arduino_nano_33_ble_sense/omv_boardconfig.h +++ b/src/omv/boards/arduino_nano_33_ble_sense/omv_boardconfig.h @@ -65,9 +65,6 @@ #define OMV_ENABLE_TUSBDBG (1) #define OMV_TUSBDBG_PACKET (64) -// Enable self-tests on first boot -#define OMV_ENABLE_SELFTEST (0) - // If buffer size is bigger than this threshold, the quality is reduced. // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (320 * 240) @@ -79,9 +76,6 @@ // FB Heap Block Size #define OMV_UMM_BLOCK_SIZE 16 -// Core VBAT for selftests -#define OMV_CORE_VBAT "3.3" - // USB IRQn. #define OMV_USB_IRQN (USBD_IRQn) #define OMV_USB1_IRQ_HANDLER (USBD_IRQHandler) diff --git a/src/omv/templates/selftest_py.h b/src/omv/templates/selftest_py.h deleted file mode 100644 index a181678f4..000000000 --- a/src/omv/templates/selftest_py.h +++ /dev/null @@ -1,74 +0,0 @@ -static const char fresh_selftest_py[] = -"import sensor, time, pyb\n" -"\n" -"def test_int_adc():\n" -" adc = pyb.ADCAll(12)\n" -" # Test VBAT\n" -" vbat = adc.read_core_vbat()\n" -" vbat_diff = abs(vbat-"OMV_CORE_VBAT")\n" -" if (vbat_diff > 0.15):\n" -" raise Exception('INTERNAL ADC TEST FAILED VBAT=%fv'%vbat)\n" -"\n" -" # Test VREF\n" -" vref = adc.read_core_vref()\n" -" vref_diff = abs(vref-1.2)\n" -" if (vref_diff > 0.1):\n" -" raise Exception('INTERNAL ADC TEST FAILED VREF=%fv'%vref)\n" -" adc = None\n" -" print('INTERNAL ADC TEST PASSED...')\n" -"\n" -"def test_color_bars():\n" -" sensor.reset()\n" -" # Set sensor settings\n" -" sensor.set_brightness(0)\n" -" sensor.set_saturation(3)\n" -" sensor.set_gainceiling(8)\n" -" sensor.set_contrast(2)\n" -"\n" -" # Set sensor pixel format\n" -" sensor.set_framesize(sensor.QVGA)\n" -" sensor.set_pixformat(sensor.RGB565)\n" -"\n" -" # Enable colorbar test mode\n" -" sensor.set_colorbar(True)\n" -"\n" -" # Skip a few frames to allow the sensor settle down\n" -" for i in range(0, 100):\n" -" image = sensor.snapshot()\n" -"\n" -" #color bars thresholds\n" -" t = [lambda r, g, b: r < 70 and g < 70 and b < 70, # Black\n" -" lambda r, g, b: r < 70 and g < 70 and b > 200, # Blue\n" -" lambda r, g, b: r > 200 and g < 70 and b < 70, # Red\n" -" lambda r, g, b: r > 200 and g < 70 and b > 200, # Purple\n" -" lambda r, g, b: r < 70 and g > 200 and b < 70, # Green\n" -" lambda r, g, b: r < 70 and g > 200 and b > 200, # Aqua\n" -" lambda r, g, b: r > 200 and g > 200 and b < 70, # Yellow\n" -" lambda r, g, b: r > 200 and g > 200 and b > 200] # White\n" -"\n" -" # color bars are inverted for OV7725\n" -" if (sensor.get_id() == sensor.OV7725):\n" -" t = t[::-1]\n" -"\n" -" #320x240 image with 8 color bars each one is approx 40 pixels.\n" -" #we start from the center of the frame buffer, and average the\n" -" #values of 10 sample pixels from the center of each color bar.\n" -" for i in range(0, 8):\n" -" avg = (0, 0, 0)\n" -" idx = 40*i+20 #center of colorbars\n" -" for off in range(0, 10): #avg 10 pixels\n" -" rgb = image.get_pixel(idx+off, 120)\n" -" avg = tuple(map(sum, zip(avg, rgb)))\n" -"\n" -" if not t[i](avg[0]/10, avg[1]/10, avg[2]/10):\n" -" raise Exception('COLOR BARS TEST FAILED.'\n" -" 'BAR#(%d): RGB(%d,%d,%d)'%(i+1, avg[0]/10, avg[1]/10, avg[2]/10))\n" -"\n" -" print('COLOR BARS TEST PASSED...')\n" -"\n" -"if __name__ == '__main__':\n" -" print('')\n" -" test_int_adc()\n" -" if sensor.get_id() == sensor.OV7725: test_color_bars()\n" -"\n" -;