[bsp/stm32f407-lckfb-skystar] 天空星高配版的FLASH从GD25Q32升级为W25Q128 (#9108)

* -更新芯片型号和板子型号

* -天空星目前只有青春版(没有贴外部flash),高配版(有贴外部flash)正在生产,所贴的SPI FLASH 从GD25Q32升级为W25Q128。
This commit is contained in:
yuanzihao
2024-06-27 23:04:35 +08:00
committed by GitHub
parent 6ea7466d89
commit 76e123d8ca
9 changed files with 1105 additions and 546 deletions
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -6,14 +6,14 @@ RTT_DIR := ../../..
PKGS_DIR := packages
config SOC_STM32F407ZG
config SOC_STM32F407VE
bool
select SOC_SERIES_STM32F4
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y
config BOARD_STM32F407_SPARK
config BOARD_STM32F407_LCKFB
bool
default y
@@ -3,7 +3,7 @@ menu "Hardware Drivers Config"
menu "Onboard Peripheral Drivers"
config BSP_USING_SPI_FLASH
bool "Enable SPI FLASH (GD25Q32 spi1)"
bool "Enable SPI FLASH (W25Q128 spi1)"
select BSP_USING_SPI
select BSP_USING_SPI1
select RT_USING_SFUD
@@ -29,7 +29,7 @@ menu "Onboard Peripheral Drivers"
endif
config BSP_USING_FLASH_FATFS
bool "Enable FAL filesystem partition base on GD25Q32"
bool "Enable FAL filesystem partition base on W25Q128"
select BSP_USING_FAL
default n
if BSP_USING_FLASH_FATFS
@@ -24,13 +24,13 @@
extern const struct fal_flash_dev stm32_onchip_flash_16k;
extern const struct fal_flash_dev stm32_onchip_flash_64k;
extern const struct fal_flash_dev stm32_onchip_flash_128k;
extern struct fal_flash_dev gd25q32;
extern struct fal_flash_dev w25q128;
/* flash device table */
#define FAL_FLASH_DEV_TABLE \
{ \
&stm32_onchip_flash_128k, \
&gd25q32, \
&w25q128, \
}
/* ====================== Partition Configuration ========================== */
@@ -39,9 +39,9 @@ extern struct fal_flash_dev gd25q32;
{ \
{FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 0, 384 * 1024, 0}, \
{FAL_PART_MAGIC_WROD, "param", "onchip_flash_128k", 384 * 1024, 512 * 1024, 0}, \
{FAL_PART_MAGIC_WROD, "easyflash", "GD25Q32", 0, 512 * 1024, 0}, \
{FAL_PART_MAGIC_WROD, "download", "GD25Q32", 512 * 1024, 512 * 1024, 0}, \
{FAL_PART_MAGIC_WROD, "filesystem", "GD25Q32", (512 + 512) * 1024, 3 * 1024 * 1024, 0}, \
{FAL_PART_MAGIC_WROD, "easyflash", "W25Q128", 0, 512 * 1024, 0}, \
{FAL_PART_MAGIC_WROD, "download", "W25Q128", 512 * 1024, 512 * 1024, 0}, \
{FAL_PART_MAGIC_WROD, "filesystem", "W25Q128", (512 + 512) * 1024, 15 * 1024 * 1024, 0}, \
}
#endif /*FAL_PART_TABLE*/
@@ -21,11 +21,11 @@ static int write(long offset, const uint8_t *buf, size_t size);
static int erase(long offset, size_t size);
static sfud_flash_t sfud_dev = NULL;
struct fal_flash_dev gd25q32 =
struct fal_flash_dev w25q128 =
{
.name = "GD25Q32",
.name = "W25Q128",
.addr = 0,
.len = 4 * 1024 * 1024,
.len = 16 * 1024 * 1024,
.blk_size = 4096,
.ops = {init, read, write, erase},
.write_gran = 1
@@ -33,15 +33,15 @@ struct fal_flash_dev gd25q32 =
static int init(void)
{
sfud_dev = rt_sfud_flash_find_by_dev_name("GD25Q32");
sfud_dev = rt_sfud_flash_find_by_dev_name("W25Q128");
if (RT_NULL == sfud_dev)
{
return -1;
}
/* update the flash chip information */
gd25q32.blk_size = sfud_dev->chip.erase_gran;
gd25q32.len = sfud_dev->chip.capacity;
w25q128.blk_size = sfud_dev->chip.erase_gran;
w25q128.len = sfud_dev->chip.capacity;
return 0;
}
@@ -50,7 +50,7 @@ static int read(long offset, uint8_t *buf, size_t size)
{
assert(sfud_dev);
assert(sfud_dev->init_ok);
sfud_read(sfud_dev, gd25q32.addr + offset, size, buf);
sfud_read(sfud_dev, w25q128.addr + offset, size, buf);
return size;
}
@@ -59,7 +59,7 @@ static int write(long offset, const uint8_t *buf, size_t size)
{
assert(sfud_dev);
assert(sfud_dev->init_ok);
if (sfud_write(sfud_dev, gd25q32.addr + offset, size, buf) != SFUD_SUCCESS)
if (sfud_write(sfud_dev, w25q128.addr + offset, size, buf) != SFUD_SUCCESS)
{
return -1;
}
@@ -71,7 +71,7 @@ static int erase(long offset, size_t size)
{
assert(sfud_dev);
assert(sfud_dev->init_ok);
if (sfud_erase(sfud_dev, gd25q32.addr + offset, size) != SFUD_SUCCESS)
if (sfud_erase(sfud_dev, w25q128.addr + offset, size) != SFUD_SUCCESS)
{
return -1;
}
@@ -21,7 +21,7 @@ static int rt_hw_spi_flash_init(void)
__HAL_RCC_GPIOB_CLK_ENABLE();
rt_hw_spi_device_attach("spi1", "spi10", GET_PIN(A, 4));
if (RT_NULL == rt_sfud_flash_probe("GD25Q32", "spi10"))
if (RT_NULL == rt_sfud_flash_probe("W25Q128", "spi10"))
{
return -RT_ERROR;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff