Kaynağa Gözat

[bsp][stm32] 移除 f0 和 f1 中 flash write 对 size 对齐的限制

Signed-off-by: MurphyZhao <d2014zjt@163.com>
MurphyZhao 6 yıl önce
ebeveyn
işleme
bc2ee9999b

+ 0 - 6
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));

+ 0 - 6
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));