├── docs ├── STM32F407VGT6.jpg └── STM32F407VX_M_schematics.pdf ├── board_init.c ├── mpconfigboard.mk ├── stm32f4xx_hal_conf.h ├── bdev.c ├── LICENSE.txt ├── pins.csv ├── README.md └── mpconfigboard.h /docs/STM32F407VGT6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcauser/MCUDEV_DEVEBOX_F407VGT6/HEAD/docs/STM32F407VGT6.jpg -------------------------------------------------------------------------------- /docs/STM32F407VX_M_schematics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcauser/MCUDEV_DEVEBOX_F407VGT6/HEAD/docs/STM32F407VX_M_schematics.pdf -------------------------------------------------------------------------------- /board_init.c: -------------------------------------------------------------------------------- 1 | #include "py/mphal.h" 2 | 3 | void Mcudev_Devebox_F407VG_board_early_init(void) { 4 | // set SPI flash CS pin high 5 | mp_hal_pin_output(pin_A15); 6 | mp_hal_pin_write(pin_A15, 1); 7 | } 8 | -------------------------------------------------------------------------------- /mpconfigboard.mk: -------------------------------------------------------------------------------- 1 | MCU_SERIES = f4 2 | CMSIS_MCU = STM32F407xx 3 | AF_FILE = boards/stm32f405_af.csv 4 | LD_FILES = boards/stm32f405.ld boards/common_ifs.ld 5 | TEXT0_ADDR = 0x08000000 6 | TEXT1_ADDR = 0x08020000 7 | -------------------------------------------------------------------------------- /stm32f4xx_hal_conf.h: -------------------------------------------------------------------------------- 1 | #ifndef MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H 2 | #define MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H 3 | 4 | #include "boards/stm32f4xx_hal_conf_base.h" 5 | 6 | // Oscillator values in Hz 7 | #define HSE_VALUE (8000000) 8 | #define LSE_VALUE (32768) 9 | #define EXTERNAL_CLOCK_VALUE (12288000) 10 | 11 | // Oscillator timeouts in ms 12 | #define HSE_STARTUP_TIMEOUT (100) 13 | #define LSE_STARTUP_TIMEOUT (5000) 14 | 15 | #endif // MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H 16 | -------------------------------------------------------------------------------- /bdev.c: -------------------------------------------------------------------------------- 1 | #include "storage.h" 2 | 3 | #if !MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE 4 | 5 | // External SPI flash uses standard SPI interface 6 | 7 | STATIC const mp_soft_spi_obj_t soft_spi_bus = { 8 | .delay_half = MICROPY_HW_SOFTSPI_MIN_DELAY, 9 | .polarity = 0, 10 | .phase = 0, 11 | .sck = MICROPY_HW_SPIFLASH_SCK, 12 | .mosi = MICROPY_HW_SPIFLASH_MOSI, 13 | .miso = MICROPY_HW_SPIFLASH_MISO, 14 | }; 15 | 16 | STATIC mp_spiflash_cache_t spi_bdev_cache; 17 | 18 | const mp_spiflash_config_t spiflash_config = { 19 | .bus_kind = MP_SPIFLASH_BUS_SPI, 20 | .bus.u_spi.cs = MICROPY_HW_SPIFLASH_CS, 21 | .bus.u_spi.data = (void*)&soft_spi_bus, 22 | .bus.u_spi.proto = &mp_soft_spi_proto, 23 | .cache = &spi_bdev_cache, 24 | }; 25 | 26 | spi_bdev_t spi_bdev; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Mike Causer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /pins.csv: -------------------------------------------------------------------------------- 1 | PA0,PA0 2 | PA1,PA1 3 | PA2,PA2 4 | PA3,PA3 5 | PA4,PA4 6 | PA5,PA5 7 | PA6,PA6 8 | PA7,PA7 9 | PA8,PA8 10 | PA9,PA9 11 | PA10,PA10 12 | PA11,PA11 13 | PA12,PA12 14 | PA13,PA13 15 | PA14,PA14 16 | PA15,PA15 17 | PB0,PB0 18 | PB1,PB1 19 | PB2,PB2 20 | PB3,PB3 21 | PB4,PB4 22 | PB5,PB5 23 | PB6,PB6 24 | PB7,PB7 25 | PB8,PB8 26 | PB9,PB9 27 | PB10,PB10 28 | PB11,PB11 29 | PB12,PB12 30 | PB13,PB13 31 | PB14,PB14 32 | PB15,PB15 33 | PC0,PC0 34 | PC1,PC1 35 | PC2,PC2 36 | PC3,PC3 37 | PC4,PC4 38 | PC5,PC5 39 | PC6,PC6 40 | PC7,PC7 41 | PC8,PC8 42 | PC9,PC9 43 | PC10,PC10 44 | PC11,PC11 45 | PC12,PC12 46 | PC13,PC13 47 | PC14,PC14 48 | PC15,PC15 49 | PD0,PD0 50 | PD1,PD1 51 | PD2,PD2 52 | PD3,PD3 53 | PD4,PD4 54 | PD5,PD5 55 | PD6,PD6 56 | PD7,PD7 57 | PD8,PD8 58 | PD9,PD9 59 | PD10,PD10 60 | PD11,PD11 61 | PD12,PD12 62 | PD13,PD13 63 | PD14,PD14 64 | PD15,PD15 65 | PE0,PE0 66 | PE1,PE1 67 | PE2,PE2 68 | PE3,PE3 69 | PE4,PE4 70 | PE5,PE5 71 | PE6,PE6 72 | PE7,PE7 73 | PE8,PE8 74 | PE9,PE9 75 | PE10,PE10 76 | PE11,PE11 77 | PE12,PE12 78 | PE13,PE13 79 | PE14,PE14 80 | PE15,PE15 81 | DAC1,PA4 82 | DAC2,PA5 83 | LED_D2,PA1 84 | USB_DM,PA11 85 | USB_DP,PA12 86 | OSC32_IN,PC14 87 | OSC32_OUT,PC15 88 | SD_D0,PC8 89 | SD_D1,PC9 90 | SD_D2,PC10 91 | SD_D3,PC11 92 | SD_CK,PC12 93 | SD_CMD,PD2 94 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MCUDev DevEBox STM32F407VGT6 2 | 3 | MicroPython board definition files for the MCUDev black STM32F407VGT6 mini dev board. 4 | 5 | **Markings:** DevEBox STM32F4XX_M Ver:V2.0 SN:1810 6 | 7 | ![board](docs/STM32F407VGT6.jpg) 8 | 9 | You can buy one for around $13 AUD (Oct 2019) on [AliExpress]. 10 | 11 | ### Build the firmware 12 | 13 | Clone the board definitions to your [MicroPython](https://github.com/micropython/micropython) `ports/stm32/boards` folder. 14 | 15 | ```bash 16 | cd micropython/ports/stm32/boards 17 | git clone https://github.com/mcauser/MCUDEV_DEVEBOX_F407VGT6.git 18 | 19 | cd .. 20 | make BOARD=MCUDEV_DEVEBOX_F407VGT6 21 | ``` 22 | 23 | ### Flashing via DFU 24 | 25 | This board can be flashed using DFU. To put the board in DFU mode, disconnect 26 | USB, set BOOT0 to ON by connecting pin BT0 to 3V3 and reconnect USB. 27 | 28 | Now you can flash the board using USB with the command: 29 | 30 | ```bash 31 | make BOARD=MCUDEV_DEVEBOX_F407VGT6 deploy 32 | ``` 33 | 34 | Once the upload is complete, disconnect USB, set BOOT0 to OFF by connecting 35 | pin BT0 to GND and reconnect USB. 36 | 37 | Alternatively, you can use the MicroPython command `pyb.bootloader()` 38 | to get into DFU mode without needing to use the switch. 39 | 40 | Currently, you need to unplug and replug the board in order to switch from DFU 41 | mode back to regular mode. 42 | 43 | ### Accessing the board 44 | 45 | Once built and deployed, you can access the MicroPython REPL (the Python prompt) via USB serial. 46 | 47 | ```bash 48 | screen /dev/tty.usbmodem1422 115200 49 | # or 50 | screen /dev/ttyACM0 115200 51 | ``` 52 | 53 | ### Specifications 54 | 55 | * STM32F407VGT6 ARM Cortex M4 56 | * 168MHz, 210 DMIPS / 1.25 DMIPS / MHz 57 | * 1.8V - 3.6V operating voltage 58 | * 8MHz system crystal 59 | * 32.768KHz RTC crystal 60 | * 2.54mm pitch pins 61 | * SWD header 62 | * 1 MByte Flash, 192 + 4 KByte SRAM 63 | * 3x SPI, 3x USART, 2x UART, 2x I2S, 3x I2C 64 | * 1x FSMC, 1x SDIO, 2x CAN 65 | * 1x USB 2.0 FS / HS controller (with dedicated DMA) 66 | * 1x USB HS ULPI (for external USB HS PHY) 67 | * Micro SD 68 | * Winbond W25Q16 16Mbit SPI Flash 69 | * 1x 10/100 Ethernet MAC 70 | * 1x 8 to 12-bit Parallel Camera interface 71 | * 3x ADC (12-bit / 16-channel) 72 | * 2x DAC (12-bit) 73 | * 12x general timers, 2x advanced timers 74 | * AMS1117-3.3V: 3.3V LDO voltage regulator, max current 800mA 75 | * Micro USB for power and comms 76 | * Power LED D1 77 | * User LED D2 (PA1) active low 78 | * Reset button, 1x user buttons K0 79 | * 2x22 side header 80 | * SPI TFT/OLED header (3V3, GND, MOSI, SCK, CS, MISO, RST, BL) 81 | * RTC battery header B1 beside SD card 82 | * M3 mounting holes 83 | * Dimensions: 40.89mm x 68.59mm 84 | 85 | ### Exposed Port Pins 86 | 87 | * PA0-PA15 88 | * PB0-PB3, PB5-PB15 (PB4 SPI1_MISO used exclusively with SPI Flash) 89 | * PC0-PC13 (PC14 OSC32_IN and PC15 OSC32_OUT not broken out) 90 | * PD0-PD15 91 | * PE0-PE15 92 | 93 | ### Peripherals 94 | 95 | #### TFT/OLED (J4) 96 | 97 | * 1 3V3 98 | * 2 GND 99 | * 3 PB15 MOSI 100 | * 4 PB13 SCK 101 | * 5 PB12 CS 102 | * 6 PB14 MISO 103 | * 7 PC5 RS 104 | * 8 PB1 BLK 105 | 106 | #### SPI Flash W25Q16 (U3) 107 | 108 | * 1 PA15 F_CS 109 | * 2 PB4 SPI1_MISO 110 | * 3 WP 3V3 111 | * 4 GND 112 | * 5 PB5 SPI1_MOSI 113 | * 6 PB3 SPI1_SCK 114 | * 7 HOLD 3V3 115 | * 8 VCC 3V3 116 | 117 | #### SWD debug (J1) 118 | 119 | * 1 Boot0 120 | * 2 3V3 121 | * 3 GND 122 | * 4 PA13 SWDIO 123 | * 5 PA14 SWCLK 124 | 125 | #### USB (J5) 126 | 127 | * 1 VCC 5V 128 | * 2 PA11 USB_DM 129 | * 3 PA12 USB_DP 130 | * 4 NC ID 131 | * 5 GND 132 | 133 | #### Micro SD (U5) 134 | 135 | * 1 PC10 SDIO_D2 136 | * 2 PC11 SDIO_D3 137 | * 3 PD2 SDIO_CMD 138 | * 4 3V3 139 | * 5 PC12 SDIO_SCK 140 | * 6 GND 141 | * 7 PC8 SDIO_D0 142 | * 8 PC9 SDIO_D1 143 | * 9 NC SD_NC 144 | 145 | #### User Button (K1) 146 | 147 | * PA0 WK_UP 148 | 149 | #### User LED (D2) 150 | 151 | * PA1 152 | 153 | #### Battery (B1) 154 | 155 | * 1 BAT54C 156 | * 2 GND 157 | 158 | ### Links 159 | 160 | * [STM32F407VG on st.com](https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32f4-series/stm32f407-417/stm32f407vg.html) 161 | * Buy on [AliExpress] or search for "STM32F407VGT6" 162 | * Buy on [Taobao](https://item.taobao.com/item.htm?id=582677940441) 163 | * [STM32F407VGT6 schematics](https://github.com/mcauser/MCUDEV_DEVEBOX_F407VGT6/blob/master/docs/STM32F407VX_M_schematics.pdf) 164 | 165 | ### Related boards 166 | 167 | * [MCUDev Black STM32F407VET6](https://github.com/mcauser/BLACK_F407VE) 168 | * [MCUDev Black STM32F407ZET6](https://github.com/mcauser/BLACK_F407ZE) 169 | * [MCUDev Black STM32F407ZGT6](https://github.com/mcauser/BLACK_F407ZG) 170 | * [MCUDev DevEBox STM32F407VET6](https://github.com/mcauser/MCUDEV_DEVEBOX_F407VET6) 171 | * [MCUDev DevEBox STM32F407VGT6](https://github.com/mcauser/MCUDEV_DEVEBOX_F407VGT6) - this board 172 | * [VCC GND STM32F407VET6 Mini](https://github.com/mcauser/VCC_GND_F407VE) 173 | * [VCC GND STM32F407ZGT6 Mini](https://github.com/mcauser/VCC_GND_F407ZG) 174 | 175 | [AliExpress]: https://www.aliexpress.com/item/32985219862.html 176 | 177 | ## License 178 | 179 | Licensed under the [MIT License](http://opensource.org/licenses/MIT). 180 | -------------------------------------------------------------------------------- /mpconfigboard.h: -------------------------------------------------------------------------------- 1 | #define MICROPY_HW_BOARD_NAME "MCUDEV DEVEBOX STM32F407VG" 2 | #define MICROPY_HW_MCU_NAME "STM32F407VG" 3 | #define MICROPY_HW_FLASH_FS_LABEL "DEVEBOXF407VG" 4 | 5 | // 1 = use internal flash (1 MByte) 6 | // 0 = use onboard SPI flash (2 MByte) Winbond W25Q16 7 | #define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (1) 8 | 9 | #define MICROPY_HW_HAS_SWITCH (1) // has 1 button KEY0 10 | #define MICROPY_HW_HAS_FLASH (1) 11 | #define MICROPY_HW_ENABLE_RNG (1) 12 | #define MICROPY_HW_ENABLE_RTC (1) 13 | #define MICROPY_HW_ENABLE_DAC (1) 14 | #define MICROPY_HW_ENABLE_USB (1) 15 | #define MICROPY_HW_ENABLE_SDCARD (0) // it has a sd scard, but i am not sure what the detect pin is, yet 16 | 17 | // HSE is 8MHz 18 | #define MICROPY_HW_CLK_PLLM (8) // divide external clock by this to get 1MHz 19 | #define MICROPY_HW_CLK_PLLN (336) // PLL clock in MHz 20 | #define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2) // divide PLL clock by this to get core clock 21 | #define MICROPY_HW_CLK_PLLQ (7) // divide core clock by this to get 48MHz 22 | 23 | // The board has a 32kHz crystal for the RTC 24 | #define MICROPY_HW_RTC_USE_LSE (1) 25 | #define MICROPY_HW_RTC_USE_US (0) 26 | // #define MICROPY_HW_RTC_USE_CALOUT (1) // turn on/off PC13 512Hz output 27 | 28 | // USART1 29 | #define MICROPY_HW_UART1_TX (pin_A9) // PA9,PB6 30 | #define MICROPY_HW_UART1_RX (pin_A10) // PA10,PB7 31 | // PA11 usart1_cts 32 | // PA12 usart1_rts 33 | // PA8 usart1_ck 34 | 35 | // USART2 36 | #define MICROPY_HW_UART2_TX (pin_A2) // PA2,PD5 37 | #define MICROPY_HW_UART2_RX (pin_A3) // PA3,PD6 38 | #define MICROPY_HW_UART2_RTS (pin_A1) // PA1,PD4 39 | #define MICROPY_HW_UART2_CTS (pin_A0) // PA0,PD3 40 | 41 | // USART3 42 | #define MICROPY_HW_UART3_TX (pin_D8) // PB10,PC10,PD8 43 | #define MICROPY_HW_UART3_RX (pin_D9) // PB11,PC11,PD9 44 | #define MICROPY_HW_UART3_RTS (pin_D12) // PB14,PD12 45 | #define MICROPY_HW_UART3_CTS (pin_D11) // PB13,PD11 46 | // D10 usart3_ck C12 47 | 48 | // UART4 49 | #define MICROPY_HW_UART4_TX (pin_C10) // PC10 50 | #define MICROPY_HW_UART4_RX (pin_C11) // PC11 51 | 52 | // UART5 53 | #define MICROPY_HW_UART5_TX (pin_C12) // PC12 54 | #define MICROPY_HW_UART5_RX (pin_D2) // PD2 55 | 56 | // I2C busses 57 | #define MICROPY_HW_I2C1_SCL (pin_B6) // PB8,PB6 58 | #define MICROPY_HW_I2C1_SDA (pin_B7) // PB9,PB7 59 | 60 | #define MICROPY_HW_I2C2_SCL (pin_B10) // PB10 61 | #define MICROPY_HW_I2C2_SDA (pin_B11) // PB11 62 | 63 | // I2S busses 64 | // I2S2_CK PB13 65 | // I2S2_MCK PC6 66 | // I2S2_WS PB12 67 | 68 | // I2S3_CK PB3 69 | // I2S3_MCK PC7 70 | // I2S3_SD PB5 71 | // I2S3_WS PA15 72 | 73 | // SPI busses 74 | #define MICROPY_HW_SPI1_NSS (pin_A4) // PA4 75 | #define MICROPY_HW_SPI1_SCK (pin_A5) // PA5,PB3 76 | #define MICROPY_HW_SPI1_MISO (pin_A6) // PA6,PB4 77 | #define MICROPY_HW_SPI1_MOSI (pin_A7) // PA7,PB5 78 | 79 | #define MICROPY_HW_SPI2_NSS (pin_B12) // PB12 80 | #define MICROPY_HW_SPI2_SCK (pin_B13) // PB13 81 | #define MICROPY_HW_SPI2_MISO (pin_B14) // PB14 82 | #define MICROPY_HW_SPI2_MOSI (pin_B15) // PB15 83 | 84 | #define MICROPY_HW_SPI3_NSS (pin_A15) // PA15 85 | #define MICROPY_HW_SPI3_SCK (pin_B3) // PB3 86 | #define MICROPY_HW_SPI3_MISO (pin_B4) // PB4 87 | #define MICROPY_HW_SPI3_MOSI (pin_B5) // PB5 88 | 89 | // CAN busses 90 | #define MICROPY_HW_CAN1_TX (pin_B9) // PB9,PD1,PA12 91 | #define MICROPY_HW_CAN1_RX (pin_B8) // PB8,PD0,PA11 92 | 93 | // DAC 94 | // DAC_OUT1 PA4 95 | // DAC_OUT2 PA5 96 | 97 | // KEY0 has no pullup or pulldown; Pressing the button makes the input go high. 98 | #define MICROPY_HW_USRSW_PIN (pin_A0) 99 | #define MICROPY_HW_USRSW_PULL (GPIO_PULLDOWN) 100 | #define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_RISING) 101 | #define MICROPY_HW_USRSW_PRESSED (0) 102 | 103 | // LEDs 104 | // LED D1 is the power LED and always on 105 | #define MICROPY_HW_LED1 (pin_A1) // LED D2 106 | #define MICROPY_HW_LED_ON(pin) (mp_hal_pin_low(pin)) 107 | #define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_high(pin)) 108 | 109 | // If using onboard SPI flash 110 | #if !MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE 111 | 112 | // Winbond W25Q16 SPI Flash = 16 Mbit (2 MByte) 113 | #define MICROPY_HW_SPIFLASH_SIZE_BITS (16 * 1024 * 1024) 114 | #define MICROPY_HW_SPIFLASH_CS (pin_A15) 115 | #define MICROPY_HW_SPIFLASH_SCK (pin_B3) 116 | #define MICROPY_HW_SPIFLASH_MISO (pin_B4) 117 | #define MICROPY_HW_SPIFLASH_MOSI (pin_B5) 118 | 119 | #define MICROPY_BOARD_EARLY_INIT Mcudev_Devebox_F407VG_board_early_init 120 | void Mcudev_Devebox_F407VG_board_early_init(void); 121 | 122 | extern const struct _mp_spiflash_config_t spiflash_config; 123 | extern struct _spi_bdev_t spi_bdev; 124 | #define MICROPY_HW_BDEV_IOCTL(op, arg) ( \ 125 | (op) == BDEV_IOCTL_NUM_BLOCKS ? (MICROPY_HW_SPIFLASH_SIZE_BITS / 8 / FLASH_BLOCK_SIZE) : \ 126 | (op) == BDEV_IOCTL_INIT ? spi_bdev_ioctl(&spi_bdev, (op), (uint32_t)&spiflash_config) : \ 127 | spi_bdev_ioctl(&spi_bdev, (op), (arg)) \ 128 | ) 129 | #define MICROPY_HW_BDEV_READBLOCKS(dest, bl, n) spi_bdev_readblocks(&spi_bdev, (dest), (bl), (n)) 130 | #define MICROPY_HW_BDEV_WRITEBLOCKS(src, bl, n) spi_bdev_writeblocks(&spi_bdev, (src), (bl), (n)) 131 | 132 | #endif 133 | 134 | // SD card detect switch 135 | // #define MICROPY_HW_SDCARD_DETECT_PIN (pin_A8) // nope 136 | // #define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_PULLUP) 137 | // #define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET) 138 | // 1 - PC10 - DAT2/RES 139 | // 2 - PC11 - CD/DAT3/CS 140 | // 3 - PD2 - CMD/DI 141 | // 4 - VCC - VDD 142 | // 5 - PC12 - CLK/SCLK 143 | // 6 - GND - VSS 144 | // 7 - PC8 - DAT0/D0 145 | // 8 - PC9 - DAT1/RES 146 | // 9 SW2 - GND 147 | // 10 SW1 - GND 148 | 149 | // USB config 150 | #define MICROPY_HW_USB_FS (1) 151 | // #define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9) 152 | // #define MICROPY_HW_USB_OTG_ID_PIN (pin_A10) 153 | --------------------------------------------------------------------------------