Skip to content

Commit 13d1192

Browse files
committed
stm32/mpconfigboard_common: Define TinyUSB MCU type for N6.
Allows using TinyUSB stack on N6. Note there's still an issue with TinyUSB on the N6: `pyb_usbd_init()` can't be called multiple times (on soft-reboot). Signed-off-by: iabdalkader <[email protected]>
1 parent 82d6510 commit 13d1192

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ports/stm32/mpconfigboard_common.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,24 @@
484484
#define MICROPY_HW_MAX_UART (10)
485485
#define MICROPY_HW_MAX_LPUART (1)
486486

487+
#define CFG_TUSB_MCU OPT_MCU_STM32N6
488+
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)
489+
490+
// Configuration for STM32U5 series
491+
#elif defined(STM32U5)
492+
493+
#define MP_HAL_UNIQUE_ID_ADDRESS (UID_BASE)
494+
// STM32U5 has 26 EXTI vectors but does not have line for RTC/USB.
495+
// To treat these interrupts as same as exti, add virtual vectors for
496+
// EXTI_RTC_TIMESTAMP (26), EXTI_RTC_WAKEUP (27),
497+
// EXTI_RTC_ALARM (28), and EXTI_USB_OTG_FS_WAKEUP (29)
498+
#define PYB_EXTI_NUM_VECTORS (30)
499+
#define MICROPY_HW_MAX_I2C (6)
500+
#define MICROPY_HW_MAX_TIMER (17)
501+
#define MICROPY_HW_MAX_UART (6)
502+
#define MICROPY_HW_MAX_LPUART (1)
503+
504+
>>>>>>> b087cb41e (stm32/mpconfigboard_common: Define TinyUSB MCU type for N6.)
487505
// Configuration for STM32WB series
488506
#elif defined(STM32WB)
489507

0 commit comments

Comments
 (0)