提交 c0855d13 编写于 作者: J jinsheng

增加 flash

上级 8e28732f
...@@ -52,6 +52,7 @@ static rt_uint32_t GetSector(rt_uint32_t Address) ...@@ -52,6 +52,7 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
{ {
sector = FLASH_SECTOR_1; sector = FLASH_SECTOR_1;
} }
#if (FLASH_SECTOR_TOTAL >= 4)
else if ((Address < ADDR_FLASH_SECTOR_3) && (Address >= ADDR_FLASH_SECTOR_2)) else if ((Address < ADDR_FLASH_SECTOR_3) && (Address >= ADDR_FLASH_SECTOR_2))
{ {
sector = FLASH_SECTOR_2; sector = FLASH_SECTOR_2;
...@@ -60,6 +61,7 @@ static rt_uint32_t GetSector(rt_uint32_t Address) ...@@ -60,6 +61,7 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
{ {
sector = FLASH_SECTOR_3; sector = FLASH_SECTOR_3;
} }
#elif (FLASH_SECTOR_TOTAL >= 8)
else if ((Address < ADDR_FLASH_SECTOR_5) && (Address >= ADDR_FLASH_SECTOR_4)) else if ((Address < ADDR_FLASH_SECTOR_5) && (Address >= ADDR_FLASH_SECTOR_4))
{ {
sector = FLASH_SECTOR_4; sector = FLASH_SECTOR_4;
...@@ -76,6 +78,7 @@ static rt_uint32_t GetSector(rt_uint32_t Address) ...@@ -76,6 +78,7 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
{ {
sector = FLASH_SECTOR_7; sector = FLASH_SECTOR_7;
} }
#elif (FLASH_SECTOR_TOTAL >= 24)
else if ((Address < ADDR_FLASH_SECTOR_9) && (Address >= ADDR_FLASH_SECTOR_8)) else if ((Address < ADDR_FLASH_SECTOR_9) && (Address >= ADDR_FLASH_SECTOR_8))
{ {
sector = FLASH_SECTOR_8; sector = FLASH_SECTOR_8;
...@@ -88,10 +91,18 @@ static rt_uint32_t GetSector(rt_uint32_t Address) ...@@ -88,10 +91,18 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
{ {
sector = FLASH_SECTOR_10; sector = FLASH_SECTOR_10;
} }
else /* (Address < FLASH_END_ADDR) && (Address >= ADDR_FLASH_SECTOR_11) */ #else
else
{ {
#if (FLASH_SECTOR_TOTAL == 4)
sector = FLASH_SECTOR_4;
#elif (FLASH_SECTOR_TOTAL == 8)
sector = FLASH_SECTOR_8;
#elif (FLASH_SECTOR_TOTAL == 24)
sector = FLASH_SECTOR_11; sector = FLASH_SECTOR_11;
#endif
} }
#endif
return sector; return sector;
} }
......
...@@ -320,6 +320,7 @@ CONFIG_BSP_USING_GPIO=y ...@@ -320,6 +320,7 @@ CONFIG_BSP_USING_GPIO=y
CONFIG_BSP_USING_UART=y CONFIG_BSP_USING_UART=y
CONFIG_BSP_USING_UART1=y CONFIG_BSP_USING_UART1=y
# CONFIG_BSP_UART1_RX_USING_DMA is not set # CONFIG_BSP_UART1_RX_USING_DMA is not set
# CONFIG_BSP_USING_ON_CHIP_FLASH is not set
# CONFIG_BSP_USING_QSPI is not set # CONFIG_BSP_USING_QSPI is not set
# CONFIG_BSP_USING_SDIO is not set # CONFIG_BSP_USING_SDIO is not set
......
...@@ -53,7 +53,7 @@ STM32F746-disco 是 ST 推出的一款基于 ARM Cortex-M7 内核的开发板, ...@@ -53,7 +53,7 @@ STM32F746-disco 是 ST 推出的一款基于 ARM Cortex-M7 内核的开发板,
| SPI | 暂不支持 | 即将支持 | | SPI | 暂不支持 | 即将支持 |
| QSPI | 支持 | QSPI1 | | QSPI | 支持 | QSPI1 |
| I2C | 暂不支持 | 即将支持 | | I2C | 暂不支持 | 即将支持 |
| FLASH | 暂不支持 | 即将支持 | | FLASH | 支持 | |
| WDT | 暂不支持 | 即将支持 | | WDT | 暂不支持 | 即将支持 |
| SDIO | 支持 | 支持 | | SDIO | 支持 | 支持 |
| USB Device | 暂不支持 | 即将支持 | | USB Device | 暂不支持 | 即将支持 |
......
...@@ -61,6 +61,9 @@ menu "On-chip Peripheral Drivers" ...@@ -61,6 +61,9 @@ menu "On-chip Peripheral Drivers"
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
default n default n
endif endif
config BSP_USING_ON_CHIP_FLASH
bool "Enable on-chip FLASH"
default n
config BSP_USING_QSPI config BSP_USING_QSPI
bool "Enable QSPI BUS" bool "Enable QSPI BUS"
select RT_USING_QSPI select RT_USING_QSPI
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册