Skip to content

Commit f09e23e

Browse files
authored
Merge pull request #2732 from hathach/fix-fsdev-issue
fix fsdev issue introduced by #1942
2 parents e09cf36 + 4de46fc commit f09e23e

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

hw/bsp/ch32v20x/boards/ch32v203c_r0_1v0/board.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ set(LD_RAM_SIZE 20K)
1010
function(update_board TARGET)
1111
target_compile_definitions(${TARGET} PUBLIC
1212
SYSCLK_FREQ_144MHz_HSE=144000000
13-
CH32_FLASH_ENHANCE_READ_MODE=1
1413
CFG_EXAMPLE_MSC_DUAL_READONLY
1514
)
1615
endfunction()

hw/bsp/ch32v20x/boards/ch32v203g_r0_1v0/board.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ set(LD_RAM_SIZE 10K)
88
function(update_board TARGET)
99
target_compile_definitions(${TARGET} PUBLIC
1010
SYSCLK_FREQ_144MHz_HSI=144000000
11-
CH32_FLASH_ENHANCE_READ_MODE=1
1211
CFG_EXAMPLE_MSC_DUAL_READONLY
1312
)
1413
endfunction()

hw/bsp/ch32v20x/boards/nanoch32v203/board.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ set(LD_RAM_SIZE 20K)
88
function(update_board TARGET)
99
target_compile_definitions(${TARGET} PUBLIC
1010
SYSCLK_FREQ_144MHz_HSE=144000000
11-
CH32_FLASH_ENHANCE_READ_MODE=1
1211
CFG_EXAMPLE_MSC_DUAL_READONLY
1312
)
1413
endfunction()

hw/bsp/ch32v20x/family.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ function(add_board_target BOARD_TARGET)
7272

7373
update_board(${BOARD_TARGET})
7474

75+
if (LD_FLASH_SIZE STREQUAL 224K)
76+
target_compile_definitions(${BOARD_TARGET} PUBLIC
77+
CH32_FLASH_ENHANCE_READ_MODE=1
78+
)
79+
endif()
80+
7581
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
7682
target_compile_options(${BOARD_TARGET} PUBLIC
7783
-mcmodel=medany

src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ static bool dcd_write_packet_memory(uint16_t dst, const void *__restrict src, ui
10041004
srcVal++;
10051005
}
10061006

1007-
if (wNBytes) {
1007+
if (wNBytes & 0x01) {
10081008
temp1 = (uint16_t) *srcVal;
10091009
*pdwVal = temp1;
10101010
}

0 commit comments

Comments
 (0)