Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
5260e647
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
5260e647
编写于
3月 03, 2019
作者:
Comeon_fly
提交者:
GitHub
3月 03, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1 from RT-Thread/master
同步更新
上级
8eb7e02d
f44b8b7b
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
204 addition
and
6 deletion
+204
-6
bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f7.c
bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f7.c
+150
-4
bsp/stm32/stm32f746-st-disco/.config
bsp/stm32/stm32f746-st-disco/.config
+1
-0
bsp/stm32/stm32f746-st-disco/README.md
bsp/stm32/stm32f746-st-disco/README.md
+1
-1
bsp/stm32/stm32f746-st-disco/board/Kconfig
bsp/stm32/stm32f746-st-disco/board/Kconfig
+3
-0
bsp/stm32/stm32f746-st-disco/board/ports/fal_cfg.h
bsp/stm32/stm32f746-st-disco/board/ports/fal_cfg.h
+48
-0
include/libc/libc_errno.h
include/libc/libc_errno.h
+1
-1
未找到文件。
bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_f7.c
浏览文件 @
5260e647
...
...
@@ -6,6 +6,7 @@
* Change Logs:
* Date Author Notes
* 2018-12-5 SummerGift first version
* 2019-3-2 jinsheng add Macro judgment
*/
#include "board.h"
...
...
@@ -21,7 +22,32 @@
//#define DRV_DEBUG
#define LOG_TAG "drv.flash"
#include <drv_log.h>
#if defined (FLASH_OPTCR_nDBANK)
#define ADDR_FLASH_SECTOR_0 ((rt_uint32_t)0x08000000)
/* Base address of Sector 0, 16 Kbytes */
#define ADDR_FLASH_SECTOR_1 ((rt_uint32_t)0x08004000)
/* Base address of Sector 1, 16 Kbytes */
#define ADDR_FLASH_SECTOR_2 ((rt_uint32_t)0x08008000)
/* Base address of Sector 2, 16 Kbytes */
#define ADDR_FLASH_SECTOR_3 ((rt_uint32_t)0x0800C000)
/* Base address of Sector 3, 16 Kbytes */
#define ADDR_FLASH_SECTOR_4 ((rt_uint32_t)0x08010000)
/* Base address of Sector 4, 64 Kbytes */
#define ADDR_FLASH_SECTOR_5 ((rt_uint32_t)0x08020000)
/* Base address of Sector 5, 128 Kbytes */
#define ADDR_FLASH_SECTOR_6 ((rt_uint32_t)0x08040000)
/* Base address of Sector 6, 128 Kbytes */
#define ADDR_FLASH_SECTOR_7 ((rt_uint32_t)0x08060000)
/* Base address of Sector 7, 128 Kbytes */
#define ADDR_FLASH_SECTOR_8 ((rt_uint32_t)0x08080000)
/* Base address of Sector 8, 128 Kbytes */
#define ADDR_FLASH_SECTOR_9 ((rt_uint32_t)0x080A0000)
/* Base address of Sector 9, 128 Kbytes */
#define ADDR_FLASH_SECTOR_10 ((rt_uint32_t)0x080C0000)
/* Base address of Sector 10, 128 Kbytes */
#define ADDR_FLASH_SECTOR_11 ((rt_uint32_t)0x080E0000)
/* Base address of Sector 11, 128 Kbytes */
#define ADDR_FLASH_SECTOR_12 ((rt_uint32_t)0x08100000)
/* Base address of Sector 12, 16 Kbytes */
#define ADDR_FLASH_SECTOR_13 ((rt_uint32_t)0x08104000)
/* Base address of Sector 13, 16 Kbytes */
#define ADDR_FLASH_SECTOR_14 ((rt_uint32_t)0x08108000)
/* Base address of Sector 14, 16 Kbytes */
#define ADDR_FLASH_SECTOR_15 ((rt_uint32_t)0x0810C000)
/* Base address of Sector 15, 16 Kbytes */
#define ADDR_FLASH_SECTOR_16 ((rt_uint32_t)0x08110000)
/* Base address of Sector 16, 64 Kbytes */
#define ADDR_FLASH_SECTOR_17 ((rt_uint32_t)0x08120000)
/* Base address of Sector 17, 128 Kbytes */
#define ADDR_FLASH_SECTOR_18 ((rt_uint32_t)0x08140000)
/* Base address of Sector 18, 128 Kbytes */
#define ADDR_FLASH_SECTOR_19 ((rt_uint32_t)0x08160000)
/* Base address of Sector 19, 128 Kbytes */
#define ADDR_FLASH_SECTOR_20 ((rt_uint32_t)0x08180000)
/* Base address of Sector 20, 128 Kbytes */
#define ADDR_FLASH_SECTOR_21 ((rt_uint32_t)0x081A0000)
/* Base address of Sector 21, 128 Kbytes */
#define ADDR_FLASH_SECTOR_22 ((rt_uint32_t)0x081C0000)
/* Base address of Sector 22, 128 Kbytes */
#define ADDR_FLASH_SECTOR_23 ((rt_uint32_t)0x081E0000)
/* Base address of Sector 23, 128 Kbytes */
#else
#define ADDR_FLASH_SECTOR_0 ((rt_uint32_t)0x08000000)
/* Base address of Sector 0, 32 Kbytes */
#define ADDR_FLASH_SECTOR_1 ((rt_uint32_t)0x08008000)
/* Base address of Sector 1, 32 Kbytes */
#define ADDR_FLASH_SECTOR_2 ((rt_uint32_t)0x08010000)
/* Base address of Sector 2, 32 Kbytes */
...
...
@@ -34,7 +60,7 @@
#define ADDR_FLASH_SECTOR_9 ((rt_uint32_t)0x08140000)
/* Base address of Sector 9, 256 Kbytes */
#define ADDR_FLASH_SECTOR_10 ((rt_uint32_t)0x08180000)
/* Base address of Sector 10, 256 Kbytes */
#define ADDR_FLASH_SECTOR_11 ((rt_uint32_t)0x081C0000)
/* Base address of Sector 11, 256 Kbytes */
#endif
/**
* @brief Gets the sector of a given address
* @param None
...
...
@@ -43,7 +69,115 @@
static
rt_uint32_t
GetSector
(
rt_uint32_t
Address
)
{
rt_uint32_t
sector
=
0
;
#if defined (FLASH_OPTCR_nDBANK)
if
((
Address
<
ADDR_FLASH_SECTOR_1
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_0
))
{
sector
=
FLASH_SECTOR_0
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_2
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_1
))
{
sector
=
FLASH_SECTOR_1
;
}
#if (FLASH_SECTOR_TOTAL >= 4)
else
if
((
Address
<
ADDR_FLASH_SECTOR_3
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_2
))
{
sector
=
FLASH_SECTOR_2
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_4
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_3
))
{
sector
=
FLASH_SECTOR_3
;
}
#elif (FLASH_SECTOR_TOTAL >= 8)
else
if
((
Address
<
ADDR_FLASH_SECTOR_5
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_4
))
{
sector
=
FLASH_SECTOR_4
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_6
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_5
))
{
sector
=
FLASH_SECTOR_5
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_7
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_6
))
{
sector
=
FLASH_SECTOR_6
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_8
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_7
))
{
sector
=
FLASH_SECTOR_7
;
}
#elif (FLASH_SECTOR_TOTAL >= 24)
else
if
((
Address
<
ADDR_FLASH_SECTOR_9
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_8
))
{
sector
=
FLASH_SECTOR_8
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_10
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_9
))
{
sector
=
FLASH_SECTOR_9
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_11
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_10
))
{
sector
=
FLASH_SECTOR_10
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_12
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_11
))
{
sector
=
FLASH_SECTOR_11
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_13
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_12
))
{
sector
=
FLASH_SECTOR_12
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_14
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_13
))
{
sector
=
FLASH_SECTOR_13
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_15
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_14
))
{
sector
=
FLASH_SECTOR_14
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_16
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_15
))
{
sector
=
FLASH_SECTOR_15
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_17
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_16
))
{
sector
=
FLASH_SECTOR_16
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_18
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_17
))
{
sector
=
FLASH_SECTOR_17
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_19
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_18
))
{
sector
=
FLASH_SECTOR_18
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_20
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_19
))
{
sector
=
FLASH_SECTOR_19
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_21
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_20
))
{
sector
=
FLASH_SECTOR_20
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_22
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_21
))
{
sector
=
FLASH_SECTOR_21
;
}
else
if
((
Address
<
ADDR_FLASH_SECTOR_23
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_22
))
{
sector
=
FLASH_SECTOR_22
;
}
#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_23
;
#endif
}
#endif
#else
if
((
Address
<
ADDR_FLASH_SECTOR_1
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_0
))
{
sector
=
FLASH_SECTOR_0
;
...
...
@@ -52,6 +186,7 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
{
sector
=
FLASH_SECTOR_1
;
}
#if (FLASH_SECTOR_TOTAL >= 4)
else
if
((
Address
<
ADDR_FLASH_SECTOR_3
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_2
))
{
sector
=
FLASH_SECTOR_2
;
...
...
@@ -60,6 +195,7 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
{
sector
=
FLASH_SECTOR_3
;
}
#elif (FLASH_SECTOR_TOTAL >= 8)
else
if
((
Address
<
ADDR_FLASH_SECTOR_5
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_4
))
{
sector
=
FLASH_SECTOR_4
;
...
...
@@ -76,6 +212,7 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
{
sector
=
FLASH_SECTOR_7
;
}
#elif (FLASH_SECTOR_TOTAL >= 24)
else
if
((
Address
<
ADDR_FLASH_SECTOR_9
)
&&
(
Address
>=
ADDR_FLASH_SECTOR_8
))
{
sector
=
FLASH_SECTOR_8
;
...
...
@@ -88,10 +225,19 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
{
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
;
#endif
}
#endif
#endif
return
sector
;
}
...
...
bsp/stm32/stm32f746-st-disco/.config
浏览文件 @
5260e647
...
...
@@ -320,6 +320,7 @@ CONFIG_BSP_USING_GPIO=y
CONFIG_BSP_USING_UART
=
y
CONFIG_BSP_USING_UART1
=
y
# 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_SDIO is not set
...
...
bsp/stm32/stm32f746-st-disco/README.md
浏览文件 @
5260e647
...
...
@@ -53,7 +53,7 @@ STM32F746-disco 是 ST 推出的一款基于 ARM Cortex-M7 内核的开发板,
| SPI | 暂不支持 | 即将支持 |
| QSPI | 支持 | QSPI1 |
| I2C | 暂不支持 | 即将支持 |
| FLASH |
暂不支持 | 即将支持
|
| FLASH |
支持 |
|
| WDT | 暂不支持 | 即将支持 |
| SDIO | 支持 | 支持 |
| USB Device | 暂不支持 | 即将支持 |
...
...
bsp/stm32/stm32f746-st-disco/board/Kconfig
浏览文件 @
5260e647
...
...
@@ -61,6 +61,9 @@ menu "On-chip Peripheral Drivers"
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
default n
endif
config BSP_USING_ON_CHIP_FLASH
bool "Enable on-chip FLASH"
default n
config BSP_USING_QSPI
bool "Enable QSPI BUS"
select RT_USING_QSPI
...
...
bsp/stm32/stm32f746-st-disco/board/ports/fal_cfg.h
0 → 100644
浏览文件 @
5260e647
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-03-02 jinsheng first version
*/
#ifndef _FAL_CFG_H_
#define _FAL_CFG_H_
#include <rtthread.h>
#include <board.h>
#define FLASH_SIZE_GRANULARITY_32K (4 * 32 * 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
;
extern
const
struct
fal_flash_dev
stm32_onchip_flash_256k
;
/* flash device table */
#define FAL_FLASH_DEV_TABLE \
{ \
&stm32_onchip_flash_32k, \
&stm32_onchip_flash_128k, \
&stm32_onchip_flash_256k, \
}
/* ====================== Partition Configuration ========================== */
#ifdef FAL_PART_HAS_TABLE_CFG
/* 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", 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 */
#endif
/* _FAL_CFG_H_ */
include/libc/libc_errno.h
浏览文件 @
5260e647
...
...
@@ -161,7 +161,7 @@ defined in armcc/errno.h
#define EPROTONOSUPPORT (ERROR_BASE_NO + 93)
#define ESOCKTNOSUPPORT (ERROR_BASE_NO + 94)
#define EOPNOTSUPP (ERROR_BASE_NO + 95)
#define ENOTSUP EOPNOTSUPP
)
#define ENOTSUP EOPNOTSUPP
#define EPFNOSUPPORT (ERROR_BASE_NO + 96)
#define EAFNOSUPPORT (ERROR_BASE_NO + 97)
#define EADDRINUSE (ERROR_BASE_NO + 98)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录