Skip to content

Commit 8d25702

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 b7b77e5 commit 8d25702

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
@@ -542,6 +542,24 @@
542542
#define MICROPY_HW_MAX_UART (10)
543543
#define MICROPY_HW_MAX_LPUART (1)
544544

545+
#define CFG_TUSB_MCU OPT_MCU_STM32N6
546+
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)
547+
548+
// Configuration for STM32U5 series
549+
#elif defined(STM32U5)
550+
551+
#define MP_HAL_UNIQUE_ID_ADDRESS (UID_BASE)
552+
// STM32U5 has 26 EXTI vectors but does not have line for RTC/USB.
553+
// To treat these interrupts as same as exti, add virtual vectors for
554+
// EXTI_RTC_TIMESTAMP (26), EXTI_RTC_WAKEUP (27),
555+
// EXTI_RTC_ALARM (28), and EXTI_USB_OTG_FS_WAKEUP (29)
556+
#define PYB_EXTI_NUM_VECTORS (30)
557+
#define MICROPY_HW_MAX_I2C (6)
558+
#define MICROPY_HW_MAX_TIMER (17)
559+
#define MICROPY_HW_MAX_UART (6)
560+
#define MICROPY_HW_MAX_LPUART (1)
561+
562+
>>>>>>> b087cb41e (stm32/mpconfigboard_common: Define TinyUSB MCU type for N6.)
545563
// Configuration for STM32WB series
546564
#elif defined(STM32WB)
547565

0 commit comments

Comments
 (0)