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 7664e7a4b4540b2ad07c835f93f7c30a4b414cc7..0bafd5b779a27c4e99cbff67132e98ad429e7b4b 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 d71013d3ea2994f11a82b5bf6ce90945c5dcaec7..d92e11b583685f8b4d65c4b2cebcac3f50541bd6 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/stm32f103-atk-nano/board/Kconfig b/bsp/stm32/stm32f103-atk-nano/board/Kconfig index e7873048cf0f4a10b4451e6dc54af05d283a03cd..010389a3bbe4480b9df28e7429b474b9468e9830 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 983ce4bb861e8b33f1e24f6098ff8f6817f96b31..419bb3564c401de18e7b1b99971704336a3aac31 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 66d7cf8d0fc780669c015ebfe2861158c0aeeca8..5da6237062599a9c8c5c8ef3ed153af070a013d4 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/stm32f407-atk-explorer/board/ports/fal_cfg.h b/bsp/stm32/stm32f407-atk-explorer/board/ports/fal_cfg.h index 6ed136aad259a541956bc1cde6661d700793b796..a587e207ceae989a714172b0ee92ab159e70fdd6 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/Kconfig b/bsp/stm32/stm32f429-armfly-v6/board/Kconfig index e169c1a8ace387acf722b32724e271a7661feb12..4ecba0d5a345e1c0913aca5bf626397d7a0d2019 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-armfly-v6/board/ports/fal_cfg.h b/bsp/stm32/stm32f429-armfly-v6/board/ports/fal_cfg.h index df06c652270dc3d34972959c6c515a57665413c4..a587e207ceae989a714172b0ee92ab159e70fdd6 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/Kconfig b/bsp/stm32/stm32f429-atk-apollo/board/Kconfig index a38ce45a8bd1ea4dbcdb863405f6286b84aa9b47..e43d9db64fba743ab6d71a5c7b83235904388846 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-atk-apollo/board/ports/fal_cfg.h b/bsp/stm32/stm32f429-atk-apollo/board/ports/fal_cfg.h index df06c652270dc3d34972959c6c515a57665413c4..a587e207ceae989a714172b0ee92ab159e70fdd6 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/Kconfig b/bsp/stm32/stm32f429-fire-challenger/board/Kconfig index 4e8b545302443f27c734e8e349c1715e8413fd03..f0514211da6310e061af9d5d41017746c219ea48 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/stm32f429-fire-challenger/board/ports/fal_cfg.h b/bsp/stm32/stm32f429-fire-challenger/board/ports/fal_cfg.h index 5f27860dacbb920ca960c16028686e0afe51940c..a587e207ceae989a714172b0ee92ab159e70fdd6 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/Kconfig b/bsp/stm32/stm32f767-atk-apollo/board/Kconfig index 7d1273b33f68f8f76b173d5198813eda99b732e1..676fb439daa2873e9d7b536b152112cba7000546 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 0345cfc9fba57f7d928a363e11a6fc303964f294..36ecb754e9939962f4d01c6ecaf33f9671eb110d 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-atk-apollo/board/ports/fal_cfg.h b/bsp/stm32/stm32f767-atk-apollo/board/ports/fal_cfg.h index 10c05885da602c32b02335537e1b5d332bef6779..891beb2010a87cb4cc041bd999e6efc7d67513b5 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/drv_qspi_flash.c b/bsp/stm32/stm32f767-fire-challenger/board/ports/drv_qspi_flash.c index 0345cfc9fba57f7d928a363e11a6fc303964f294..36ecb754e9939962f4d01c6ecaf33f9671eb110d 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/stm32f767-fire-challenger/board/ports/fal_cfg.h b/bsp/stm32/stm32f767-fire-challenger/board/ports/fal_cfg.h index 10c05885da602c32b02335537e1b5d332bef6779..891beb2010a87cb4cc041bd999e6efc7d67513b5 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 */ diff --git a/bsp/stm32/stm32l475-atk-pandora/board/Kconfig b/bsp/stm32/stm32l475-atk-pandora/board/Kconfig index afe8fe2f5ebb934d484045394c1406dd0390a45c..28b7b0dde11ba5c4fc367c016afa735c35da16ba 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 0345cfc9fba57f7d928a363e11a6fc303964f294..36ecb754e9939962f4d01c6ecaf33f9671eb110d 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; }