From 6e32c1d00c268d0e9cd2c2ea53612ce14b44bf4f Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Mon, 26 Jan 2026 21:44:37 -0500 Subject: [PATCH 1/3] Add M5Stack Dial --- .../espressif/boards/m5stack_dial/board.cmake | 2 + ports/espressif/boards/m5stack_dial/board.h | 70 +++++++++++++++++++ ports/espressif/boards/m5stack_dial/sdkconfig | 8 +++ supported_boards.md | 1 + 4 files changed, 81 insertions(+) create mode 100644 ports/espressif/boards/m5stack_dial/board.cmake create mode 100644 ports/espressif/boards/m5stack_dial/board.h create mode 100644 ports/espressif/boards/m5stack_dial/sdkconfig diff --git a/ports/espressif/boards/m5stack_dial/board.cmake b/ports/espressif/boards/m5stack_dial/board.cmake new file mode 100644 index 000000000..9bac46d64 --- /dev/null +++ b/ports/espressif/boards/m5stack_dial/board.cmake @@ -0,0 +1,2 @@ +# Apply board specific content here +set(IDF_TARGET "esp32s3") diff --git a/ports/espressif/boards/m5stack_dial/board.h b/ports/espressif/boards/m5stack_dial/board.h new file mode 100644 index 000000000..55614deda --- /dev/null +++ b/ports/espressif/boards/m5stack_dial/board.h @@ -0,0 +1,70 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2025 Alec Delaney + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#ifndef M5STACK_DIAL_BOARD_H_ +#define M5STACK_DIAL_BOARD_H_ + +//--------------------------------------------------------------------+ +// Button +//--------------------------------------------------------------------+ + +// Enter UF2 mode if GPIO is pressed while 2nd stage bootloader indicator +// is on e.g RGB = Purple. If it is GPIO0, user should not hold this while +// reset since that will instead run the 1st stage ROM bootloader +#define PIN_BUTTON_UF2 0 + +// GPIO that implement 1-bit memory with RC components which hold the +// pin value long enough for double reset detection. +//#define PIN_DOUBLE_RESET_RC + +//--------------------------------------------------------------------+ +// LED +//--------------------------------------------------------------------+ + +// GPIO connected to Neopixel data +#define NEOPIXEL_PIN 21 + +// Brightness percentage from 1 to 255 +#define NEOPIXEL_BRIGHTNESS 0x10 + +// Number of neopixels +#define NEOPIXEL_NUMBER 1 + +//--------------------------------------------------------------------+ +// USB UF2 +//--------------------------------------------------------------------+ + +#define USB_VID 0x303A +#define USB_PID 0x811A + +#define USB_MANUFACTURER "M5Stack" +#define USB_PRODUCT "Stamp S3" + +#define UF2_PRODUCT_NAME USB_MANUFACTURER " " USB_PRODUCT +#define UF2_BOARD_ID "ESP32S3-StampS3-01" +#define UF2_VOLUME_LABEL "M5S3BOOT" +#define UF2_INDEX_URL "https://docs.m5stack.com/en/core/StampS3" + +#endif diff --git a/ports/espressif/boards/m5stack_dial/sdkconfig b/ports/espressif/boards/m5stack_dial/sdkconfig new file mode 100644 index 000000000..04513503a --- /dev/null +++ b/ports/espressif/boards/m5stack_dial/sdkconfig @@ -0,0 +1,8 @@ +# Board Specific Config + +# Partition Table +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MB.csv" + +# Serial flasher config +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" diff --git a/supported_boards.md b/supported_boards.md index a8c6c4a3f..6155297c4 100644 --- a/supported_boards.md +++ b/supported_boards.md @@ -71,6 +71,7 @@ | m5stack_atoms3_lite | M5Stack AtomS3 Lite | 0x303A:0x8160 | https://shop.m5stack.com/products/atoms3-lite-esp32s3-dev-kit | | m5stack_atoms3u | M5Stack AtomS3U | 0x303A:0x8188 | https://docs.m5stack.com/en/core/AtomS3U | | m5stack_cores3 | M5Stack CoreS3 | 0x303A:0x811B | https://shop.m5stack.com/products/m5stack-cores3-esp32s3-lotdevelopment-kit | +| m5stack_dial | M5Stack Dial | 0x303A:0x811A | https://docs.m5stack.com/en/core/M5Dial | | m5stack_stamps3 | M5Stack Stamp S3 | 0x303A:0x811A | https://docs.m5stack.com/en/core/StampS3 | | magiclick_s3_n4r2 | MakerM0 MagiClick S3 | 0x303A:0x81AC | https://github.com/MakerM0/MagiClick-esp32s3 | | maker_badge | Czech maker Maker badge | 0x239A:0x2030 | https://github.com/dronecz/maker_badge | From 517aef0d37312605346157524aae54b4901b11ef Mon Sep 17 00:00:00 2001 From: Algy Tynan Date: Sun, 12 Apr 2026 17:32:23 +1000 Subject: [PATCH 2/3] Restore FlexSPI1 clock speed on RT1170 --- .../mimxrt10xx/boards/imxrt1170_evk/board/clock_config.c | 8 +++++--- ports/mimxrt10xx/boards/imxrt1170_evk/mimxrt1170_evkb.mex | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ports/mimxrt10xx/boards/imxrt1170_evk/board/clock_config.c b/ports/mimxrt10xx/boards/imxrt1170_evk/board/clock_config.c index ba940e174..43ce839df 100644 --- a/ports/mimxrt10xx/boards/imxrt1170_evk/board/clock_config.c +++ b/ports/mimxrt10xx/boards/imxrt1170_evk/board/clock_config.c @@ -160,10 +160,12 @@ void BOARD_BootClockRUN(void) { rootCfg.div = 1; CLOCK_SetRootClock(kCLOCK_Root_Cssys, &rootCfg); - /* Configure FLEXSPI1 using OSC_RC_48M_DIV2 */ - rootCfg.mux = kCLOCK_FLEXSPI1_ClockRoot_MuxOscRc48MDiv2; - rootCfg.div = 1; + /* Configure FLEXSPI1 using OSC_RC_400M (100MHz) */ + rootCfg.mux = kCLOCK_FLEXSPI1_ClockRoot_MuxOscRc400M; + rootCfg.div = 4; CLOCK_SetRootClock(kCLOCK_Root_Flexspi1, &rootCfg); + FLEXSPI1->MCR0 |= FLEXSPI_MCR0_SWRESET_MASK; + while (FLEXSPI1->MCR0 & FLEXSPI_MCR0_SWRESET_MASK) {} /* Configure GPT1 using OSC_24M for timing */ rootCfg.mux = kCLOCK_GPT1_ClockRoot_MuxOsc24MOut; diff --git a/ports/mimxrt10xx/boards/imxrt1170_evk/mimxrt1170_evkb.mex b/ports/mimxrt10xx/boards/imxrt1170_evk/mimxrt1170_evkb.mex index 2099126db..4474e3d4a 100644 --- a/ports/mimxrt10xx/boards/imxrt1170_evk/mimxrt1170_evkb.mex +++ b/ports/mimxrt10xx/boards/imxrt1170_evk/mimxrt1170_evkb.mex @@ -231,7 +231,7 @@ - + @@ -303,6 +303,8 @@ + + From bbba220a716c2eeac924cca42caec3397fbe4f93 Mon Sep 17 00:00:00 2001 From: Piclaw Date: Wed, 15 Apr 2026 10:26:43 -0700 Subject: [PATCH 3/3] Add Waveshare ESP32-S3-Tiny board support Add tinyuf2 bootloader support for the Waveshare ESP32-S3-Tiny board. Board specs: - ESP32-S3FH4R2 (dual-core LX7, 240MHz) - 4MB Flash, 2MB PSRAM - Neopixel on GPIO38 (GRB color order) - Boot button on GPIO0 - USB VID:PID 0x303A:0x81F8 Based on the existing waveshare_esp32_s3_zero board definition, with pin and USB descriptor adjustments for the Tiny variant. Resolves adafruit/circuitpython-org#1692 --- .../waveshare_esp32_s3_tiny/board.cmake | 2 + .../boards/waveshare_esp32_s3_tiny/board.h | 74 +++++++++++++++++++ .../boards/waveshare_esp32_s3_tiny/sdkconfig | 7 ++ supported_boards.md | 1 + 4 files changed, 84 insertions(+) create mode 100644 ports/espressif/boards/waveshare_esp32_s3_tiny/board.cmake create mode 100644 ports/espressif/boards/waveshare_esp32_s3_tiny/board.h create mode 100644 ports/espressif/boards/waveshare_esp32_s3_tiny/sdkconfig diff --git a/ports/espressif/boards/waveshare_esp32_s3_tiny/board.cmake b/ports/espressif/boards/waveshare_esp32_s3_tiny/board.cmake new file mode 100644 index 000000000..9bac46d64 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32_s3_tiny/board.cmake @@ -0,0 +1,2 @@ +# Apply board specific content here +set(IDF_TARGET "esp32s3") diff --git a/ports/espressif/boards/waveshare_esp32_s3_tiny/board.h b/ports/espressif/boards/waveshare_esp32_s3_tiny/board.h new file mode 100644 index 000000000..5863ae798 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32_s3_tiny/board.h @@ -0,0 +1,74 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2020 Ha Thach (tinyusb.org) for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef WAVESHARE_ESP32_S3_TINY_H_ +#define WAVESHARE_ESP32_S3_TINY_H_ + +//--------------------------------------------------------------------+ +// Button +//--------------------------------------------------------------------+ + +// Enter UF2 mode if GPIO is pressed while 2nd stage bootloader indicator +// is on e.g RGB = Purple. If it is GPIO0, user should not hold this while +// reset since that will instead run the 1st stage ROM bootloader +#define PIN_BUTTON_UF2 0 + +// GPIO that implement 1-bit memory with RC components which hold the +// pin value long enough for double reset detection. +// #define PIN_DOUBLE_RESET_RC + +//--------------------------------------------------------------------+ +// LED +//--------------------------------------------------------------------+ + +// GPIO connected to Neopixel data +#define NEOPIXEL_PIN 38 + +// Brightness percentage from 1 to 255 +#define NEOPIXEL_BRIGHTNESS 0x10 + +// Number of neopixels +#define NEOPIXEL_NUMBER 1 + +// Invert Neopixel red and green +#define NEOPIXEL_INVERT_RG 1 + +// LED for indicator and writing flash +// If not defined neopixel will be use for flash writing instead + +//--------------------------------------------------------------------+ +// USB UF2 +//--------------------------------------------------------------------+ + +#define USB_VID 0x303a +#define USB_PID 0x81F8 +#define USB_MANUFACTURER "Waveshare Electronics" +#define USB_PRODUCT "ESP32-S3-Tiny" + +#define UF2_PRODUCT_NAME USB_MANUFACTURER " " USB_PRODUCT +#define UF2_BOARD_ID "ESP32-S3-Tiny" +#define UF2_VOLUME_LABEL "WS3TINYBOOT" +#define UF2_INDEX_URL "https://www.waveshare.com/wiki/ESP32-S3-Tiny" + +#endif diff --git a/ports/espressif/boards/waveshare_esp32_s3_tiny/sdkconfig b/ports/espressif/boards/waveshare_esp32_s3_tiny/sdkconfig new file mode 100644 index 000000000..6eb1896c4 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32_s3_tiny/sdkconfig @@ -0,0 +1,7 @@ +# Board Specific Config + +# Partition Table +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MB-noota.csv" + +# Serial flasher config +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y diff --git a/supported_boards.md b/supported_boards.md index 6155297c4..6fa608335 100644 --- a/supported_boards.md +++ b/supported_boards.md @@ -105,6 +105,7 @@ | waveshare_esp32_s3_pico | Waveshare Electronics ESP32-S3-Pico | 0x303A:0x81A2 | http://www.waveshare.com/wiki/ESP32-S2-Pico | | waveshare_esp32_s3_touch_lcd_169 | Waveshare Electronics ESP32-S3-Touch-LCD-1.69 | 0x303A:0x8220 | https://www.waveshare.com/product/esp32-s3-touch-lcd-1.69.htm | | waveshare_esp32_s3_touch_lcd_2 | Waveshare Electronics ESP32-S3-Touch-LCD-2 | 0x303A:0x82CF | https://www.waveshare.com/esp32-s3-touch-lcd-2.htm?sku=29667 | +| waveshare_esp32_s3_tiny | Waveshare Electronics ESP32-S3-Tiny | 0x303A:0x81F8 | https://www.waveshare.com/wiki/ESP32-S3-Tiny | | waveshare_esp32_s3_zero | Waveshare Electronics ESP32-S3-Zero | 0x303A:0x81B3 | https://www.waveshare.com/wiki/ESP32-S3-Zero | | waveshare_esp32s2_pico | Waveshare Electronics ESP32-S2-Pico | 0x303A:0x8109 | http://www.waveshare.com/wiki/ESP32-S2-Pico | | waveshare_esp32s3_lcd_169 | Waveshare Electronics ESP32-S3-LCD-1.69 | 0x303A:0x8223 | https://www.waveshare.com/product/esp32-s3-lcd-1.69.htm |