Skip to content

Commit bc2ee99

Browse files
committed
[bsp][stm32] 移除 f0 和 f1 中 flash write 对 size 对齐的限制
Signed-off-by: MurphyZhao <[email protected]>
1 parent 25b4935 commit bc2ee99

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f0.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ int stm32_flash_write(rt_uint32_t addr, const rt_uint8_t *buf, size_t size)
8484
return -RT_EINVAL;
8585
}
8686

87-
if (size % 4 != 0)
88-
{
89-
LOG_E("write size must be 4-byte alignment");
90-
return -RT_EINVAL;
91-
}
92-
9387
if ((end_addr) > STM32_FLASH_END_ADDRESS)
9488
{
9589
LOG_E("write outrange flash size! addr is (0x%p)", (void *)(addr + size));

bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f1.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ int stm32_flash_write(rt_uint32_t addr, const rt_uint8_t *buf, size_t size)
8484
return -RT_EINVAL;
8585
}
8686

87-
if (size % 4 != 0)
88-
{
89-
LOG_E("write size must be 4-byte alignment");
90-
return -RT_EINVAL;
91-
}
92-
9387
if ((end_addr) > STM32_FLASH_END_ADDRESS)
9488
{
9589
LOG_E("write outrange flash size! addr is (0x%p)", (void *)(addr + size));

0 commit comments

Comments
 (0)