Skip to content

Commit 718bcdb

Browse files
committed
Add STM32L5 support - no OTG similar to some L4s
1 parent 5add4c9 commit 718bcdb

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

src/common/tusb_mcu.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@
229229
#define TUP_USBIP_DWC2_STM32
230230
#define TUP_DCD_ENDPOINT_MAX 6
231231

232+
#elif TU_CHECK_MCU(OPT_MCU_STM32L5)
233+
#define TUP_USBIP_FSDEV
234+
#define TUP_USBIP_FSDEV_STM32
235+
#define TUP_DCD_ENDPOINT_MAX 8
236+
237+
232238
//--------------------------------------------------------------------+
233239
// Sony
234240
//--------------------------------------------------------------------+

src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ void dcd_int_enable (uint8_t rhport)
362362
NVIC_EnableIRQ(USB_HP_IRQn);
363363
NVIC_EnableIRQ(USB_LP_IRQn);
364364

365+
#elif CFG_TUSB_MCU == OPT_MCU_STM32L5
366+
NVIC_EnableIRQ(USB_FS_IRQn);
367+
365368
#else
366369
#error Unknown arch in USB driver
367370
#endif
@@ -409,6 +412,9 @@ void dcd_int_disable(uint8_t rhport)
409412
NVIC_DisableIRQ(USB_HP_IRQn);
410413
NVIC_DisableIRQ(USB_LP_IRQn);
411414

415+
#elif CFG_TUSB_MCU == OPT_MCU_STM32L5
416+
NVIC_DisableIRQ(USB_FS_IRQn);
417+
412418
#else
413419
#error Unknown arch in USB driver
414420
#endif

src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@
9393
#include "stm32l4xx.h"
9494
#define PMA_LENGTH (1024u)
9595

96+
#elif CFG_TUSB_MCU == OPT_MCU_STM32L5
97+
#include "stm32l5xx.h"
98+
#define PMA_LENGTH (1024u)
99+
100+
#ifndef USB_PMAADDR
101+
#define USB_PMAADDR (USB_BASE + (USB_PMAADDR_NS - USB_BASE_NS))
102+
#endif
103+
96104
#else
97105
#error You are using an untested or unimplemented STM32 variant. Please update the driver.
98106
// This includes L1x0, L1x1, L1x2, L4x2 and L4x3, G1x1, G1x3, and G1x4

src/tusb_option.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
#define OPT_MCU_STM32G4 311 ///< ST G4
8383
#define OPT_MCU_STM32WB 312 ///< ST WB
8484
#define OPT_MCU_STM32U5 313 ///< ST U5
85+
#define OPT_MCU_STM32L5 314 ///< ST L5
8586

8687
// Sony
8788
#define OPT_MCU_CXD56 400 ///< SONY CXD56

0 commit comments

Comments
 (0)