diff --git a/board/fal_cfg.h b/board/fal_cfg.h index 14d751e..883bfb7 100644 --- a/board/fal_cfg.h +++ b/board/fal_cfg.h @@ -34,7 +34,6 @@ extern const struct fal_flash_dev stm32_onchip_flash_128k; /* flash device table */ #define FAL_FLASH_DEV_TABLE \ { \ - &stm32_onchip_flash_16k, \ &stm32_onchip_flash_64k, \ &stm32_onchip_flash_128k, \ } @@ -53,8 +52,7 @@ extern const struct fal_flash_dev stm32_onchip_flash_128k; */ #define FAL_PART_TABLE \ { \ - {FAL_PART_MAGIC_WROD, "boot_0", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \ - {FAL_PART_MAGIC_WROD, "boot_1", "onchip_flash_64k", 0 , FLASH_SIZE_GRANULARITY_64K , 0}, \ + {FAL_PART_MAGIC_WROD, "boot", "onchip_flash_64k", 0 , FLASH_SIZE_GRANULARITY_16K + FLASH_SIZE_GRANULARITY_64K , 0}, \ {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 0 , FLASH_SIZE_APP, 0}, \ {FAL_PART_MAGIC_WROD, "ulog", "onchip_flash_128k", FLASH_OFFSET_LOG , FLASH_SIZE_LOG, 0}, \ } diff --git a/libraries/HAL_Drivers/drv_flash/drv_flash_f4.c b/libraries/HAL_Drivers/drv_flash/drv_flash_f4.c index afca990..2f32516 100644 --- a/libraries/HAL_Drivers/drv_flash/drv_flash_f4.c +++ b/libraries/HAL_Drivers/drv_flash/drv_flash_f4.c @@ -361,37 +361,20 @@ __exit: #if defined(RT_USING_FAL) -static int fal_flash_read_16k(long offset, rt_uint8_t *buf, size_t size); static int fal_flash_read_64k(long offset, rt_uint8_t *buf, size_t size); static int fal_flash_read_128k(long offset, rt_uint8_t *buf, size_t size); -static int fal_flash_write_16k(long offset, const rt_uint8_t *buf, size_t size); static int fal_flash_write_64k(long offset, const rt_uint8_t *buf, size_t size); static int fal_flash_write_128k(long offset, const rt_uint8_t *buf, size_t size); -static int fal_flash_erase_16k(long offset, size_t size); static int fal_flash_erase_64k(long offset, size_t size); static int fal_flash_erase_128k(long offset, size_t size); -const struct fal_flash_dev stm32_onchip_flash_16k = -{ - "onchip_flash_16k", - STM32_FLASH_START_ADRESS_16K, - FLASH_SIZE_GRANULARITY_16K, - (16 * 1024), - { - NULL, - fal_flash_read_16k, - fal_flash_write_16k, - fal_flash_erase_16k, - }, - 8, -}; const struct fal_flash_dev stm32_onchip_flash_64k = { "onchip_flash_64k", - STM32_FLASH_START_ADRESS_64K, - FLASH_SIZE_GRANULARITY_64K, + STM32_FLASH_START_ADRESS_16K, + FLASH_SIZE_GRANULARITY_64K + FLASH_SIZE_GRANULARITY_16K, (64 * 1024), { NULL, @@ -416,10 +399,6 @@ const struct fal_flash_dev stm32_onchip_flash_128k = 8, }; -static int fal_flash_read_16k(long offset, rt_uint8_t *buf, size_t size) -{ - return stm32_flash_read(stm32_onchip_flash_16k.addr + offset, buf, size); -} static int fal_flash_read_64k(long offset, rt_uint8_t *buf, size_t size) { return stm32_flash_read(stm32_onchip_flash_64k.addr + offset, buf, size); @@ -429,10 +408,6 @@ static int fal_flash_read_128k(long offset, rt_uint8_t *buf, size_t size) return stm32_flash_read(stm32_onchip_flash_128k.addr + offset, buf, size); } -static int fal_flash_write_16k(long offset, const rt_uint8_t *buf, size_t size) -{ - return stm32_flash_write(stm32_onchip_flash_16k.addr + offset, buf, size); -} static int fal_flash_write_64k(long offset, const rt_uint8_t *buf, size_t size) { return stm32_flash_write(stm32_onchip_flash_64k.addr + offset, buf, size); @@ -442,10 +417,6 @@ static int fal_flash_write_128k(long offset, const rt_uint8_t *buf, size_t size) return stm32_flash_write(stm32_onchip_flash_128k.addr + offset, buf, size); } -static int fal_flash_erase_16k(long offset, size_t size) -{ - return stm32_flash_erase(stm32_onchip_flash_16k.addr + offset, size); -} static int fal_flash_erase_64k(long offset, size_t size) { return stm32_flash_erase(stm32_onchip_flash_64k.addr + offset, size); diff --git a/project.uvoptx b/project.uvoptx index bfebf24..833e7c1 100644 --- a/project.uvoptx +++ b/project.uvoptx @@ -568,7 +568,7 @@ Drivers - 0 + 1 0 0 0 @@ -588,7 +588,7 @@ 5 31 1 - 1 + 0 0 0 board\board.c