Merge pull request #2233 from zhaojuntao/fix-bsp-flash-drv

[bsp][stm32/libraries] 移除 flash 驱动中 flash write 函数对 size 对齐的限制
This commit is contained in:
Bernard Xiong 2019-01-19 16:20:20 +08:00 committed by GitHub
commit 0889bafda8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 18 deletions

View File

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

View File

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

View File

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