diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index f794919d2f0d9aaf70ac8c88ef3d798ede5a2850..3f592fd17d6c9ad6add425cd48b592c57770bfa3 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -1,3 +1,49 @@ +# Phytium Standalone SDK 2023-09-26 ChangeLog + +Change Log since 2023-09-21 + +## example + +- fix i2c bug + +## drivers + +- remove define of D2000、FT2004 + +# Phytium FreeRTOS SDK 2023-09-21 ChangeLog + +Change Log sinc 2023-09-20 + +# example + +- modify readme + +# Phytium FreeRTOS SDK 2023-09-20 ChangeLog + +Change Log sinc 2023-09-18 + +# example + +- modify readme + +# Phytium FreeRTOS SDK 2023-09-18 ChangeLog + +Change Log sinc 2023-09-18 + +# example + +- update Readme.md of something example including:lwip_startup,udp_multicast and timer_tacho. +- delete redundant statements in makefile of timer_tacho. + +# Phytium FreeRTOS SDK 2023-09-18 ChangeLog + +Change Log sinc 2023-09-15 + +# example + +- add PHYTIUMPI readme of ddma, gdma, gpio, sdio, openamp, excepyion_debug, nested_interrupt examples + + # Phytium FreeRTOS SDK 2023-09-15 ChangeLog Change Log sinc 2023-09-15 diff --git a/drivers/i2c/fi2c_os.c b/drivers/i2c/fi2c_os.c index 5605d3cbb0b6a4b8f61a99fd3484c1dedde88000..35fe9c144b22096fcfb8da68b316fc3c97f9eaac 100644 --- a/drivers/i2c/fi2c_os.c +++ b/drivers/i2c/fi2c_os.c @@ -35,20 +35,13 @@ #include "fdebug.h" #include "fio_mux.h" -#if defined(CONFIG_TARGET_E2000D) || defined(CONFIG_TARGET_E2000Q)|| defined(CONFIG_TARGET_PHYTIUMPI) - #include "fmio_hw.h" - #include "fmio.h" -#endif +#include "fmio_hw.h" +#include "fmio.h" -#if defined(CONFIG_TARGET_E2000D) || defined(CONFIG_TARGET_E2000Q) || defined(CONFIG_TARGET_PHYTIUMPI) static FMioCtrl i2c_master; static FMioCtrl i2c_slave; static FFreeRTOSI2c os_i2c[FMIO_NUM] = {0}; -#endif -#if defined(CONFIG_TARGET_D2000) || defined(CONFIG_TARGET_FT2004) -static FFreeRTOSI2c os_i2c[FI2C_NUM] = {0}; -#endif /* virtual eeprom memory */ /** @@ -98,7 +91,6 @@ FFreeRTOSI2c *FFreeRTOSI2cInit(u32 instance_id, u32 work_mode, u32 slave_address FI2cConfig i2c_config; /* E2000 use MIO -> I2C */ -#if defined(CONFIG_TARGET_E2000D) || defined(CONFIG_TARGET_E2000Q) || defined(CONFIG_TARGET_PHYTIUMPI) FASSERT(instance_id < FMIO_NUM); if (FT_COMPONENT_IS_READY == os_i2c[instance_id].i2c_device.is_ready) @@ -157,32 +149,7 @@ FFreeRTOSI2c *FFreeRTOSI2cInit(u32 instance_id, u32 work_mode, u32 slave_address i2c_config.irq_prority = I2C_SLAVE_IRQ_PRORITY; } FIOPadSetMioMux(i2c_config.instance_id); -#endif -#if defined(CONFIG_TARGET_D2000) - FASSERT(instance_id < FI2C_NUM); - if (FT_COMPONENT_IS_READY == os_i2c[instance_id].i2c_device.is_ready) - { - vPrintf("I2c device %d is already initialized.\r\n", instance_id); - return NULL; - } - - i2c_config = *FI2cLookupConfig(instance_id); - if (work_mode == FI2C_MASTER) /* 主机中断优先级低于从机接收 */ - { - i2c_config.irq_prority = I2C_MASTER_IRQ_PRORITY; - } - else - { - i2c_config.irq_prority = I2C_SLAVE_IRQ_PRORITY; - } - /* Modify configuration */ - i2c_config.work_mode = work_mode; - i2c_config.slave_addr = slave_address; - i2c_config.speed_rate = speed_rate; - /* Setup iomux */ - -#endif err = FI2cCfgInitialize(&os_i2c[instance_id].i2c_device, &i2c_config); if (err != FREERTOS_I2C_SUCCESS) { @@ -207,10 +174,8 @@ void FFreeRTOSI2cDeinit(FFreeRTOSI2c *os_i2c_p) { FASSERT(os_i2c_p); FASSERT(os_i2c_p->wr_semaphore != NULL); -#if defined(CONFIG_TARGET_E2000D) || defined(CONFIG_TARGET_E2000Q) FMioCtrl *pctrl = &i2c_master; FMioFuncDeinit(pctrl); -#endif /* 避免没有关闭中断,存在触发 */ InterruptMask(os_i2c_p->i2c_device.config.irq_num); FI2cDeInitialize(&os_i2c_p->i2c_device); diff --git a/example/freertos_feature/eventgroup/README.md b/example/freertos_feature/eventgroup/README.md index 1ee292c83985de5f91eb93b24cfd374eeb983086..42828e8572ed9ac96dd20ec0e85ecd37d709801b 100644 --- a/example/freertos_feature/eventgroup/README.md +++ b/example/freertos_feature/eventgroup/README.md @@ -58,6 +58,22 @@ [参考 freertos 使用说明](../../../docs/reference/usr/usage.md) +#### 2.3.1 下载过程 + +- host侧设置重启host侧tftp服务器 +``` +sudo service tftpd-hpa restart +``` + +- 开发板侧使用bootelf命令跳转 +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 0x90100000 freertos.elf +bootelf -p 0x90100000 +``` + ### 2.4 输出与实验现象 - 系统进入后,输入```event```查看指令说明 diff --git a/example/freertos_feature/interrupt/README.md b/example/freertos_feature/interrupt/README.md index 638c88f1f8abe8fdff12e2c8b45a3db369080ca4..9244d8b18d615bd00559148f567e36a579728bac 100644 --- a/example/freertos_feature/interrupt/README.md +++ b/example/freertos_feature/interrupt/README.md @@ -2,13 +2,13 @@ ## 1. 例程介绍 -本例程示范了freertos环境下的inteerrupt的使用。 +本例程示范了freertos环境下的interrupt的使用。 主要介绍了二值信号量、计数信号量、在中断中使用队列等方法 ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(FT2000-4/D2000/E2000D/E2000Q/E2000Q) +- Phytium开发板(FT2000-4/D2000/E2000D/E2000Q/E2000Q/PhytiumPi) - [Phytium freeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk) - [Phytium standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) ### 2.1 硬件配置方法 @@ -58,6 +58,22 @@ [参考 freertos 使用说明](../../../docs/reference/usr/usage.md) +#### 2.3.1 下载过程 + +- host侧设置重启host侧tftp服务器 +``` +sudo service tftpd-hpa restart +``` + +- 开发板侧使用bootelf命令跳转 +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 0x90100000 freertos.elf +bootelf -p 0x90100000 +``` + ### 2.4 输出与实验现象 - 系统进入后,输入```intr```查看指令说明 diff --git a/example/freertos_feature/queue/README.md b/example/freertos_feature/queue/README.md index c461b0a08a6b1c83601995383278dffc6f9da6d2..43f4457fd505e2a69a330a2fe594492209f0db80 100644 --- a/example/freertos_feature/queue/README.md +++ b/example/freertos_feature/queue/README.md @@ -58,6 +58,22 @@ [参考 freertos 使用说明](../../../docs/reference/usr/usage.md) +#### 2.3.1 下载过程 + +- host侧设置重启host侧tftp服务器 +``` +sudo service tftpd-hpa restart +``` + +- 开发板侧使用bootelf命令跳转 +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 0x90100000 freertos.elf +bootelf -p 0x90100000 +``` + ### 2.4 输出与实验现象 - 系统进入后,输入```queue```查看指令说明 diff --git a/example/freertos_feature/resource/README.md b/example/freertos_feature/resource/README.md index 38ee6941eb669054c776244c14d15b6352478744..25757181b25aec2084fc550e61770fb89c135df5 100644 --- a/example/freertos_feature/resource/README.md +++ b/example/freertos_feature/resource/README.md @@ -59,6 +59,22 @@ [参考 freertos 使用说明](../../../docs/reference/usr/usage.md) +#### 2.3.1 下载过程 + +- host侧设置重启host侧tftp服务器 +``` +sudo service tftpd-hpa restart +``` + +- 开发板侧使用bootelf命令跳转 +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 0x90100000 freertos.elf +bootelf -p 0x90100000 +``` + ### 2.4 输出与实验现象 - 系统进入后,输入```resource```查看指令说明 diff --git a/example/freertos_feature/software_timer/README.md b/example/freertos_feature/software_timer/README.md index 66e6fd691d2bcb09c774790ad311a0d4f9a32abe..294f648c0cb990d3f0d1a182feedf1077b4021b8 100644 --- a/example/freertos_feature/software_timer/README.md +++ b/example/freertos_feature/software_timer/README.md @@ -61,6 +61,22 @@ FreeRTOS 提供的软件定时器支持单次模式和周期模式; [参考 freertos 使用说明](../../../docs/reference/usr/usage.md) +#### 2.3.1 下载过程 + +- host侧设置重启host侧tftp服务器 +``` +sudo service tftpd-hpa restart +``` + +- 开发板侧使用bootelf命令跳转 +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 0x90100000 freertos.elf +bootelf -p 0x90100000 +``` + ### 2.4 输出与实验现象 - 系统进入后,输入```timer```查看指令说明 diff --git a/example/freertos_feature/task/README.md b/example/freertos_feature/task/README.md index 097cf08e8a44b185f603b345c2e155dd1e4cacb0..35384653687b9e869421b61bc25f9fcd2561c141 100644 --- a/example/freertos_feature/task/README.md +++ b/example/freertos_feature/task/README.md @@ -58,6 +58,22 @@ [参考 freertos 使用说明](../../../docs/reference/usr/usage.md) +#### 2.3.1 下载过程 + +- host侧设置重启host侧tftp服务器 +``` +sudo service tftpd-hpa restart +``` + +- 开发板侧使用bootelf命令跳转 +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 0x90100000 freertos.elf +bootelf -p 0x90100000 +``` + ### 2.4 输出与实验现象 - 系统进入后,输入```task```查看指令说明 diff --git a/example/freertos_feature/task_notify/README.md b/example/freertos_feature/task_notify/README.md index 5003ae48465326c2aaf81e5c8193b81b5f02952c..cb223a7031c44bea41e36d4b071aadbb4a1b119d 100644 --- a/example/freertos_feature/task_notify/README.md +++ b/example/freertos_feature/task_notify/README.md @@ -62,6 +62,22 @@ FreeRTOS 从 V8.2.0 版本开始提供任务通知这个功能,每个任务都 [参考 freertos 使用说明](../../../docs/reference/usr/usage.md) +#### 2.3.1 下载过程 + +- host侧设置重启host侧tftp服务器 +``` +sudo service tftpd-hpa restart +``` + +- 开发板侧使用bootelf命令跳转 +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 0x90100000 freertos.elf +bootelf -p 0x90100000 +``` + ### 2.4 输出与实验现象 - 系统进入后,输入```notify```查看指令说明 diff --git a/example/network/lwip_startup/README.md b/example/network/lwip_startup/README.md index 0e6ee3722b1a13df1be4a813d1318f8f5d77c749..d29d222185bef45d77e84c1ca3c1a29d0cc8043a 100644 --- a/example/network/lwip_startup/README.md +++ b/example/network/lwip_startup/README.md @@ -26,6 +26,7 @@ - CONFIG_TARGET_E2000Q - CONFIG_TARGET_FT2004 - CONFIG_TARGET_D2000 +- CONFIG_TARGET_PHYTIUMPI ### 2.2 SDK配置方法 @@ -39,13 +40,13 @@ - CONFIG_USE_LETTER_SHELL 本例子已经提供好具体的编译指令,以下进行介绍: - 1. make 将目录下的工程进行编译 - 2. make clean 将目录下的工程进行清理 - 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - 4. make list_kconfig 当前工程支持哪些配置文件 - 5. make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 - 6. make menuconfig 配置目录下的参数变量 - 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 +- make 将目录下的工程进行编译 +- make clean 将目录下的工程进行清理 +- make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 +- make list_kconfig 当前工程支持哪些配置文件 +- make load_kconfig LOAD_CONFIG_NAME=< kconfig-nfiguration files > 将预设配置加载至工程中 +- make menuconfig 配置目录下的参数变量 +- make backup_kconfig 将目录下的sdkconfig 备份到./configs下 具体使用方法为: - 在当前目录下 @@ -122,7 +123,7 @@ lwip probe 0 0 1 0 192.168.4.10 192.168.4.1 255.255.255.0 命令定义为: ``` -lwip probe +lwip probe ``` - driver id 为驱动类型 , 0为xmac ,1为gmac - device id 为mac控制器 diff --git a/example/network/lwip_startup/pic/network_demo_config.png b/example/network/lwip_startup/pic/network_demo_config.png index 3d0898f038d215446cb9c262f13e711f652908f4..a2c546c6297e7fbff044f1eaceb5491dbb81584c 100644 Binary files a/example/network/lwip_startup/pic/network_demo_config.png and b/example/network/lwip_startup/pic/network_demo_config.png differ diff --git a/example/network/sockets/udp_multicast/README.md b/example/network/sockets/udp_multicast/README.md index a6dcb20bfcd097e5e50ffbe32c893f3c507ae6a3..27ffe83010cd1a735746cc396eb2628a974fd358 100644 --- a/example/network/sockets/udp_multicast/README.md +++ b/example/network/sockets/udp_multicast/README.md @@ -16,6 +16,7 @@ 本例程支持的硬件平台包括 - E2000D/E2000Q +- FT2004 - D2000 - PhytiumPi @@ -23,7 +24,9 @@ - CONFIG_TARGET_E2000D - CONFIG_TARGET_E2000Q +- CONFIG_TARGET_FT2004 - CONFIG_TARGET_D2000 +- CONFIG_TARGET_PHYTIUMPI ### 2.2 SDK配置方法 @@ -42,7 +45,7 @@ - make clean 将目录下的工程进行清理 - make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - make list_kconfig 当前工程支持哪些配置文件 -- make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 +- make load_kconfig LOAD_CONFIG_NAME=< kconfig configuration files > 将预设配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 @@ -100,36 +103,8 @@ bootelf -p 0x90100000 ### 2.4 输出与实验现象 -- 启动进入后,根据连接的xmac口,输入指令完成网口初始化 - -### 2.4.1 如何进行实验 - -- 当开发者配置好程序之后,通过2.3.1/2.3.2的方式将编译好的镜像文件拷贝至开发板中。 -- 以E2000D/Q demo 板为例,开发者输入以下命令则可以初始化网卡: - -``` -lwip probe 0 0 1 0 192.168.4.10 192.168.4.1 255.255.255.0 -``` - -命令定义为: -``` -lwip probe -``` -- driver id 为驱动类型 , 0为xmac ,1为gmac -- device id 为mac控制器 -- interface id 为gmii 控制器类型,0 is rgmii ,1 is sgmii -- dhcp_en 1为使能dhcp 功能,0为关闭dhcp 功能 -- ipaddr 为ipv4 地址,示例为: 192.168.4.10 -- gateway 为网关 ,示例为: 192.168.4. -- netmask 为子网掩码,示例为255.255.255.0 - -- 效果图如下 - -![](./pic/lwip_probe.png) - - - -#### 2.4.2 基于IPv4下初始化 +#### 2.4.1 如何配置程序 +##### 基于IPv4下初始化 - 输入以下命令 @@ -143,7 +118,7 @@ make menuconfig -#### 2.4.3 IPv4$IPv6 共存的模式 +##### IPv4 && IPv6 共存的模式 - 输入以下命令 @@ -161,12 +136,44 @@ make menuconfig ![](./pic/DisableNotusingIPV4attheaSametime.png) -#### 2.4.4 进行multicast 测试 -- 完成2.4.1 / 2.4.2 /2.4.3 之后 ,可以进行multcast 的相关实验 ,以下以ipv6 的实验为例 +#### 2.4.2 如何进行实验 + +- 当开发者配置好程序之后,通过2.3.1/2.3.2的方式将编译好的镜像文件拷贝至开发板中。 +- 启动进入后,根据连接的xmac口,输入指令完成网口初始化 +- 以E2000D/Q demo 板为例,开发者输入以下命令则可以初始化网卡: + +``` +lwip probe 0 0 1 0 192.168.4.10 192.168.4.1 255.255.255.0 +``` + +命令定义为: +``` +lwip probe +``` +- driver id 为驱动类型 , 0为xmac ,1为gmac +- device id 为mac控制器 +- interface id 为gmii 控制器类型,0 is rgmii ,1 is sgmii +- dhcp_en 1为使能dhcp 功能,0为关闭dhcp 功能 +- ipaddr 为ipv4 地址,示例为: 192.168.4.10 +- gateway 为网关 ,示例为: 192.168.4. +- netmask 为子网掩码,示例为255.255.255.0 + +- 效果图如下 + +![](./pic/lwip_probe.png) + + + + + + +#### 2.4.3 进行multicast 测试 + +- 完成2.4.1 / 2.4.2 之后 ,可以进行multcast 的相关实验 ,以下以ipv6 的实验为例 - 在串口终端上输入以下指令 ``` -multicast +multicast e0 ``` - 在编译器环境下执行 ``` diff --git "a/example/network/sockets/udp_multicast/pic/\344\270\262\345\217\243\347\273\210\347\253\257\346\211\223\345\215\260.png" "b/example/network/sockets/udp_multicast/pic/\344\270\262\345\217\243\347\273\210\347\253\257\346\211\223\345\215\260.png" index 946b6c80ab4d3d4283493ac7a8c5b4d5d223c00f..5075cc657c43cafeb0a2ff6e36355bc228482337 100644 Binary files "a/example/network/sockets/udp_multicast/pic/\344\270\262\345\217\243\347\273\210\347\253\257\346\211\223\345\215\260.png" and "b/example/network/sockets/udp_multicast/pic/\344\270\262\345\217\243\347\273\210\347\253\257\346\211\223\345\215\260.png" differ diff --git "a/example/network/sockets/udp_multicast/pic/\346\265\213\350\257\225\347\273\210\347\253\257\346\211\223\345\215\260.png" "b/example/network/sockets/udp_multicast/pic/\346\265\213\350\257\225\347\273\210\347\253\257\346\211\223\345\215\260.png" index 1a3ca3db2c4c81ecaeab4ddda2251fa7cd23a47b..7a435c296cc32f0967d3cb36124f92a22648acd6 100644 Binary files "a/example/network/sockets/udp_multicast/pic/\346\265\213\350\257\225\347\273\210\347\253\257\346\211\223\345\215\260.png" and "b/example/network/sockets/udp_multicast/pic/\346\265\213\350\257\225\347\273\210\347\253\257\346\211\223\345\215\260.png" differ diff --git a/example/peripheral/dma/ddma/README.md b/example/peripheral/dma/ddma/README.md index c6f56a38de98cfba505836c6af654c1d6114e8fb..860c206e837a6e57202fdac8d537d2c440b49bd2 100644 --- a/example/peripheral/dma/ddma/README.md +++ b/example/peripheral/dma/ddma/README.md @@ -13,23 +13,25 @@ DDMA (Device Direct Memory Access) 用于配合外设,将数据从一个内存 - [Phytium FreeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk) - [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) -- 本例程在 E2000 D Demo 板上完成测试,测试使用 SPI-2,测试前需要按照下图短接 SPI-2 的 RX 脚和 TX 脚 -> RX 脚是 CPU_IO (J30) 的 5 脚和 9 脚 +本例程在 E2000 Demo 板 与飞腾派上完成测试,默认的内部回环模式下,无需额外接线 -![](./figs/board.jpg) +如需要测试非内部回环模式,例如测试 E2000 D Demo 板的 SPI-2 ,测试前需要按照下图短接 SPI-2 的 RX 脚和 TX 脚,并合理修改代码 +> RX 脚是 CPU_IO (J30) 的 5 脚和 9 脚 ![](./figs/spi2_pin.jpg) - ### 2.1 硬件配置方法 本例程支持的硬件平台包括 -- E2000 +- E2000D +- E2000Q +- PHYTIUMPI 对应的配置项是, - CONFIG_TARGET_E2000D - +- CONFIG_TARGET_E2000Q +- CONFIG_TARGET_PHYTIUMPI ### 2.2 SDK配置方法 diff --git a/example/peripheral/dma/gdma/README.md b/example/peripheral/dma/gdma/README.md index 698c6989c66d480fa68844147abe03b61cba9d59..e15fb48c0824a241f4d02a2e0871113667a4e2a6 100644 --- a/example/peripheral/dma/gdma/README.md +++ b/example/peripheral/dma/gdma/README.md @@ -21,11 +21,15 @@ GDMA (Generic Direct Memory Access) 用于将数据从一个内存地址复制 本例程支持的硬件平台包括 -- E2000 +- E2000D +- E2000Q +- PHYTIUMPI 对应的配置项是, - CONFIG_TARGET_E2000D +- CONFIG_TARGET_E2000Q +- CONFIG_TARGET_PHYTIUMPI ### 2.2 SDK配置方法 diff --git a/example/peripheral/gpio/README.md b/example/peripheral/gpio/README.md index c76422354c03d2dd14f2eef3270a00ef51db9576..182c5c652a4cc0b9b1f7588198528dd53abbd1ad 100644 --- a/example/peripheral/gpio/README.md +++ b/example/peripheral/gpio/README.md @@ -14,24 +14,22 @@ GPIO (General-purpose input/output),即通用型输入输出,其引脚可以 - [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) ### 2.1 硬件配置方法 - -本例程需要用到 -- E2000 Q Demo 板 +- E2000 D/Q Demo 板 或 飞腾派 - 杜邦线 -![](./figs/board.jpg) - - +#### 2.1.1 对于E2000 D/Q Demo 板 - 在本例程中连接 GPIO-4-A-11 和 GPIO-4-A-12,分别配置为输入引脚和输出引脚,参考 E2000 Q 数据手册可知,引脚的复用功能6为 GPIO,因此例程中会修改引脚复用, - GPIO-4-A-11 和 GPIO-4-A-12 的引脚为外侧排第 4 和第 5 引脚,具体情况可以参考 E2000 Q Demo板原理图 - ![](./figs/pin_connect_gpio4.jpg) -- 也可以使用 GPIO-3-A-4 和 GPIO-3-A-5 进行测试 - +- 也可以使用 GPIO-3-A-4 和 GPIO-3-A-5 进行测试 ![](./figs/pin_connect_gpio3.jpg) +#### 2.1.2 对于飞腾派 +- 需要用杜邦线短接GPIO3_1与GPIO3_2,分别对应飞腾派上的J1组引脚的第11号与第16号引脚 +![](./figs/firefly_gpio_board.png) + ### 2.2 SDK配置方法 本例程需要, diff --git a/example/peripheral/gpio/figs/firefly_gpio_board.png b/example/peripheral/gpio/figs/firefly_gpio_board.png new file mode 100644 index 0000000000000000000000000000000000000000..d2f196d0600dfa86bd0019257668dbdb0d9bac8f Binary files /dev/null and b/example/peripheral/gpio/figs/firefly_gpio_board.png differ diff --git a/example/peripheral/i2c/README.md b/example/peripheral/i2c/README.md index a422bd7cd554c58362e1ec4d90b16f63e32ff861..36eeec30ecc3b3db2d2baef7cca601d1c179dcb0 100644 --- a/example/peripheral/i2c/README.md +++ b/example/peripheral/i2c/README.md @@ -3,32 +3,37 @@ ## 1. 例程介绍 本例程示范了freertos环境下的i2c的读写使用,包括i2c的初始化、写、读和去初始化操作; -程序启动后,创建i2c的初始化、写任务和读任务; +(支持E2000DQ demo开发板)实现了读取RTC的例程。 (支持firefly开发板)本例程实现了I2C主从(Master-Slave)通信,主机侧是开发板的MIO1,负责发起I2C数据读写,此例程中我们master端仅采用poll模式去读写操作,从机侧是开发板的MIO2模拟eeprom,负责响应I2C数据读写,采用中断响应方式,从机侧实现了一个虚拟的EEPROM缓冲区,模拟主机侧写入和读取数据的过程。 ## 2. 如何使用例程 本例程需要用到 + - Phytium开发板(E2000DQ/phytiumpi) - [Phytium freeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk) - [Phytium standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) + ### 2.1 硬件配置方法 本例程支持的硬件平台包括 + - E2000DQ demo、phytiumpi开发板 对应的配置项是 + - CONFIG_TARGET_E2000D、 CONFIG_TARGET_E2000Q - CONFIG_TARGET_PHYTIUMPI + ### 2.1.1 硬件连线 - E2000 ![hardware_e2000](./figs/E2000_1339.png) --phytiumpi +- phytiumpi -![phytiumpi](figs/hw_i2c_pi.jpg) +![phytiumpi](./figs/hw_i2c_pi.png) ### 2.2 SDK配置方法 @@ -42,7 +47,7 @@ - CONFIG_USE_LETTER_SHELL - CONFIG_FREERTOS_USE_I2C -如果是E2000系列 + 如果是E2000系列 - CONFIG_FREERTOS_USE_MIO 本例子已经提供好具体的编译指令,以下进行介绍: @@ -50,11 +55,12 @@ 2. make clean 将目录下的工程进行清理 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 4. make list_kconfig 当前工程支持哪些配置文件 - 5. make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 + 5. make load_kconfig LOAD_CONFIG_NAME=`` 将预设配置加载至工程中 6. make menuconfig 配置目录下的参数变量 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 具体使用方法为: + - 在当前目录下 - 执行以上指令 @@ -63,24 +69,38 @@ #### 2.3.1 构建过程 - 在host侧完成配置 ->配置成d2000,对于其它平台,使用对应的默认配置,如E2000D `make load_e2000d_aarch32` + +> 配置成平台,使用对应的默认配置,如E2000D `make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_i2c` - 选择目标平台 + +E2000D demo板 + ``` -make load_e2000d_aarch32 +make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_i2c +``` + +或者 +phytiumpi 的 firefly板 + +``` +make load_kconfig LOAD_CONFIG_NAME=phytiumpi_aarch64_firefly_i2c ``` - 选择例程需要的配置 + ``` make menuconfig ``` - 进行编译 + ``` make image ``` - 将编译出的镜像放置到tftp目录下 + ``` make image ``` @@ -88,11 +108,13 @@ make image #### 2.3.2 下载过程 - host侧设置重启host侧tftp服务器 + ``` sudo service tftpd-hpa restart ``` - 开发板侧使用bootelf命令跳转 + ``` setenv ipaddr 192.168.4.20 setenv serverip 192.168.4.50 @@ -104,23 +126,24 @@ bootelf -p 0x90100000 ### 2.4 输出与实验现象 - 系统进入后,创建i2c初始化任务,创建i2c从机中断初始化,注册中断服务函数,创建i2c主机的读写任务函数。 +- E2000支持i2c 读写RTC +``` +i2c rtc +``` -- E2000 - -![e2000d](./figs/E2000_1339.png) +![e2000d](figs/E2000_rtc.png) -![e2000d](figs/e2000_rtc.png) +- phytiumpi 支持主从机进行通信,从设备控制器模拟eeprom -- phytiumpi +``` +i2c rw +``` -![phytiumpi](figs/phytiumpi.png) +![phytiumpi](./figs/phytiumpi.png) ## 3. 如何解决问题 +关于飞腾派上RTC问题,因未焊接DS1339芯片,所以未对飞腾派做例程操作支持。如果需要,可以参考现有的RTC例程,添加飞腾派配置即可。 ## 4. 修改历史记录 - - - - diff --git a/example/peripheral/i2c/figs/E2000_rtc.png b/example/peripheral/i2c/figs/E2000_rtc.png index 3dd508c283d16bda7c08494856b05d5ff020a5b4..dedd52ab3a320eecd0a36edfb79dfaf318ddedc4 100644 Binary files a/example/peripheral/i2c/figs/E2000_rtc.png and b/example/peripheral/i2c/figs/E2000_rtc.png differ diff --git a/example/peripheral/i2c/figs/hw_i2c_pi.jpg b/example/peripheral/i2c/figs/hw_i2c_pi.jpg deleted file mode 100644 index 119c7952aa8cfd9e79c3d00162fee95c7e5946e2..0000000000000000000000000000000000000000 Binary files a/example/peripheral/i2c/figs/hw_i2c_pi.jpg and /dev/null differ diff --git a/example/peripheral/i2c/figs/hw_i2c_pi.png b/example/peripheral/i2c/figs/hw_i2c_pi.png new file mode 100644 index 0000000000000000000000000000000000000000..4fa1f052fe2b9e59d2c98ac7d3f58864a6985caa Binary files /dev/null and b/example/peripheral/i2c/figs/hw_i2c_pi.png differ diff --git a/example/peripheral/i2c/figs/phytiumpi.png b/example/peripheral/i2c/figs/phytiumpi.png index 8afa69657843bd194e0c5ff7bc281423e21c3142..78dc38aab05da5c1f9fdc339999d5ef8ca7d6dc7 100644 Binary files a/example/peripheral/i2c/figs/phytiumpi.png and b/example/peripheral/i2c/figs/phytiumpi.png differ diff --git a/example/peripheral/i2c/inc/i2c_example.h b/example/peripheral/i2c/inc/i2c_example.h index 6b48115a5c08276730296a050b34d68ef522480e..87ac39b1e4c459b559566296cfec1ea0f9bd4f67 100644 --- a/example/peripheral/i2c/inc/i2c_example.h +++ b/example/peripheral/i2c/inc/i2c_example.h @@ -41,7 +41,8 @@ extern "C" /************************** Function Prototypes ******************************/ /* i2c write and read test */ -BaseType_t FFreeRTOSI2cCreate(void); +BaseType_t FFreeRTOSI2cRtcCreate(void); +BaseType_t FFreeRTOSI2cLoopbackCreate(void); /* dump buffer of slave */ void FFreeRTOSI2cSlaveDump(FFreeRTOSI2c *os_i2c_p); diff --git a/example/peripheral/i2c/main.c b/example/peripheral/i2c/main.c index 4cc00aede3f570d1ea118d590525ec084b935ad5..1a9b4ef008adf100e3e5b1735575f8b60e27de92 100644 --- a/example/peripheral/i2c/main.c +++ b/example/peripheral/i2c/main.c @@ -31,12 +31,6 @@ int main(void) { BaseType_t ret; - ret = FFreeRTOSI2cCreate(); - if (ret != pdPASS) - { - goto FAIL_EXIT; - } - ret = LSUserShellTask(); if (ret != pdPASS) { diff --git a/example/peripheral/i2c/makefile b/example/peripheral/i2c/makefile index 13c14898d0f8ad5159f3e5baa6067deda58349eb..8cdbb131737371bf472dd0695f73ceba32b2c1a4 100644 --- a/example/peripheral/i2c/makefile +++ b/example/peripheral/i2c/makefile @@ -8,7 +8,6 @@ BOOT_IMG_NAME ?= freertos USER_CSRC := main.c USER_CSRC += $(wildcard src/*.c) -USER_CSRC += $(wildcard ../common/*.c) USER_ASRC := USER_CXXSRC := diff --git a/example/peripheral/i2c/sdkconfig b/example/peripheral/i2c/sdkconfig index b811a80553074dbe8a9bc8adcb087bd09ae1b416..4060116502e71871b34a4c686ceedd3fdd0ec4f5 100644 --- a/example/peripheral/i2c/sdkconfig +++ b/example/peripheral/i2c/sdkconfig @@ -45,14 +45,15 @@ CONFIG_USE_MMU=y # # Soc configuration # -CONFIG_TARGET_PHYTIUMPI=y +# CONFIG_TARGET_PHYTIUMPI is not set # CONFIG_TARGET_E2000Q is not set -# CONFIG_TARGET_E2000D is not set +CONFIG_TARGET_E2000D=y # CONFIG_TARGET_E2000S is not set # CONFIG_TARGET_FT2004 is not set # CONFIG_TARGET_D2000 is not set -CONFIG_SOC_NAME="phytiumpi" -CONFIG_SOC_CORE_NUM=4 +CONFIG_SOC_NAME="e2000" +CONFIG_TARGET_TYPE_NAME="d" +CONFIG_SOC_CORE_NUM=2 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 @@ -67,21 +68,22 @@ CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # # Board Configuration # -CONFIG_BOARD_NAME="firefly" +CONFIG_E2000D_DEMO_BOARD=y +CONFIG_BOARD_NAME="demo" + +# +# IO mux configuration when board start up +# # CONFIG_USE_SPI_IOPAD is not set # CONFIG_USE_GPIO_IOPAD is not set # CONFIG_USE_CAN_IOPAD is not set # CONFIG_USE_QSPI_IOPAD is not set # CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_ADC_IOPAD is not set # CONFIG_USE_MIO_IOPAD is not set # CONFIG_USE_TACHO_IOPAD is not set # CONFIG_USE_UART_IOPAD is not set # CONFIG_USE_THIRD_PARTY_IOPAD is not set -CONFIG_FIREFLY_DEMO_BOARD=y - -# -# IO mux configuration when board start up -# # end of IO mux configuration when board start up # CONFIG_CUS_DEMO_BOARD is not set diff --git a/example/peripheral/i2c/sdkconfig.h b/example/peripheral/i2c/sdkconfig.h index 65851304993e6a2ceaf02f08af3fc4993237fd4c..0011401d52900eb85bd39ca05e80055e8f96c659 100644 --- a/example/peripheral/i2c/sdkconfig.h +++ b/example/peripheral/i2c/sdkconfig.h @@ -41,14 +41,15 @@ /* Soc configuration */ -#define CONFIG_TARGET_PHYTIUMPI +/* CONFIG_TARGET_PHYTIUMPI is not set */ /* CONFIG_TARGET_E2000Q is not set */ -/* CONFIG_TARGET_E2000D is not set */ +#define CONFIG_TARGET_E2000D /* CONFIG_TARGET_E2000S is not set */ /* CONFIG_TARGET_FT2004 is not set */ /* CONFIG_TARGET_D2000 is not set */ -#define CONFIG_SOC_NAME "phytiumpi" -#define CONFIG_SOC_CORE_NUM 4 +#define CONFIG_SOC_NAME "e2000" +#define CONFIG_TARGET_TYPE_NAME "d" +#define CONFIG_SOC_CORE_NUM 2 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 @@ -62,20 +63,21 @@ /* Board Configuration */ -#define CONFIG_BOARD_NAME "firefly" +#define CONFIG_E2000D_DEMO_BOARD +#define CONFIG_BOARD_NAME "demo" + +/* IO mux configuration when board start up */ + /* CONFIG_USE_SPI_IOPAD is not set */ /* CONFIG_USE_GPIO_IOPAD is not set */ /* CONFIG_USE_CAN_IOPAD is not set */ /* CONFIG_USE_QSPI_IOPAD is not set */ /* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_ADC_IOPAD is not set */ /* CONFIG_USE_MIO_IOPAD is not set */ /* CONFIG_USE_TACHO_IOPAD is not set */ /* CONFIG_USE_UART_IOPAD is not set */ /* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ -#define CONFIG_FIREFLY_DEMO_BOARD - -/* IO mux configuration when board start up */ - /* end of IO mux configuration when board start up */ /* CONFIG_CUS_DEMO_BOARD is not set */ diff --git a/example/peripheral/i2c/src/cmd_i2c.c b/example/peripheral/i2c/src/cmd_i2c.c new file mode 100644 index 0000000000000000000000000000000000000000..39e5126f00e6edfeba3b5717bc404e4864f2ca81 --- /dev/null +++ b/example/peripheral/i2c/src/cmd_i2c.c @@ -0,0 +1,83 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: cmd_i2c.c + * Date: 2023-09-25 14:42:53 + * LastEditTime: 2023-09-25 14:42:53 + * Description:  This file is for i2c shell command implmentation. + * + * Modify History: + * Ver    Who         Date          Changes + * -----  ------      --------     -------------------------------------- + * 1.0 liushengming 2023/09/25 init commit + */ +/***************************** Include Files *********************************/ +#include +#include +#include "strto.h" +#include "sdkconfig.h" +#include "FreeRTOS.h" +#include "shell.h" +#include "fi2c_os.h" +#include "i2c_example.h" + +/************************** Function Prototypes ******************************/ + +/*****************************************************************************/ +static void FI2cExampleUsage() +{ + printf("Usage:\r\n"); +#if defined(CONFIG_E2000D_DEMO_BOARD)||defined(CONFIG_E2000Q_DEMO_BOARD) + printf(" i2c rtc\r\n"); + printf(" -- E2000 demo board set time and read it.\r\n"); +#endif +#if defined(CONFIG_FIREFLY_DEMO_BOARD) + printf(" i2c rw\r\n"); + printf(" -- firefly board,Two i2c controllers are used for master-slave communication.\r\n"); +#endif +} + +static int I2cCmdEntry(int argc, char *argv[]) +{ + int ret = 0; + if (argc < 2) + { + FI2cExampleUsage(); + return -1; + } +#if defined(CONFIG_E2000D_DEMO_BOARD)||defined(CONFIG_E2000Q_DEMO_BOARD) + else if (!strcmp(argv[1], "rtc")) + { + ret = FFreeRTOSI2cRtcCreate(); + if (ret != pdPASS) + { + printf("FFreeRTOSI2cRtcCreate error :0x%x!\n",ret); + return ret; + } + } +#endif +#if defined(CONFIG_FIREFLY_DEMO_BOARD) + else if (!strcmp(argv[1], "rw")) + { + ret = FFreeRTOSI2cLoopbackCreate(); + if (ret != pdPASS) + { + printf("FFreeRTOSI2cLoopbackCreate error :0x%x!\n",ret); + return ret; + } + } +#endif + return ret; +} + +SHELL_EXPORT_CMD(SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), i2c, I2cCmdEntry, test freertos i2c driver); diff --git a/example/peripheral/i2c/src/i2c_example.c b/example/peripheral/i2c/src/i2c_ms_example.c similarity index 67% rename from example/peripheral/i2c/src/i2c_example.c rename to example/peripheral/i2c/src/i2c_ms_example.c index ecc55873ed9115cb163c7cb3dc1b02cd7a4506ae..57ac4b60ae21879e803629506b4f9c1d000ad6ad 100644 --- a/example/peripheral/i2c/src/i2c_example.c +++ b/example/peripheral/i2c/src/i2c_ms_example.c @@ -11,15 +11,15 @@ * See the Phytium Public License for more details. * * - * FilePath: i2c_example.c + * FilePath: i2c_ms_example.c * Date: 2022-11-10 11:35:23 * LastEditTime: 2022-11-10 11:35:24 - * Description:  This file is for i2c test example functions. + * Description:  This file is for i2c master and slave test example functions. * * Modify History: * Ver    Who         Date          Changes * -----  ------      --------     -------------------------------------- - * 1.0 liushengming 2022/11/25 init commit + * 1.0 liushengming 2023/09/25 init commit */ #include #include "FreeRTOSConfig.h" @@ -37,19 +37,13 @@ #include "fdebug.h" #include "ftypes.h" #include "finterrupt.h" -#if defined(CONFIG_TARGET_E2000D) || defined(CONFIG_TARGET_E2000Q) || defined(CONFIG_TARGET_PHYTIUMPI) - #define BCD_TO_BIN(bcd) (( ((((bcd)&0xf0)>>4)*10) + ((bcd)&0xf) ) & 0xff) - #define BIN_TO_BCD(bin) (( (((bin)/10)<<4) + ((bin)%10) ) & 0xff) -#endif /* write and read task delay in milliseconds */ -#define TASK_DELAY_MS 5000UL +#define TASK_DELAY_MS 1000UL /* slave address */ /* Notice! Using addresses above 0x50 may cause the loopback test to fail */ #define MASTER_SLAVE_ADDR 0x01 -#define EEPROM_ADDR 0x57 -#define RTC_ADDR 0x68 #define DAT_LENGTH 15 static char data_w[DAT_LENGTH] = {0}; @@ -254,7 +248,6 @@ static void FI2cIntrTxAbrtcallback(void *instance, void *param) } } - static void I2cSlaveTask(void *pvParameters) { const char *pcTaskName = "\r\n*****I2cSlaveTask is running...\r\n"; @@ -266,15 +259,13 @@ static void I2cSlaveTask(void *pvParameters) Cast this to a FFreeRTOSI2c pointer. */ FFreeRTOSI2c *os_i2c_write_p = (FFreeRTOSI2c *) pvParameters; - while (1) - { - vTaskDelay(xDelay); - vPrintf(pcTaskName); - /* 获取到信号,打印内存块 */ - FFreeRTOSI2cSlaveDump(os_i2c_write_p); - } + vPrintf(pcTaskName); + /* 获取到信号,打印内存块 */ + FFreeRTOSI2cSlaveDump(os_i2c_write_p); + vTaskDelete(NULL); } + static void I2cReadTask(void *pvParameters) { const TickType_t xDelay = pdMS_TO_TICKS(TASK_DELAY_MS); @@ -291,7 +282,7 @@ static void I2cReadTask(void *pvParameters) FFreeRTOSI2c *os_i2c_read_p = (FFreeRTOSI2c *) pvParameters; message.slave_addr = os_i2c_read_p->i2c_device.config.slave_addr; -#if defined(CONFIG_TARGET_D2000) || defined(CONFIG_TARGET_FT2004) + /*8位地址*/ message.mem_byte_len = 1; message.mem_addr = 0x1;/* 地址偏移0x1的位置poll方式读取数据 */ @@ -316,40 +307,7 @@ static void I2cReadTask(void *pvParameters) FtDumpHexByte(data_r0, DAT_LENGTH); vPrintf("data_r1:\r\n"); FtDumpHexByte(data_r1, DAT_LENGTH); - vPrintf("\r\nI2cReadTask is over.\r\n"); -#endif -#if defined(CONFIG_TARGET_E2000D) || defined(CONFIG_TARGET_E2000Q) || defined(CONFIG_TARGET_PHYTIUMPI) - message.mem_byte_len = 1; - message.mem_addr = 0x0;/* 地址偏移0x0的位置poll方式读取数据 */ - message.buf_length = 7; - message.buf = data_r0; - message.mode = FI2C_READ_DATA_POLL; - ret = FFreeRTOSI2cTransfer(os_i2c_read_p, &message); - if (ret != FREERTOS_I2C_SUCCESS) - { - vPrintf("FFreeRTOSI2cTransfer read poll task error,i2c id:%d.\r\n", os_i2c_read_p->i2c_device.config.instance_id); - } - u16 year; - if (data_r0[5] & 0x80) - { - year = BCD_TO_BIN(data_r0[6]) + 2000; - } - else - { - year = BCD_TO_BIN(data_r0[6]) + 1900; - } - printf("Date_time: %d-%d-%d week:%d time:%d:%d:%d\r\n", - year, - BCD_TO_BIN(data_r0[5] & 0x1F), - BCD_TO_BIN(data_r0[4] & 0x3F), - BCD_TO_BIN((data_r0[3] - 1) & 0x7), - BCD_TO_BIN(data_r0[2] & 0x3F), - BCD_TO_BIN(data_r0[1] & 0x7F), - BCD_TO_BIN(data_r0[0] & 0x7F) - ); - vTaskDelay(xDelay); -#endif FFreeRTOSI2cDeinit(os_i2c_read_p);/*写入再读取完成后去初始化FFreeRTOSI2c主机设置*/ printf("I2cReadTask is over.\r\n "); vTaskDelete(NULL); @@ -357,8 +315,6 @@ static void I2cReadTask(void *pvParameters) static void I2cWriteTask(void *pvParameters) { - const TickType_t xDelay = pdMS_TO_TICKS(TASK_DELAY_MS); - vTaskDelay(xDelay); const char *pcWriteTaskName = "\r\n*****I2cWriteTask is running...\r\n"; vPrintf(pcWriteTaskName); FError ret = FREERTOS_I2C_SUCCESS; @@ -371,7 +327,6 @@ static void I2cWriteTask(void *pvParameters) FFreeRTOSI2c *os_i2c_write_p = (FFreeRTOSI2c *) pvParameters; message.slave_addr = os_i2c_write_p->i2c_device.config.slave_addr; -#if defined(CONFIG_TARGET_D2000) || defined(CONFIG_TARGET_FT2004) for (i = 0; i < DAT_LENGTH; i++) { data_w[i] = i ; @@ -394,43 +349,15 @@ static void I2cWriteTask(void *pvParameters) { vPrintf("FFreeRTOSI2cTransfer write poll task error,i2c id:%d.\r\n", os_i2c_write_p->i2c_device.config.instance_id); } -#endif -#if defined(CONFIG_TARGET_E2000D) || defined(CONFIG_TARGET_E2000Q) || defined(CONFIG_TARGET_PHYTIUMPI) - /*RTC*/ - data_w[0] = BIN_TO_BCD(20) ;/*second*/ - data_w[1] = BIN_TO_BCD(20) ;/*minute*/ - data_w[2] = BIN_TO_BCD(20) ;/*hour*/ - data_w[3] = BIN_TO_BCD(2 + 1) ; /*weekday2 + 1*/ - data_w[4] = BIN_TO_BCD(6) ;/*day_of_month*/ - - data_w[5] = (BIN_TO_BCD(9) | 0x80); /* 2000 -> (* | 0x80) , 1900 -> (* | 0x0) */ - data_w[6] = BIN_TO_BCD(2023 % 100) ; - /*8位地址*/ - message.mem_byte_len = 1; - message.buf = data_w; - message.buf_length = 7; - message.mem_addr = 0x0;/* 地址偏移0x0的位置poll方式写入数据 */ - message.mode = FI2C_WRITE_DATA_POLL; - ret = FFreeRTOSI2cTransfer(os_i2c_write_p, &message); - if (ret != FREERTOS_I2C_SUCCESS) - { - vPrintf("FFreeRTOSI2cTransfer write poll task error,i2c id:%d.\r\n", os_i2c_write_p->i2c_device.config.instance_id); - } -#endif printf("I2cWriteTask is over.\r\n "); vTaskDelete(NULL); } -static void FI2cMasterSlaveSetIoMux(u32 instance_id) -{ - FIOPadSetMioMux(instance_id); -} - static FError FFreeRTOSI2cInitSet(uint32_t id, uint32_t work_mode, uint32_t slave_address) { FError err; - FI2cMasterSlaveSetIoMux(id); + FIOPadSetMioMux(id); /* init i2c controller */ if (work_mode == FI2C_MASTER) /* 主机初始化默认使用poll模式 */ { @@ -472,32 +399,7 @@ static void I2cInitTask(void *pvParameters) BaseType_t xReturn = pdPASS; taskENTER_CRITICAL(); //进入临界区 -#if defined(CONFIG_TARGET_E2000Q) || defined(CONFIG_TARGET_E2000D) - err = FFreeRTOSI2cInitSet(FMIO9_ID, FI2C_MASTER, RTC_ADDR); - if (err != FREERTOS_I2C_SUCCESS) - { - vPrintf("I2c FFreeRTOSI2cInitSet failed.\r\n"); - return; - } - - xReturn = xTaskCreate((TaskFunction_t)I2cReadTask, /* 任务入口函数 */ - (const char *)"I2cReadTask",/* 任务名字 */ - (uint16_t)1024, /* 任务栈大小 */ - (void *)os_i2c_master,/* 任务入口函数参数 */ - (UBaseType_t)configMAX_PRIORITIES - 2, /* 任务的优先级 */ - (TaskHandle_t *)&read_handle); /* 任务控制 */ - FASSERT_MSG(xReturn == pdPASS, "I2cReadTask creation is failed."); - - xReturn = xTaskCreate((TaskFunction_t)I2cWriteTask, /* 任务入口函数 */ - (const char *)"I2cWriteTask",/* 任务名字 */ - (uint16_t)1024, /* 任务栈大小 */ - (void *)os_i2c_master,/* 任务入口函数参数 */ - (UBaseType_t)configMAX_PRIORITIES - 1, /* 任务的优先级 */ - (TaskHandle_t *)&write_handle); /* 任务控制 */ - FASSERT_MSG(xReturn == pdPASS, "I2cWriteTask creation is failed."); -#endif -#if defined(CONFIG_TARGET_PHYTIUMPI) err = FFreeRTOSI2cInitSet(FMIO1_ID, FI2C_MASTER, MASTER_SLAVE_ADDR); if (err != FREERTOS_I2C_SUCCESS) { @@ -532,78 +434,15 @@ static void I2cInitTask(void *pvParameters) (const char *)"I2cSlaveTask",/* 任务名字 */ (uint16_t)1024, /* 任务栈大小 */ (void *)os_i2c_slave,/* 任务入口函数参数 */ - (UBaseType_t)configMAX_PRIORITIES - 2, /* 任务的优先级 */ - (TaskHandle_t *)&slave_handle); /* 任务控制 */ - FASSERT_MSG(xReturn == pdPASS, "I2cSlaveTask creation is failed."); -#endif - -#if defined(CONFIG_TARGET_D2000) - err = FFreeRTOSI2cInitSet(FI2C0_ID, FI2C_MASTER, MASTER_SLAVE_ADDR); - if (err != FREERTOS_I2C_SUCCESS) - { - vPrintf("I2c FFreeRTOSI2cInitSet failed.\r\n"); - return; - } - - err = FFreeRTOSI2cInitSet(FI2C2_ID, FI2C_SLAVE, MASTER_SLAVE_ADDR); - if (err != FREERTOS_I2C_SUCCESS) - { - vPrintf("I2c FFreeRTOSI2cInitSet failed.\r\n"); - return; - } - - xReturn = xTaskCreate((TaskFunction_t)I2cReadTask, /* 任务入口函数 */ - (const char *)"I2cReadTask",/* 任务名字 */ - (uint16_t)1024, /* 任务栈大小 */ - (void *)os_i2c_master,/* 任务入口函数参数 */ (UBaseType_t)configMAX_PRIORITIES - 3, /* 任务的优先级 */ - (TaskHandle_t *)&read_handle); /* 任务控制 */ - FASSERT_MSG(xReturn == pdPASS, "I2cReadTask creation is failed."); - - xReturn = xTaskCreate((TaskFunction_t)I2cWriteTask, /* 任务入口函数 */ - (const char *)"I2cWriteTask",/* 任务名字 */ - (uint16_t)1024, /* 任务栈大小 */ - (void *)os_i2c_master,/* 任务入口函数参数 */ - (UBaseType_t)configMAX_PRIORITIES - 1, /* 任务的优先级 */ - (TaskHandle_t *)&write_handle); /* 任务控制 */ - FASSERT_MSG(xReturn == pdPASS, "I2cWriteTask creation is failed."); - - xReturn = xTaskCreate((TaskFunction_t)I2cSlaveTask, /* 任务入口函数 */ - (const char *)"I2cSlaveTask",/* 任务名字 */ - (uint16_t)1024, /* 任务栈大小 */ - (void *)os_i2c_slave,/* 任务入口函数参数 */ - (UBaseType_t)configMAX_PRIORITIES - 2, /* 任务的优先级 */ (TaskHandle_t *)&slave_handle); /* 任务控制 */ FASSERT_MSG(xReturn == pdPASS, "I2cSlaveTask creation is failed."); -#endif -#if defined(CONFIG_TARGET_FT2004) - err = FFreeRTOSI2cInitSet(FI2C0_ID, FI2C_MASTER, EEPROM_ADDR); - if (err != FREERTOS_I2C_SUCCESS) - { - vPrintf("I2c FFreeRTOSI2cInitSet failed.\r\n"); - return; - } - xReturn = xTaskCreate((TaskFunction_t)I2cReadTask, /* 任务入口函数 */ - (const char *)"I2cReadTask",/* 任务名字 */ - (uint16_t)1024, /* 任务栈大小 */ - (void *)os_i2c_master,/* 任务入口函数参数 */ - (UBaseType_t)configMAX_PRIORITIES - 2, /* 任务的优先级 */ - (TaskHandle_t *)&read_handle); /* 任务控制 */ - FASSERT_MSG(xReturn == pdPASS, "I2cReadTask creation is failed."); - xReturn = xTaskCreate((TaskFunction_t)I2cWriteTask, /* 任务入口函数 */ - (const char *)"I2cWriteTask",/* 任务名字 */ - (uint16_t)1024, /* 任务栈大小 */ - (void *)os_i2c_master,/* 任务入口函数参数 */ - (UBaseType_t)configMAX_PRIORITIES - 1, /* 任务的优先级 */ - (TaskHandle_t *)&write_handle); /* 任务控制 */ - FASSERT_MSG(xReturn == pdPASS, "I2cWriteTask creation is failed."); -#endif taskEXIT_CRITICAL(); //退出临界区 vTaskDelete(NULL); } -BaseType_t FFreeRTOSI2cCreate(void) +BaseType_t FFreeRTOSI2cLoopbackCreate(void) { BaseType_t xReturn = pdPASS;/* 定义一个创建信息返回值,默认为 pdPASS */ BaseType_t xTimerStarted = pdPASS; @@ -620,6 +459,7 @@ BaseType_t FFreeRTOSI2cCreate(void) taskEXIT_CRITICAL(); //退出临界区 printf("I2c task is created successfully.\r\n"); + vTaskDelay(TASK_DELAY_MS*3); return xReturn; } diff --git a/example/peripheral/i2c/src/i2c_rtc_example.c b/example/peripheral/i2c/src/i2c_rtc_example.c new file mode 100644 index 0000000000000000000000000000000000000000..02dde6cd46783f6575d0a695d172506a8df27cad --- /dev/null +++ b/example/peripheral/i2c/src/i2c_rtc_example.c @@ -0,0 +1,393 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: i2c_example.c + * Date: 2022-11-10 11:35:23 + * LastEditTime: 2022-11-10 11:35:24 + * Description:  This file is for i2c rtc test example functions. + * + * Modify History: + * Ver    Who         Date          Changes + * -----  ------      --------     -------------------------------------- + * 1.0 liushengming 2022/11/25 init commit + * 1.0 liushengming 2023/09/25 rtc commit + */ +#include +#include "FreeRTOSConfig.h" +#include "FreeRTOS.h" +#include "task.h" +#include "fi2c.h" +#include "fi2c_hw.h" +#include "fi2c_os.h" +#include "timers.h" +#include "fcpu_info.h" +#include "i2c_example.h" +#include "fparameters.h" +#include "fio_mux.h" +#include "sdkconfig.h" +#include "fdebug.h" +#include "ftypes.h" +#include "finterrupt.h" + +#if defined(CONFIG_E2000D_DEMO_BOARD) || defined(CONFIG_E2000Q_DEMO_BOARD) || defined(CONFIG_FIREFLY_DEMO_BOARD) +#define DS_1339_MIO FMIO9_ID +#else +#define DS_1339_MIO FMIO0_ID +#endif + +/* + * RTC register addresses + */ +#define DS1339_SEC_REG 0x0 +#define DS1339_MIN_REG 0x1 +#define DS1339_HOUR_REG 0x2 +#define DS1339_DAY_REG 0x3 +#define DS1339_DATE_REG 0x4 +#define DS1339_MONTH_REG 0x5 +#define DS1339_YEAR_REG 0x6 + +#define BCD_TO_BIN(bcd) (( ((((bcd)&0xf0)>>4)*10) + ((bcd)&0xf) ) & 0xff) +#define BIN_TO_BCD(bin) (( (((bin)/10)<<4) + ((bin)%10) ) & 0xff) + +/* write and read task delay in milliseconds */ +#define TASK_DELAY_MS 1000UL + +/* rtc address */ + +#define RTC_ADDR 0x68 + +#define DAT_LENGTH 15 + +static char data_r0[DAT_LENGTH]; + + +static xTaskHandle init_handle; +static xTaskHandle read_handle; +static xTaskHandle write_handle; + + +static FFreeRTOSI2c *os_i2c_master; + +typedef struct +{ + u16 year; /* year */ + u8 month; /* month */ + u8 day_of_month; /* day of month */ + u8 day_of_week; /* day of week */ + u8 hour; /* hour */ + u8 minute; /* minute */ + u8 second; /* second */ +} FRtcDateTimer; + +static FError DsRtcDateCheck(FRtcDateTimer *rtc_time) +{ + FASSERT(rtc_time != NULL); + + /* Check validity of seconds value */ + if (rtc_time->second > 59) + { + return FI2C_ERR_INVAL_PARM; + } + + /* Check validity of minutes value */ + if (rtc_time->minute > 59) + { + return FI2C_ERR_INVAL_PARM; + } + + /* Check validity of day of week value */ + if (rtc_time->day_of_week < 1 || rtc_time->day_of_week > 7) + { + return FI2C_ERR_INVAL_PARM; + } + + /* Check validity of hours value */ + if (rtc_time->hour > 23) + { + return FI2C_ERR_INVAL_PARM; + } + + /* Check validity of day of month value */ + if (rtc_time->day_of_month < 1 || rtc_time->day_of_month > 31) + { + return FI2C_ERR_INVAL_PARM; + } + + /* Check validity of month value */ + if (rtc_time->month < 1 || rtc_time->month > 12) + { + return FI2C_ERR_INVAL_PARM; + } + + /* Check validity of year value */ + if (rtc_time->year > 2099) + { + return FI2C_ERR_INVAL_PARM; + } + return FREERTOS_I2C_SUCCESS; +} +/* + * @name: FI2cIntrTxDone + * @msg:user transmit FIFO done interrupt callback. + * @param {void} *instance_p + */ +static void FI2cIntrTxDonecallback(void *instance, void *param) +{ + BaseType_t x_result = pdFALSE; + BaseType_t xhigher_priority_task_woken = pdFALSE; + + FI2c *instance_p = (FI2c *)instance; + x_result = xEventGroupSetBitsFromISR(os_i2c_master[instance_p->config.instance_id].trx_event, RTOS_I2C_WRITE_DONE, &xhigher_priority_task_woken); + if (x_result != pdFAIL) + { + portYIELD_FROM_ISR(xhigher_priority_task_woken); + } +} + +/* + * @name: FI2cIntrRxDonecallback + * @msg:user receive fifo level done interrupt callback. + * @param {void} *instance_p + */ +static void FI2cIntrRxDonecallback(void *instance, void *param) +{ + BaseType_t x_result = pdFALSE; + BaseType_t xhigher_priority_task_woken = pdFALSE; + + FI2c *instance_p = (FI2c *)instance; + x_result = xEventGroupSetBitsFromISR(os_i2c_master[instance_p->config.instance_id].trx_event, RTOS_I2C_READ_DONE, &xhigher_priority_task_woken); + if (x_result != pdFAIL) + { + portYIELD_FROM_ISR(xhigher_priority_task_woken); + } +} + +/* + * @name: FI2cIntrTxAbrtcallback + * @msg:user transmit abort interrupt callback. + * @param {void} *instance_p + */ +static void FI2cIntrTxAbrtcallback(void *instance, void *param) +{ + BaseType_t x_result = pdFALSE; + BaseType_t xhigher_priority_task_woken = pdFALSE; + + FI2c *instance_p = (FI2c *)instance; + x_result = xEventGroupSetBitsFromISR(os_i2c_master[instance_p->config.instance_id].trx_event, RTOS_I2C_TRANS_ABORTED, &xhigher_priority_task_woken); + if (x_result != pdFAIL) + { + portYIELD_FROM_ISR(xhigher_priority_task_woken); + } +} + +static void I2cReadTask(void *pvParameters) +{ + const TickType_t xDelay = pdMS_TO_TICKS(TASK_DELAY_MS); + vTaskDelay(xDelay); + const char *pcReadTaskName = "\r\n*****I2cReadTask is running...\r\n"; + vPrintf(pcReadTaskName); + FError ret = FREERTOS_I2C_SUCCESS; + + /* Master mode for send or receive data */ + FFreeRTOSI2cMessage message; + + /* The FFreeRTOSI2c to use is passed in via the parameter. + Cast this to a FFreeRTOSI2c pointer. */ + FFreeRTOSI2c *os_i2c_read_p = (FFreeRTOSI2c *) pvParameters; + + message.slave_addr = os_i2c_read_p->i2c_device.config.slave_addr; + message.mem_byte_len = 1; + message.mem_addr = 0x0;/* 地址偏移0x0的位置poll方式读取数据 */ + message.buf_length = 7; + message.buf = data_r0; + message.mode = FI2C_READ_DATA_POLL; + + ret = FFreeRTOSI2cTransfer(os_i2c_read_p, &message); + if (ret != FREERTOS_I2C_SUCCESS) + { + vPrintf("FFreeRTOSI2cTransfer read poll task error,i2c id:%d.\r\n", os_i2c_read_p->i2c_device.config.instance_id); + } + u16 year; + if (data_r0[5] & 0x80) + { + year = BCD_TO_BIN(data_r0[6]) + 2000; + } + else + { + year = BCD_TO_BIN(data_r0[6]) + 1900; + } + printf("Date_time: %d-%d-%d week:%d time:%d:%d:%d\r\n", + year, + BCD_TO_BIN(data_r0[5] & 0x1F), + BCD_TO_BIN(data_r0[4] & 0x3F), + BCD_TO_BIN((data_r0[3] - 1) & 0x7), + BCD_TO_BIN(data_r0[2] & 0x3F), + BCD_TO_BIN(data_r0[1] & 0x7F), + BCD_TO_BIN(data_r0[0] & 0x7F) + ); + vTaskDelay(xDelay); + FFreeRTOSI2cDeinit(os_i2c_read_p);/*写入再读取完成后去初始化FFreeRTOSI2c主机设置*/ + printf("I2cReadTask is over.\r\n "); + vTaskDelete(NULL); +} + +static void I2cWriteTask(void *pvParameters) +{ + const TickType_t xDelay = pdMS_TO_TICKS(TASK_DELAY_MS); + vTaskDelay(xDelay); + const char *pcWriteTaskName = "\r\n*****I2cWriteTask is running...\r\n"; + vPrintf(pcWriteTaskName); + FError ret = FREERTOS_I2C_SUCCESS; + u8 i,century; + u8 data_buf[7] = {0}; + /* Master mode for send or receive data */ + FFreeRTOSI2cMessage message; + + /* The FFreeRTOSI2c to use is passed in via the parameter. + Cast this to a FFreeRTOSI2c pointer. */ + FFreeRTOSI2c *os_i2c_write_p = (FFreeRTOSI2c *) pvParameters; + + message.slave_addr = os_i2c_write_p->i2c_device.config.slave_addr; + FRtcDateTimer date_time = {2023, 9, 25, 1, 20, 13, 30}; + printf("Set:year: %d, month: %d, day: %d,week: %d, hour: %d, minute: %d, second: %d\r\n", + date_time.year, + date_time.month, + date_time.day_of_month, + date_time.day_of_week, + date_time.hour, + date_time.minute, + date_time.second); + ret = DsRtcDateCheck(&date_time); + if (FREERTOS_I2C_SUCCESS != ret) + { + vPrintf("Time data param error.\r\n"); + return; + } + data_buf[0] = BIN_TO_BCD(date_time.second); + + data_buf[1] = BIN_TO_BCD(date_time.minute); + + data_buf[2] = BIN_TO_BCD(date_time.hour); + + data_buf[3] = BIN_TO_BCD(date_time.day_of_week + 1); + + data_buf[4] = BIN_TO_BCD(date_time.day_of_month); + + if (date_time.year >= 2000) + { + century = 0x80; + } + else + { + century = 0x0; + } + data_buf[5] = (BIN_TO_BCD(date_time.month) | century); + + data_buf[6] = BIN_TO_BCD(date_time.year % 100); + + /*8位地址*/ + message.mem_byte_len = 1; + message.buf = &data_buf; + message.buf_length = sizeof(data_buf); + message.mem_addr = 0x0;/* 地址偏移0x0的位置poll方式写入数据 */ + message.mode = FI2C_WRITE_DATA_POLL; + ret = FFreeRTOSI2cTransfer(os_i2c_write_p, &message); + if (ret != FREERTOS_I2C_SUCCESS) + { + vPrintf("FFreeRTOSI2cTransfer write poll task error,i2c id:%d.\r\n", os_i2c_write_p->i2c_device.config.instance_id); + } + printf("I2cWriteTask is over.\r\n "); + vTaskDelete(NULL); +} + +static FError FFreeRTOSI2cInitSet(uint32_t id, uint32_t work_mode, uint32_t slave_address) +{ + FError err; + FIOPadSetMioMux(id); + /* init i2c controller */ + if (work_mode == FI2C_MASTER) /* 主机初始化默认使用poll模式 */ + { + os_i2c_master = FFreeRTOSI2cInit(id, work_mode, slave_address, FI2C_SPEED_STANDARD_RATE); + /* register intr callback */ + InterruptInstall(os_i2c_master->i2c_device.config.irq_num, FI2cMasterIntrHandler, &os_i2c_master->i2c_device, "fi2cmaster"); + /* register intr handler func */ + FI2cMasterRegisterIntrHandler(&os_i2c_master->i2c_device, FI2C_EVT_MASTER_TRANS_ABORTED, FI2cIntrTxAbrtcallback); + FI2cMasterRegisterIntrHandler(&os_i2c_master->i2c_device, FI2C_EVT_MASTER_READ_DONE, FI2cIntrRxDonecallback); + FI2cMasterRegisterIntrHandler(&os_i2c_master->i2c_device, FI2C_EVT_MASTER_WRITE_DONE, FI2cIntrTxDonecallback); + } + else + { + printf("error_work_mode!\r\n"); + return FREERTOS_I2C_INVAILD_PARAM_ERROR; + } + return FREERTOS_I2C_SUCCESS; +} + +static void I2cInitTask(void *pvParameters) +{ + FError err; + BaseType_t xReturn = pdPASS; + + taskENTER_CRITICAL(); //进入临界区 + + err = FFreeRTOSI2cInitSet(DS_1339_MIO, FI2C_MASTER, RTC_ADDR); + if (err != FREERTOS_I2C_SUCCESS) + { + vPrintf("I2c FFreeRTOSI2cInitSet failed.\r\n"); + return; + } + + xReturn = xTaskCreate((TaskFunction_t)I2cReadTask, /* 任务入口函数 */ + (const char *)"I2cReadTask",/* 任务名字 */ + (uint16_t)1024, /* 任务栈大小 */ + (void *)os_i2c_master,/* 任务入口函数参数 */ + (UBaseType_t)configMAX_PRIORITIES - 2, /* 任务的优先级 */ + (TaskHandle_t *)&read_handle); /* 任务控制 */ + FASSERT_MSG(xReturn == pdPASS, "I2cReadTask creation is failed."); + + xReturn = xTaskCreate((TaskFunction_t)I2cWriteTask, /* 任务入口函数 */ + (const char *)"I2cWriteTask",/* 任务名字 */ + (uint16_t)1024, /* 任务栈大小 */ + (void *)os_i2c_master,/* 任务入口函数参数 */ + (UBaseType_t)configMAX_PRIORITIES - 1, /* 任务的优先级 */ + (TaskHandle_t *)&write_handle); /* 任务控制 */ + FASSERT_MSG(xReturn == pdPASS, "I2cWriteTask creation is failed."); + + taskEXIT_CRITICAL(); //退出临界区 + vTaskDelete(NULL); +} + +BaseType_t FFreeRTOSI2cRtcCreate(void) +{ + BaseType_t xReturn = pdPASS;/* 定义一个创建信息返回值,默认为 pdPASS */ + BaseType_t xTimerStarted = pdPASS; + + taskENTER_CRITICAL(); //进入临界区 + + xReturn = xTaskCreate((TaskFunction_t)I2cInitTask, /* 任务入口函数 */ + (const char *)"I2cInitTask",/* 任务名字 */ + (uint16_t)1024, /* 任务栈大小 */ + (void *)NULL,/* 任务入口函数参数 */ + (UBaseType_t)configMAX_PRIORITIES - 1, /* 任务的优先级 */ + (TaskHandle_t *)&init_handle); /* 任务控制 */ + FASSERT_MSG(xReturn == pdPASS, "I2cInitTask creation is failed."); + + taskEXIT_CRITICAL(); //退出临界区 + printf("I2c task is created successfully.\r\n"); + vTaskDelay(TASK_DELAY_MS*3); + return xReturn; +} + + + + diff --git a/example/peripheral/media/lvgl_demo/README.md b/example/peripheral/media/lvgl_demo/README.md index a3fd8490647e47ac3f972ff283dc1063173133bc..fd77da15b779aa80cc91e8d25f0cd0af684a0096 100644 --- a/example/peripheral/media/lvgl_demo/README.md +++ b/example/peripheral/media/lvgl_demo/README.md @@ -53,13 +53,13 @@ lvgl中widgets属于组件测试,将lvgl中库组件组合运行,此demo属 - 本例子已经提供好具体的编译指令,以下进行介绍: - 1. make 将目录下的工程进行编译 - 2. make clean 将目录下的工程进行清理 - 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - 4. make list_kconfig 当前工程支持哪些配置文件 - 5. make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 - 6. make menuconfig 配置目录下的参数变量 - 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 + - make 将目录下的工程进行编译 + - make clean 将目录下的工程进行清理 + - make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 + - make list_kconfig 当前工程支持哪些配置文件 + - make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 + - make menuconfig 配置目录下的参数变量 + - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - 具体使用方法为: - 在当前目录下 @@ -75,11 +75,11 @@ lvgl中widgets属于组件测试,将lvgl中库组件组合运行,此demo属 >配置成E2000,对于其它平台,使用对应的默认配置 ``` -$ make load_e2000q_aarch32 -$ make menuconfig - -- 在host侧完成构建 +make load_kconfig LOAD_CONFIG_NAME=e2000q_aarch64_demo_media +make menuconfig +make image ``` +- 在host侧完成构建 - 选择即将要运行的例程 ![demo_select](fig/demo_select.png) @@ -101,7 +101,7 @@ sudo service tftpd-hpa restart setenv ipaddr 192.168.4.20 setenv serverip 192.168.4.50 setenv gatewayip 192.168.4.1 -tftpboot 0x90100000 baremetal.elf +tftpboot 0x90100000 freertos.elf bootelf -p 0x90100000 ``` ### 2.4 输出与实验现象 @@ -118,12 +118,12 @@ bootelf -p 0x90100000 Media init 2 640 480 2 32 60 -2 : 通道号 -640 : 宽 -480 : 高 -2 :模式(克隆,水平,垂直) -32 :色深 -60 :刷新率 +- 2 : 通道号 +- 640 : 宽 +- 480 : 高 +- 2 :模式(克隆,水平,垂直) +- 32 :色深 +- 60 :刷新率 初始化LVGL图形库: diff --git a/example/peripheral/media/lvgl_indev/README.md b/example/peripheral/media/lvgl_indev/README.md index 2913103f71c5c289c716f4ede49704046d978b9c..3e5700c9404d8236ed28971f057e9664c64c5d82 100644 --- a/example/peripheral/media/lvgl_indev/README.md +++ b/example/peripheral/media/lvgl_indev/README.md @@ -47,13 +47,13 @@ DC 是一个显示控制器,主要完成将 CPU/GPU/VPU 处理后的图像数 - 本例子已经提供好具体的编译指令,以下进行介绍: - 1. make 将目录下的工程进行编译 - 2. make clean 将目录下的工程进行清理 - 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - 4. make list_kconfig 当前工程支持哪些配置文件 - 5. make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 - 6. make menuconfig 配置目录下的参数变量 - 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 + - make 将目录下的工程进行编译 + - make clean 将目录下的工程进行清理 + - make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 + - make list_kconfig 当前工程支持哪些配置文件 + - make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 + - make menuconfig 配置目录下的参数变量 + - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - 具体使用方法为: - 在当前目录下 @@ -69,11 +69,13 @@ DC 是一个显示控制器,主要完成将 CPU/GPU/VPU 处理后的图像数 >配置成E2000,对于其它平台,使用对应的默认配置 ``` -$ make load_e2000q_aarch32 -$ make menuconfig +make load_kconfig LOAD_CONFIG_NAME=e2000q_aarch64_demo_media +make menuconfig +make image +``` - 在host侧完成构建 -``` + 目前在menuconfig中支持配置色深,色深设置为32,其余设置值为third-party/lvgl-8.3/lv_conf.c设置默认值 在使用过程中, 使用者可根据实际硬件情况以及需要,在third-party/lvgl-8.3/lv_conf.c中进行相应组件配置。 @@ -89,7 +91,7 @@ sudo service tftpd-hpa restart setenv ipaddr 192.168.4.20 setenv serverip 192.168.4.50 setenv gatewayip 192.168.4.1 -tftpboot 0x90100000 baremetal.elf +tftpboot 0x90100000 freertos.elf bootelf -p 0x90100000 ``` ### 2.4 输出与实验现象 @@ -110,12 +112,12 @@ Media init 2 640 480 2 32 60 注:此色深32应与lvgl中的色深参数相等,否则可能出现画面填充错位的现象 -2 : 通道号 -640 : 宽 -480 : 高 -2 :模式(克隆,水平,垂直) -32 :色深 -60 :刷新率 +- 2 : 通道号 +- 640 : 宽 +- 480 : 高 +- 2 :模式(克隆,水平,垂直) +- 32 :色深 +- 60 :刷新率 ![init](fig/media_init.png) diff --git a/example/peripheral/media/media_test/README.md b/example/peripheral/media/media_test/README.md index 229636ef9739e04d68e3932ca2a98d54c1bd1b65..787d0be260966085d9488d6e0c65fe16bf94ab84 100644 --- a/example/peripheral/media/media_test/README.md +++ b/example/peripheral/media/media_test/README.md @@ -49,13 +49,13 @@ DC 是一个显示控制器,主要完成将 CPU/GPU/VPU 处理后的图像数 >依赖哪些驱动、库和第三方组件,如何完成配置(列出需要使能的关键配置项)
- 本例子已经提供好具体的编译指令,以下进行介绍: - 1. make 将目录下的工程进行编译 - 2. make clean 将目录下的工程进行清理 - 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - 4. make list_kconfig 当前工程支持哪些配置文件 - 5. make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 - 6. make menuconfig 配置目录下的参数变量 - 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 + - make 将目录下的工程进行编译 + - make clean 将目录下的工程进行清理 + - make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 + - make list_kconfig 当前工程支持哪些配置文件 + - make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 + - make menuconfig 配置目录下的参数变量 + - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - 具体使用方法为: - 在当前目录下 @@ -71,30 +71,28 @@ DC 是一个显示控制器,主要完成将 CPU/GPU/VPU 处理后的图像数 >配置成E2000,对于其它平台,使用对应的默认配置 ``` -$ make load_e2000q_aarch32 -$ make menuconfig - +make load_kconfig LOAD_CONFIG_NAME=e2000q_aarch64_demo_media +make menuconfig +make image +``` ![use fmedia lib to link](fig/fmedia_lib.jpg) #### 2.3.2 下载过程 - host侧设置重启host侧tftp服务器 -``` +``` sudo service tftpd-hpa restart - ``` - 开发板侧使用bootelf命令跳转 ``` - setenv ipaddr 192.168.4.20 setenv serverip 192.168.4.50 setenv gatewayip 192.168.4.1 -tftpboot 0x90100000 baremetal.elf +tftpboot 0x90100000 freertos.elf bootelf -p 0x90100000 - ``` ### 2.4 输出与实验现象 @@ -113,12 +111,12 @@ Media init 2 640 480 2 32 60 注:此色深32应与lvgl中的色深参数相等,否则可能出现画面填充错位的现象 -2 : 通道号 -640 : 宽 -480 : 高 -2 :模式(克隆,水平,垂直) -32 :色深 -60 :刷新率 +- 2 : 通道号 +- 640 : 宽 +- 480 : 高 +- 2 :模式(克隆,水平,垂直) +- 32 :色深 +- 60 :刷新率 演示一个demo: diff --git a/example/peripheral/pwm/README.md b/example/peripheral/pwm/README.md index 29824532bbe33921b0050ce9ec717db883dab4c2..ae1bf7c524aa3533d0f7f529cac68362fe9b2e5a 100644 --- a/example/peripheral/pwm/README.md +++ b/example/peripheral/pwm/README.md @@ -30,6 +30,20 @@ - CONFIG_TARGET_E2000Q - CONFIG_TARGET_PHYTIUMPI +### 2.1.1 E2000 +- E2000 demo板需外接逻辑分析仪或示波器测试,方法如下 + +![e2000_pwm](./figs/e2000_pwm.png) + +- 上图所示为E2000 J30组引脚,将pwm_out与GND与逻辑分析仪或示波器相连即可 + +### 2.1.2 PhytiumPi +- PhytiumPi需外接逻辑分析仪或示波器测试,方法如下 + +![phytiumpi_pwm](./figs/phytiumpi_pwm.png) + +-上图为PhytiumPi J1组引脚,第33号引脚为pwm(红色标记处)输出引脚,39号引脚(蓝色标记处)为GND,将该引脚与逻辑分析仪或示波器相连即可 + ### 2.2 SDK配置方法 本例程需要, @@ -88,6 +102,9 @@ bootelf -p 0x90100000 ![delete](./figs/delete.png) +- 输出波形如下所示 + +![pwm_out](./figs/pwm_out.png) ## 3. 如何解决问题 - 若不想使能死区输出,可将FFreeRTOSPwmDbSet的部分去除,只需调用FFreeRTOSPwmSet即可。 diff --git a/example/peripheral/pwm/figs/e2000_pwm.png b/example/peripheral/pwm/figs/e2000_pwm.png new file mode 100644 index 0000000000000000000000000000000000000000..c2192d7a07de6475987c5183816a4debfea48152 Binary files /dev/null and b/example/peripheral/pwm/figs/e2000_pwm.png differ diff --git a/example/peripheral/pwm/figs/phytiumpi_pwm.png b/example/peripheral/pwm/figs/phytiumpi_pwm.png new file mode 100644 index 0000000000000000000000000000000000000000..033e80f72cc2b1fae9e492e3e07737be7bf0b2f0 Binary files /dev/null and b/example/peripheral/pwm/figs/phytiumpi_pwm.png differ diff --git a/example/peripheral/pwm/figs/pwm_out.png b/example/peripheral/pwm/figs/pwm_out.png new file mode 100644 index 0000000000000000000000000000000000000000..6e95e85170a03ca8c0c2798e1d46329925ea9a01 Binary files /dev/null and b/example/peripheral/pwm/figs/pwm_out.png differ diff --git a/example/peripheral/qspi/README.md b/example/peripheral/qspi/README.md index 2b870fd9e9e2d8602bc994792faae291bf3d130e..b734e949b00ea479ef68bc89d64e888fd066e297 100644 --- a/example/peripheral/qspi/README.md +++ b/example/peripheral/qspi/README.md @@ -11,7 +11,7 @@ E2000D上使用的Nor Flash介质型号是GD25Q128,容量为16MB; ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(FT2000-4/D2000/E2000D/E2000Q/PhytiumPi) +- Phytium开发板:FT2000-4/D2000/E2000D/E2000Q/PhytiumPi(包含QSPI-FLASH芯片座) - [Phytium freeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk) - [Phytium standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) ### 2.1 硬件配置方法 diff --git a/example/peripheral/qspi/makefile b/example/peripheral/qspi/makefile index 03b5b5f1191ca6b52759850f9b37fb4d9969917f..02a36e43e035060c37c71b6e180110fb293ad571 100644 --- a/example/peripheral/qspi/makefile +++ b/example/peripheral/qspi/makefile @@ -8,14 +8,12 @@ BOOT_IMG_NAME ?= freertos USER_CSRC := main.c USER_CSRC += $(wildcard src/*.c) -USER_CSRC += $(wildcard ../common/*.c) USER_ASRC := USER_CXXSRC := USER_INCLUDE := $(PROJECT_DIR) \ - $(PROJECT_DIR)/inc \ - $(PROJECT_DIR)/../common + $(PROJECT_DIR)/inc include $(FREERTOS_SDK_DIR)/tools/makeall.mk diff --git a/example/peripheral/sdio/README.md b/example/peripheral/sdio/README.md index ad161f743bc00adc383a1a439f2508615030e5b7..ad0de625d009e5100e0ecf4e8bae422beac93a26 100644 --- a/example/peripheral/sdio/README.md +++ b/example/peripheral/sdio/README.md @@ -4,8 +4,8 @@ SD存储卡(Secure Digital Memory Card), 是一种基于半导体快闪记忆器的新一代记忆设备,由于它体积小、数据传输速度快、可热插拔等优良的特性,被广泛地于便携式装置上使用, 本例程提供了两类常见SD存储设备的读写支持, -- TF(Transflash Card)卡,也称 MicroSD卡,体积为15mm x 11mm x 1mm,主要配合卡套,实现可扩展的存储器 -- eMMC (Embedded Multi Media Card)卡,主要实现的内嵌式存储器标准规格 +- TF(Transflash Card)卡,也称 MicroSD卡,体积为15mm x 11mm x 1mm,主要配合卡套,实现可扩展的存储器 +- eMMC (Embedded Multi Media Card)卡,主要实现的内嵌式存储器标准规格 TF 卡和 eMMC 卡的常见容量包括 4G、8G、16G、32G、64G 和 128G @@ -14,7 +14,7 @@ SD卡的通信依赖三种数据格式:命令包,响应包,数据包,控 ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(E2000) +- Phytium开发板(E2000D/E2000Q/PhytiumPi) - [Phytium FreeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk) - [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) @@ -24,11 +24,15 @@ SD卡的通信依赖三种数据格式:命令包,响应包,数据包,控 本例程支持的硬件平台包括 -- E2000 +- E2000D +- E2000Q +- PHYTIUMPI 对应的配置项是, -- CONFIG_TARGET_E2000 +- CONFIG_TARGET_E2000D +- CONFIG_TARGET_E2000Q +- CONFIG_TARGET_PHYTIUMPI 本例程在 E2000-测试板B上完成测试,在测试板B上,SD-0控制器连接TF卡,SD-1控制器连接eMMC @@ -68,7 +72,7 @@ SD卡的通信依赖三种数据格式:命令包,响应包,数据包,控 - 选择目标平台 ``` -make load_e2000q_aarch64 +make load_kconfig LOAD_CONFIG_NAME=e2000q_aarch64_demo_sdio ``` - 选择例程需要的配置 @@ -105,6 +109,7 @@ bootelf -p 0xa0100000 ### 2.4 输出与实验现象 - 系统进入后,创建任务初始化tf卡,循环读写Tf卡中第3~6块的内容 +>注意:飞腾派上没有emmc,作为外插的sd口连接控制器0,且使用tf卡进行读写操作时需要避开固件存储的范围,请使用命令:sd wr 0 tf 10485760 3 ``` sd wr 1 tf 3 3 @@ -113,6 +118,7 @@ sd wr 1 tf 3 3 ![tf](./figs/tf_wr.png) - 系统进入后,创建任务初始化eMMC,循环读写eMMC中第7~9块的内容 +>注意:飞腾派上没有emmc,无法使用下面的命令 ``` sd wr 0 emmc 7 3 diff --git a/example/peripheral/sdio/main.c b/example/peripheral/sdio/main.c index 71a28ae64e399cbcce144f3b9fbf33285bcdf7dc..e8ce4b27e36c7d85929435354d3b88f0a77e2c77 100644 --- a/example/peripheral/sdio/main.c +++ b/example/peripheral/sdio/main.c @@ -41,8 +41,6 @@ int main(void) /* board init */ sdmmc_sys_init(); - ret = FFreeRTOSSdWriteRead(1U, FALSE, 0, 4); - vTaskStartScheduler(); while (1); diff --git a/example/peripheral/spi/README.md b/example/peripheral/spi/README.md index c313d5b0863eaa2c92dc53678b746bb2b658992b..15c61bb2d96ee3854696125ab98a9536dba5ac2e 100644 --- a/example/peripheral/spi/README.md +++ b/example/peripheral/spi/README.md @@ -9,9 +9,10 @@ ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(E2000) +- Phytium开发板(E2000D/E2000Q/FT2000-4/D2000/PhytiumPi) - [Phytium FreeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk) - [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) +- Flash芯片 ### 2.1 硬件配置方法 @@ -27,7 +28,19 @@ - CONFIG_TARGET_D2000 - CONFIG_TARGET_PHYTIUMPI -本例程在 E2000-测试板A上完成测试 +### 2.1.1 E2000 +- E2000 demo板需使用杜邦线外接Flash进行测试,方法如下 + +![e2000_spi_flash](./figs/e2000_spi_flash.png) + +- 上图为E2000开发板J30与SPI引脚对应图,将flash芯片使用外接连接即可 + +### 2.1.2 PhytiumPi +- PhytiumPi需使用杜邦线外接Flash进行测试,方法如下 + +![phytiumpi_spi_flash](./figs/phytiumpi_spi_flash.png) + +- 上图为PhytiumPi开发板J1与SPI引脚对应图,将flash芯片使用外接连接即可 ### 2.2 SDK配置方法 diff --git a/example/peripheral/spi/figs/e2000_spi_flash.png b/example/peripheral/spi/figs/e2000_spi_flash.png new file mode 100644 index 0000000000000000000000000000000000000000..c50b4391dccaa0b3785c39ab49a2abe77cbe5c5a Binary files /dev/null and b/example/peripheral/spi/figs/e2000_spi_flash.png differ diff --git a/example/peripheral/spi/figs/phytiumpi_spi_flash.png b/example/peripheral/spi/figs/phytiumpi_spi_flash.png new file mode 100644 index 0000000000000000000000000000000000000000..7453e192c173179566d7b948cf391b64527141bb Binary files /dev/null and b/example/peripheral/spi/figs/phytiumpi_spi_flash.png differ diff --git a/example/peripheral/timer_tacho/README.md b/example/peripheral/timer_tacho/README.md index 23b2995931900259a637c8f0c71b06acc2054fab..bfdc16b5693d77f1a3406922c905c58b67c3c335 100644 --- a/example/peripheral/timer_tacho/README.md +++ b/example/peripheral/timer_tacho/README.md @@ -21,7 +21,8 @@ E2000DQ上使用的demo板上的 PWM-IN12(tacho—in12) 进行测试。 对应的配置项是 -- CONFIG_TARGET_E2000D、 CONFIG_TARGET_E2000Q +- CONFIG_TARGET_E2000D、 CONFIG_TARGET_E2000Q +- CONFIG_TARGET_PHYTIUMPI ### 2.1.1 硬件连线 @@ -29,6 +30,10 @@ E2000DQ上使用的demo板上的 PWM-IN12(tacho—in12) 进行测试。 ![hardware_e2000](./figs/tacho_hdw.png) +- PHYTIUMPI 硬件连线 + +![hardware_phytiumpi](./figs/phytiumpi_tacho.png) + ### 2.2 SDK配置方法 本例程需要, @@ -42,7 +47,7 @@ E2000DQ上使用的demo板上的 PWM-IN12(tacho—in12) 进行测试。 - make clean 将目录下的工程进行清理 - make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - make list_kconfig 当前工程支持哪些配置文件 -- make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 +- make load_kconfig LOAD_CONFIG_NAME=< kconfig configuration files > 将预设配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 diff --git a/example/peripheral/timer_tacho/figs/phytiumpi_tacho.png b/example/peripheral/timer_tacho/figs/phytiumpi_tacho.png new file mode 100644 index 0000000000000000000000000000000000000000..228c8e2eb0b311196031587648c1b63bc0468622 Binary files /dev/null and b/example/peripheral/timer_tacho/figs/phytiumpi_tacho.png differ diff --git a/example/peripheral/timer_tacho/makefile b/example/peripheral/timer_tacho/makefile index 13c14898d0f8ad5159f3e5baa6067deda58349eb..f97df75c431a0c0cd79668750744b79a9ccff765 100644 --- a/example/peripheral/timer_tacho/makefile +++ b/example/peripheral/timer_tacho/makefile @@ -8,7 +8,7 @@ BOOT_IMG_NAME ?= freertos USER_CSRC := main.c USER_CSRC += $(wildcard src/*.c) -USER_CSRC += $(wildcard ../common/*.c) + USER_ASRC := USER_CXXSRC := diff --git a/example/peripheral/usb/cherryusb_host/README.md b/example/peripheral/usb/cherryusb_host/README.md index ea43969b7c70dc15746148d88d799f302198aa5c..e5fc171de1bb39c7fedf3f4f0d416c222116d969 100644 --- a/example/peripheral/usb/cherryusb_host/README.md +++ b/example/peripheral/usb/cherryusb_host/README.md @@ -27,17 +27,17 @@ CherryUSB 是一个用于嵌入式系统 USB 协议栈,支持运行在Host模 - Letter Shell组件,依赖 USE_LETTER_SHELL 本例子已经提供好具体的编译指令,以下进行介绍: - 1. make 将目录下的工程进行编译 - 2. make clean 将目录下的工程进行清理 - 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - 4. make list_kconfig 当前工程支持哪些配置文件 - 5. make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 - 6. make menuconfig 配置目录下的参数变量 - 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - -- 具体使用方法为: - - 在当前目录下 - - 执行以上指令 +- make 将目录下的工程进行编译 +- make clean 将目录下的工程进行清理 +- make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 +- make list_kconfig 当前工程支持哪些配置文件 +- make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 +- make menuconfig 配置目录下的参数变量 +- make backup_kconfig 将目录下的sdkconfig 备份到./configs下 + +具体使用方法为: +- 在当前目录下 +- 执行以上指令 ### 2.3 构建和下载 @@ -47,7 +47,7 @@ CherryUSB 是一个用于嵌入式系统 USB 协议栈,支持运行在Host模 - 选择目标平台和例程需要的配置 ``` -make load_e2000d_aarch64 +make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_cherry_usb ``` - 进行编译 @@ -121,7 +121,7 @@ usb mouse /usb1/mouse1 ![usb_mouse_input](./figs/usb_mouse_input.png) -- 上图中,首先打印的是通过 USB 键盘输入的字符串,已经一系列特殊字符,然后是鼠标的输入,x和y是鼠标的平面坐标位置,w是鼠标中间滚轮的位置,<-、-> 和 C 分别是按下鼠标左、右键和中间滚轮后的返回 +- 上图中,首先打印的是通过 USB 键盘输入的字符串,以及一系列特殊字符,然后是鼠标的输入,x和y是鼠标的平面坐标位置,w是鼠标中间滚轮的位置,<-、-> 和 C 分别是按下鼠标左、右键和中间滚轮后的返回 ## 3. 如何解决问题 diff --git a/example/storage/fatfs/READEME.md b/example/storage/fatfs/README.md similarity index 94% rename from example/storage/fatfs/READEME.md rename to example/storage/fatfs/README.md index 984b49677f998a094770e573213a2cb59c4e6f99..ecaaaa7a6adcad8ae7302782106cb6c84646bf6c 100644 --- a/example/storage/fatfs/READEME.md +++ b/example/storage/fatfs/README.md @@ -9,7 +9,7 @@ ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(E2000D/E2000Q) +- Phytium开发板(E2000D/E2000Q/PhytiumPi) - [Phytium freeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk) - [Phytium standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) @@ -18,11 +18,14 @@ ### 2.1 硬件配置方法 本例程支持的硬件平台包括 -- E2000D、E2000Q开发板 +- E2000D、E2000Q、PhytiumPi开发板 + +注:为防止破坏固件Phytium目前仅支持使用RAM测试 对应的配置项是 - CONFIG_TARGET_E2000D - CONFIG_TARGET_E2000Q +- CONFIG_TARGET_PHYTIUMPI ### 2.2 SDK配置方法 diff --git a/example/storage/fatfs/configs/phytiumpi_aarch32_firefly_fatfs.config b/example/storage/fatfs/configs/phytiumpi_aarch32_firefly_fatfs.config new file mode 100644 index 0000000000000000000000000000000000000000..e43676f5622dc08434ae762434b9dcbb97247d33 --- /dev/null +++ b/example/storage/fatfs/configs/phytiumpi_aarch32_firefly_fatfs.config @@ -0,0 +1,406 @@ + +# +# Project Configuration +# +CONFIG_FATFS_BASIC_TEST=y +CONFIG_FATFS_SPEED_TEST=y +CONFIG_FATFS_CYCLE_TEST=y +# end of Project Configuration + +CONFIG_USE_FREERTOS=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +# CONFIG_ARCH_ARMV8_AARCH64 is not set +CONFIG_ARCH_ARMV8_AARCH32=y + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH32=y +CONFIG_ARCH_EXECUTION_STATE="aarch32" + +# +# Fpu configuration +# +# CONFIG_ARCH_FPU_VFP_V3 is not set +CONFIG_ARCH_FPU_VFP_V4=y +CONFIG_ARM_DPFPU32=y +# CONFIG_ARM_FPU_ABI_SOFT is not set +CONFIG_ARM_FPU_SYMBOL="crypto-neon-fp-armv8" +CONFIG_ARM_NEON=y +CONFIG_ARCH_FPU=y +# end of Fpu configuration +# end of Compiler configuration + +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# end of Arm architecture configuration +# end of Arch configuration + +# +# Soc configuration +# +CONFIG_TARGET_PHYTIUMPI=y +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +# CONFIG_TARGET_FT2004 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_SOC_NAME="phytiumpi" +CONFIG_SOC_CORE_NUM=4 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_E2000=y +# CONFIG_USE_SPINLOCK is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Soc configuration + +# +# Board Configuration +# +CONFIG_BOARD_NAME="firefly" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +# CONFIG_USE_UART_IOPAD is not set +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_FIREFLY_DEMO_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +CONFIG_TARGET_NAME="fatfs" +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +CONFIG_LOG_ERROR=y +# CONFIG_LOG_NONE is not set +CONFIG_LOG_EXTRA_INFO=y +# CONFIG_LOG_DISPALY_CORE_NUM is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# end of Sdk common configuration + +# +# Image information configuration +# +# CONFIG_IMAGE_INFO is not set +# end of Image information configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI is not set +CONFIG_USE_GIC=y +CONFIG_ENABLE_GICV3=y +CONFIG_USE_SERIAL=y + +# +# Usart Configuration +# +CONFIG_ENABLE_Pl011_UART=y +# end of Usart Configuration + +# CONFIG_USE_GPIO is not set +# CONFIG_USE_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO is not set +CONFIG_USE_SDMMC=y +# CONFIG_ENABLE_FSDMMC is not set +CONFIG_ENABLE_FSDIO=y +# CONFIG_USE_PCIE is not set +# CONFIG_USE_WDT is not set +# CONFIG_USE_DMA is not set +# CONFIG_USE_NAND is not set +# CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +# CONFIG_USE_SCMI_MHU is not set +# end of Drivers configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +CONFIG_OUTPUT_BINARY=y + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_WALL_WARNING_ERROR is not set +# CONFIG_STRICT_PROTOTYPES is not set +# CONFIG_DEBUG_SYMBOLS is not set +# CONFIG_FRAME_POINTER is not set +# CONFIG_OUTPUT_ASM_DIS is not set +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USB_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0x80100000 +CONFIG_IMAGE_MAX_LENGTH=0x2000000 +CONFIG_HEAP_SIZE=2 +CONFIG_SVC_STACK_SIZE=0x1000 +CONFIG_SYS_STACK_SIZE=0x1000 +CONFIG_IRQ_STACK_SIZE=0x1000 +CONFIG_ABORT_STACK_SIZE=0x1000 +CONFIG_FIQ_STACK_SIZE=0x1000 +CONFIG_UNDEF_STACK_SIZE=0x1000 +# end of Linker Options +# end of Build setup + +# +# Component Configuration +# + +# +# Freertos Uart Drivers +# +CONFIG_FREERTOS_USE_UART=y +# end of Freertos Uart Drivers + +# +# Freertos Pwm Drivers +# +# CONFIG_FREERTOS_USE_PWM is not set +# end of Freertos Pwm Drivers + +# +# Freertos Qspi Drivers +# +# CONFIG_FREERTOS_USE_QSPI is not set +# end of Freertos Qspi Drivers + +# +# Freertos Wdt Drivers +# +# CONFIG_FREERTOS_USE_WDT is not set +# end of Freertos Wdt Drivers + +# +# Freertos Eth Drivers +# +# CONFIG_FREERTOS_USE_XMAC is not set +# CONFIG_FREERTOS_USE_GMAC is not set +# end of Freertos Eth Drivers + +# +# Freertos Gpio Drivers +# +# CONFIG_FREERTOS_USE_GPIO is not set +# end of Freertos Gpio Drivers + +# +# Freertos Spim Drivers +# +# CONFIG_FREERTOS_USE_FSPIM is not set +# end of Freertos Spim Drivers + +# +# Freertos DMA Drivers +# +# CONFIG_FREERTOS_USE_FDDMA is not set +# CONFIG_FREERTOS_USE_FGDMA is not set +# end of Freertos DMA Drivers + +# +# Freertos Adc Drivers +# +# CONFIG_FREERTOS_USE_ADC is not set +# end of Freertos Adc Drivers + +# +# Freertos Can Drivers +# +# CONFIG_FREERTOS_USE_CAN is not set +# end of Freertos Can Drivers + +# +# Freertos I2c Drivers +# +# CONFIG_FREERTOS_USE_I2C is not set +# end of Freertos I2c Drivers + +# +# Freertos Mio Drivers +# +# CONFIG_FREERTOS_USE_MIO is not set +# end of Freertos Mio Drivers + +# +# Freertos Timer Drivers +# +# CONFIG_FREERTOS_USE_TIMER is not set +# end of Freertos Timer Drivers + +# +# Freertos Media Drivers +# +# CONFIG_FREERTOS_USE_MEDIA is not set +# end of Freertos Media Drivers +# end of Component Configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration + +# CONFIG_USE_AMP is not set +CONFIG_USE_SDMMC_CMD=y + +# +# Sdmmc configuration +# +# CONFIG_SDMMC_USE_FSDMMC is not set +CONFIG_SDMMC_USE_FSDIO=y +# end of Sdmmc configuration + +# CONFIG_USE_YMODEM is not set +# CONFIG_USE_SFUD is not set +CONFIG_USE_BACKTRACE=y +CONFIG_USE_FATFS_0_1_4=y + +# +# FATFS Configuration (0.1.4) +# +CONFIG_FATFS_RAM_DISK=y + +# +# RAM Disk Configuration +# +CONFIG_FATFS_RAM_DISK_BASE=0xa0000000 +CONFIG_FATFS_RAM_DISK_SIZE_MB=500 +CONFIG_FATFS_RAM_DISK_SECTOR_SIZE_BYTE=512 +# end of RAM Disk Configuration + +# CONFIG_FATFS_SDMMC_FSDIO_TF is not set +# CONFIG_FATFS_SDMMC_FSDIO_EMMC is not set +# CONFIG_FATFS_SDMMC_FSDMMC_TF is not set +# CONFIG_FATFS_SATA_DISK is not set +# CONFIG_FATFS_USB is not set +CONFIG_FATFS_VOLUME_COUNT=10 +# CONFIG_FATFS_LFN_NONE is not set +CONFIG_FATFS_LFN_HEAP=y +# CONFIG_FATFS_LFN_STACK is not set +CONFIG_FATFS_MAX_LFN=255 +CONFIG_FATFS_FS_LOCK=0 +CONFIG_FATFS_TIMEOUT_MS=10000 +CONFIG_FATFS_PER_FILE_CACHE=y +CONFIG_FATFS_ALLOC_PREFER_MEMP=y +CONFIG_FATFS_MEMP_SIZE=2 +# end of FATFS Configuration (0.1.4) + +CONFIG_USE_TLSF=y +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_CHERRY_USB is not set +# end of Third-party configuration + +# +# Kernel Configuration +# +CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y +CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_MAX_PRIORITIES=32 +CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=13 +CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=11 +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_MINIMAL_TASK_STACKSIZE=1024 +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=32 +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y +CONFIG_FREERTOS_USE_TRACE_FACILITY=y +CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y +# CONFIG_FREERTOS_USE_TICKLESS_IDLE is not set +CONFIG_FREERTOS_TOTAL_HEAP_SIZE=10240 +CONFIG_FREERTOS_TASK_FPU_SUPPORT=1 +# end of Kernel Configuration diff --git a/example/storage/fatfs/configs/phytiumpi_aarch64_firefly_fatfs.config b/example/storage/fatfs/configs/phytiumpi_aarch64_firefly_fatfs.config new file mode 100644 index 0000000000000000000000000000000000000000..cab86f47128ce2318df484815aae11b90431770e --- /dev/null +++ b/example/storage/fatfs/configs/phytiumpi_aarch64_firefly_fatfs.config @@ -0,0 +1,404 @@ + +# +# Project Configuration +# +CONFIG_FATFS_BASIC_TEST=y +CONFIG_FATFS_SPEED_TEST=y +CONFIG_FATFS_CYCLE_TEST=y +# end of Project Configuration + +CONFIG_USE_FREERTOS=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +CONFIG_ARCH_ARMV8_AARCH64=y +# CONFIG_ARCH_ARMV8_AARCH32 is not set + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_ARCH_EXECUTION_STATE="aarch64" + +# +# Fpu configuration +# +CONFIG_ARM_NEON=y +# end of Fpu configuration + +CONFIG_ARM_CRC=y +CONFIG_ARM_CRYPTO=y +CONFIG_ARM_FLOAT_POINT=y +# CONFIG_GCC_CODE_MODEL_TINY is not set +CONFIG_GCC_CODE_MODEL_SMALL=y +# CONFIG_GCC_CODE_MODEL_LARGE is not set +# end of Compiler configuration + +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +# CONFIG_BOOT_WITH_FLUSH_CACHE is not set +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arm architecture configuration +# end of Arch configuration + +# +# Soc configuration +# +CONFIG_TARGET_PHYTIUMPI=y +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +# CONFIG_TARGET_FT2004 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_SOC_NAME="phytiumpi" +CONFIG_SOC_CORE_NUM=4 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_E2000=y +# CONFIG_USE_SPINLOCK is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Soc configuration + +# +# Board Configuration +# +CONFIG_BOARD_NAME="firefly" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +# CONFIG_USE_UART_IOPAD is not set +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_FIREFLY_DEMO_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +CONFIG_TARGET_NAME="fatfs" +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +CONFIG_LOG_ERROR=y +# CONFIG_LOG_NONE is not set +CONFIG_LOG_EXTRA_INFO=y +# CONFIG_LOG_DISPALY_CORE_NUM is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# end of Sdk common configuration + +# +# Image information configuration +# +# CONFIG_IMAGE_INFO is not set +# end of Image information configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI is not set +CONFIG_USE_GIC=y +CONFIG_ENABLE_GICV3=y +CONFIG_USE_SERIAL=y + +# +# Usart Configuration +# +CONFIG_ENABLE_Pl011_UART=y +# end of Usart Configuration + +# CONFIG_USE_GPIO is not set +# CONFIG_USE_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO is not set +CONFIG_USE_SDMMC=y +# CONFIG_ENABLE_FSDMMC is not set +CONFIG_ENABLE_FSDIO=y +# CONFIG_USE_PCIE is not set +# CONFIG_USE_WDT is not set +# CONFIG_USE_DMA is not set +# CONFIG_USE_NAND is not set +# CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +# CONFIG_USE_SCMI_MHU is not set +# end of Drivers configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +CONFIG_OUTPUT_BINARY=y + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_WALL_WARNING_ERROR is not set +# CONFIG_STRICT_PROTOTYPES is not set +# CONFIG_DEBUG_SYMBOLS is not set +# CONFIG_FRAME_POINTER is not set +# CONFIG_OUTPUT_ASM_DIS is not set +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USB_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0x80100000 +CONFIG_IMAGE_MAX_LENGTH=0x2000000 +CONFIG_HEAP_SIZE=2 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 +# end of Linker Options +# end of Build setup + +# +# Component Configuration +# + +# +# Freertos Uart Drivers +# +CONFIG_FREERTOS_USE_UART=y +# end of Freertos Uart Drivers + +# +# Freertos Pwm Drivers +# +# CONFIG_FREERTOS_USE_PWM is not set +# end of Freertos Pwm Drivers + +# +# Freertos Qspi Drivers +# +# CONFIG_FREERTOS_USE_QSPI is not set +# end of Freertos Qspi Drivers + +# +# Freertos Wdt Drivers +# +# CONFIG_FREERTOS_USE_WDT is not set +# end of Freertos Wdt Drivers + +# +# Freertos Eth Drivers +# +# CONFIG_FREERTOS_USE_XMAC is not set +# CONFIG_FREERTOS_USE_GMAC is not set +# end of Freertos Eth Drivers + +# +# Freertos Gpio Drivers +# +# CONFIG_FREERTOS_USE_GPIO is not set +# end of Freertos Gpio Drivers + +# +# Freertos Spim Drivers +# +# CONFIG_FREERTOS_USE_FSPIM is not set +# end of Freertos Spim Drivers + +# +# Freertos DMA Drivers +# +# CONFIG_FREERTOS_USE_FDDMA is not set +# CONFIG_FREERTOS_USE_FGDMA is not set +# end of Freertos DMA Drivers + +# +# Freertos Adc Drivers +# +# CONFIG_FREERTOS_USE_ADC is not set +# end of Freertos Adc Drivers + +# +# Freertos Can Drivers +# +# CONFIG_FREERTOS_USE_CAN is not set +# end of Freertos Can Drivers + +# +# Freertos I2c Drivers +# +# CONFIG_FREERTOS_USE_I2C is not set +# end of Freertos I2c Drivers + +# +# Freertos Mio Drivers +# +# CONFIG_FREERTOS_USE_MIO is not set +# end of Freertos Mio Drivers + +# +# Freertos Timer Drivers +# +# CONFIG_FREERTOS_USE_TIMER is not set +# end of Freertos Timer Drivers + +# +# Freertos Media Drivers +# +# CONFIG_FREERTOS_USE_MEDIA is not set +# end of Freertos Media Drivers +# end of Component Configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration + +# CONFIG_USE_AMP is not set +CONFIG_USE_SDMMC_CMD=y + +# +# Sdmmc configuration +# +# CONFIG_SDMMC_USE_FSDMMC is not set +CONFIG_SDMMC_USE_FSDIO=y +# end of Sdmmc configuration + +# CONFIG_USE_YMODEM is not set +# CONFIG_USE_SFUD is not set +CONFIG_USE_BACKTRACE=y +CONFIG_USE_FATFS_0_1_4=y + +# +# FATFS Configuration (0.1.4) +# +CONFIG_FATFS_RAM_DISK=y + +# +# RAM Disk Configuration +# +CONFIG_FATFS_RAM_DISK_BASE=0xa0000000 +CONFIG_FATFS_RAM_DISK_SIZE_MB=500 +CONFIG_FATFS_RAM_DISK_SECTOR_SIZE_BYTE=512 +# end of RAM Disk Configuration + +# CONFIG_FATFS_SDMMC_FSDIO_TF is not set +# CONFIG_FATFS_SDMMC_FSDIO_EMMC is not set +# CONFIG_FATFS_SDMMC_FSDMMC_TF is not set +# CONFIG_FATFS_SATA_DISK is not set +# CONFIG_FATFS_USB is not set +CONFIG_FATFS_VOLUME_COUNT=10 +# CONFIG_FATFS_LFN_NONE is not set +CONFIG_FATFS_LFN_HEAP=y +# CONFIG_FATFS_LFN_STACK is not set +CONFIG_FATFS_MAX_LFN=255 +CONFIG_FATFS_FS_LOCK=0 +CONFIG_FATFS_TIMEOUT_MS=10000 +CONFIG_FATFS_PER_FILE_CACHE=y +CONFIG_FATFS_ALLOC_PREFER_MEMP=y +CONFIG_FATFS_MEMP_SIZE=2 +# end of FATFS Configuration (0.1.4) + +CONFIG_USE_TLSF=y +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_CHERRY_USB is not set +# end of Third-party configuration + +# +# Kernel Configuration +# +CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y +CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_MAX_PRIORITIES=32 +CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=13 +CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=11 +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_MINIMAL_TASK_STACKSIZE=1024 +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=32 +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y +CONFIG_FREERTOS_USE_TRACE_FACILITY=y +CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y +# CONFIG_FREERTOS_USE_TICKLESS_IDLE is not set +CONFIG_FREERTOS_TOTAL_HEAP_SIZE=10240 +CONFIG_FREERTOS_TASK_FPU_SUPPORT=1 +# end of Kernel Configuration diff --git a/example/storage/fatfs/sdkconfig b/example/storage/fatfs/sdkconfig index 67b629de634544ef6f002d6be252c4de64990cb2..e43676f5622dc08434ae762434b9dcbb97247d33 100644 --- a/example/storage/fatfs/sdkconfig +++ b/example/storage/fatfs/sdkconfig @@ -3,8 +3,8 @@ # Project Configuration # CONFIG_FATFS_BASIC_TEST=y -# CONFIG_FATFS_SPEED_TEST is not set -# CONFIG_FATFS_CYCLE_TEST is not set +CONFIG_FATFS_SPEED_TEST=y +CONFIG_FATFS_CYCLE_TEST=y # end of Project Configuration CONFIG_USE_FREERTOS=y @@ -18,8 +18,8 @@ CONFIG_ARCH_NAME="armv8" # # Arm architecture configuration # -CONFIG_ARCH_ARMV8_AARCH64=y -# CONFIG_ARCH_ARMV8_AARCH32 is not set +# CONFIG_ARCH_ARMV8_AARCH64 is not set +CONFIG_ARCH_ARMV8_AARCH32=y # # Compiler configuration @@ -27,41 +27,38 @@ CONFIG_ARCH_ARMV8_AARCH64=y CONFIG_ARM_GCC_SELECT=y # CONFIG_ARM_CLANG_SELECT is not set CONFIG_TOOLCHAIN_NAME="gcc" -CONFIG_TARGET_ARMV8_AARCH64=y -CONFIG_ARCH_EXECUTION_STATE="aarch64" +CONFIG_TARGET_ARMV8_AARCH32=y +CONFIG_ARCH_EXECUTION_STATE="aarch32" # # Fpu configuration # +# CONFIG_ARCH_FPU_VFP_V3 is not set +CONFIG_ARCH_FPU_VFP_V4=y +CONFIG_ARM_DPFPU32=y +# CONFIG_ARM_FPU_ABI_SOFT is not set +CONFIG_ARM_FPU_SYMBOL="crypto-neon-fp-armv8" CONFIG_ARM_NEON=y +CONFIG_ARCH_FPU=y # end of Fpu configuration - -CONFIG_ARM_CRC=y -CONFIG_ARM_CRYPTO=y -CONFIG_ARM_FLOAT_POINT=y -# CONFIG_GCC_CODE_MODEL_TINY is not set -CONFIG_GCC_CODE_MODEL_SMALL=y -# CONFIG_GCC_CODE_MODEL_LARGE is not set # end of Compiler configuration CONFIG_USE_CACHE=y CONFIG_USE_MMU=y -# CONFIG_BOOT_WITH_FLUSH_CACHE is not set -# CONFIG_MMU_DEBUG_PRINTS is not set +CONFIG_USE_AARCH64_L1_TO_AARCH32=y # end of Arm architecture configuration # end of Arch configuration # # Soc configuration # -# CONFIG_TARGET_PHYTIUMPI is not set -CONFIG_TARGET_E2000Q=y +CONFIG_TARGET_PHYTIUMPI=y +# CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set # CONFIG_TARGET_FT2004 is not set # CONFIG_TARGET_D2000 is not set -CONFIG_SOC_NAME="e2000" -CONFIG_TARGET_TYPE_NAME="q" +CONFIG_SOC_NAME="phytiumpi" CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 @@ -77,7 +74,7 @@ CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # # Board Configuration # -CONFIG_BOARD_NAME="demo" +CONFIG_BOARD_NAME="firefly" # CONFIG_USE_SPI_IOPAD is not set # CONFIG_USE_GPIO_IOPAD is not set # CONFIG_USE_CAN_IOPAD is not set @@ -87,7 +84,7 @@ CONFIG_BOARD_NAME="demo" # CONFIG_USE_TACHO_IOPAD is not set # CONFIG_USE_UART_IOPAD is not set # CONFIG_USE_THIRD_PARTY_IOPAD is not set -CONFIG_E2000Q_DEMO_BOARD=y +CONFIG_FIREFLY_DEMO_BOARD=y # # IO mux configuration when board start up @@ -217,8 +214,12 @@ CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0x80100000 CONFIG_IMAGE_MAX_LENGTH=0x2000000 CONFIG_HEAP_SIZE=2 -CONFIG_STACK_SIZE=0x100000 -CONFIG_FPU_STACK_SIZE=0x1000 +CONFIG_SVC_STACK_SIZE=0x1000 +CONFIG_SYS_STACK_SIZE=0x1000 +CONFIG_IRQ_STACK_SIZE=0x1000 +CONFIG_ABORT_STACK_SIZE=0x1000 +CONFIG_FIQ_STACK_SIZE=0x1000 +CONFIG_UNDEF_STACK_SIZE=0x1000 # end of Linker Options # end of Build setup @@ -356,20 +357,11 @@ CONFIG_FATFS_RAM_DISK_SIZE_MB=500 CONFIG_FATFS_RAM_DISK_SECTOR_SIZE_BYTE=512 # end of RAM Disk Configuration -CONFIG_FATFS_SDMMC=y -CONFIG_FATFS_SDMMC_FSDIO_TF=y -CONFIG_FATFS_SDMMC_FSDIO_EMMC=y +# CONFIG_FATFS_SDMMC_FSDIO_TF is not set +# CONFIG_FATFS_SDMMC_FSDIO_EMMC is not set # CONFIG_FATFS_SDMMC_FSDMMC_TF is not set -CONFIG_FATFS_SATA_DISK=y - -# -# SATA Disk Configuration -# -# CONFIG_FATFS_FSATA is not set -# CONFIG_FATFS_FSATA_PCIE is not set -# end of SATA Disk Configuration - -CONFIG_FATFS_USB=y +# CONFIG_FATFS_SATA_DISK is not set +# CONFIG_FATFS_USB is not set CONFIG_FATFS_VOLUME_COUNT=10 # CONFIG_FATFS_LFN_NONE is not set CONFIG_FATFS_LFN_HEAP=y @@ -387,22 +379,7 @@ CONFIG_USE_TLSF=y # CONFIG_USE_LITTLE_FS is not set # CONFIG_USE_LVGL is not set # CONFIG_USE_FREEMODBUS is not set -CONFIG_USE_CHERRY_USB=y - -# -# CherryUSB Configuration -# -CONFIG_CHERRY_USB_PORT_XHCI=y -# CONFIG_CHERRY_USB_PORT_PHYTIUM_OTG is not set -CONFIG_CHERRYUSB_HOST=y -# CONFIG_CHERRYUSB_DEVICE is not set -CONFIG_CHERRY_USB_HOST_HUB=y -CONFIG_CHERRY_USB_HOST_MSC=y -# CONFIG_CHERRY_USB_HOST_HID is not set -# CONFIG_CHERRY_USB_HOST_VEDIO is not set -# CONFIG_CHERRY_USB_HOST_CDC is not set -# CONFIG_CHERRY_USB_HOST_RNDIS_WIRELESS is not set -# end of CherryUSB Configuration +# CONFIG_USE_CHERRY_USB is not set # end of Third-party configuration # diff --git a/example/storage/fatfs/sdkconfig.h b/example/storage/fatfs/sdkconfig.h index e0720a9dc76138f268eac01299f3fbcb4842a42e..b826d5479349b75e29de632fa16c122af5a9df3c 100644 --- a/example/storage/fatfs/sdkconfig.h +++ b/example/storage/fatfs/sdkconfig.h @@ -4,8 +4,8 @@ /* Project Configuration */ #define CONFIG_FATFS_BASIC_TEST -/* CONFIG_FATFS_SPEED_TEST is not set */ -/* CONFIG_FATFS_CYCLE_TEST is not set */ +#define CONFIG_FATFS_SPEED_TEST +#define CONFIG_FATFS_CYCLE_TEST /* end of Project Configuration */ #define CONFIG_USE_FREERTOS @@ -16,45 +16,43 @@ /* Arm architecture configuration */ -#define CONFIG_ARCH_ARMV8_AARCH64 -/* CONFIG_ARCH_ARMV8_AARCH32 is not set */ +/* CONFIG_ARCH_ARMV8_AARCH64 is not set */ +#define CONFIG_ARCH_ARMV8_AARCH32 /* Compiler configuration */ #define CONFIG_ARM_GCC_SELECT /* CONFIG_ARM_CLANG_SELECT is not set */ #define CONFIG_TOOLCHAIN_NAME "gcc" -#define CONFIG_TARGET_ARMV8_AARCH64 -#define CONFIG_ARCH_EXECUTION_STATE "aarch64" +#define CONFIG_TARGET_ARMV8_AARCH32 +#define CONFIG_ARCH_EXECUTION_STATE "aarch32" /* Fpu configuration */ +/* CONFIG_ARCH_FPU_VFP_V3 is not set */ +#define CONFIG_ARCH_FPU_VFP_V4 +#define CONFIG_ARM_DPFPU32 +/* CONFIG_ARM_FPU_ABI_SOFT is not set */ +#define CONFIG_ARM_FPU_SYMBOL "crypto-neon-fp-armv8" #define CONFIG_ARM_NEON +#define CONFIG_ARCH_FPU /* end of Fpu configuration */ -#define CONFIG_ARM_CRC -#define CONFIG_ARM_CRYPTO -#define CONFIG_ARM_FLOAT_POINT -/* CONFIG_GCC_CODE_MODEL_TINY is not set */ -#define CONFIG_GCC_CODE_MODEL_SMALL -/* CONFIG_GCC_CODE_MODEL_LARGE is not set */ /* end of Compiler configuration */ #define CONFIG_USE_CACHE #define CONFIG_USE_MMU -/* CONFIG_BOOT_WITH_FLUSH_CACHE is not set */ -/* CONFIG_MMU_DEBUG_PRINTS is not set */ +#define CONFIG_USE_AARCH64_L1_TO_AARCH32 /* end of Arm architecture configuration */ /* end of Arch configuration */ /* Soc configuration */ -/* CONFIG_TARGET_PHYTIUMPI is not set */ -#define CONFIG_TARGET_E2000Q +#define CONFIG_TARGET_PHYTIUMPI +/* CONFIG_TARGET_E2000Q is not set */ /* CONFIG_TARGET_E2000D is not set */ /* CONFIG_TARGET_E2000S is not set */ /* CONFIG_TARGET_FT2004 is not set */ /* CONFIG_TARGET_D2000 is not set */ -#define CONFIG_SOC_NAME "e2000" -#define CONFIG_TARGET_TYPE_NAME "q" +#define CONFIG_SOC_NAME "phytiumpi" #define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 @@ -69,7 +67,7 @@ /* Board Configuration */ -#define CONFIG_BOARD_NAME "demo" +#define CONFIG_BOARD_NAME "firefly" /* CONFIG_USE_SPI_IOPAD is not set */ /* CONFIG_USE_GPIO_IOPAD is not set */ /* CONFIG_USE_CAN_IOPAD is not set */ @@ -79,7 +77,7 @@ /* CONFIG_USE_TACHO_IOPAD is not set */ /* CONFIG_USE_UART_IOPAD is not set */ /* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ -#define CONFIG_E2000Q_DEMO_BOARD +#define CONFIG_FIREFLY_DEMO_BOARD /* IO mux configuration when board start up */ @@ -195,8 +193,12 @@ #define CONFIG_IMAGE_LOAD_ADDRESS 0x80100000 #define CONFIG_IMAGE_MAX_LENGTH 0x2000000 #define CONFIG_HEAP_SIZE 2 -#define CONFIG_STACK_SIZE 0x100000 -#define CONFIG_FPU_STACK_SIZE 0x1000 +#define CONFIG_SVC_STACK_SIZE 0x1000 +#define CONFIG_SYS_STACK_SIZE 0x1000 +#define CONFIG_IRQ_STACK_SIZE 0x1000 +#define CONFIG_ABORT_STACK_SIZE 0x1000 +#define CONFIG_FIQ_STACK_SIZE 0x1000 +#define CONFIG_UNDEF_STACK_SIZE 0x1000 /* end of Linker Options */ /* end of Build setup */ @@ -310,18 +312,11 @@ #define CONFIG_FATFS_RAM_DISK_SIZE_MB 500 #define CONFIG_FATFS_RAM_DISK_SECTOR_SIZE_BYTE 512 /* end of RAM Disk Configuration */ -#define CONFIG_FATFS_SDMMC -#define CONFIG_FATFS_SDMMC_FSDIO_TF -#define CONFIG_FATFS_SDMMC_FSDIO_EMMC +/* CONFIG_FATFS_SDMMC_FSDIO_TF is not set */ +/* CONFIG_FATFS_SDMMC_FSDIO_EMMC is not set */ /* CONFIG_FATFS_SDMMC_FSDMMC_TF is not set */ -#define CONFIG_FATFS_SATA_DISK - -/* SATA Disk Configuration */ - -/* CONFIG_FATFS_FSATA is not set */ -/* CONFIG_FATFS_FSATA_PCIE is not set */ -/* end of SATA Disk Configuration */ -#define CONFIG_FATFS_USB +/* CONFIG_FATFS_SATA_DISK is not set */ +/* CONFIG_FATFS_USB is not set */ #define CONFIG_FATFS_VOLUME_COUNT 10 /* CONFIG_FATFS_LFN_NONE is not set */ #define CONFIG_FATFS_LFN_HEAP @@ -338,21 +333,7 @@ /* CONFIG_USE_LITTLE_FS is not set */ /* CONFIG_USE_LVGL is not set */ /* CONFIG_USE_FREEMODBUS is not set */ -#define CONFIG_USE_CHERRY_USB - -/* CherryUSB Configuration */ - -#define CONFIG_CHERRY_USB_PORT_XHCI -/* CONFIG_CHERRY_USB_PORT_PHYTIUM_OTG is not set */ -#define CONFIG_CHERRYUSB_HOST -/* CONFIG_CHERRYUSB_DEVICE is not set */ -#define CONFIG_CHERRY_USB_HOST_HUB -#define CONFIG_CHERRY_USB_HOST_MSC -/* CONFIG_CHERRY_USB_HOST_HID is not set */ -/* CONFIG_CHERRY_USB_HOST_VEDIO is not set */ -/* CONFIG_CHERRY_USB_HOST_CDC is not set */ -/* CONFIG_CHERRY_USB_HOST_RNDIS_WIRELESS is not set */ -/* end of CherryUSB Configuration */ +/* CONFIG_USE_CHERRY_USB is not set */ /* end of Third-party configuration */ /* Kernel Configuration */ diff --git a/example/storage/qspi_spiffs/README.md b/example/storage/qspi_spiffs/README.md index 121f9a2defea37675cf13aa84e4b999ec99a5966..d95cfdf575a613cdd5a21a53ea725d052e605dc0 100644 --- a/example/storage/qspi_spiffs/README.md +++ b/example/storage/qspi_spiffs/README.md @@ -30,13 +30,14 @@ E2000D上使用的Nor Flash介质型号是GD25LQ128E,容量为16MB; >哪些硬件平台是支持的,需要哪些外设,例程与开发板哪些IO口相关等(建议附录开发板照片,展示哪些IO口被引出)
本例程支持的硬件平台包括 -- FT2000/4、D2000、E2000D、E2000Q开发板 +- FT2000/4、D2000、E2000D、E2000Q、PhytiumPi(包含qspi—flash芯片座)开发板 对应的配置项是 - CONFIG_TARGET_FT2004 - CONFIG_TARGET_D2000 - CONFIG_TARGET_E2000D - CONFIG_TARGET_E2000Q +- CONFIG_TARGET_PHYTIUMPI - 本例程适配了GD25Q256、GD25Q128、GD25Q64、S25FS256的Nor-Flash芯片,如使用其他型号,需自行参考适配 @@ -53,9 +54,9 @@ E2000D上使用的Nor Flash介质型号是GD25LQ128E,容量为16MB; - CONFIG_USE_IOMUX,使能IO复用驱动组件 - CONFIG_ENABLE_FIOMUX,选择FIOMUX驱动 - CONFIG_USE_GPIO,使能GPIO驱动组件 -- CONFIG_ENABLE_F_GPIO,选择FGPIO驱动 +- CONFIG_ENABLE_FGPIO,选择FGPIO驱动 - CONFIG_USE_SFUD,选择SFUD协议框架 -- CONFIG_SFUD_CTRL_F_SPIM,关联SFUD框架和FSPIM驱动 +- CONFIG_SFUD_CTRL_FSPIM,关联SFUD框架和FSPIM驱动 - CONFIG_USE_SPIFFS CONFIG_SPIFFS_ON_FSPIM_SFUD,使能SPIFFS 本例子已经提供好具体的编译指令,以下进行介绍: @@ -96,6 +97,7 @@ bootelf -p 0x90100000 ### 2.4 输出与实验现象 >描述输入输出情况,列出存在哪些输出,对应的输出是什么(建议附录相关现象图片)
+ 程序启动后,依次创建Init、WriteRead任务,创建单次模式软件定时器用于删除任务,Init任务会首先初始化并挂载qspi flash的部分区域(可通过FSPIFFS_IF_FORMAT选择是否进行格式化操作),随后创建一个文件,然后释放信号量通知WriteRead任务开始执行; - init完成,挂载文件系统完成,创建测试文件 diff --git a/example/storage/qspi_spiffs/configs/phytiumpi_aarch32_firefly_qspi_spiffs.config b/example/storage/qspi_spiffs/configs/phytiumpi_aarch32_firefly_qspi_spiffs.config new file mode 100644 index 0000000000000000000000000000000000000000..22c145c38bc6c4555b8bfc77260bd1d0ded6a723 --- /dev/null +++ b/example/storage/qspi_spiffs/configs/phytiumpi_aarch32_firefly_qspi_spiffs.config @@ -0,0 +1,382 @@ +CONFIG_USE_FREERTOS=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +# CONFIG_ARCH_ARMV8_AARCH64 is not set +CONFIG_ARCH_ARMV8_AARCH32=y + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH32=y +CONFIG_ARCH_EXECUTION_STATE="aarch32" + +# +# Fpu configuration +# +# CONFIG_ARCH_FPU_VFP_V3 is not set +CONFIG_ARCH_FPU_VFP_V4=y +CONFIG_ARM_DPFPU32=y +# CONFIG_ARM_FPU_ABI_SOFT is not set +CONFIG_ARM_FPU_SYMBOL="crypto-neon-fp-armv8" +CONFIG_ARM_NEON=y +CONFIG_ARCH_FPU=y +# end of Fpu configuration +# end of Compiler configuration + +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# end of Arm architecture configuration +# end of Arch configuration + +# +# Soc configuration +# +CONFIG_TARGET_PHYTIUMPI=y +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +# CONFIG_TARGET_FT2004 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_SOC_NAME="phytiumpi" +CONFIG_SOC_CORE_NUM=4 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_E2000=y +# CONFIG_USE_SPINLOCK is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Soc configuration + +# +# Board Configuration +# +CONFIG_BOARD_NAME="firefly" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +# CONFIG_USE_UART_IOPAD is not set +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_FIREFLY_DEMO_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +CONFIG_TARGET_NAME="qspi_spiffs" +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +CONFIG_LOG_INFO=y +# CONFIG_LOG_WARN is not set +# CONFIG_LOG_ERROR is not set +# CONFIG_LOG_NONE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_LOG_DISPALY_CORE_NUM is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# end of Sdk common configuration + +# +# Image information configuration +# +# CONFIG_IMAGE_INFO is not set +# end of Image information configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +CONFIG_USE_QSPI=y + +# +# Qspi Configuration +# +CONFIG_USE_FQSPI=y +# end of Qspi Configuration + +CONFIG_USE_GIC=y +CONFIG_ENABLE_GICV3=y +CONFIG_USE_SERIAL=y + +# +# Usart Configuration +# +CONFIG_ENABLE_Pl011_UART=y +# end of Usart Configuration + +# CONFIG_USE_GPIO is not set +# CONFIG_USE_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO is not set +# CONFIG_USE_SDMMC is not set +# CONFIG_USE_PCIE is not set +# CONFIG_USE_WDT is not set +# CONFIG_USE_DMA is not set +# CONFIG_USE_NAND is not set +# CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +# CONFIG_USE_SCMI_MHU is not set +# end of Drivers configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +CONFIG_OUTPUT_BINARY=y + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_WALL_WARNING_ERROR is not set +# CONFIG_STRICT_PROTOTYPES is not set +# CONFIG_DEBUG_SYMBOLS is not set +# CONFIG_FRAME_POINTER is not set +# CONFIG_OUTPUT_ASM_DIS is not set +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USB_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0x80100000 +CONFIG_IMAGE_MAX_LENGTH=0x1000000 +CONFIG_HEAP_SIZE=1 +CONFIG_SVC_STACK_SIZE=0x1000 +CONFIG_SYS_STACK_SIZE=0x1000 +CONFIG_IRQ_STACK_SIZE=0x1000 +CONFIG_ABORT_STACK_SIZE=0x1000 +CONFIG_FIQ_STACK_SIZE=0x1000 +CONFIG_UNDEF_STACK_SIZE=0x1000 +# end of Linker Options +# end of Build setup + +# +# Component Configuration +# + +# +# Freertos Uart Drivers +# +CONFIG_FREERTOS_USE_UART=y +# end of Freertos Uart Drivers + +# +# Freertos Pwm Drivers +# +# CONFIG_FREERTOS_USE_PWM is not set +# end of Freertos Pwm Drivers + +# +# Freertos Qspi Drivers +# +CONFIG_FREERTOS_USE_QSPI=y +# end of Freertos Qspi Drivers + +# +# Freertos Wdt Drivers +# +# CONFIG_FREERTOS_USE_WDT is not set +# end of Freertos Wdt Drivers + +# +# Freertos Eth Drivers +# +# CONFIG_FREERTOS_USE_XMAC is not set +# CONFIG_FREERTOS_USE_GMAC is not set +# end of Freertos Eth Drivers + +# +# Freertos Gpio Drivers +# +# CONFIG_FREERTOS_USE_GPIO is not set +# end of Freertos Gpio Drivers + +# +# Freertos Spim Drivers +# +# CONFIG_FREERTOS_USE_FSPIM is not set +# end of Freertos Spim Drivers + +# +# Freertos DMA Drivers +# +# CONFIG_FREERTOS_USE_FDDMA is not set +# CONFIG_FREERTOS_USE_FGDMA is not set +# end of Freertos DMA Drivers + +# +# Freertos Adc Drivers +# +# CONFIG_FREERTOS_USE_ADC is not set +# end of Freertos Adc Drivers + +# +# Freertos Can Drivers +# +# CONFIG_FREERTOS_USE_CAN is not set +# end of Freertos Can Drivers + +# +# Freertos I2c Drivers +# +# CONFIG_FREERTOS_USE_I2C is not set +# end of Freertos I2c Drivers + +# +# Freertos Mio Drivers +# +# CONFIG_FREERTOS_USE_MIO is not set +# end of Freertos Mio Drivers + +# +# Freertos Timer Drivers +# +# CONFIG_FREERTOS_USE_TIMER is not set +# end of Freertos Timer Drivers + +# +# Freertos Media Drivers +# +# CONFIG_FREERTOS_USE_MEDIA is not set +# end of Freertos Media Drivers +# end of Component Configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration + +# CONFIG_USE_AMP is not set +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_YMODEM is not set +CONFIG_USE_SFUD=y + +# +# Sfud configuration +# +# CONFIG_SFUD_CTRL_FSPIM is not set +CONFIG_SFUD_CTRL_FQSPI=y +# CONFIG_SFUD_QSPI_READ_MODE_READ is not set +# CONFIG_SFUD_QSPI_READ_MODE_DUAL_READ is not set +CONFIG_SFUD_QSPI_READ_MODE_QUAD_READ=y +# end of Sfud configuration + +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS_0_1_4 is not set +# CONFIG_USE_TLSF is not set +CONFIG_USE_SPIFFS=y + +# +# SPIFFS Configuration +# +# CONFIG_SPIFFS_ON_FSPIM_SFUD is not set +CONFIG_SPIFFS_ON_FQSPI_SFUD=y +# end of SPIFFS Configuration + +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_CHERRY_USB is not set +# end of Third-party configuration + +# +# Kernel Configuration +# +CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y +CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_MAX_PRIORITIES=32 +CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=13 +CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=11 +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_MINIMAL_TASK_STACKSIZE=1024 +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=32 +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y +CONFIG_FREERTOS_USE_TRACE_FACILITY=y +CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y +# CONFIG_FREERTOS_USE_TICKLESS_IDLE is not set +CONFIG_FREERTOS_TOTAL_HEAP_SIZE=10240 +CONFIG_FREERTOS_TASK_FPU_SUPPORT=1 +# end of Kernel Configuration diff --git a/example/storage/qspi_spiffs/configs/phytiumpi_aarch64_firefly_qspi_spiffs.config b/example/storage/qspi_spiffs/configs/phytiumpi_aarch64_firefly_qspi_spiffs.config new file mode 100644 index 0000000000000000000000000000000000000000..2594a2266d72c72f5ca25e9233653a7870e32708 --- /dev/null +++ b/example/storage/qspi_spiffs/configs/phytiumpi_aarch64_firefly_qspi_spiffs.config @@ -0,0 +1,380 @@ +CONFIG_USE_FREERTOS=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +CONFIG_ARCH_ARMV8_AARCH64=y +# CONFIG_ARCH_ARMV8_AARCH32 is not set + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_ARCH_EXECUTION_STATE="aarch64" + +# +# Fpu configuration +# +CONFIG_ARM_NEON=y +# end of Fpu configuration + +CONFIG_ARM_CRC=y +CONFIG_ARM_CRYPTO=y +CONFIG_ARM_FLOAT_POINT=y +# CONFIG_GCC_CODE_MODEL_TINY is not set +CONFIG_GCC_CODE_MODEL_SMALL=y +# CONFIG_GCC_CODE_MODEL_LARGE is not set +# end of Compiler configuration + +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +# CONFIG_BOOT_WITH_FLUSH_CACHE is not set +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arm architecture configuration +# end of Arch configuration + +# +# Soc configuration +# +CONFIG_TARGET_PHYTIUMPI=y +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +# CONFIG_TARGET_FT2004 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_SOC_NAME="phytiumpi" +CONFIG_SOC_CORE_NUM=4 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_E2000=y +# CONFIG_USE_SPINLOCK is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Soc configuration + +# +# Board Configuration +# +CONFIG_BOARD_NAME="firefly" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +# CONFIG_USE_UART_IOPAD is not set +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_FIREFLY_DEMO_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +CONFIG_TARGET_NAME="qspi_spiffs" +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +CONFIG_LOG_INFO=y +# CONFIG_LOG_WARN is not set +# CONFIG_LOG_ERROR is not set +# CONFIG_LOG_NONE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_LOG_DISPALY_CORE_NUM is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# end of Sdk common configuration + +# +# Image information configuration +# +# CONFIG_IMAGE_INFO is not set +# end of Image information configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +CONFIG_USE_QSPI=y + +# +# Qspi Configuration +# +CONFIG_USE_FQSPI=y +# end of Qspi Configuration + +CONFIG_USE_GIC=y +CONFIG_ENABLE_GICV3=y +CONFIG_USE_SERIAL=y + +# +# Usart Configuration +# +CONFIG_ENABLE_Pl011_UART=y +# end of Usart Configuration + +# CONFIG_USE_GPIO is not set +# CONFIG_USE_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO is not set +# CONFIG_USE_SDMMC is not set +# CONFIG_USE_PCIE is not set +# CONFIG_USE_WDT is not set +# CONFIG_USE_DMA is not set +# CONFIG_USE_NAND is not set +# CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +# CONFIG_USE_SCMI_MHU is not set +# end of Drivers configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +CONFIG_OUTPUT_BINARY=y + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_WALL_WARNING_ERROR is not set +# CONFIG_STRICT_PROTOTYPES is not set +# CONFIG_DEBUG_SYMBOLS is not set +# CONFIG_FRAME_POINTER is not set +# CONFIG_OUTPUT_ASM_DIS is not set +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USB_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0x80100000 +CONFIG_IMAGE_MAX_LENGTH=0x1000000 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x400 +CONFIG_FPU_STACK_SIZE=0x1000 +# end of Linker Options +# end of Build setup + +# +# Component Configuration +# + +# +# Freertos Uart Drivers +# +CONFIG_FREERTOS_USE_UART=y +# end of Freertos Uart Drivers + +# +# Freertos Pwm Drivers +# +# CONFIG_FREERTOS_USE_PWM is not set +# end of Freertos Pwm Drivers + +# +# Freertos Qspi Drivers +# +CONFIG_FREERTOS_USE_QSPI=y +# end of Freertos Qspi Drivers + +# +# Freertos Wdt Drivers +# +# CONFIG_FREERTOS_USE_WDT is not set +# end of Freertos Wdt Drivers + +# +# Freertos Eth Drivers +# +# CONFIG_FREERTOS_USE_XMAC is not set +# CONFIG_FREERTOS_USE_GMAC is not set +# end of Freertos Eth Drivers + +# +# Freertos Gpio Drivers +# +# CONFIG_FREERTOS_USE_GPIO is not set +# end of Freertos Gpio Drivers + +# +# Freertos Spim Drivers +# +# CONFIG_FREERTOS_USE_FSPIM is not set +# end of Freertos Spim Drivers + +# +# Freertos DMA Drivers +# +# CONFIG_FREERTOS_USE_FDDMA is not set +# CONFIG_FREERTOS_USE_FGDMA is not set +# end of Freertos DMA Drivers + +# +# Freertos Adc Drivers +# +# CONFIG_FREERTOS_USE_ADC is not set +# end of Freertos Adc Drivers + +# +# Freertos Can Drivers +# +# CONFIG_FREERTOS_USE_CAN is not set +# end of Freertos Can Drivers + +# +# Freertos I2c Drivers +# +# CONFIG_FREERTOS_USE_I2C is not set +# end of Freertos I2c Drivers + +# +# Freertos Mio Drivers +# +# CONFIG_FREERTOS_USE_MIO is not set +# end of Freertos Mio Drivers + +# +# Freertos Timer Drivers +# +# CONFIG_FREERTOS_USE_TIMER is not set +# end of Freertos Timer Drivers + +# +# Freertos Media Drivers +# +# CONFIG_FREERTOS_USE_MEDIA is not set +# end of Freertos Media Drivers +# end of Component Configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration + +# CONFIG_USE_AMP is not set +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_YMODEM is not set +CONFIG_USE_SFUD=y + +# +# Sfud configuration +# +# CONFIG_SFUD_CTRL_FSPIM is not set +CONFIG_SFUD_CTRL_FQSPI=y +# CONFIG_SFUD_QSPI_READ_MODE_READ is not set +# CONFIG_SFUD_QSPI_READ_MODE_DUAL_READ is not set +CONFIG_SFUD_QSPI_READ_MODE_QUAD_READ=y +# end of Sfud configuration + +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS_0_1_4 is not set +# CONFIG_USE_TLSF is not set +CONFIG_USE_SPIFFS=y + +# +# SPIFFS Configuration +# +# CONFIG_SPIFFS_ON_FSPIM_SFUD is not set +CONFIG_SPIFFS_ON_FQSPI_SFUD=y +# end of SPIFFS Configuration + +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_CHERRY_USB is not set +# end of Third-party configuration + +# +# Kernel Configuration +# +CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y +CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_MAX_PRIORITIES=32 +CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=13 +CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=11 +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_MINIMAL_TASK_STACKSIZE=1024 +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=32 +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y +CONFIG_FREERTOS_USE_TRACE_FACILITY=y +CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y +# CONFIG_FREERTOS_USE_TICKLESS_IDLE is not set +CONFIG_FREERTOS_TOTAL_HEAP_SIZE=10240 +CONFIG_FREERTOS_TASK_FPU_SUPPORT=1 +# end of Kernel Configuration diff --git a/example/storage/spim_spiffs/README.md b/example/storage/spim_spiffs/README.md index 2eaf4a5fe2de76a2465eff838ee8186036e42d7f..ef03e70f8c2e539cbc6c93ad9fcbbd25964c67b3 100644 --- a/example/storage/spim_spiffs/README.md +++ b/example/storage/spim_spiffs/README.md @@ -18,8 +18,8 @@ - 3. 支持的 Flash 容量不能超过 128 MB - 4. 不支持坏块检测和坏块处理 -本例程通过Freertos下的SPIFFS测试,验证了SPIM Nor-flash文件系统的基本功能,如文件系统格式化,文件的创建、读写、删除和枚举等。例程在E2000 test板上测试通过,使用的Nor Flash介质型号是GD25LQ128E,容量为16MB,如下: -![hardware](./figs/hardware.jpg) +本例程通过Freertos下的SPIFFS测试,验证了SPIM Nor-flash文件系统的基本功能,如文件系统格式化,文件的创建、读写、删除和枚举等。 + ## 2. 如何使用例程 @@ -39,6 +39,20 @@ - CONFIG_TARGET_E2000Q - CONFIG_TARGET_PHYTIUMPI +### 2.1.1 E2000 +- E2000 demo板需使用杜邦线外接Flash进行测试,方法如下 + +![e2000_spi_flash](./figs/e2000_spi_flash.png) + +- 上图为E2000开发板J30与SPI引脚对应图,将flash芯片使用外接连接即可 + +### 2.1.2 PhytiumPi +- PhytiumPi需使用杜邦线外接Flash进行测试,方法如下 + +![phytiumpi_spi_flash](./figs/phytiumpi_spi_flash.png) + +- 上图为PhytiumPi开发板J1与SPI引脚对应图,将flash芯片使用外接连接即可 + - 本例程适配了GD25Q256、GD25Q128、GD25Q64、S25FS256的Nor-Flash芯片,如使用其他型号,需自行参考适配 ### 2.2 SDK配置方法 @@ -54,7 +68,7 @@ - CONFIG_USE_GPIO,使能GPIO驱动组件 - CONFIG_ENABLE_F_GPIO,选择FGPIO驱动 - CONFIG_USE_SFUD,选择SFUD协议框架 -- CONFIG_SFUD_CTRL_F_SPIM,关联SFUD框架和FSPIM驱动 +- CONFIG_SFUD_CTRL_FSPIM,关联SFUD框架和FSPIM驱动 - CONFIG_USE_SPIFFS CONFIG_SPIFFS_ON_FSPIM_SFUD,使能SPIFFS 本例子已经提供好具体的编译指令,以下进行介绍: @@ -90,7 +104,8 @@ bootelf -p 0x90100000 ### 2.4 输出与实验现象 ->描述输入输出情况,列出存在哪些输出,对应的输出是什么(建议附录相关现象图片)
+>描述输入输出情况,列出存在哪些输出,对应的输出是什么(建议附录相关现象图片)
+ 程序启动后,依次创建Init、Read、Write任务,创建单次模式软件定时器用于删除任务,Init任务会首先初始化并挂载spim flash的部分区域(可通过FSPIFFS_IF_FORMAT选择是否进行格式化操作),随后创建一个文件,然后释放信号量通知Read和Write任务开始执行; - init完成,挂载文件系统完成,创建测试文件 diff --git a/example/storage/spim_spiffs/figs/e2000_spi_flash.png b/example/storage/spim_spiffs/figs/e2000_spi_flash.png new file mode 100644 index 0000000000000000000000000000000000000000..c50b4391dccaa0b3785c39ab49a2abe77cbe5c5a Binary files /dev/null and b/example/storage/spim_spiffs/figs/e2000_spi_flash.png differ diff --git a/example/storage/spim_spiffs/figs/hardware.jpg b/example/storage/spim_spiffs/figs/hardware.jpg deleted file mode 100644 index e655675198ab62038cc4360ea98c90617803c4b5..0000000000000000000000000000000000000000 Binary files a/example/storage/spim_spiffs/figs/hardware.jpg and /dev/null differ diff --git a/example/storage/spim_spiffs/figs/phytiumpi_spi_flash.png b/example/storage/spim_spiffs/figs/phytiumpi_spi_flash.png new file mode 100644 index 0000000000000000000000000000000000000000..7453e192c173179566d7b948cf391b64527141bb Binary files /dev/null and b/example/storage/spim_spiffs/figs/phytiumpi_spi_flash.png differ diff --git a/example/system/amp/openamp/README.md b/example/system/amp/openamp/README.md index e5113da0c60fc5548b04d686e75622ebc368635e..63a1866127be06a78113c158af363faf6fbb9d66 100644 --- a/example/system/amp/openamp/README.md +++ b/example/system/amp/openamp/README.md @@ -2,7 +2,7 @@ ## 1. 例程介绍 -> ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作 `
` +> 介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作
- OpenAMP(Open Asymmetric Multi-processing) 是一个软件架构,为多核之间非对称运行提供软件支持 。 - OpenAMP 提供了以下关键特性: @@ -18,18 +18,18 @@ ## 2. 如何使用例程 -> ``描述开发平台准备,使用例程配置,构建和下载镜像的过程 `
` +> 描述开发平台准备,使用例程配置,构建和下载镜像的过程
### 2.1 硬件配置方法 -> ``哪些硬件平台是支持的,需要哪些外设,例程与开发板哪些IO口相关等(建议附录开发板照片,展示哪些IO口被引出)`
` +> 哪些硬件平台是支持的,需要哪些外设,例程与开发板哪些IO口相关等(建议附录开发板照片,展示哪些IO口被引出)
1. 准备一块d2000 E2000Q/D firefly开发板 2. 将串口连接好电脑,波特率设为 115200-8-1-N ### 2.2 SDK配置方法 -> ``依赖哪些驱动、库和第三方组件,如何完成配置(列出需要使能的关键配置项)`
` +> 依赖哪些驱动、库和第三方组件,如何完成配置(列出需要使能的关键配置项)
本例子已经提供好具体的编译指令,以下进行介绍: - make 将目录下的工程进行编译 @@ -46,7 +46,7 @@ ### 2.3 构建和下载 -> ``描述构建、烧录下载镜像的过程,列出相关的命令 `
` +> 描述构建、烧录下载镜像的过程,列出相关的命令
#### OpenAMP 配置 @@ -73,72 +73,70 @@ ### 2.4 输出与实验现象 -> ``描述输入输出情况,列出存在哪些输入,对应的输出是什么(建议附录相关现象图片)`
` - -#### D2000/FT2004/E2000 aarch32 裸跑程序测试 (rtos间) +> 描述输入输出情况,列出存在哪些输入,对应的输出是什么(建议附录相关现象图片)
+#### aarch32 裸跑程序测试 (rtos间) +以D2000为例 1. 在编译环境下,切换至 example/amp/openamp 目录 - 1.1 输入 'make config_d2000_aarch32' 加载默认D2000配置信息,或者输入 'make config_ft2004_aarch32' 加载默认ft2004配置信息 - 1.2 输入 'make all' 编译core0 / core1 代码,并且生成对应的elf 文件 - 1.3 先将 ./core0/makefile 与 ./core1/makefile 中 的 USR_BOOT_DIR 修改为您的tftp 所覆盖的目录 - 1.4 输入 'make image' 将生成的elf 拷贝至 tftp 的目录下 -2. 使用串口连接D2000/FT2004 开发板 ,并且打开串口终端工具 - 2.1 复位开发板之后,将D2000/FT2004 开发板的网络与tftp 服务器在同一局域网中 - 2.2 在中断工具下输入以下命令 - -``` - setenv ipaddr 192.168.4.20 - setenv serverip 192.168.4.50 - setenv gatewayip 192.168.4.1 - tftpboot f0000000 openamp_core0.elf - tftpboot f1000000 openamp_core1.elf - bootelf -p f0000000 -``` - -2.3 会显示如下内容 - -![](./figs/d2000_aarch32_openamp_startup.png) - -2.4 输入 'loadelf -p f1000000' 加载从核程序 -2.5 输入 'rpmsg_echo_task' 运行openamp 测试程序 -2.6 结果显示为 - -![aarch32运行结果](figs/aarch32_runtime.png) - -#### D2000/FT2004/E2000 aarch64 裸跑程序测试 (rtos间) - +- 1.1 输入 'make config_d2000_aarch32' 等命令加载默所需要的配置信息 +- 1.2 先将 ./core0/makefile 与 ./core1/makefile 中 的 USR_BOOT_DIR 修改为您的tftp 所覆盖的目录 +- 1.3 输入 'make image' 编译core0 / core1 代码,并且生成对应的elf 文件并将生成的 elf 文件拷贝至 tftp 的目录下 +2. 使用串口连接开发板 ,并且打开串口终端工具 +- 2.1 复位开发板之后,将开发板的网络与tftp 服务器在同一局域网中 +- 2.2 在中断工具下输入以下命令 + + ``` + setenv ipaddr 192.168.4.20 + setenv serverip 192.168.4.50 + setenv gatewayip 192.168.4.1 + tftpboot f0000000 openamp_core0.elf + tftpboot f1000000 openamp_core1.elf + bootelf -p f0000000 + ``` + +- 2.3 会显示如下内容 + + ![](./figs/d2000_aarch32_openamp_startup.png) + +- 2.4 输入 'loadelf -p f1000000' 加载从核程序 +- 2.5 输入 'rpmsg_echo_task' 运行openamp 测试程序 +- 2.6 结果显示为 + + ![aarch32运行结果](figs/aarch32_runtime.png) + +#### aarch64 裸跑程序测试 (rtos间) +以D2000为例 1. 在编译环境下,切换至 example/amp/openamp 目录 - 1.1 输入 'make config_d2000_aarch64' 加载默认配置信息,或输入 'make config_ft2004_aarch64' 加载默认配置信息 - 1.2 输入 'make all' 编译core0 / core1 代码,并且生成对应的elf 文件 - 1.3 先将 ./core0/makefile 与 ./core1/makefile 中 的 USR_BOOT_DIR 修改为您的tftp 所覆盖的目录 - 1.4 输入 'make image' 将生成的elf 拷贝至 tftp 的目录下 -2. 使用串口连接D2000/FT2004 开发板 ,并且打开串口终端工具 - 2.1 复位开发板之后,将D2000/FT2004 开发板的网络与tftp 服务器在同一局域网中 - 2.2 在中断工具下输入以下命令 +- 1.1 输入 'make config_d2000_aarch64' 等命令加载默所需要的配置信息 +- 1.2 先将 ./core0/makefile 与 ./core1/makefile 中 的 USR_BOOT_DIR 修改为您的tftp 所覆盖的目录 +- 1.3 输入 'make image' 编译core0 / core1 代码,并且生成对应的elf 文件并将生成的 elf 文件拷贝至 tftp 的目录下 +2. 使用串口连接开发板 ,并且打开串口终端工具 +- 2.1 复位开发板之后,将开发板的网络与tftp 服务器在同一局域网中 +- 2.2 在中断工具下输入以下命令 -``` - setenv ipaddr 192.168.4.20 - setenv serverip 192.168.4.50 - setenv gatewayip 192.168.4.1 - tftpboot f0000000 openamp_core0.elf - tftpboot f1000000 openamp_core1.elf - bootelf -p f0000000 -``` + ``` + setenv ipaddr 192.168.4.20 + setenv serverip 192.168.4.50 + setenv gatewayip 192.168.4.1 + tftpboot f0000000 openamp_core0.elf + tftpboot f1000000 openamp_core1.elf + bootelf -p f0000000 + ``` -2.3 会显示如下内容 +- 2.3 会显示如下内容 -![](./figs/d2000_aarch64_openamp_startup.png) + ![](./figs/d2000_aarch64_openamp_startup.png) -2.4 输入 'loadelf -p f1000000' 加载从核程序 -2.5 输入 'rpmsg_echo_task' 运行openamp 测试程序 -2.6 结果显示为 +- 2.4 输入 'loadelf -p f1000000' 加载从核程序 +- 2.5 输入 'rpmsg_echo_task' 运行openamp 测试程序 +- 2.6 结果显示为 -![aarch64_runtime](figs/aarch64_runtime.png) + ![aarch64_runtime](figs/aarch64_runtime.png) #### D2000/E2000 aarch32 裸机程序测试 (与linux) - +以D2000为例 1. 进入amp/openamp 目录 -2. 进入core0 下 ,输入 make load_d2000_aarch32 ,加载预先配置信息 +2. 进入 ./core0 下 ,输入 make load_d2000_aarch32 ,加载预先配置信息 3. 输入make menuconfig ,在 Project Configuration → AMP Config 下 取消 DEBUG_CODE ![](./figs/freertos_openamp_d2000_config.png) 4. 在 Third-Party Configuration → Use Asymmetric Multi-processing → OpenAmp 下,选择 Skip local rvdev->shbuf_io ,并选择Use the Vring definition in the master @@ -149,9 +147,9 @@ ![](./figs/d2000_linux_reasult.png) #### D2000/E2000 aarch64 裸机程序测试 (与linux) - +以D2000为例 1. 进入amp/openamp 目录 -2. 进入core0 下 ,输入 make load_d2000_aarch64 ,加载预先配置信息 +2. 进入 ./core0 下,输入 make load_d2000_aarch64 ,加载预先配置信息 3. 输入make menuconfig ,在 Project Configuration → AMP Config 下 取消 DEBUG_CODE 4. 在 Third-Party Configuration → Use Asymmetric Multi-processing → OpenAmp 下,选择 Skip local rvdev->shbuf_io ,并选择Use the Vring definition in the master ![img](./figs/freertos_openamp_d2000_aarch32_ampconfig.png) @@ -161,11 +159,9 @@ ![](./figs/d2000_linux_reasult.png) ## 3. 如何解决问题 (Q&A) - > 主要记录使用例程中可能会遇到的问题,给出相应的解决方案 ## 4. 修改历史记录 - > 记录例程的重大修改记录,标明修改发生的版本号 - 2021-03-21 :v0.1.0 初始化项目 diff --git a/example/system/amp/openamp/makefile b/example/system/amp/openamp/makefile index 034d5cd238fccdcfb8be1f31801005e2e6576045..35d15d1294a3c9a574590449a422c7c7884648e6 100644 --- a/example/system/amp/openamp/makefile +++ b/example/system/amp/openamp/makefile @@ -8,16 +8,8 @@ clean_core0: clean_core1: $(MAKE) -C ./core1 clean -boot_core0: - $(MAKE) -C ./core0 boot - -boot_core1: - $(MAKE) -C ./core1 boot - clean: clean_core0 clean_core1 -image: boot_core0 boot_core1 - config_d2000_aarch64: $(MAKE) -C ./core0 load_kconfig LOAD_CONFIG_NAME=d2000_aarch64_TEST_openamp_core0 $(MAKE) -C ./core1 load_kconfig LOAD_CONFIG_NAME=d2000_aarch64_TEST_openamp_core1 @@ -65,7 +57,8 @@ menuconfig_core1: $(MAKE) -C ./core1 menuconfig image: - $(MAKE) boot + $(MAKE) -C ./core0 image + $(MAKE) -C ./core1 image backupconfig: $(MAKE) -C ./core0 backup_kconfig