From 32b43c1fdee5cbbf9d250fbfeb75f7a654782df4 Mon Sep 17 00:00:00 2001 From: SummerGift Date: Mon, 28 Jan 2019 13:55:23 +0800 Subject: [PATCH 1/2] [bsp][stm32] optimize spi flash prompt message --- bsp/stm32/stm32f103-atk-nano/board/Kconfig | 2 +- bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig | 2 +- bsp/stm32/stm32f407-atk-explorer/board/Kconfig | 2 +- bsp/stm32/stm32f429-armfly-v6/board/Kconfig | 2 +- bsp/stm32/stm32f429-atk-apollo/board/Kconfig | 2 +- bsp/stm32/stm32f429-fire-challenger/board/Kconfig | 2 +- bsp/stm32/stm32f767-atk-apollo/board/Kconfig | 2 +- bsp/stm32/stm32f767-atk-apollo/board/ports/drv_qspi_flash.c | 2 +- .../stm32f767-fire-challenger/board/ports/drv_qspi_flash.c | 2 +- bsp/stm32/stm32l475-atk-pandora/board/Kconfig | 2 +- bsp/stm32/stm32l475-atk-pandora/board/ports/drv_qspi_flash.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bsp/stm32/stm32f103-atk-nano/board/Kconfig b/bsp/stm32/stm32f103-atk-nano/board/Kconfig index e7873048cf..010389a3bb 100644 --- a/bsp/stm32/stm32f103-atk-nano/board/Kconfig +++ b/bsp/stm32/stm32f103-atk-nano/board/Kconfig @@ -19,7 +19,7 @@ menu "Onboard Peripheral Drivers" default n config BSP_USING_SPI_FLASH - bool "Enable SPI FLASH (w25q16 spi2)" + bool "Enable SPI FLASH (W25Q16 spi2)" select BSP_USING_SPI select BSP_USING_SPI2 select RT_USING_SFUD diff --git a/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig b/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig index 983ce4bb86..419bb3564c 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig +++ b/bsp/stm32/stm32f103-fire-arbitrary/board/Kconfig @@ -19,7 +19,7 @@ menu "Onboard Peripheral Drivers" default n config BSP_USING_SPI_FLASH - bool "Enable SPI FLASH (w25q64 spi1)" + bool "Enable SPI FLASH (W25Q64 spi1)" select BSP_USING_SPI select BSP_USING_SPI1 select RT_USING_SFUD diff --git a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig index 66d7cf8d0f..5da6237062 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/Kconfig +++ b/bsp/stm32/stm32f407-atk-explorer/board/Kconfig @@ -26,7 +26,7 @@ menu "Onboard Peripheral Drivers" default n config BSP_USING_SPI_FLASH - bool "Enable SPI FLASH (w25q128 spi1)" + bool "Enable SPI FLASH (W25Q128 spi1)" select BSP_USING_SPI select BSP_USING_SPI1 select RT_USING_SFUD diff --git a/bsp/stm32/stm32f429-armfly-v6/board/Kconfig b/bsp/stm32/stm32f429-armfly-v6/board/Kconfig index e169c1a8ac..4ecba0d5a3 100644 --- a/bsp/stm32/stm32f429-armfly-v6/board/Kconfig +++ b/bsp/stm32/stm32f429-armfly-v6/board/Kconfig @@ -24,7 +24,7 @@ menu "Onboard Peripheral Drivers" default n config BSP_USING_SPI_FLASH - bool "Enable SPI FLASH (w25q64 spi3)" + bool "Enable SPI FLASH (W25Q64 spi3)" select BSP_USING_SPI select BSP_USING_SPI3 select RT_USING_SFUD diff --git a/bsp/stm32/stm32f429-atk-apollo/board/Kconfig b/bsp/stm32/stm32f429-atk-apollo/board/Kconfig index a38ce45a8b..e43d9db64f 100644 --- a/bsp/stm32/stm32f429-atk-apollo/board/Kconfig +++ b/bsp/stm32/stm32f429-atk-apollo/board/Kconfig @@ -30,7 +30,7 @@ menu "Onboard Peripheral Drivers" default n config BSP_USING_SPI_FLASH - bool "Enable SPI FLASH (w25q256 spi5)" + bool "Enable SPI FLASH (W25Q256 spi5)" select BSP_USING_SPI select BSP_USING_SPI5 select RT_USING_SFUD diff --git a/bsp/stm32/stm32f429-fire-challenger/board/Kconfig b/bsp/stm32/stm32f429-fire-challenger/board/Kconfig index 4e8b545302..f0514211da 100644 --- a/bsp/stm32/stm32f429-fire-challenger/board/Kconfig +++ b/bsp/stm32/stm32f429-fire-challenger/board/Kconfig @@ -25,7 +25,7 @@ menu "Onboard Peripheral Drivers" default n config BSP_USING_SPI_FLASH - bool "Enable SPI FLASH (w25q256 spi5)" + bool "Enable SPI FLASH (W25Q128 spi5)" select BSP_USING_SPI select BSP_USING_SPI5 select RT_USING_SFUD diff --git a/bsp/stm32/stm32f767-atk-apollo/board/Kconfig b/bsp/stm32/stm32f767-atk-apollo/board/Kconfig index 7d1273b33f..676fb439da 100644 --- a/bsp/stm32/stm32f767-atk-apollo/board/Kconfig +++ b/bsp/stm32/stm32f767-atk-apollo/board/Kconfig @@ -24,7 +24,7 @@ menu "Onboard Peripheral Drivers" default n config BSP_USING_QSPI_FLASH - bool "Enable QSPI FLASH (W25Q256 qspi)" + bool "Enable QSPI FLASH (w25q128 qspi)" select BSP_USING_QSPI select RT_USING_SFUD select RT_SFUD_USING_QSPI diff --git a/bsp/stm32/stm32f767-atk-apollo/board/ports/drv_qspi_flash.c b/bsp/stm32/stm32f767-atk-apollo/board/ports/drv_qspi_flash.c index 0345cfc9fb..36ecb754e9 100644 --- a/bsp/stm32/stm32f767-atk-apollo/board/ports/drv_qspi_flash.c +++ b/bsp/stm32/stm32f767-atk-apollo/board/ports/drv_qspi_flash.c @@ -65,7 +65,7 @@ static int rt_hw_qspi_flash_with_sfud_init(void) stm32_qspi_bus_attach_device("qspi1", "qspi10", RT_NULL, 4, w25qxx_enter_qspi_mode, RT_NULL); /* init w25q128 */ - if (RT_NULL == rt_sfud_flash_probe("w25q128", "qspi10")) + if (RT_NULL == rt_sfud_flash_probe("W25Q128", "qspi10")) { return -RT_ERROR; } diff --git a/bsp/stm32/stm32f767-fire-challenger/board/ports/drv_qspi_flash.c b/bsp/stm32/stm32f767-fire-challenger/board/ports/drv_qspi_flash.c index 0345cfc9fb..36ecb754e9 100644 --- a/bsp/stm32/stm32f767-fire-challenger/board/ports/drv_qspi_flash.c +++ b/bsp/stm32/stm32f767-fire-challenger/board/ports/drv_qspi_flash.c @@ -65,7 +65,7 @@ static int rt_hw_qspi_flash_with_sfud_init(void) stm32_qspi_bus_attach_device("qspi1", "qspi10", RT_NULL, 4, w25qxx_enter_qspi_mode, RT_NULL); /* init w25q128 */ - if (RT_NULL == rt_sfud_flash_probe("w25q128", "qspi10")) + if (RT_NULL == rt_sfud_flash_probe("W25Q128", "qspi10")) { return -RT_ERROR; } diff --git a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig index afe8fe2f5e..28b7b0dde1 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig +++ b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig @@ -14,7 +14,7 @@ menu "Onboard Peripheral Drivers" default y config BSP_USING_QSPI_FLASH - bool "Enable QSPI FLASH" + bool "Enable QSPI FLASH (W25Q128 qspi1)" select BSP_USING_QSPI select RT_USING_SFUD select RT_SFUD_USING_QSPI diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_qspi_flash.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_qspi_flash.c index 0345cfc9fb..36ecb754e9 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_qspi_flash.c +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_qspi_flash.c @@ -65,7 +65,7 @@ static int rt_hw_qspi_flash_with_sfud_init(void) stm32_qspi_bus_attach_device("qspi1", "qspi10", RT_NULL, 4, w25qxx_enter_qspi_mode, RT_NULL); /* init w25q128 */ - if (RT_NULL == rt_sfud_flash_probe("w25q128", "qspi10")) + if (RT_NULL == rt_sfud_flash_probe("W25Q128", "qspi10")) { return -RT_ERROR; } From 532a14ddd875e6aad68e49a9a57fbe2ed53dbd9a Mon Sep 17 00:00:00 2001 From: SummerGift Date: Mon, 28 Jan 2019 13:59:37 +0800 Subject: [PATCH 2/2] [bsp][stm32] fix flash partition bug --- .../libraries/HAL_Drivers/drv_flash/drv_flash_f4.c | 6 +++--- .../libraries/HAL_Drivers/drv_flash/drv_flash_f7.c | 6 +++--- .../stm32f407-atk-explorer/board/ports/fal_cfg.h | 14 +++++++++----- .../stm32f429-armfly-v6/board/ports/fal_cfg.h | 14 +++++++++----- .../stm32f429-atk-apollo/board/ports/fal_cfg.h | 14 +++++++++----- .../board/ports/fal_cfg.h | 14 +++++++++----- .../stm32f767-atk-apollo/board/ports/fal_cfg.h | 14 +++++++++----- .../board/ports/fal_cfg.h | 14 +++++++++----- 8 files changed, 60 insertions(+), 36 deletions(-) diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f4.c b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f4.c index 7664e7a4b4..0bafd5b779 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f4.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f4.c @@ -327,9 +327,9 @@ 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, FLASH_SIZE_GRANULARITY_16K, (16 * 1024), {NULL, fal_flash_read_16k, fal_flash_write_16k, fal_flash_erase_16k} }; -const struct fal_flash_dev stm32_onchip_flash_64k = { "onchip_flash_64k", STM32_FLASH_START_ADRESS, FLASH_SIZE_GRANULARITY_64K, (64 * 1024), {NULL, fal_flash_read_64k, fal_flash_write_64k, fal_flash_erase_64k} }; -const struct fal_flash_dev stm32_onchip_flash_128k = { "onchip_flash_128k", STM32_FLASH_START_ADRESS, FLASH_SIZE_GRANULARITY_128K, (128 * 1024), {NULL, fal_flash_read_128k, fal_flash_write_128k, fal_flash_erase_128k} }; +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} }; +const struct fal_flash_dev stm32_onchip_flash_64k = { "onchip_flash_64k", STM32_FLASH_START_ADRESS_64K, FLASH_SIZE_GRANULARITY_64K, (64 * 1024), {NULL, fal_flash_read_64k, fal_flash_write_64k, fal_flash_erase_64k} }; +const struct fal_flash_dev stm32_onchip_flash_128k = { "onchip_flash_128k", STM32_FLASH_START_ADRESS_128K, FLASH_SIZE_GRANULARITY_128K, (128 * 1024), {NULL, fal_flash_read_128k, fal_flash_write_128k, fal_flash_erase_128k} }; static int fal_flash_read_16k(long offset, rt_uint8_t *buf, size_t size) { diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f7.c b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f7.c index d71013d3ea..d92e11b583 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f7.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f7.c @@ -253,9 +253,9 @@ static int fal_flash_erase_32k(long offset, size_t size); static int fal_flash_erase_128k(long offset, size_t size); static int fal_flash_erase_256k(long offset, size_t size); -const struct fal_flash_dev stm32_onchip_flash_32k = { "onchip_flash_32k", STM32_FLASH_START_ADRESS, FLASH_SIZE_GRANULARITY_32K, (32 * 1024), {NULL, fal_flash_read_32k, fal_flash_write_32k, fal_flash_erase_32k} }; -const struct fal_flash_dev stm32_onchip_flash_128k = { "onchip_flash_128k", STM32_FLASH_START_ADRESS, FLASH_SIZE_GRANULARITY_128K, (128 * 1024), {NULL, fal_flash_read_128k, fal_flash_write_128k, fal_flash_erase_128k} }; -const struct fal_flash_dev stm32_onchip_flash_256k = { "onchip_flash_256k", STM32_FLASH_START_ADRESS, FLASH_SIZE_GRANULARITY_256K, (256 * 1024), {NULL, fal_flash_read_256k, fal_flash_write_256k, fal_flash_erase_256k} }; +const struct fal_flash_dev stm32_onchip_flash_32k = { "onchip_flash_32k", STM32_FLASH_START_ADRESS_32K, FLASH_SIZE_GRANULARITY_32K, (32 * 1024), {NULL, fal_flash_read_32k, fal_flash_write_32k, fal_flash_erase_32k} }; +const struct fal_flash_dev stm32_onchip_flash_128k = { "onchip_flash_128k", STM32_FLASH_START_ADRESS_128K, FLASH_SIZE_GRANULARITY_128K, (128 * 1024), {NULL, fal_flash_read_128k, fal_flash_write_128k, fal_flash_erase_128k} }; +const struct fal_flash_dev stm32_onchip_flash_256k = { "onchip_flash_256k", STM32_FLASH_START_ADRESS_256K, FLASH_SIZE_GRANULARITY_256K, (256 * 1024), {NULL, fal_flash_read_256k, fal_flash_write_256k, fal_flash_erase_256k} }; static int fal_flash_read_32k(long offset, rt_uint8_t *buf, size_t size) { diff --git a/bsp/stm32/stm32f407-atk-explorer/board/ports/fal_cfg.h b/bsp/stm32/stm32f407-atk-explorer/board/ports/fal_cfg.h index 6ed136aad2..a587e207ce 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/ports/fal_cfg.h +++ b/bsp/stm32/stm32f407-atk-explorer/board/ports/fal_cfg.h @@ -15,8 +15,12 @@ #include #define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024) -#define FLASH_SIZE_GRANULARITY_64K (FLASH_SIZE_GRANULARITY_16K + 64 * 1024) -#define FLASH_SIZE_GRANULARITY_128K (FLASH_SIZE_GRANULARITY_64K + 7 * 128 * 1024) +#define FLASH_SIZE_GRANULARITY_64K (64 * 1024) +#define FLASH_SIZE_GRANULARITY_128K (7 * 128 * 1024) + +#define STM32_FLASH_START_ADRESS_16K STM32_FLASH_START_ADRESS +#define STM32_FLASH_START_ADRESS_64K (STM32_FLASH_START_ADRESS_16K + FLASH_SIZE_GRANULARITY_16K) +#define STM32_FLASH_START_ADRESS_128K (STM32_FLASH_START_ADRESS_64K + FLASH_SIZE_GRANULARITY_64K) extern const struct fal_flash_dev stm32_onchip_flash_16k; extern const struct fal_flash_dev stm32_onchip_flash_64k; @@ -35,9 +39,9 @@ extern const struct fal_flash_dev stm32_onchip_flash_128k; /* partition table */ #define FAL_PART_TABLE \ { \ - {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \ - {FAL_PART_MAGIC_WROD, "param", "onchip_flash_64k", FLASH_SIZE_GRANULARITY_16K , FLASH_SIZE_GRANULARITY_64K , 0}, \ - {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", FLASH_SIZE_GRANULARITY_64K, FLASH_SIZE_GRANULARITY_128K, 0}, \ + {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \ + {FAL_PART_MAGIC_WROD, "param", "onchip_flash_64k", 0 , FLASH_SIZE_GRANULARITY_64K , 0}, \ + {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 0 , FLASH_SIZE_GRANULARITY_128K, 0}, \ } #endif /* FAL_PART_HAS_TABLE_CFG */ diff --git a/bsp/stm32/stm32f429-armfly-v6/board/ports/fal_cfg.h b/bsp/stm32/stm32f429-armfly-v6/board/ports/fal_cfg.h index df06c65227..a587e207ce 100644 --- a/bsp/stm32/stm32f429-armfly-v6/board/ports/fal_cfg.h +++ b/bsp/stm32/stm32f429-armfly-v6/board/ports/fal_cfg.h @@ -15,8 +15,12 @@ #include #define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024) -#define FLASH_SIZE_GRANULARITY_64K (FLASH_SIZE_GRANULARITY_16K + 64 * 1024) -#define FLASH_SIZE_GRANULARITY_128K (FLASH_SIZE_GRANULARITY_64K + 7 * 128 * 1024) +#define FLASH_SIZE_GRANULARITY_64K (64 * 1024) +#define FLASH_SIZE_GRANULARITY_128K (7 * 128 * 1024) + +#define STM32_FLASH_START_ADRESS_16K STM32_FLASH_START_ADRESS +#define STM32_FLASH_START_ADRESS_64K (STM32_FLASH_START_ADRESS_16K + FLASH_SIZE_GRANULARITY_16K) +#define STM32_FLASH_START_ADRESS_128K (STM32_FLASH_START_ADRESS_64K + FLASH_SIZE_GRANULARITY_64K) extern const struct fal_flash_dev stm32_onchip_flash_16k; extern const struct fal_flash_dev stm32_onchip_flash_64k; @@ -35,9 +39,9 @@ extern const struct fal_flash_dev stm32_onchip_flash_128k; /* partition table */ #define FAL_PART_TABLE \ { \ - {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \ - {FAL_PART_MAGIC_WROD, "param", "onchip_flash_64k", FLASH_SIZE_GRANULARITY_16K , FLASH_SIZE_GRANULARITY_64K , 0}, \ - {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", FLASH_SIZE_GRANULARITY_64K, FLASH_SIZE_GRANULARITY_128K, 0}, \ + {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \ + {FAL_PART_MAGIC_WROD, "param", "onchip_flash_64k", 0 , FLASH_SIZE_GRANULARITY_64K , 0}, \ + {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 0 , FLASH_SIZE_GRANULARITY_128K, 0}, \ } #endif /* FAL_PART_HAS_TABLE_CFG */ diff --git a/bsp/stm32/stm32f429-atk-apollo/board/ports/fal_cfg.h b/bsp/stm32/stm32f429-atk-apollo/board/ports/fal_cfg.h index df06c65227..a587e207ce 100644 --- a/bsp/stm32/stm32f429-atk-apollo/board/ports/fal_cfg.h +++ b/bsp/stm32/stm32f429-atk-apollo/board/ports/fal_cfg.h @@ -15,8 +15,12 @@ #include #define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024) -#define FLASH_SIZE_GRANULARITY_64K (FLASH_SIZE_GRANULARITY_16K + 64 * 1024) -#define FLASH_SIZE_GRANULARITY_128K (FLASH_SIZE_GRANULARITY_64K + 7 * 128 * 1024) +#define FLASH_SIZE_GRANULARITY_64K (64 * 1024) +#define FLASH_SIZE_GRANULARITY_128K (7 * 128 * 1024) + +#define STM32_FLASH_START_ADRESS_16K STM32_FLASH_START_ADRESS +#define STM32_FLASH_START_ADRESS_64K (STM32_FLASH_START_ADRESS_16K + FLASH_SIZE_GRANULARITY_16K) +#define STM32_FLASH_START_ADRESS_128K (STM32_FLASH_START_ADRESS_64K + FLASH_SIZE_GRANULARITY_64K) extern const struct fal_flash_dev stm32_onchip_flash_16k; extern const struct fal_flash_dev stm32_onchip_flash_64k; @@ -35,9 +39,9 @@ extern const struct fal_flash_dev stm32_onchip_flash_128k; /* partition table */ #define FAL_PART_TABLE \ { \ - {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \ - {FAL_PART_MAGIC_WROD, "param", "onchip_flash_64k", FLASH_SIZE_GRANULARITY_16K , FLASH_SIZE_GRANULARITY_64K , 0}, \ - {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", FLASH_SIZE_GRANULARITY_64K, FLASH_SIZE_GRANULARITY_128K, 0}, \ + {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \ + {FAL_PART_MAGIC_WROD, "param", "onchip_flash_64k", 0 , FLASH_SIZE_GRANULARITY_64K , 0}, \ + {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 0 , FLASH_SIZE_GRANULARITY_128K, 0}, \ } #endif /* FAL_PART_HAS_TABLE_CFG */ diff --git a/bsp/stm32/stm32f429-fire-challenger/board/ports/fal_cfg.h b/bsp/stm32/stm32f429-fire-challenger/board/ports/fal_cfg.h index 5f27860dac..a587e207ce 100644 --- a/bsp/stm32/stm32f429-fire-challenger/board/ports/fal_cfg.h +++ b/bsp/stm32/stm32f429-fire-challenger/board/ports/fal_cfg.h @@ -15,8 +15,12 @@ #include #define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024) -#define FLASH_SIZE_GRANULARITY_64K (FLASH_SIZE_GRANULARITY_16K + 64 * 1024) -#define FLASH_SIZE_GRANULARITY_128K (FLASH_SIZE_GRANULARITY_64K + 7 * 128 * 1024) +#define FLASH_SIZE_GRANULARITY_64K (64 * 1024) +#define FLASH_SIZE_GRANULARITY_128K (7 * 128 * 1024) + +#define STM32_FLASH_START_ADRESS_16K STM32_FLASH_START_ADRESS +#define STM32_FLASH_START_ADRESS_64K (STM32_FLASH_START_ADRESS_16K + FLASH_SIZE_GRANULARITY_16K) +#define STM32_FLASH_START_ADRESS_128K (STM32_FLASH_START_ADRESS_64K + FLASH_SIZE_GRANULARITY_64K) extern const struct fal_flash_dev stm32_onchip_flash_16k; extern const struct fal_flash_dev stm32_onchip_flash_64k; @@ -35,9 +39,9 @@ extern const struct fal_flash_dev stm32_onchip_flash_128k; /* partition table */ #define FAL_PART_TABLE \ { \ - {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \ - {FAL_PART_MAGIC_WROD, "app", "onchip_flash_64k", FLASH_SIZE_GRANULARITY_16K , FLASH_SIZE_GRANULARITY_64K , 0}, \ - {FAL_PART_MAGIC_WROD, "download", "onchip_flash_128k", FLASH_SIZE_GRANULARITY_64K, FLASH_SIZE_GRANULARITY_128K, 0}, \ + {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_16k", 0 , FLASH_SIZE_GRANULARITY_16K , 0}, \ + {FAL_PART_MAGIC_WROD, "param", "onchip_flash_64k", 0 , FLASH_SIZE_GRANULARITY_64K , 0}, \ + {FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 0 , FLASH_SIZE_GRANULARITY_128K, 0}, \ } #endif /* FAL_PART_HAS_TABLE_CFG */ diff --git a/bsp/stm32/stm32f767-atk-apollo/board/ports/fal_cfg.h b/bsp/stm32/stm32f767-atk-apollo/board/ports/fal_cfg.h index 10c05885da..891beb2010 100644 --- a/bsp/stm32/stm32f767-atk-apollo/board/ports/fal_cfg.h +++ b/bsp/stm32/stm32f767-atk-apollo/board/ports/fal_cfg.h @@ -15,8 +15,12 @@ #include #define FLASH_SIZE_GRANULARITY_32K (4 * 32 * 1024) -#define FLASH_SIZE_GRANULARITY_128K (FLASH_SIZE_GRANULARITY_32K + 128 * 1024) -#define FLASH_SIZE_GRANULARITY_256K (FLASH_SIZE_GRANULARITY_128K + 3 * 256 * 1024) +#define FLASH_SIZE_GRANULARITY_128K (128 * 1024) +#define FLASH_SIZE_GRANULARITY_256K (3 * 256 * 1024) + +#define STM32_FLASH_START_ADRESS_32K STM32_FLASH_START_ADRESS +#define STM32_FLASH_START_ADRESS_128K (STM32_FLASH_START_ADRESS_32K + FLASH_SIZE_GRANULARITY_32K) +#define STM32_FLASH_START_ADRESS_256K (STM32_FLASH_START_ADRESS_128K + FLASH_SIZE_GRANULARITY_128K) extern const struct fal_flash_dev stm32_onchip_flash_32k; extern const struct fal_flash_dev stm32_onchip_flash_128k; @@ -35,9 +39,9 @@ extern const struct fal_flash_dev stm32_onchip_flash_256k; /* partition table */ #define FAL_PART_TABLE \ { \ - {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_32k", 0 , FLASH_SIZE_GRANULARITY_32K , 0}, \ - {FAL_PART_MAGIC_WROD, "param", "onchip_flash_128k", FLASH_SIZE_GRANULARITY_32K , FLASH_SIZE_GRANULARITY_128K, 0}, \ - {FAL_PART_MAGIC_WROD, "app", "onchip_flash_256k", FLASH_SIZE_GRANULARITY_128K, FLASH_SIZE_GRANULARITY_256K, 0}, \ + {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_32k", 0 , FLASH_SIZE_GRANULARITY_32K , 0}, \ + {FAL_PART_MAGIC_WROD, "param", "onchip_flash_128k", 0 , FLASH_SIZE_GRANULARITY_128K, 0}, \ + {FAL_PART_MAGIC_WROD, "app", "onchip_flash_256k", 0 , FLASH_SIZE_GRANULARITY_256K, 0}, \ } #endif /* FAL_PART_HAS_TABLE_CFG */ diff --git a/bsp/stm32/stm32f767-fire-challenger/board/ports/fal_cfg.h b/bsp/stm32/stm32f767-fire-challenger/board/ports/fal_cfg.h index 10c05885da..891beb2010 100644 --- a/bsp/stm32/stm32f767-fire-challenger/board/ports/fal_cfg.h +++ b/bsp/stm32/stm32f767-fire-challenger/board/ports/fal_cfg.h @@ -15,8 +15,12 @@ #include #define FLASH_SIZE_GRANULARITY_32K (4 * 32 * 1024) -#define FLASH_SIZE_GRANULARITY_128K (FLASH_SIZE_GRANULARITY_32K + 128 * 1024) -#define FLASH_SIZE_GRANULARITY_256K (FLASH_SIZE_GRANULARITY_128K + 3 * 256 * 1024) +#define FLASH_SIZE_GRANULARITY_128K (128 * 1024) +#define FLASH_SIZE_GRANULARITY_256K (3 * 256 * 1024) + +#define STM32_FLASH_START_ADRESS_32K STM32_FLASH_START_ADRESS +#define STM32_FLASH_START_ADRESS_128K (STM32_FLASH_START_ADRESS_32K + FLASH_SIZE_GRANULARITY_32K) +#define STM32_FLASH_START_ADRESS_256K (STM32_FLASH_START_ADRESS_128K + FLASH_SIZE_GRANULARITY_128K) extern const struct fal_flash_dev stm32_onchip_flash_32k; extern const struct fal_flash_dev stm32_onchip_flash_128k; @@ -35,9 +39,9 @@ extern const struct fal_flash_dev stm32_onchip_flash_256k; /* partition table */ #define FAL_PART_TABLE \ { \ - {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_32k", 0 , FLASH_SIZE_GRANULARITY_32K , 0}, \ - {FAL_PART_MAGIC_WROD, "param", "onchip_flash_128k", FLASH_SIZE_GRANULARITY_32K , FLASH_SIZE_GRANULARITY_128K, 0}, \ - {FAL_PART_MAGIC_WROD, "app", "onchip_flash_256k", FLASH_SIZE_GRANULARITY_128K, FLASH_SIZE_GRANULARITY_256K, 0}, \ + {FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_32k", 0 , FLASH_SIZE_GRANULARITY_32K , 0}, \ + {FAL_PART_MAGIC_WROD, "param", "onchip_flash_128k", 0 , FLASH_SIZE_GRANULARITY_128K, 0}, \ + {FAL_PART_MAGIC_WROD, "app", "onchip_flash_256k", 0 , FLASH_SIZE_GRANULARITY_256K, 0}, \ } #endif /* FAL_PART_HAS_TABLE_CFG */