Skip to content

Commit 31dfd67

Browse files
committed
fix stm32u0 data stride
Signed-off-by: Zixun LI <admin@hifiphile.com>
1 parent dc00f35 commit 31dfd67

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/portable/st/stm32_fsdev/fsdev_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ TU_VERIFY_STATIC(FSDEV_BTABLE_BASE % 8 == 0, "BTABLE base must be aligned to 8 b
7171
// 1x16 bit / word access scheme
7272
#define FSDEV_PMA_STRIDE 2
7373
#define pma_access_scheme TU_ATTR_ALIGNED(4)
74-
#elif CFG_TUSB_FSDEV_PMA_SIZE == 1024
74+
#elif CFG_TUSB_FSDEV_PMA_SIZE == 1024 && CFG_TUSB_MCU != OPT_MCU_STM32U0
7575
// 2x16 bit / word access scheme
7676
#define FSDEV_PMA_STRIDE 1
7777
#define pma_access_scheme
78-
#elif CFG_TUSB_FSDEV_PMA_SIZE == 2048
78+
#elif CFG_TUSB_FSDEV_PMA_SIZE == 2048 || CFG_TUSB_MCU == OPT_MCU_STM32U0
7979
// 32 bit access scheme
8080
#define FSDEV_BUS_32BIT
8181
#define FSDEV_PMA_STRIDE 1

src/tusb_option.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@
343343
#if CFG_TUSB_FSDEV_PMA_SIZE == 512
344344
#define CFG_TUSB_FIFO_HWFIFO_DATA_STRIDE 2 // 16-bit data
345345
#define CFG_TUSB_FIFO_HWFIFO_ADDR_STRIDE 4 // 32-bit address increase
346-
#elif CFG_TUSB_FSDEV_PMA_SIZE == 1024
346+
#elif CFG_TUSB_FSDEV_PMA_SIZE == 1024 && CFG_TUSB_MCU != OPT_MCU_STM32U0
347347
#define CFG_TUSB_FIFO_HWFIFO_DATA_STRIDE 2 // 16-bit data
348348
#define CFG_TUSB_FIFO_HWFIFO_ADDR_STRIDE 2 // 16-bit address increase
349-
#elif CFG_TUSB_FSDEV_PMA_SIZE == 2048
349+
#elif CFG_TUSB_FSDEV_PMA_SIZE == 2048 || CFG_TUSB_MCU == OPT_MCU_STM32U0
350350
#define CFG_TUSB_FIFO_HWFIFO_DATA_STRIDE 4 // 32-bit data
351351
#define CFG_TUSB_FIFO_HWFIFO_ADDR_STRIDE 4 // 32-bit address increase
352352
#endif

0 commit comments

Comments
 (0)