소스 검색

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

Signed-off-by: MurphyZhao <d2014zjt@163.com>
MurphyZhao 6 년 전
부모
커밋
bc2ee9999b
2개의 변경된 파일0개의 추가작업 그리고 12개의 파일을 삭제
  1. 0 6
      bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f0.c
  2. 0 6
      bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f1.c

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