diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f0.c b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f0.c index dd472b9694..0a73e968e2 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f0.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f0.c @@ -84,12 +84,6 @@ int stm32_flash_write(rt_uint32_t addr, const rt_uint8_t *buf, size_t size) return -RT_EINVAL; } - if (size % 4 != 0) - { - LOG_E("write size must be 4-byte alignment"); - return -RT_EINVAL; - } - if ((end_addr) > STM32_FLASH_END_ADDRESS) { LOG_E("write outrange flash size! addr is (0x%p)", (void *)(addr + size)); diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f1.c b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f1.c index 306b2fb665..37022dd1ca 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f1.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f1.c @@ -84,12 +84,6 @@ int stm32_flash_write(rt_uint32_t addr, const rt_uint8_t *buf, size_t size) return -RT_EINVAL; } - if (size % 4 != 0) - { - LOG_E("write size must be 4-byte alignment"); - return -RT_EINVAL; - } - if ((end_addr) > STM32_FLASH_END_ADDRESS) { LOG_E("write outrange flash size! addr is (0x%p)", (void *)(addr + size)); diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_l4.c b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_l4.c index 6567db13f1..388791428d 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_l4.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_l4.c @@ -140,12 +140,6 @@ int stm32_flash_write(rt_uint32_t addr, const uint8_t *buf, size_t size) return -RT_EINVAL; } - if(size % 8 != 0) - { - LOG_E("write size must be 8-byte alignment"); - return -RT_EINVAL; - } - HAL_FLASH_Unlock(); __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGSERR);