diff --git a/README.md b/README.md index 8f7213ff99c90f1393096e7343c746719cc784fd..9d887122089d9c9fefad73f7c70fb993b9cbdc22 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ 本项目发布了Phytium系列CPU的FreeRTOS源代码,参考例程以及配置构建工具 +代码仓库整体共分为两个分支: +- master 分支:开发分支,用于保存最新的协作开发代码以及bug修复后的代码。其只要求保障新功能基本正确并且能够满足基本的使用需求,并没有经过系统性和复杂条件下的测试。 +- release 分支:发布分支,包含核心启动代码、芯片外设驱动、用户使用例程和构建的脚本工具。用于保存经过系统性测试的代码并对外发布版本,默认下载此分支的代码。 + --- ## 2. 快速入门 diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index 3bd315b7256f76814c24aadb49d0aec7ceb28fb7..7a59ee87e406d6cf13de7b4b0c30109ee7e42155 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -1,3 +1,40 @@ +# Phytium FreeRTOS SDK 2022-11-11 ChangeLog + +Change Log sinc 2022-11-11 + +## example + +- task/task_notify e2000q support +- modify some README.md description +- modify openamp & freertos_feature\task & storage\sata_fatfs readme.md +- modify freertos_feature\eventgroup interrupt queue resource software_timer readme.md and picture +- remove e2000q adc support +- modify some README.md description + + +# Phytium FreeRTOS SDK 2022-11-01 ChangeLog + +Change Log sinc 2022-11-1 + +## driver + +- add USE_SPI slection in Kconfig + +## example + +- add fspim_spiffs example + +## third-party + +- sfud debug +- add spiffs port for spim + +# Phytium Standalone SDK 2022-10-31 ChangeLog + +Change Log sinc 2022-10-31 + +- rename some include file with f prefix + # Phytium FreeRTOS SDK 2022-10-21 ChangeLog Change Log sinc 2022-10-15 diff --git a/drivers/Kconfig b/drivers/Kconfig index 6496ededbb4e3e3b2ce7219b8af426c71ddacc12..b7b47d228e45d5103fd35dff7e21b47bfbd2976e 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -51,6 +51,8 @@ menu "Freertos Spim Drivers" bool prompt "Use Freertos spim driver" default n + select USE_SPI + select USE_FSPIM endmenu menu "Freertos DMA Drivers" diff --git a/drivers/adc/fadc_os.c b/drivers/adc/fadc_os.c index cf6ee6085271ebb443b2d142faeb485273d888de..4678a9fee4b795a539f6fa3fa293c834a8aec39f 100644 --- a/drivers/adc/fadc_os.c +++ b/drivers/adc/fadc_os.c @@ -25,12 +25,12 @@ #include #include #include "task.h" -#include "ft_types.h" -#include "ft_assert.h" -#include "ft_debug.h" +#include "ftypes.h" +#include "fassert.h" +#include "fdebug.h" #include "fadc_os.h" #include "fadc.h" -#include "interrupt.h" +#include "finterrupt.h" #include "fadc_hw.h" #define FADC_DEBUG_TAG "FFreeRTOSAdc" diff --git a/drivers/adc/fadc_os.h b/drivers/adc/fadc_os.h index e85f00d7f5fe2b6338cc6ab35c160115ca59efd8..c3c98e9e40d3e994922fa7eead8ea3e1943fbe76 100644 --- a/drivers/adc/fadc_os.h +++ b/drivers/adc/fadc_os.h @@ -26,10 +26,10 @@ #include #include -#include "ft_error_code.h" +#include "ferror_code.h" #include "fadc.h" -#include "ft_types.h" -#include "parameters.h" +#include "ftypes.h" +#include "fparameters.h" /* freertos adc error */ #define FREERTOS_ADC_SEM_ERROR FT_CODE_ERR(ErrModBsp, ErrBspAdc, 10) diff --git a/drivers/can/fcan_os.c b/drivers/can/fcan_os.c index 1bece2a4c3e8bbd2bc0c947f2e1d6dad82e8f1f8..79ccc47dd274af805b90c3f8959d528de40a05ce 100644 --- a/drivers/can/fcan_os.c +++ b/drivers/can/fcan_os.c @@ -25,12 +25,12 @@ #include #include #include "task.h" -#include "ft_types.h" -#include "ft_assert.h" -#include "ft_debug.h" +#include "ftypes.h" +#include "fassert.h" +#include "fdebug.h" #include "fcan_os.h" #include "fcan.h" -#include "interrupt.h" +#include "finterrupt.h" #include "fcan_hw.h" #define FCAN_DEBUG_TAG "FFreeRTOSCan" diff --git a/drivers/can/fcan_os.h b/drivers/can/fcan_os.h index 5efca37a2e75142fbbcabbed537dc9b4c89bdca0..19d85a00144c289cc083b97316bf9a58c66ba6e2 100644 --- a/drivers/can/fcan_os.h +++ b/drivers/can/fcan_os.h @@ -26,9 +26,9 @@ #include #include -#include "ft_error_code.h" +#include "ferror_code.h" #include "fcan.h" -#include "ft_types.h" +#include "ftypes.h" /* freertos can error */ #define FREERTOS_CAN_OK FT_SUCCESS diff --git a/drivers/dma/fddma/fddma_os.c b/drivers/dma/fddma/fddma_os.c index 10d273aaaa35d43832145c78ac22f98954a3a1a5..a25648b5dbd59f5fd32a4329d33f3c0b44f0f44a 100644 --- a/drivers/dma/fddma/fddma_os.c +++ b/drivers/dma/fddma/fddma_os.c @@ -25,10 +25,10 @@ /***************************** Include Files *********************************/ #include -#include "ft_assert.h" -#include "ft_debug.h" -#include "interrupt.h" -#include "cpu_info.h" +#include "fassert.h" +#include "fdebug.h" +#include "finterrupt.h" +#include "fcpu_info.h" #include "fsleep.h" #include "fddma_os.h" diff --git a/drivers/dma/fddma/fddma_os.h b/drivers/dma/fddma/fddma_os.h index c3a5ad4269202145b39edbcf2474ce7e33b6c2f4..c6595646b1c00f5e1a0b775e2fc209d05c05e3bf 100644 --- a/drivers/dma/fddma/fddma_os.h +++ b/drivers/dma/fddma/fddma_os.h @@ -34,7 +34,7 @@ extern "C" #include #include -#include "parameters.h" +#include "fparameters.h" #include "fddma.h" /************************** Constant Definitions *****************************/ diff --git a/drivers/dma/fgdma/fgdma_os.c b/drivers/dma/fgdma/fgdma_os.c index f5e37ac1e0b62bbdb49aa386904ad89e6c937a93..99c2f92ed263c4b45267f869d2d92b2c80d01d1f 100644 --- a/drivers/dma/fgdma/fgdma_os.c +++ b/drivers/dma/fgdma/fgdma_os.c @@ -26,11 +26,11 @@ #include #include -#include "interrupt.h" -#include "parameters.h" -#include "ft_debug.h" +#include "finterrupt.h" +#include "fparameters.h" +#include "fdebug.h" #include "fsleep.h" -#include "cpu_info.h" +#include "fcpu_info.h" #include "fgdma.h" #include "fgdma_hw.h" diff --git a/drivers/dma/fgdma/fgdma_os.h b/drivers/dma/fgdma/fgdma_os.h index c566f4e5c93f034c6674708480d9e1dab544e241..ad8a246b69b85378cfcf54093d6306a2f78808fd 100644 --- a/drivers/dma/fgdma/fgdma_os.h +++ b/drivers/dma/fgdma/fgdma_os.h @@ -34,7 +34,7 @@ extern "C" #include #include -#include "parameters.h" +#include "fparameters.h" #include "fgdma.h" #include "fmemory_pool.h" /************************** Constant Definitions *****************************/ diff --git a/drivers/eth/xmac/ft_os_xmac.c b/drivers/eth/xmac/ft_os_xmac.c index 482870f91e91d4ff7864ef910ca49d06b35d48a4..8f3f5c11b6484bfe0f62ec28d7a7328ef78a839c 100644 --- a/drivers/eth/xmac/ft_os_xmac.c +++ b/drivers/eth/xmac/ft_os_xmac.c @@ -22,26 +22,26 @@ */ -#include "parameters.h" -#include "ft_assert.h" +#include "fparameters.h" +#include "fassert.h" #include "ft_os_xmac.h" #include "fxmac.h" -#include "cache.h" +#include "fcache.h" #include "fxmac_bdring.h" #include "lwip_port.h" #include "eth_ieee_reg.h" -#include "cpu_info.h" +#include "fcpu_info.h" #ifdef __aarch64__ -#include "aarch64.h" +#include "faarch64.h" #else -#include "cp15.h" +#include "fcp15.h" #endif #include "FreeRTOS.h" #include "semphr.h" -#include "ft_debug.h" +#include "fdebug.h" #define FXMAC_OS_XMAC_DEBUG_TAG "FXMAC_OS_XMAC" #define FXMAC_OS_XMAC_PRINT_E(format, ...) FT_DEBUG_PRINT_E(FXMAC_OS_XMAC_DEBUG_TAG, format, ##__VA_ARGS__) diff --git a/drivers/eth/xmac/ft_os_xmac.h b/drivers/eth/xmac/ft_os_xmac.h index ba4c1f1001ae696a256d056b1a344111841ccd23..9a1b357e6a06a293a4d07ada7ebf44e055afebf7 100644 --- a/drivers/eth/xmac/ft_os_xmac.h +++ b/drivers/eth/xmac/ft_os_xmac.h @@ -30,8 +30,8 @@ #include #include #include "fxmac.h" -#include "kernel.h" -#include "ft_error_code.h" +#include "fkernel.h" +#include "ferror_code.h" #define FREERTOS_XMAC_INIT_ERROR FT_CODE_ERR(ErrModPort, 0, 0x1) #define FREERTOS_XMAC_PARAM_ERROR FT_CODE_ERR(ErrModPort, 0, 0x2) diff --git a/drivers/gpio/fgpio/fgpio_os.c b/drivers/gpio/fgpio/fgpio_os.c index 9d7d9ec4458a0042e96b23134fbd600740d87746..292546f27c69075b188094034d07e8a01c0e358d 100644 --- a/drivers/gpio/fgpio/fgpio_os.c +++ b/drivers/gpio/fgpio/fgpio_os.c @@ -26,10 +26,10 @@ #include #include -#include "interrupt.h" -#include "ft_debug.h" +#include "finterrupt.h" +#include "fdebug.h" #include "fsleep.h" -#include "cpu_info.h" +#include "fcpu_info.h" #include "fiopad.h" #include "fgpio_os.h" diff --git a/drivers/gpio/fgpio/fgpio_os.h b/drivers/gpio/fgpio/fgpio_os.h index 86dcc85dda5dc20c3e30ab5f7da77578a75d9307..9fd6e0b53da6295a0989d8cd1d483ce9d878082f 100644 --- a/drivers/gpio/fgpio/fgpio_os.h +++ b/drivers/gpio/fgpio/fgpio_os.h @@ -34,8 +34,8 @@ extern "C" #include #include -#include "kernel.h" -#include "parameters.h" +#include "fkernel.h" +#include "fparameters.h" #include "fgpio.h" /************************** Constant Definitions *****************************/ diff --git a/drivers/mmc/fsdio/fsdio_os.c b/drivers/mmc/fsdio/fsdio_os.c index 1b00ebd9cb22ff66b01b79762a9d3cea0f05c756..762aa7a9f943a198f18774935305250cc9b119ac 100644 --- a/drivers/mmc/fsdio/fsdio_os.c +++ b/drivers/mmc/fsdio/fsdio_os.c @@ -27,12 +27,12 @@ #include #include -#include "interrupt.h" -#include "parameters.h" -#include "ft_debug.h" -#include "ft_assert.h" +#include "finterrupt.h" +#include "fparameters.h" +#include "fdebug.h" +#include "fassert.h" #include "fsleep.h" -#include "cpu_info.h" +#include "fcpu_info.h" #include "fiopad.h" #include "fsdio_os.h" diff --git a/drivers/mmc/fsdio/fsdio_os.h b/drivers/mmc/fsdio/fsdio_os.h index 27b526ec3595a1c7bd78ce86f091fb72ace3f4a7..52836e70363230d1315753125eb47936a6a083a7 100644 --- a/drivers/mmc/fsdio/fsdio_os.h +++ b/drivers/mmc/fsdio/fsdio_os.h @@ -34,8 +34,8 @@ extern "C" #include #include -#include "kernel.h" -#include "parameters.h" +#include "fkernel.h" +#include "fparameters.h" #include "fsdio.h" /************************** Constant Definitions *****************************/ diff --git a/drivers/pwm/fpwm_os.c b/drivers/pwm/fpwm_os.c index fba4a762ba0a1e6b6f539aecec2e18af1193c09c..37f42fef2eb91d83d79203d63d9312d212f8367d 100644 --- a/drivers/pwm/fpwm_os.c +++ b/drivers/pwm/fpwm_os.c @@ -25,12 +25,12 @@ #include #include #include "task.h" -#include "ft_types.h" -#include "ft_assert.h" -#include "ft_debug.h" +#include "ftypes.h" +#include "fassert.h" +#include "fdebug.h" #include "fpwm_os.h" #include "fpwm.h" -#include "interrupt.h" +#include "finterrupt.h" #include "fpwm_hw.h" #define FPWM_DEBUG_TAG "FFreeRTOSPwm" diff --git a/drivers/pwm/fpwm_os.h b/drivers/pwm/fpwm_os.h index e0a84cf4c3929d89280e23d020e2b6f9d75b3cd2..18054a238b66149ec33404c3a5c45f1e9f16ca5e 100644 --- a/drivers/pwm/fpwm_os.h +++ b/drivers/pwm/fpwm_os.h @@ -26,9 +26,9 @@ #include #include -#include "ft_error_code.h" +#include "ferror_code.h" #include "fpwm.h" -#include "ft_types.h" +#include "ftypes.h" /* freertos pwm error */ #define FREERTOS_PWM_SEM_ERROR FT_CODE_ERR(ErrModBsp, ErrBspPwm, 10) diff --git a/drivers/qspi/fqspi_os.c b/drivers/qspi/fqspi_os.c index b55b1e8ddf905dc1373247f382e468e650a94b28..25b97b86562b74930c93349dad21528890fea020 100644 --- a/drivers/qspi/fqspi_os.c +++ b/drivers/qspi/fqspi_os.c @@ -25,8 +25,8 @@ #include #include #include "task.h" -#include "ft_types.h" -#include "ft_assert.h" +#include "ftypes.h" +#include "fassert.h" #include "fqspi_os.h" #include "fqspi.h" #include "fqspi_hw.h" diff --git a/drivers/qspi/fqspi_os.h b/drivers/qspi/fqspi_os.h index bf33cb4866227782bb09f5e0f9f8a2485bcb84be..8c59a75dda3ed9b94c2ddf7bb6fdce80c5fa4ef1 100644 --- a/drivers/qspi/fqspi_os.h +++ b/drivers/qspi/fqspi_os.h @@ -26,10 +26,10 @@ #include #include -#include "ft_error_code.h" +#include "ferror_code.h" #include "fqspi.h" #include "fqspi_hw.h" -#include "ft_types.h" +#include "ftypes.h" #define FREERTOS_QSPI_SEM_ERROR FT_CODE_ERR(ErrModBsp, ErrBspQSpi, 10) diff --git a/drivers/serial/fpl011/fpl011_os.c b/drivers/serial/fpl011/fpl011_os.c index 2f7cf7902a1a34e7dae58908d8181ab9f92de89b..3d231df9962c748a4515a2256860c070cc3ad913 100644 --- a/drivers/serial/fpl011/fpl011_os.c +++ b/drivers/serial/fpl011/fpl011_os.c @@ -24,11 +24,11 @@ #include "fpl011_os.h" #include "fpl011.h" #include "fpl011_hw.h" -#include "interrupt.h" -#include "ft_types.h" -#include "ft_assert.h" +#include "finterrupt.h" +#include "ftypes.h" +#include "fassert.h" #include "sdkconfig.h" -#include "cpu_info.h" +#include "fcpu_info.h" #include /* Callback events */ diff --git a/drivers/serial/fpl011/fpl011_os.h b/drivers/serial/fpl011/fpl011_os.h index ead753e28972b64c27daf980d54030da482d1fde..f6826f4abee057d786a44735b063407574defc9b 100644 --- a/drivers/serial/fpl011/fpl011_os.h +++ b/drivers/serial/fpl011/fpl011_os.h @@ -30,8 +30,8 @@ #include #include "fpl011.h" #include "fpl011_hw.h" -#include "ft_types.h" -#include "ft_error_code.h" +#include "ftypes.h" +#include "ferror_code.h" #define FREERTOS_UART_SEM_ERROR FT_CODE_ERR(ErrModPort, 0, 0x1) #define FREERTOS_UART_EVENT_ERROR FT_CODE_ERR(ErrModPort, 0, 0x2) diff --git a/drivers/spi/fspim/fspim_os.c b/drivers/spi/fspim/fspim_os.c index d18a550df47c4e1199fd0561b1da04bfb7948e9a..e5bd91b3cd5ea46645807719922e0a93437a90fb 100644 --- a/drivers/spi/fspim/fspim_os.c +++ b/drivers/spi/fspim/fspim_os.c @@ -26,12 +26,12 @@ #include #include -#include "interrupt.h" -#include "parameters.h" -#include "ft_debug.h" -#include "ft_assert.h" +#include "finterrupt.h" +#include "fparameters.h" +#include "fdebug.h" +#include "fassert.h" #include "fsleep.h" -#include "cpu_info.h" +#include "fcpu_info.h" #include "fiopad.h" #include "fspim_os.h" diff --git a/drivers/spi/fspim/fspim_os.h b/drivers/spi/fspim/fspim_os.h index b4a828636d2c082f67ff28a466683c99f4cbaa18..31b974e9d903392c0e9f712382b20c1ac1935b3c 100644 --- a/drivers/spi/fspim/fspim_os.h +++ b/drivers/spi/fspim/fspim_os.h @@ -34,7 +34,7 @@ extern "C" #include #include -#include "parameters.h" +#include "fparameters.h" #include "fspim.h" /************************** Constant Definitions *****************************/ diff --git a/drivers/wdt/fwdt_os.c b/drivers/wdt/fwdt_os.c index e94a6a87b6cadd4330a36e29a339548650d5d6e4..906d7f6e878f14fb22e0897bbf5d47fc9f506665 100644 --- a/drivers/wdt/fwdt_os.c +++ b/drivers/wdt/fwdt_os.c @@ -25,12 +25,12 @@ #include #include #include "task.h" -#include "ft_types.h" -#include "ft_assert.h" -#include "ft_debug.h" +#include "ftypes.h" +#include "fassert.h" +#include "fdebug.h" #include "fwdt_os.h" #include "fwdt.h" -#include "interrupt.h" +#include "finterrupt.h" #include "fwdt_hw.h" diff --git a/drivers/wdt/fwdt_os.h b/drivers/wdt/fwdt_os.h index 7bc033d245c81d23b8c63b51f63964e13696add2..826d4ba6e787951fa92e5ba9523d8f72875ebbdf 100644 --- a/drivers/wdt/fwdt_os.h +++ b/drivers/wdt/fwdt_os.h @@ -26,9 +26,9 @@ #include #include -#include "ft_error_code.h" +#include "ferror_code.h" #include "fwdt.h" -#include "ft_types.h" +#include "ftypes.h" /* freertos wdt error */ #define FREERTOS_WDT_SEM_ERROR FT_CODE_ERR(ErrModBsp, ErrBspWdt, 10) diff --git a/example/amp/openamp/README.md b/example/amp/openamp/README.md index eaa4b325076fdee86640e69aeacfc3193873f6ad..0d5d851641cc567f8786428f66b2b75ed50ad9a1 100644 --- a/example/amp/openamp/README.md +++ b/example/amp/openamp/README.md @@ -87,16 +87,18 @@ >描述输入输出情况,列出存在哪些输入,对应的输出是什么(建议附录相关现象图片)
-#### D2000/FT2004 aarch32 裸跑程序测试 (裸机间) +#### D2000/FT2004 aarch32 程序测试 (Free Rtos) -1. 在编译环境下,切换至 phytium-standalone-sdk/baremetal/example/system/amp/openamp 目录 -1.1 输入 'make config_amp_d2000_aarch32' 加载默认D2000配置信息,或者输入 'make config_amp_ft2004_aarch32' 加载默认ft2004配置信息 -1.2 输入 'make all' 编译core0 / core1 代码,并且生成对应的elf 文件 -1.3 先将 ./core0/makefile 与 ./core1/makefile 中 的 USR_BOOT_DIR 修改为您的tftp 所覆盖的目录 -1.4 输入 'make boot' 将生成的elf 拷贝至 tftp 的目录下 +1. 在编译环境下,切换至 phytium-free-rtos-sdk/example/amp/openamp 目录 +- 1.1 输入 'make config_amp_d2000_aarch32' 加载默认D2000配置信息,或者输入 'make config_amp_ft2004_aarch32' 加载默认ft2004配置信息 +- 1.2 输入 'make all' 编译core0 / core1 代码,并且生成对应的elf 文件 +- 1.3 先将 ./core0/makefile 与 ./core1/makefile 中 的 USR_BOOT_DIR 修改为您的tftp 所覆盖的目录 +- 1.4 输入 'make boot' 将生成的elf 拷贝至 tftp 的目录下 2. 使用串口连接D2000/FT2004 开发板 ,并且打开串口终端工具 + 2.1 复位开发板之后,将D2000/FT2004 开发板的网络与tftp 服务器在同一局域网中 + 2.2 在中断工具下输入以下命令 ``` @@ -112,20 +114,23 @@ ![](./figs/d2000_aarch32_openamp_startup.png) -2.4 输入 'loadelf -p f1000000' 加载从核程序 +2.4 输入 'loadelf -p f1000000' 加载从核程 + +![](./figs/d2000_aarch32_loadelf_result.png) + 2.5 输入 'rpmsg_echo_task' 运行openamp 测试程序 2.6 结果显示为 ![](./figs/d2000_aarch32_openamp_reault.png) -#### D2000/FT2004 aarch64 裸跑程序测试 (裸机间) +#### D2000/FT2004 aarch64 程序测试 (Free Rtos) 1. 在编译环境下,切换至 phytium-standalone-sdk/baremetal/example/system/amp/openamp 目录 -1.1 输入 'make config_amp_d2000_aarch64' 加载默认配置信息,或输入 'make config_amp_ft2004_aarch64' 加载默认配置信息 -1.2 输入 'make all' 编译core0 / core1 代码,并且生成对应的elf 文件 -1.3 先将 ./core0/makefile 与 ./core1/makefile 中 的 USR_BOOT_DIR 修改为您的tftp 所覆盖的目录 -1.4 输入 'make boot' 将生成的elf 拷贝至 tftp 的目录下 +- 1.1 输入 'make config_amp_d2000_aarch64' 加载默认配置信息,或输入 'make config_amp_ft2004_aarch64' 加载默认配置信息 +- 1.2 输入 'make all' 编译core0 / core1 代码,并且生成对应的elf 文件 +- 1.3 先将 ./core0/makefile 与 ./core1/makefile 中 的 USR_BOOT_DIR 修改为您的tftp 所覆盖的目录 +- 1.4 输入 'make boot' 将生成的elf 拷贝至 tftp 的目录下 2. 使用串口连接D2000/FT2004 开发板 ,并且打开串口终端工具 2.1 复位开发板之后,将D2000/FT2004 开发板的网络与tftp 服务器在同一局域网中 @@ -145,6 +150,8 @@ 2.4 输入 'loadelf -p f1000000' 加载从核程序 +![](./figs/d2000_aarch64_loadelf_result.png) + 2.5 输入 'rpmsg_echo_task' 运行openamp 测试程序 2.6 结果显示为 diff --git a/example/amp/openamp/core0/main.c b/example/amp/openamp/core0/main.c index ffe60fc907705e0b3c2d1a0374f604ac5e8718bf..54f9f899664dad1bcdf9ccff425d6b978ab17b23 100644 --- a/example/amp/openamp/core0/main.c +++ b/example/amp/openamp/core0/main.c @@ -22,12 +22,12 @@ */ -#include "ft_types.h" -#include "psci.h" +#include "ftypes.h" +#include "fpsci.h" #include "shell.h" #include "fsleep.h" -#include "f_printk.h" -#include "ft_debug.h" +#include "fprintk.h" +#include "fdebug.h" #include "shell_port.h" #define OPENAMP_MAIN_DEBUG_TAG "OPENAMP_MAIN" diff --git a/example/amp/openamp/core0/rpmsg-echo_os.c b/example/amp/openamp/core0/rpmsg-echo_os.c index 1a707b0069767ae7c00f4e9db88798a043e1b2fa..6888eba3d65e230e3ce8ed6fdf954180fa195ee2 100644 --- a/example/amp/openamp/core0/rpmsg-echo_os.c +++ b/example/amp/openamp/core0/rpmsg-echo_os.c @@ -40,9 +40,9 @@ This application echoes back data that was sent to it by the master core. */ #include "FreeRTOS.h" #include "task.h" #include "shell.h" -#include "interrupt.h" -#include "cache.h" -#include "psci.h" +#include "finterrupt.h" +#include "fcache.h" +#include "fpsci.h" /************************** Constant Definitions *****************************/ diff --git a/example/amp/openamp/core1/main.c b/example/amp/openamp/core1/main.c index 75927bb56c81bb19b12e954891e6cb251de5d553..ad9278e22c6de920d3a792e58c3bb192c00d44f4 100644 --- a/example/amp/openamp/core1/main.c +++ b/example/amp/openamp/core1/main.c @@ -22,15 +22,13 @@ */ -#include "ft_types.h" -#include "psci.h" -// #include "shell.h" +#include "ftypes.h" +#include "fpsci.h" #include "fsleep.h" -#include "f_printk.h" -#include "ft_debug.h" +#include "fprintk.h" +#include "fdebug.h" #include "FreeRTOS.h" #include "task.h" -// #include "shell_port.h" #define OPENAMP_MAIN_DEBUG_TAG "OPENAMP_MAIN" #define OPENAMP_MAIN_DEBUG_I(format, ...) FT_DEBUG_PRINT_I(OPENAMP_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) diff --git a/example/amp/openamp/core1/rpmsg-ping_os.c b/example/amp/openamp/core1/rpmsg-ping_os.c index 8731af53da49122e921b005d7fa9f66c29efdfd0..f6f9964eac95c7ad2cd001893e2473923c8fb19b 100644 --- a/example/amp/openamp/core1/rpmsg-ping_os.c +++ b/example/amp/openamp/core1/rpmsg-ping_os.c @@ -14,7 +14,7 @@ This application echoes back data that was sent to it by the master core. */ #include #include #include -#include "ft_types.h" +#include "ftypes.h" #include "platform_info.h" #include "rpmsg-echo.h" #include "FreeRTOS.h" diff --git a/example/amp/openamp/figs/d2000_aarch32_loadelf_result.png b/example/amp/openamp/figs/d2000_aarch32_loadelf_result.png new file mode 100644 index 0000000000000000000000000000000000000000..5040003220d29e73bca9a6c624cc3cffe1210a11 Binary files /dev/null and b/example/amp/openamp/figs/d2000_aarch32_loadelf_result.png differ diff --git a/example/amp/openamp/figs/d2000_aarch64_loadelf_result.png b/example/amp/openamp/figs/d2000_aarch64_loadelf_result.png new file mode 100644 index 0000000000000000000000000000000000000000..91c645deb317ca0b1a22cd69f5acb94544ac098c Binary files /dev/null and b/example/amp/openamp/figs/d2000_aarch64_loadelf_result.png differ diff --git a/example/freertos_feature/eventgroup/README.md b/example/freertos_feature/eventgroup/README.md index 0c8ac76204385f3036ebe68e5df3bd7b4181064c..b40de87abf047bbb0743a53dd8b5a0a4fc976a11 100644 --- a/example/freertos_feature/eventgroup/README.md +++ b/example/freertos_feature/eventgroup/README.md @@ -31,7 +31,7 @@ ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(FT2000-4/D2000/E2000D) +- Phytium开发板(FT2000-4/D2000/E2000D/E2000Q) - [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 硬件配置方法 @@ -41,12 +41,14 @@ - FT2000-4 - D2000 - E2000D +- E2000Q 对应的配置项是, - CONFIG_TARGET_F2000_4 - CONFIG_TARGET_D2000 - CONFIG_TARGET_E2000D +- CONFIG_TARGET_E2000Q ### 2.2 SDK配置方法 @@ -68,6 +70,8 @@ - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 @@ -123,8 +127,14 @@ bootelf -p 0x90100000 - 系统进入后,输入```event```查看指令说明 - 输入```event manage_cre```,启动Event Group管理测试 - 输入```event manage_del```,删除Event Group管理测试 + +![manage](./figs/event_manage.png) + - 输入```event sync_cre```,启动Event Group任务同步测试 - 输入```event sync_del```,删除Event Group任务同步测试 + +![sync](./figs/event_sync.png) + - 测试任务能够能正常创建和删除,输入```ps```查看任务状态正常,即测试正常 ## 3. 如何解决问题 diff --git a/example/freertos_feature/eventgroup/configs/e2000q_aarch32_eg_configs b/example/freertos_feature/eventgroup/configs/e2000q_aarch32_eg_configs index 2fe965a523e72eb1736dfda348ff99451b89d666..1b53ed9171a1fca357a6362a54b3f83039f9a6fd 100644 --- a/example/freertos_feature/eventgroup/configs/e2000q_aarch32_eg_configs +++ b/example/freertos_feature/eventgroup/configs/e2000q_aarch32_eg_configs @@ -2,7 +2,7 @@ # # Freertos Configuration # -CONFIG_TARGET_NAME="e2000q_freertos_a32" +CONFIG_TARGET_NAME="e2000d_freertos_a32" # end of Freertos Configuration # @@ -17,7 +17,7 @@ CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set CONFIG_USE_CACHE=y CONFIG_USE_MMU=y -CONFIG_USE_SYS_TICK=y +# CONFIG_USE_SYS_TICK is not set CONFIG_USE_AARCH64_L1_TO_AARCH32=y # end of Arch Configuration @@ -77,9 +77,9 @@ CONFIG_USE_NEW_LIBC=y # # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set -CONFIG_LOG_INFO=y +# CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set +CONFIG_LOG_ERROR=y # CONFIG_LOG_NONE is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y @@ -95,7 +95,7 @@ CONFIG_AARCH32_RAM_LD=y # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y CONFIG_ROM_START_UP_ADDR=0x80100000 -CONFIG_ROM_SIZE_MB=1 +CONFIG_ROM_SIZE_MB=2 CONFIG_LINK_SCRIPT_RAM=y CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 @@ -207,7 +207,7 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration -# CONFIG_USE_TLSF is not set +CONFIG_USE_TLSF=y # CONFIG_USE_SDMMC_CMD is not set # CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/freertos_feature/eventgroup/configs/e2000q_aarch64_eg_configs b/example/freertos_feature/eventgroup/configs/e2000q_aarch64_eg_configs index 9c50f2b0368b0cb7549298c291755806fc32ae00..506efc21145e3c62ebe1b565aaebe9ed68d02d8b 100644 --- a/example/freertos_feature/eventgroup/configs/e2000q_aarch64_eg_configs +++ b/example/freertos_feature/eventgroup/configs/e2000q_aarch64_eg_configs @@ -2,7 +2,7 @@ # # Freertos Configuration # -CONFIG_TARGET_NAME="e2000q_freertos_a64" +CONFIG_TARGET_NAME="e2000d_freertos_a64" # end of Freertos Configuration # @@ -17,7 +17,7 @@ CONFIG_USE_FREERTOS=y CONFIG_TARGET_ARMV8_AARCH64=y CONFIG_USE_CACHE=y CONFIG_USE_MMU=y -CONFIG_USE_SYS_TICK=y +# CONFIG_USE_SYS_TICK is not set # CONFIG_MMU_DEBUG_PRINTS is not set # end of Arch Configuration @@ -77,9 +77,9 @@ CONFIG_USE_NEW_LIBC=y # # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set -CONFIG_LOG_INFO=y +# CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set +CONFIG_LOG_ERROR=y # CONFIG_LOG_NONE is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y @@ -95,7 +95,7 @@ CONFIG_AARCH64_RAM_LD=y # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y CONFIG_ROM_START_UP_ADDR=0x80100000 -CONFIG_ROM_SIZE_MB=1 +CONFIG_ROM_SIZE_MB=2 CONFIG_LINK_SCRIPT_RAM=y CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 @@ -203,7 +203,7 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration -# CONFIG_USE_TLSF is not set +CONFIG_USE_TLSF=y # CONFIG_USE_SDMMC_CMD is not set # CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/freertos_feature/eventgroup/figs/event_manage.png b/example/freertos_feature/eventgroup/figs/event_manage.png new file mode 100644 index 0000000000000000000000000000000000000000..bb6e731973490f77a9ac7894fbf3e40729630ac9 Binary files /dev/null and b/example/freertos_feature/eventgroup/figs/event_manage.png differ diff --git a/example/freertos_feature/eventgroup/figs/event_sync.png b/example/freertos_feature/eventgroup/figs/event_sync.png new file mode 100644 index 0000000000000000000000000000000000000000..5e1b24083c5ee925261c39da02cf955aa49f2128 Binary files /dev/null and b/example/freertos_feature/eventgroup/figs/event_sync.png differ diff --git a/example/freertos_feature/eventgroup/sdkconfig b/example/freertos_feature/eventgroup/sdkconfig index 9c50f2b0368b0cb7549298c291755806fc32ae00..506efc21145e3c62ebe1b565aaebe9ed68d02d8b 100644 --- a/example/freertos_feature/eventgroup/sdkconfig +++ b/example/freertos_feature/eventgroup/sdkconfig @@ -2,7 +2,7 @@ # # Freertos Configuration # -CONFIG_TARGET_NAME="e2000q_freertos_a64" +CONFIG_TARGET_NAME="e2000d_freertos_a64" # end of Freertos Configuration # @@ -17,7 +17,7 @@ CONFIG_USE_FREERTOS=y CONFIG_TARGET_ARMV8_AARCH64=y CONFIG_USE_CACHE=y CONFIG_USE_MMU=y -CONFIG_USE_SYS_TICK=y +# CONFIG_USE_SYS_TICK is not set # CONFIG_MMU_DEBUG_PRINTS is not set # end of Arch Configuration @@ -77,9 +77,9 @@ CONFIG_USE_NEW_LIBC=y # # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set -CONFIG_LOG_INFO=y +# CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set +CONFIG_LOG_ERROR=y # CONFIG_LOG_NONE is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y @@ -95,7 +95,7 @@ CONFIG_AARCH64_RAM_LD=y # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y CONFIG_ROM_START_UP_ADDR=0x80100000 -CONFIG_ROM_SIZE_MB=1 +CONFIG_ROM_SIZE_MB=2 CONFIG_LINK_SCRIPT_RAM=y CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 @@ -203,7 +203,7 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration -# CONFIG_USE_TLSF is not set +CONFIG_USE_TLSF=y # CONFIG_USE_SDMMC_CMD is not set # CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/freertos_feature/eventgroup/sdkconfig.h b/example/freertos_feature/eventgroup/sdkconfig.h index 2e55f772e76d53ec6d106cb6e89fa66f67702aa0..2ccaa5366aa6f3e1d5c66ad7cf530e14cd54c5cb 100644 --- a/example/freertos_feature/eventgroup/sdkconfig.h +++ b/example/freertos_feature/eventgroup/sdkconfig.h @@ -3,7 +3,7 @@ /* Freertos Configuration */ -#define CONFIG_TARGET_NAME "e2000q_freertos_a64" +#define CONFIG_TARGET_NAME "e2000d_freertos_a64" /* end of Freertos Configuration */ /* Standalone Setting */ @@ -16,7 +16,7 @@ #define CONFIG_TARGET_ARMV8_AARCH64 #define CONFIG_USE_CACHE #define CONFIG_USE_MMU -#define CONFIG_USE_SYS_TICK +/* CONFIG_USE_SYS_TICK is not set */ /* CONFIG_MMU_DEBUG_PRINTS is not set */ /* end of Arch Configuration */ @@ -70,9 +70,9 @@ /* CONFIG_LOG_VERBOS is not set */ /* CONFIG_LOG_DEBUG is not set */ -#define CONFIG_LOG_INFO +/* CONFIG_LOG_INFO is not set */ /* CONFIG_LOG_WARN is not set */ -/* CONFIG_LOG_ERROR is not set */ +#define CONFIG_LOG_ERROR /* CONFIG_LOG_NONE is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER @@ -87,7 +87,7 @@ /* CONFIG_USER_DEFINED_LD is not set */ #define CONFIG_LINK_SCRIPT_ROM #define CONFIG_ROM_START_UP_ADDR 0x80100000 -#define CONFIG_ROM_SIZE_MB 1 +#define CONFIG_ROM_SIZE_MB 2 #define CONFIG_LINK_SCRIPT_RAM #define CONFIG_RAM_START_UP_ADDR 0x81000000 #define CONFIG_RAM_SIZE_MB 64 @@ -178,7 +178,7 @@ /* 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_TLSF is not set */ +#define CONFIG_USE_TLSF /* CONFIG_USE_SDMMC_CMD is not set */ /* CONFIG_USE_CHERRY_USB is not set */ /* end of FreeRTOS Setting */ diff --git a/example/freertos_feature/eventgroup/src/management.c b/example/freertos_feature/eventgroup/src/management.c index f4fdc48487bb88e75379d7fbc1824d879cba6a3e..422a1a8b31cbc7e57b936905eac6c0a9adfb85cf 100644 --- a/example/freertos_feature/eventgroup/src/management.c +++ b/example/freertos_feature/eventgroup/src/management.c @@ -9,8 +9,8 @@ This example demonstrates how to: #include "task.h" #include "event_groups.h" #include "timers.h" /* For the xTimerPendFunctionCallFromISR() function. */ -#include "interrupt.h" -#include "cpu_info.h" +#include "finterrupt.h" +#include "fcpu_info.h" static xTaskHandle xtask1_handle; static xTaskHandle xtask2_handle; diff --git a/example/freertos_feature/interrupt/README.md b/example/freertos_feature/interrupt/README.md index c6d80dc4e13efc444d5aec08dab72aa9230496ab..16fccfb221358c0634771e0d03f58e37a8621b02 100644 --- a/example/freertos_feature/interrupt/README.md +++ b/example/freertos_feature/interrupt/README.md @@ -31,7 +31,7 @@ ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(FT2000-4/D2000/E2000D) +- Phytium开发板(FT2000-4/D2000/E2000D/E2000Q) - [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 硬件配置方法 @@ -41,12 +41,14 @@ - FT2000-4 - D2000 - E2000D +- E2000Q 对应的配置项是, - CONFIG_TARGET_F2000_4 - CONFIG_TARGET_D2000 - CONFIG_TARGET_E2000D +- CONFIG_TARGET_E2000Q ### 2.2 SDK配置方法 @@ -68,6 +70,8 @@ - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 @@ -123,10 +127,19 @@ bootelf -p 0x90100000 - 系统进入后,输入```intr```查看指令说明 - 输入```intr bin_cre```,启动二进制信号量任务测试 - 输入```intr bin_del```,删除二进制信号量任务测试 + +![bin](./figs/intr_bin.png) + - 输入```intr count_cre```,启动计数信号量任务测试 - 输入```intr count_del```,删除计数信号量任务测试 + +![count](./figs/intr_count.png) + - 输入```intr queue_cre```,启动在中服务程序中使用queue测试 - 输入```intr queue_del```,删除在中服务程序中使用queue测试 + +![queue](./figs/intr_queue.png) + - 测试任务能够能正常创建和删除,输入```ps```查看任务状态正常,即测试正常 ## 3. 如何解决问题 diff --git a/example/freertos_feature/interrupt/figs/intr_bin.png b/example/freertos_feature/interrupt/figs/intr_bin.png new file mode 100644 index 0000000000000000000000000000000000000000..421da8c92b6b154f1e63acdecaa689b527f5fdc1 Binary files /dev/null and b/example/freertos_feature/interrupt/figs/intr_bin.png differ diff --git a/example/freertos_feature/interrupt/figs/intr_count.png b/example/freertos_feature/interrupt/figs/intr_count.png new file mode 100644 index 0000000000000000000000000000000000000000..03627251e1974e8dccf399a5e8defc39d9be3ab1 Binary files /dev/null and b/example/freertos_feature/interrupt/figs/intr_count.png differ diff --git a/example/freertos_feature/interrupt/figs/intr_queue.png b/example/freertos_feature/interrupt/figs/intr_queue.png new file mode 100644 index 0000000000000000000000000000000000000000..27f9925fe4caa702ca8313d81f29b9de06af30d3 Binary files /dev/null and b/example/freertos_feature/interrupt/figs/intr_queue.png differ diff --git a/example/freertos_feature/interrupt/src/binary_semaphore.c b/example/freertos_feature/interrupt/src/binary_semaphore.c index b50134f52c0eb55d8b5480fc1eadf7540f68b7f8..6752e0ee3cd0896b979a01e221d4d489c8315fbe 100644 --- a/example/freertos_feature/interrupt/src/binary_semaphore.c +++ b/example/freertos_feature/interrupt/src/binary_semaphore.c @@ -4,8 +4,8 @@ #include "task.h" #include "semphr.h" #include "croutine.h" -#include "interrupt.h" -#include "cpu_info.h" +#include "finterrupt.h" +#include "fcpu_info.h" static xTaskHandle xtask1_handle; diff --git a/example/freertos_feature/interrupt/src/counting_semaphore.c b/example/freertos_feature/interrupt/src/counting_semaphore.c index 1451810fa6e66e2e10e6173d0d2ff619c04b5ffe..38a9c61db554a770ab20b5f660fa8a0ebf1135a1 100644 --- a/example/freertos_feature/interrupt/src/counting_semaphore.c +++ b/example/freertos_feature/interrupt/src/counting_semaphore.c @@ -6,8 +6,8 @@ #include "queue.h" #include "semphr.h" #include "croutine.h" -#include "interrupt.h" -#include "cpu_info.h" +#include "finterrupt.h" +#include "fcpu_info.h" static xTaskHandle xtask1_handle; static xTaskHandle xtask2_handle; diff --git a/example/freertos_feature/interrupt/src/queue_from_interrupt.c b/example/freertos_feature/interrupt/src/queue_from_interrupt.c index 2ae7193178b287368ca6b62ba98e2f51abe35318..c504a690f94d59443a12d825a543c4bdfde1f775 100644 --- a/example/freertos_feature/interrupt/src/queue_from_interrupt.c +++ b/example/freertos_feature/interrupt/src/queue_from_interrupt.c @@ -5,8 +5,8 @@ #include "queue.h" #include "semphr.h" #include "croutine.h" -#include "interrupt.h" -#include "cpu_info.h" +#include "finterrupt.h" +#include "fcpu_info.h" static xTaskHandle xtask1_handle; static xTaskHandle xtask2_handle; diff --git a/example/freertos_feature/queue/README.md b/example/freertos_feature/queue/README.md index b34158c77a197825dcfa7622cdee73aa9e9cf1fb..ecbfe7c2c84bb5e0eb79ea68836b5d9c98a15966 100644 --- a/example/freertos_feature/queue/README.md +++ b/example/freertos_feature/queue/README.md @@ -31,7 +31,7 @@ ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(FT2000-4/D2000/E2000D) +- Phytium开发板(FT2000-4/D2000/E2000D/E2000Q) - [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 硬件配置方法 @@ -41,12 +41,14 @@ - FT2000-4 - D2000 - E2000D +- E2000Q 对应的配置项是, - CONFIG_TARGET_F2000_4 - CONFIG_TARGET_D2000 - CONFIG_TARGET_E2000D +- CONFIG_TARGET_E2000Q ### 2.2 SDK配置方法 @@ -68,6 +70,8 @@ - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 @@ -123,10 +127,19 @@ bootelf -p 0x90100000 - 系统进入后,输入```queue```查看指令说明 - 输入```queue int_cre```,启动queue的int类型数据的收发任务测试 - 输入```queue int_del```,删除queue的int类型数据的收发任务测试 + +![int](./figs/queue_int.png) + - 输入```queue struct_cre```,启动queue的struct类型数据的收发任务测试 - 输入```queue struct_del```,删除queue的struct类型数据的收发任务测试 + +![struct](./figs/queue_set.png) + - 输入```queue set_cre```,启动queue的set函数使用,收发任务测试 - 输入```queue set_del```,删除queue的set函数使用,收发任务测试 + +![set](./figs/queue_struct.png) + - 测试任务能够能正常创建和删除,输入```ps```查看任务状态正常,即测试正常 ## 3. 如何解决问题 diff --git a/example/freertos_feature/queue/figs/queue_int.png b/example/freertos_feature/queue/figs/queue_int.png new file mode 100644 index 0000000000000000000000000000000000000000..e93b660ff73209df088d566cf1ec87b362bf9868 Binary files /dev/null and b/example/freertos_feature/queue/figs/queue_int.png differ diff --git a/example/freertos_feature/queue/figs/queue_set.png b/example/freertos_feature/queue/figs/queue_set.png new file mode 100644 index 0000000000000000000000000000000000000000..154203ede093dd1e7f312a8a357ceab48d9f4156 Binary files /dev/null and b/example/freertos_feature/queue/figs/queue_set.png differ diff --git a/example/freertos_feature/queue/figs/queue_struct.png b/example/freertos_feature/queue/figs/queue_struct.png new file mode 100644 index 0000000000000000000000000000000000000000..c8cf5b182a0c493e66f6886c3eae33f51afa5783 Binary files /dev/null and b/example/freertos_feature/queue/figs/queue_struct.png differ diff --git a/example/freertos_feature/resource/README.md b/example/freertos_feature/resource/README.md index 61dcba604e07b5f89c3da6afec66c39e66538682..5a12d9d30b0437592def7d8e5af3e6ca791bb7f0 100644 --- a/example/freertos_feature/resource/README.md +++ b/example/freertos_feature/resource/README.md @@ -32,7 +32,7 @@ ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(FT2000-4/D2000/E2000D) +- Phytium开发板(FT2000-4/D2000/E2000D/E2000Q) - [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 硬件配置方法 @@ -42,13 +42,14 @@ - FT2000-4 - D2000 - E2000D +- E2000Q 对应的配置项是, - CONFIG_TARGET_F2000_4 - CONFIG_TARGET_D2000 - CONFIG_TARGET_E2000D - +- CONFIG_TARGET_E2000Q ### 2.2 SDK配置方法 本例程需要, @@ -69,6 +70,8 @@ - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 @@ -137,8 +140,14 @@ bootelf -p 0x90100000 - 系统进入后,输入```resource```查看指令说明 - 输入```resource mutex_cre```,启动互斥信号量任务测试 - 输入```resource mutex_del```,删除互斥信号量任务测试 + +![mutex](./figs/resource_mutex.png) + - 输入```resource gate_cre```,启动守护任务测试 - 输入```resource gate_del```,删除守护任务测试 + +![gate](./figs/resource_gate.png) + - 测试任务能够能正常创建和删除,输入```ps```查看任务状态正常,即测试正常 ## 3. 如何解决问题 diff --git a/example/freertos_feature/resource/figs/resource_gate.png b/example/freertos_feature/resource/figs/resource_gate.png new file mode 100644 index 0000000000000000000000000000000000000000..177990b9442e84e9a10353769f51410db514cac7 Binary files /dev/null and b/example/freertos_feature/resource/figs/resource_gate.png differ diff --git a/example/freertos_feature/resource/figs/resource_mutex.png b/example/freertos_feature/resource/figs/resource_mutex.png new file mode 100644 index 0000000000000000000000000000000000000000..ed4f704d8db6020ac4470ea3e8372414ba6a70db Binary files /dev/null and b/example/freertos_feature/resource/figs/resource_mutex.png differ diff --git a/example/freertos_feature/software_timer/README.md b/example/freertos_feature/software_timer/README.md index 1f7084d7a7a76449ce676569885235c17c9e0b23..94dd85c904c32f43743f9ff82edc35ebaa73ac8d 100644 --- a/example/freertos_feature/software_timer/README.md +++ b/example/freertos_feature/software_timer/README.md @@ -34,7 +34,7 @@ FreeRTOS 提供的软件定时器支持单次模式和周期模式; ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(FT2000-4/D2000/E2000D) +- Phytium开发板(FT2000-4/D2000/E2000D/E2000Q) - [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 硬件配置方法 @@ -44,12 +44,14 @@ FreeRTOS 提供的软件定时器支持单次模式和周期模式; - FT2000-4 - D2000 - E2000D +- E2000Q 对应的配置项是, - CONFIG_TARGET_F2000_4 - CONFIG_TARGET_D2000 - CONFIG_TARGET_E2000D +- CONFIG_TARGET_E2000Q ### 2.2 SDK配置方法 @@ -71,6 +73,8 @@ FreeRTOS 提供的软件定时器支持单次模式和周期模式; - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 @@ -126,8 +130,14 @@ bootelf -p 0x90100000 - 系统进入后,输入```timer```查看指令说明 - 输入```timer cre```,启动创建、使能定时器测试 - 输入```timer del```,删除创建、使能定时器测试 + +![cre](./figs/timer_cre.png) + - 输入```timer reset_cre```,启动定时器复位、设置id测试 - 输入```timer reset_del```,删除定时器复位、设置id测试 + +![reset](./figs/timer_reset.png) + - 测试任务能够能正常创建和删除,输入```ps```查看任务状态正常,即测试正常 ## 3. 如何解决问题 diff --git a/example/freertos_feature/software_timer/figs/timer_cre.png b/example/freertos_feature/software_timer/figs/timer_cre.png new file mode 100644 index 0000000000000000000000000000000000000000..7702560b49ab487750fa6fdb2c8027688ff1a7fe Binary files /dev/null and b/example/freertos_feature/software_timer/figs/timer_cre.png differ diff --git a/example/freertos_feature/software_timer/figs/timer_reset.png b/example/freertos_feature/software_timer/figs/timer_reset.png new file mode 100644 index 0000000000000000000000000000000000000000..c6d1928b2e2a0dce5ebf79aed11a59e2027a7217 Binary files /dev/null and b/example/freertos_feature/software_timer/figs/timer_reset.png differ diff --git a/example/freertos_feature/task/README.md b/example/freertos_feature/task/README.md index d2113a4b6bd37666373c3db7b9d3bc398b95e56e..fed68d72ee9e47342736c2e867e21379dbd49a93 100644 --- a/example/freertos_feature/task/README.md +++ b/example/freertos_feature/task/README.md @@ -68,6 +68,8 @@ - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 @@ -133,9 +135,18 @@ bootelf -p 0x90100000 ### 2.4 输出与实验现象 - 系统进入后,输入```task```查看指令说明 + +![](.\figs\task_result.png) + - 执行相应的cre和del操作,创建和删除测试任务 +![](.\figs\task_cre.png) + +![](.\figs\task_del.png) + - 测试任务能够能正常创建和删除,输入```ps```查看任务状态正常,即测试正常 +![](./pic/task_command.png) + ## 3. 如何解决问题 Q: ps查看任务状态异常 @@ -145,4 +156,3 @@ A: 当使用了某个例程,且该例程中的任务未使用vTaskDelay进行 - diff --git a/example/freertos_feature/task/configs/e2000q_aarch32_eg_configs b/example/freertos_feature/task/configs/e2000q_aarch32_eg_configs index 12c0784df24a15fadd89e09643ef5d891f82e7ed..1b53ed9171a1fca357a6362a54b3f83039f9a6fd 100644 --- a/example/freertos_feature/task/configs/e2000q_aarch32_eg_configs +++ b/example/freertos_feature/task/configs/e2000q_aarch32_eg_configs @@ -2,7 +2,7 @@ # # Freertos Configuration # -CONFIG_TARGET_NAME="e2000q_freertos_a32" +CONFIG_TARGET_NAME="e2000d_freertos_a32" # end of Freertos Configuration # @@ -207,7 +207,7 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration -# CONFIG_USE_TLSF is not set +CONFIG_USE_TLSF=y # CONFIG_USE_SDMMC_CMD is not set # CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/freertos_feature/task/configs/e2000q_aarch64_eg_configs b/example/freertos_feature/task/configs/e2000q_aarch64_eg_configs index 61cc997cbe184390ffc2756b9cf9213e657452e3..506efc21145e3c62ebe1b565aaebe9ed68d02d8b 100644 --- a/example/freertos_feature/task/configs/e2000q_aarch64_eg_configs +++ b/example/freertos_feature/task/configs/e2000q_aarch64_eg_configs @@ -2,7 +2,7 @@ # # Freertos Configuration # -CONFIG_TARGET_NAME="e2000q_freertos_a64" +CONFIG_TARGET_NAME="e2000d_freertos_a64" # end of Freertos Configuration # @@ -75,11 +75,11 @@ CONFIG_USE_NEW_LIBC=y # # Building Option # -CONFIG_LOG_VERBOS=y +# 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 is not set +CONFIG_LOG_ERROR=y # CONFIG_LOG_NONE is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y @@ -203,7 +203,7 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration -# CONFIG_USE_TLSF is not set +CONFIG_USE_TLSF=y # CONFIG_USE_SDMMC_CMD is not set # CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/freertos_feature/task/figs/task_cre.png b/example/freertos_feature/task/figs/task_cre.png new file mode 100644 index 0000000000000000000000000000000000000000..3a37b004434a046c02ff130ed16b189cae469ed7 Binary files /dev/null and b/example/freertos_feature/task/figs/task_cre.png differ diff --git a/example/freertos_feature/task/figs/task_del.png b/example/freertos_feature/task/figs/task_del.png new file mode 100644 index 0000000000000000000000000000000000000000..7d9d18cf15bc929dc92bbd1ba4784c9292417502 Binary files /dev/null and b/example/freertos_feature/task/figs/task_del.png differ diff --git a/example/freertos_feature/task/figs/task_result.png b/example/freertos_feature/task/figs/task_result.png new file mode 100644 index 0000000000000000000000000000000000000000..a25a0b1578a760d0cf9b04192fe6a1d79a848697 Binary files /dev/null and b/example/freertos_feature/task/figs/task_result.png differ diff --git a/example/freertos_feature/task/pic/task_command.png b/example/freertos_feature/task/pic/task_command.png new file mode 100644 index 0000000000000000000000000000000000000000..13af7262c1e299d87745ef996b939b6a623968b7 Binary files /dev/null and b/example/freertos_feature/task/pic/task_command.png differ diff --git a/example/freertos_feature/task/sdkconfig b/example/freertos_feature/task/sdkconfig index 61cc997cbe184390ffc2756b9cf9213e657452e3..506efc21145e3c62ebe1b565aaebe9ed68d02d8b 100644 --- a/example/freertos_feature/task/sdkconfig +++ b/example/freertos_feature/task/sdkconfig @@ -2,7 +2,7 @@ # # Freertos Configuration # -CONFIG_TARGET_NAME="e2000q_freertos_a64" +CONFIG_TARGET_NAME="e2000d_freertos_a64" # end of Freertos Configuration # @@ -75,11 +75,11 @@ CONFIG_USE_NEW_LIBC=y # # Building Option # -CONFIG_LOG_VERBOS=y +# 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 is not set +CONFIG_LOG_ERROR=y # CONFIG_LOG_NONE is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y @@ -203,7 +203,7 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration -# CONFIG_USE_TLSF is not set +CONFIG_USE_TLSF=y # CONFIG_USE_SDMMC_CMD is not set # CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/freertos_feature/task/sdkconfig.h b/example/freertos_feature/task/sdkconfig.h index aa040345f1cc858b08aefcbb3bed2cc240295c3d..2ccaa5366aa6f3e1d5c66ad7cf530e14cd54c5cb 100644 --- a/example/freertos_feature/task/sdkconfig.h +++ b/example/freertos_feature/task/sdkconfig.h @@ -3,7 +3,7 @@ /* Freertos Configuration */ -#define CONFIG_TARGET_NAME "e2000q_freertos_a64" +#define CONFIG_TARGET_NAME "e2000d_freertos_a64" /* end of Freertos Configuration */ /* Standalone Setting */ @@ -68,11 +68,11 @@ /* Building Option */ -#define CONFIG_LOG_VERBOS +/* 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 is not set */ +#define CONFIG_LOG_ERROR /* CONFIG_LOG_NONE is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG #define CONFIG_INTERRUPT_ROLE_MASTER @@ -178,7 +178,7 @@ /* 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_TLSF is not set */ +#define CONFIG_USE_TLSF /* CONFIG_USE_SDMMC_CMD is not set */ /* CONFIG_USE_CHERRY_USB is not set */ /* end of FreeRTOS Setting */ diff --git a/example/freertos_feature/task_notify/README.md b/example/freertos_feature/task_notify/README.md index 66c70cfa811751c0fcbee68a3e9e0933d223d77b..934cfa56688a834959a47bf23309e1e548682fe6 100644 --- a/example/freertos_feature/task_notify/README.md +++ b/example/freertos_feature/task_notify/README.md @@ -72,6 +72,8 @@ FreeRTOS 从 V8.2.0 版本开始提供任务通知这个功能,每个任务都 - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 @@ -131,6 +133,8 @@ bootelf -p 0x90100000 - 输入```notify false_del```,删除ulTaskNotifyTake pdFALSE测试 - 测试任务能够能正常创建和删除,输入```ps```查看任务状态正常,即测试正常 +![](./pic/task_notify.png) + ## 3. 如何解决问题 diff --git a/example/freertos_feature/task_notify/configs/e2000q_aarch32_eg_configs b/example/freertos_feature/task_notify/configs/e2000q_aarch32_eg_configs index 2fe965a523e72eb1736dfda348ff99451b89d666..1b53ed9171a1fca357a6362a54b3f83039f9a6fd 100644 --- a/example/freertos_feature/task_notify/configs/e2000q_aarch32_eg_configs +++ b/example/freertos_feature/task_notify/configs/e2000q_aarch32_eg_configs @@ -2,7 +2,7 @@ # # Freertos Configuration # -CONFIG_TARGET_NAME="e2000q_freertos_a32" +CONFIG_TARGET_NAME="e2000d_freertos_a32" # end of Freertos Configuration # @@ -17,7 +17,7 @@ CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set CONFIG_USE_CACHE=y CONFIG_USE_MMU=y -CONFIG_USE_SYS_TICK=y +# CONFIG_USE_SYS_TICK is not set CONFIG_USE_AARCH64_L1_TO_AARCH32=y # end of Arch Configuration @@ -77,9 +77,9 @@ CONFIG_USE_NEW_LIBC=y # # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set -CONFIG_LOG_INFO=y +# CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set +CONFIG_LOG_ERROR=y # CONFIG_LOG_NONE is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y @@ -95,7 +95,7 @@ CONFIG_AARCH32_RAM_LD=y # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y CONFIG_ROM_START_UP_ADDR=0x80100000 -CONFIG_ROM_SIZE_MB=1 +CONFIG_ROM_SIZE_MB=2 CONFIG_LINK_SCRIPT_RAM=y CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 @@ -207,7 +207,7 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration -# CONFIG_USE_TLSF is not set +CONFIG_USE_TLSF=y # CONFIG_USE_SDMMC_CMD is not set # CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/freertos_feature/task_notify/pic/task_notify.png b/example/freertos_feature/task_notify/pic/task_notify.png new file mode 100644 index 0000000000000000000000000000000000000000..9d1cde1a109927e3a5953d1f3116bcc0c0ac05d9 Binary files /dev/null and b/example/freertos_feature/task_notify/pic/task_notify.png differ diff --git a/example/freertos_feature/task_notify/src/notify_take_false.c b/example/freertos_feature/task_notify/src/notify_take_false.c index 9de8315d905a45d2f2c56e5c94259af886188e5d..a5b1d60a1a215ffaafa218e14d137c93ec0d6c21 100644 --- a/example/freertos_feature/task_notify/src/notify_take_false.c +++ b/example/freertos_feature/task_notify/src/notify_take_false.c @@ -10,8 +10,8 @@ that have occurred, and the number of events that have been processed. #include "FreeRTOS.h" #include "task.h" #include "semphr.h" -#include "interrupt.h" -#include "cpu_info.h" +#include "finterrupt.h" +#include "fcpu_info.h" #define TASK_STACK_SIZE 1024 diff --git a/example/freertos_feature/task_notify/src/notify_take_true.c b/example/freertos_feature/task_notify/src/notify_take_true.c index 784a0ddc4436404ad3f95a967c8e26af1509a6c1..3e931a795ad3d547ed9cbcbb45ed4b2d99357837 100644 --- a/example/freertos_feature/task_notify/src/notify_take_true.c +++ b/example/freertos_feature/task_notify/src/notify_take_true.c @@ -8,8 +8,8 @@ the ulTaskNotifyTake() xClearOnExit parameter was set to pdTRUE. #include "FreeRTOS.h" #include "task.h" #include "semphr.h" -#include "interrupt.h" -#include "cpu_info.h" +#include "finterrupt.h" +#include "fcpu_info.h" static xTaskHandle xtask1_handle = NULL; static xTaskHandle xtask2_handle = NULL; diff --git a/example/network/gmac_lwip_test/src/lwip_test.c b/example/network/gmac_lwip_test/src/lwip_test.c index 3af3f051474b985d63eadf21d91141dff4f94b39..fa4bbc18cd064287ad7fe673076ccdbc9462f70a 100644 --- a/example/network/gmac_lwip_test/src/lwip_test.c +++ b/example/network/gmac_lwip_test/src/lwip_test.c @@ -27,8 +27,8 @@ #include "sdkconfig.h" #include "FreeRTOS.h" #include "task.h" -#include "ft_types.h" -#include "parameters.h" +#include "ftypes.h" +#include "fparameters.h" #ifndef SDK_CONFIG_H__ #error "Please include sdkconfig.h first" diff --git a/example/network/sockets/udp_multicast/src/lwip_test.c b/example/network/sockets/udp_multicast/src/lwip_test.c index 5b05569e3f25ab6dd4bb0b3ed03db1de34d15c76..80206a378fba5df92460445fc83d2a61e5a13c6d 100644 --- a/example/network/sockets/udp_multicast/src/lwip_test.c +++ b/example/network/sockets/udp_multicast/src/lwip_test.c @@ -28,7 +28,7 @@ #include "sdkconfig.h" #include "FreeRTOS.h" #include "task.h" -#include "ft_types.h" +#include "ftypes.h" #include "fpinctrl.h" #ifndef SDK_CONFIG_H__ #error "Please include sdkconfig.h first" diff --git a/example/network/sockets/udp_multicast/src/multicast.c b/example/network/sockets/udp_multicast/src/multicast.c index e26caaf023fa759c1a20f6bda822ace4a9f80cd8..809fa1c7bed71b3afbca363424b5620c7b76f5ef 100644 --- a/example/network/sockets/udp_multicast/src/multicast.c +++ b/example/network/sockets/udp_multicast/src/multicast.c @@ -32,10 +32,10 @@ #include "sys.h" #include "netif.h" #include -#include "ft_types.h" +#include "ftypes.h" #include "shell.h" -#include "ft_debug.h" +#include "fdebug.h" #define MULTICAST_DEBUG_TAG "MULTICAST" #define MULTICAST_PRINT_E(format, ...) FT_DEBUG_PRINT_E(MULTICAST_DEBUG_TAG, format, ##__VA_ARGS__) diff --git a/example/network/xmac_lwip_test/src/lwip_test.c b/example/network/xmac_lwip_test/src/lwip_test.c index 2b1860f8f7cdefd192815567e96cc379b320bd35..b8245fbfd8b78260a96655964cf74b7564b72b52 100644 --- a/example/network/xmac_lwip_test/src/lwip_test.c +++ b/example/network/xmac_lwip_test/src/lwip_test.c @@ -27,7 +27,7 @@ #include "sdkconfig.h" #include "FreeRTOS.h" #include "task.h" -#include "ft_types.h" +#include "ftypes.h" #include "fpinctrl.h" #ifndef SDK_CONFIG_H__ #error "Please include sdkconfig.h first" diff --git a/example/peripheral/adc/README.md b/example/peripheral/adc/README.md index d6743b3fa5daf5f6f2431ff96b0dce17db51fc9d..2b91c00546660569925653d37ca4cc4dc155a991 100644 --- a/example/peripheral/adc/README.md +++ b/example/peripheral/adc/README.md @@ -34,7 +34,7 @@ ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(E2000D/E2000Q) +- Phytium开发板(E2000D) - [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 硬件配置方法 @@ -42,12 +42,10 @@ 本例程支持的硬件平台包括 - E2000D -- E2000Q 对应的配置项是, - CONFIG_TARGET_E2000D -- CONFIG_TARGET_E2000Q ### 2.2 SDK配置方法 @@ -68,8 +66,6 @@ - make boot 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 -- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 -- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 @@ -82,11 +78,11 @@ #### 2.3.1 构建过程 - 在host侧完成配置 -配置成e2000q,对于其它平台,使用对于的默认配置,如e2000d `make load_e2000d_aarch32` +配置成e2000d - 选择目标平台 ``` -make load_e2000q_aarch32 +make load_e2000d_aarch32 ``` - 选择例程需要的配置 diff --git a/example/peripheral/adc/figs/create.png b/example/peripheral/adc/figs/create.png index 72b39e56766fde304a0dad2b614a6496166211d0..c56a4d3485e446b5d02ca919c4bfc2b8ca151364 100644 Binary files a/example/peripheral/adc/figs/create.png and b/example/peripheral/adc/figs/create.png differ diff --git a/example/peripheral/adc/sdkconfig b/example/peripheral/adc/sdkconfig index 81066e3c606ad6d5f642647b136ed2f0d6acdaf8..4e2e0dfec4ef3a32f2dbeba38ca8486a12998648 100644 --- a/example/peripheral/adc/sdkconfig +++ b/example/peripheral/adc/sdkconfig @@ -2,7 +2,7 @@ # # Freertos Configuration # -CONFIG_TARGET_NAME="e2000q_freertos_a64" +CONFIG_TARGET_NAME="e2000d_freertos_a64" # end of Freertos Configuration # @@ -26,8 +26,8 @@ CONFIG_USE_SYS_TICK=y # # CONFIG_TARGET_F2000_4 is not set # CONFIG_TARGET_D2000 is not set -CONFIG_TARGET_E2000Q=y -# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000Q is not set +CONFIG_TARGET_E2000D=y # CONFIG_TARGET_E2000S is not set CONFIG_TARGET_E2000=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y diff --git a/example/peripheral/adc/sdkconfig.h b/example/peripheral/adc/sdkconfig.h index eb38cda4b1ff787a32117ba9ff07b76e9701e533..5a057cb72e85731a15cdd86bf1e5c90d3fb6d341 100644 --- a/example/peripheral/adc/sdkconfig.h +++ b/example/peripheral/adc/sdkconfig.h @@ -3,7 +3,7 @@ /* Freertos Configuration */ -#define CONFIG_TARGET_NAME "e2000q_freertos_a64" +#define CONFIG_TARGET_NAME "e2000d_freertos_a64" /* end of Freertos Configuration */ /* Standalone Setting */ @@ -24,8 +24,8 @@ /* CONFIG_TARGET_F2000_4 is not set */ /* CONFIG_TARGET_D2000 is not set */ -#define CONFIG_TARGET_E2000Q -/* CONFIG_TARGET_E2000D is not set */ +/* CONFIG_TARGET_E2000Q is not set */ +#define CONFIG_TARGET_E2000D /* CONFIG_TARGET_E2000S is not set */ #define CONFIG_TARGET_E2000 #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 diff --git a/example/peripheral/adc/src/adc_example.c b/example/peripheral/adc/src/adc_example.c index a19185aa3eeb34d45c423c53ec8eb224d6e2da8a..6387d65c4d40daba232fb136267c46f4b96fc35f 100644 --- a/example/peripheral/adc/src/adc_example.c +++ b/example/peripheral/adc/src/adc_example.c @@ -27,9 +27,9 @@ #include "timers.h" #include "fadc.h" #include "fadc_os.h" -#include "cpu_info.h" +#include "fcpu_info.h" #include "fpinctrl.h" -#include "ft_assert.h" +#include "fassert.h" /* The periods assigned to the one-shot timers. */ #define ONE_SHOT_TIMER_PERIOD ( pdMS_TO_TICKS( 60000UL )) diff --git a/example/peripheral/can/src/can_example.c b/example/peripheral/can/src/can_example.c index 71bcf20275222dff99bca84e793e5c19dc9a77f5..fa2fb3cb2d202a43c3fcd3e9cf1cfe8905e59d70 100644 --- a/example/peripheral/can/src/can_example.c +++ b/example/peripheral/can/src/can_example.c @@ -28,10 +28,10 @@ #include "timers.h" #include "fcan.h" #include "fcan_os.h" -#include "cpu_info.h" +#include "fcpu_info.h" #include "fpinctrl.h" -#include "ft_assert.h" -#include "ft_debug.h" +#include "fassert.h" +#include "fdebug.h" #define FCAN_TEST_DEBUG_TAG "FCAN_FREERTOS_TEST" #define FCAN_TEST_DEBUG(format, ...) FT_DEBUG_PRINT_D(FCAN_TEST_DEBUG_TAG, format, ##__VA_ARGS__) @@ -49,23 +49,16 @@ #define ARB_BAUD_RATE 1000000 #define DATA_BAUD_RATE 1000000 -/* test task number */ -// #define TEST_TASK_NUM 2 - typedef struct { u32 count; FFreeRTOSCan *os_can_p; } FCanQueueData; -// static xSemaphoreHandle xCountingSemaphore; - /* Declare a variable of type QueueHandle_t. This is used to store the queue that is accessed by all three tasks. */ static QueueHandle_t xQueue; - - static xTaskHandle send_handle; static xTaskHandle recv_handle; @@ -406,8 +399,6 @@ BaseType_t FFreeRTOSCanCreate(void) printf("FFreeRTOSCanCreate FCanQueueData create failed.\r\n" ); return pdFAIL; } - - /* enter critical region */ /* can init task */ xReturn = xTaskCreate((TaskFunction_t )FFreeRTOSCanInitTask, /* 任务入口函数 */ @@ -448,9 +439,6 @@ BaseType_t FFreeRTOSCanCreate(void) { vPrintf("CreateSoftwareTimerTasks xTimerCreate failed \r\n"); } - - /* exit critical region */ - // taskEXIT_CRITICAL(); return xReturn; } @@ -474,9 +462,6 @@ static void FFreeRTOSCanDelete(void) /* deinit can os instance */ FFreeRTOSCanDeinit(os_can_ctrl_p[FCAN_INSTANCE_0]); FFreeRTOSCanDeinit(os_can_ctrl_p[FCAN_INSTANCE_1]); - - /* delete count sem */ - // vSemaphoreDelete(xCountingSemaphore); /* delete queue */ vQueueDelete(xQueue); diff --git a/example/peripheral/dma/ddma/README.md b/example/peripheral/dma/ddma/README.md index fcdbd25e0c30b4a1e58577483abff7ab618ca3b7..cb777a24e64cf4d80069b8ade76cda04ae9fcc98 100644 --- a/example/peripheral/dma/ddma/README.md +++ b/example/peripheral/dma/ddma/README.md @@ -13,6 +13,13 @@ 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 脚 + +![](./figs/board.jpg) + +![](./figs/spi2_pin.jpg) + ### 2.1 硬件配置方法 本例程支持的硬件平台包括 @@ -21,9 +28,8 @@ DDMA (Device Direct Memory Access) 用于配合外设,将数据从一个内存 对应的配置项是, -- CONFIG_TARGET_E2000 +- CONFIG_TARGET_E2000D -本例程在 E2000-A测试板和B测试板完成测试 ### 2.2 SDK配置方法 diff --git a/example/peripheral/dma/ddma/configs/e2000q_aarch32_eg_configs b/example/peripheral/dma/ddma/configs/e2000q_aarch32_eg_configs new file mode 100644 index 0000000000000000000000000000000000000000..dfdb709fc2cd968561303ac188ad54dc26573822 --- /dev/null +++ b/example/peripheral/dma/ddma/configs/e2000q_aarch32_eg_configs @@ -0,0 +1,216 @@ + +# +# Freertos Configuration +# +CONFIG_TARGET_NAME="e2000q_freertos_a32" +# end of Freertos Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +CONFIG_TARGET_ARMV8_AARCH32=y +# CONFIG_TARGET_ARMV8_AARCH64 is not set +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +CONFIG_USE_SYS_TICK=y +CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_TARGET_E2000Q=y +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +CONFIG_USE_SPI=y +CONFIG_USE_FSPIM=y +# 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 is not set +# CONFIG_USE_PCIE is not set +# CONFIG_USE_WDT is not set +CONFIG_USE_DMA=y +# CONFIG_ENABLE_FGDMA is not set +CONFIG_ENABLE_FDDMA=y +# 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 +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# 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_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set + +# +# Linker Options +# +CONFIG_AARCH32_RAM_LD=y +# CONFIG_AARCH64_RAM_LD is not set +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +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 + +# +# Compiler Options +# +CONFIG_OUTPUT_BINARY=y +# end of Compiler Options +# end of Building Option + +# +# 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 +# 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=y +# end of Freertos Spim Drivers + +# +# Freertos DMA Drivers +# +CONFIG_FREERTOS_USE_FDDMA=y +# CONFIG_FREERTOS_USE_FGDMA is not set +# end of Freertos DMA Drivers + +# +# Freertos MMC Drivers +# +# CONFIG_FREERTOS_USE_FSDIO is not set +# end of Freertos MMC 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 +# end of Component Configuration + +# +# FreeRTOS Setting +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_AMP 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_TLSF=y +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set +# end of FreeRTOS Setting diff --git a/example/peripheral/dma/ddma/configs/e2000q_aarch64_eg_configs b/example/peripheral/dma/ddma/configs/e2000q_aarch64_eg_configs new file mode 100644 index 0000000000000000000000000000000000000000..dc348827294edcbd3c48bb1dbfc5c988d60481d5 --- /dev/null +++ b/example/peripheral/dma/ddma/configs/e2000q_aarch64_eg_configs @@ -0,0 +1,212 @@ + +# +# Freertos Configuration +# +CONFIG_TARGET_NAME="e2000q_freertos_a64" +# end of Freertos Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +# CONFIG_TARGET_ARMV8_AARCH32 is not set +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +CONFIG_USE_SYS_TICK=y +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_TARGET_E2000Q=y +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +CONFIG_USE_SPI=y +CONFIG_USE_FSPIM=y +# 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 is not set +# CONFIG_USE_PCIE is not set +# CONFIG_USE_WDT is not set +CONFIG_USE_DMA=y +# CONFIG_ENABLE_FGDMA is not set +CONFIG_ENABLE_FDDMA=y +# 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 +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# 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_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set + +# +# Linker Options +# +# CONFIG_AARCH32_RAM_LD is not set +CONFIG_AARCH64_RAM_LD=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 +# end of Linker Options + +# +# Compiler Options +# +CONFIG_OUTPUT_BINARY=y +# end of Compiler Options +# end of Building Option + +# +# 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 +# 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=y +# end of Freertos Spim Drivers + +# +# Freertos DMA Drivers +# +CONFIG_FREERTOS_USE_FDDMA=y +# CONFIG_FREERTOS_USE_FGDMA is not set +# end of Freertos DMA Drivers + +# +# Freertos MMC Drivers +# +# CONFIG_FREERTOS_USE_FSDIO is not set +# end of Freertos MMC 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 +# end of Component Configuration + +# +# FreeRTOS Setting +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_AMP 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_TLSF=y +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set +# end of FreeRTOS Setting diff --git a/example/peripheral/dma/ddma/figs/board.jpg b/example/peripheral/dma/ddma/figs/board.jpg new file mode 100644 index 0000000000000000000000000000000000000000..55cde8fb06a6cb6cdfcea883005dbef8736bc0e5 Binary files /dev/null and b/example/peripheral/dma/ddma/figs/board.jpg differ diff --git a/example/peripheral/dma/ddma/figs/spi2_pin.jpg b/example/peripheral/dma/ddma/figs/spi2_pin.jpg new file mode 100644 index 0000000000000000000000000000000000000000..808055f73d911cf0aae9204b3b2ba360cde79093 Binary files /dev/null and b/example/peripheral/dma/ddma/figs/spi2_pin.jpg differ diff --git a/example/peripheral/dma/ddma/src/ddma_spi_loopback.c b/example/peripheral/dma/ddma/src/ddma_spi_loopback.c index b1dfe68d79920ab509fac1fca81950d5c3a6a940..a361217194ff80139caeac4f15f8bfa101c66dbc 100644 --- a/example/peripheral/dma/ddma/src/ddma_spi_loopback.c +++ b/example/peripheral/dma/ddma/src/ddma_spi_loopback.c @@ -28,9 +28,9 @@ #include "task.h" #include "queue.h" -#include "cache.h" -#include "ft_assert.h" -#include "ft_debug.h" +#include "fcache.h" +#include "fassert.h" +#include "fdebug.h" #include "fpinctrl.h" #include "fspim_os.h" diff --git a/example/peripheral/dma/gdma/README.md b/example/peripheral/dma/gdma/README.md index 78883bcebfde87eabd280ee3b70e4752db4ff07f..f4ad4bb5ecf7e12bb7a81d445a2e203ae9195ae2 100644 --- a/example/peripheral/dma/gdma/README.md +++ b/example/peripheral/dma/gdma/README.md @@ -13,6 +13,10 @@ GDMA (Generic 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) +- 本例程在E2000D Demo 板测试通过,不需要进行额外连线 + +[](./figs/board.jpg) + ### 2.1 硬件配置方法 本例程支持的硬件平台包括 @@ -21,9 +25,7 @@ GDMA (Generic Direct Memory Access) 用于将数据从一个内存地址复制 对应的配置项是, -- CONFIG_TARGET_E2000 - -本例程在 E2000-A测试板和B测试板完成测试 +- CONFIG_TARGET_E2000D ### 2.2 SDK配置方法 diff --git a/example/peripheral/dma/gdma/configs/e2000q_aarch32_eg_configs b/example/peripheral/dma/gdma/configs/e2000q_aarch32_eg_configs new file mode 100644 index 0000000000000000000000000000000000000000..1e0eacf07048217f8275c900aeafc12019b3960d --- /dev/null +++ b/example/peripheral/dma/gdma/configs/e2000q_aarch32_eg_configs @@ -0,0 +1,215 @@ + +# +# Freertos Configuration +# +CONFIG_TARGET_NAME="e2000q_freertos_a32" +# end of Freertos Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +CONFIG_TARGET_ARMV8_AARCH32=y +# CONFIG_TARGET_ARMV8_AARCH64 is not set +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +# CONFIG_USE_SYS_TICK is not set +CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_TARGET_E2000Q=y +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +# 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 is not set +# CONFIG_USE_PCIE is not set +# CONFIG_USE_WDT is not set +CONFIG_USE_DMA=y +CONFIG_ENABLE_FGDMA=y +# CONFIG_ENABLE_FDDMA 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 +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# 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_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +CONFIG_LOG_EXTRA_INFO=y +# CONFIG_BOOTUP_DEBUG_PRINTS is not set + +# +# Linker Options +# +CONFIG_AARCH32_RAM_LD=y +# CONFIG_AARCH64_RAM_LD is not set +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +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 + +# +# Compiler Options +# +CONFIG_OUTPUT_BINARY=y +# end of Compiler Options +# end of Building Option + +# +# 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 +# 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=y +# end of Freertos DMA Drivers + +# +# Freertos MMC Drivers +# +# CONFIG_FREERTOS_USE_FSDIO is not set +# end of Freertos MMC 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 +# end of Component Configuration + +# +# FreeRTOS Setting +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_AMP 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_TLSF=y +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set +# end of FreeRTOS Setting diff --git a/example/peripheral/adc/configs/e2000q_aarch64_eg_configs b/example/peripheral/dma/gdma/configs/e2000q_aarch64_eg_configs similarity index 92% rename from example/peripheral/adc/configs/e2000q_aarch64_eg_configs rename to example/peripheral/dma/gdma/configs/e2000q_aarch64_eg_configs index 81066e3c606ad6d5f642647b136ed2f0d6acdaf8..dd1633142cacb6bf687bab8a2096e5ef34ecfa86 100644 --- a/example/peripheral/adc/configs/e2000q_aarch64_eg_configs +++ b/example/peripheral/dma/gdma/configs/e2000q_aarch64_eg_configs @@ -59,19 +59,14 @@ CONFIG_ENABLE_Pl011_UART=y # 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_DMA=y +CONFIG_ENABLE_FGDMA=y +# CONFIG_ENABLE_FDDMA 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=y - -# -# ADC Configuration -# -CONFIG_USE_FADC=y -# end of ADC Configuration - +# CONFIG_USE_ADC is not set # CONFIG_USE_PWM is not set # CONFIG_USE_IPC is not set # end of Components Configuration @@ -84,14 +79,14 @@ CONFIG_USE_NEW_LIBC=y # # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set -CONFIG_LOG_INFO=y +# CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set +CONFIG_LOG_ERROR=y # CONFIG_LOG_NONE is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set -# CONFIG_LOG_EXTRA_INFO is not set +CONFIG_LOG_EXTRA_INFO=y # CONFIG_BOOTUP_DEBUG_PRINTS is not set # @@ -168,7 +163,7 @@ CONFIG_FREERTOS_USE_UART=y # Freertos DMA Drivers # # CONFIG_FREERTOS_USE_FDDMA is not set -# CONFIG_FREERTOS_USE_FGDMA is not set +CONFIG_FREERTOS_USE_FGDMA=y # end of Freertos DMA Drivers # @@ -180,7 +175,7 @@ CONFIG_FREERTOS_USE_UART=y # # Freertos Adc Drivers # -CONFIG_FREERTOS_USE_ADC=y +# CONFIG_FREERTOS_USE_ADC is not set # end of Freertos Adc Drivers # @@ -210,7 +205,7 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration -# CONFIG_USE_TLSF is not set +CONFIG_USE_TLSF=y # CONFIG_USE_SDMMC_CMD is not set # CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/peripheral/dma/gdma/figs/board.jpg b/example/peripheral/dma/gdma/figs/board.jpg new file mode 100644 index 0000000000000000000000000000000000000000..55cde8fb06a6cb6cdfcea883005dbef8736bc0e5 Binary files /dev/null and b/example/peripheral/dma/gdma/figs/board.jpg differ diff --git a/example/peripheral/dma/gdma/src/gdma_memcpy.c b/example/peripheral/dma/gdma/src/gdma_memcpy.c index f3ccb1aa690fb06538cca11aaedcd4ae006f1c19..d57fda7f50f2616c2b76a8b9ca56b8e3b6834743 100644 --- a/example/peripheral/dma/gdma/src/gdma_memcpy.c +++ b/example/peripheral/dma/gdma/src/gdma_memcpy.c @@ -28,10 +28,10 @@ #include "task.h" #include "queue.h" -#include "kernel.h" -#include "cache.h" -#include "ft_assert.h" -#include "ft_debug.h" +#include "fkernel.h" +#include "fcache.h" +#include "fassert.h" +#include "fdebug.h" #include "fpinctrl.h" #include "fgdma_os.h" @@ -250,9 +250,9 @@ static void GdmaMemcpyTaskA(void *args) taskENTER_CRITICAL(); printf("[A]memcpy success !!!\r\n"); printf("[A]src buf...\r\n"); - FtDumpHexByte((const u8 *)src_a, min(GDMA_BUF_A_LEN, (fsize_t)64U)); + FtDumpHexByte((const u8 *)src_a, min((fsize_t)GDMA_BUF_A_LEN, (fsize_t)64U)); printf("[A]dst buf...\r\n"); - FtDumpHexByte((const u8 *)dst_a, min(GDMA_BUF_A_LEN, (fsize_t)64U)); + FtDumpHexByte((const u8 *)dst_a, min((fsize_t)GDMA_BUF_A_LEN, (fsize_t)64U)); taskEXIT_CRITICAL(); } else @@ -325,9 +325,9 @@ static void GdmaMemcpyTaskB(void *args) taskENTER_CRITICAL(); printf("[B]memcpy success !!!\r\n"); printf("[B]src buf...\r\n"); - FtDumpHexByte((const u8 *)src_b, min(GDMA_BUF_B_LEN, (fsize_t)64U)); + FtDumpHexByte((const u8 *)src_b, min((fsize_t)GDMA_BUF_B_LEN, (fsize_t)64U)); printf("[B]dst buf...\r\n"); - FtDumpHexByte((const u8 *)dst_b, min(GDMA_BUF_B_LEN, (fsize_t)64U)); + FtDumpHexByte((const u8 *)dst_b, min((fsize_t)GDMA_BUF_B_LEN, (fsize_t)64U)); taskEXIT_CRITICAL(); } else diff --git a/example/peripheral/gpio/README.md b/example/peripheral/gpio/README.md index 19ec7c30d8802e5aa4152c8394afa229f98fdb10..4d6d4d6ce7bb2d0d5a66d1a6f42fffcba2f5991c 100644 --- a/example/peripheral/gpio/README.md +++ b/example/peripheral/gpio/README.md @@ -15,15 +15,22 @@ GPIO (General-purpose input/output),即通用型输入输出,其引脚可以 ### 2.1 硬件配置方法 -本例程支持的硬件平台包括 +本例程需要用到 +- E2000 Q Demo 板 +- 杜邦线 -- E2000 +![](./figs/board.jpg) -对应的配置项是, -- CONFIG_TARGET_E2000 +- 在本例程中连接 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 进行测试 -本例程在 E2000-A测试板和B测试板完成测试 +![](./figs/pin_connect_gpio3.jpg) ### 2.2 SDK配置方法 diff --git a/example/peripheral/adc/configs/e2000q_aarch32_eg_configs b/example/peripheral/gpio/configs/e2000q_aarch32_eg_configs similarity index 95% rename from example/peripheral/adc/configs/e2000q_aarch32_eg_configs rename to example/peripheral/gpio/configs/e2000q_aarch32_eg_configs index 33297c696bfc2432cc6b6776ff0d6dd183b73e26..b83d23040465a105dfc076bf16254dc33ac18060 100644 --- a/example/peripheral/adc/configs/e2000q_aarch32_eg_configs +++ b/example/peripheral/gpio/configs/e2000q_aarch32_eg_configs @@ -50,7 +50,8 @@ CONFIG_USE_SERIAL=y CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration -# CONFIG_USE_GPIO is not set +CONFIG_USE_GPIO=y +CONFIG_ENABLE_FGPIO=y # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -64,14 +65,7 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set -CONFIG_USE_ADC=y - -# -# ADC Configuration -# -CONFIG_USE_FADC=y -# end of ADC Configuration - +# CONFIG_USE_ADC is not set # CONFIG_USE_PWM is not set # CONFIG_USE_IPC is not set # end of Components Configuration @@ -159,7 +153,7 @@ CONFIG_FREERTOS_USE_UART=y # # Freertos Gpio Drivers # -# CONFIG_FREERTOS_USE_GPIO is not set +CONFIG_FREERTOS_USE_GPIO=y # end of Freertos Gpio Drivers # @@ -184,7 +178,7 @@ CONFIG_FREERTOS_USE_UART=y # # Freertos Adc Drivers # -CONFIG_FREERTOS_USE_ADC=y +# CONFIG_FREERTOS_USE_ADC is not set # end of Freertos Adc Drivers # @@ -214,7 +208,7 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration -# CONFIG_USE_TLSF is not set +CONFIG_USE_TLSF=y # CONFIG_USE_SDMMC_CMD is not set # CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/peripheral/gpio/configs/e2000q_aarch64_eg_configs b/example/peripheral/gpio/configs/e2000q_aarch64_eg_configs new file mode 100644 index 0000000000000000000000000000000000000000..7e0ec82676819d3666aff8e3a9e6c8303a108a22 --- /dev/null +++ b/example/peripheral/gpio/configs/e2000q_aarch64_eg_configs @@ -0,0 +1,210 @@ + +# +# Freertos Configuration +# +CONFIG_TARGET_NAME="e2000q_freertos_a64" +# end of Freertos Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +# CONFIG_TARGET_ARMV8_AARCH32 is not set +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +CONFIG_USE_SYS_TICK=y +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_TARGET_E2000Q=y +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +# 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=y +CONFIG_ENABLE_FGPIO=y +# 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 +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# 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_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +CONFIG_LOG_EXTRA_INFO=y +# CONFIG_BOOTUP_DEBUG_PRINTS is not set + +# +# Linker Options +# +# CONFIG_AARCH32_RAM_LD is not set +CONFIG_AARCH64_RAM_LD=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 +# end of Linker Options + +# +# Compiler Options +# +CONFIG_OUTPUT_BINARY=y +# end of Compiler Options +# end of Building Option + +# +# 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 +# end of Freertos Eth Drivers + +# +# Freertos Gpio Drivers +# +CONFIG_FREERTOS_USE_GPIO=y +# 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 MMC Drivers +# +# CONFIG_FREERTOS_USE_FSDIO is not set +# end of Freertos MMC 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 +# end of Component Configuration + +# +# FreeRTOS Setting +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_AMP 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_TLSF=y +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set +# end of FreeRTOS Setting diff --git a/example/peripheral/gpio/figs/board.jpg b/example/peripheral/gpio/figs/board.jpg new file mode 100644 index 0000000000000000000000000000000000000000..55cde8fb06a6cb6cdfcea883005dbef8736bc0e5 Binary files /dev/null and b/example/peripheral/gpio/figs/board.jpg differ diff --git a/example/peripheral/gpio/figs/pin_connect_gpio3.jpg b/example/peripheral/gpio/figs/pin_connect_gpio3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..808055f73d911cf0aae9204b3b2ba360cde79093 Binary files /dev/null and b/example/peripheral/gpio/figs/pin_connect_gpio3.jpg differ diff --git a/example/peripheral/gpio/figs/pin_connect_gpio4.jpg b/example/peripheral/gpio/figs/pin_connect_gpio4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f509f182d3c2d692d0017282e0b41c40bb1a4939 Binary files /dev/null and b/example/peripheral/gpio/figs/pin_connect_gpio4.jpg differ diff --git a/example/peripheral/gpio/src/gpio_io_irq.c b/example/peripheral/gpio/src/gpio_io_irq.c index d91a1fd38e7e5b28c8e72e2e7046243c9f0ade01..54640297d39e91b269746f4652b14712e34d9a16 100644 --- a/example/peripheral/gpio/src/gpio_io_irq.c +++ b/example/peripheral/gpio/src/gpio_io_irq.c @@ -27,7 +27,7 @@ #include "FreeRTOS.h" #include "task.h" -#include "ft_debug.h" +#include "fdebug.h" #include "fsleep.h" #include "fgpio_os.h" diff --git a/example/peripheral/pwm/src/pwm_example.c b/example/peripheral/pwm/src/pwm_example.c index b13e0ccfe9c81b65e76cf1ac1c747ae92afc602c..498847454c19832d18e95481363ad270b0caf6e5 100644 --- a/example/peripheral/pwm/src/pwm_example.c +++ b/example/peripheral/pwm/src/pwm_example.c @@ -27,7 +27,7 @@ #include "timers.h" #include "fpwm.h" #include "fpwm_os.h" -#include "cpu_info.h" +#include "fcpu_info.h" #include "fpinctrl.h" #include "pwm_example.h" diff --git a/example/peripheral/qspi/README.md b/example/peripheral/qspi/README.md index df394754db6e2b0ba14eaac3ce354c44bdd7196a..0733459b04a9e25cfc1bb878cf9f0e5997b7506f 100644 --- a/example/peripheral/qspi/README.md +++ b/example/peripheral/qspi/README.md @@ -74,6 +74,8 @@ E2000D上使用的Nor Flash介质型号是GD25Q128,容量为16MB; - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 @@ -137,8 +139,8 @@ bootelf -p 0x90100000 ## 3. 如何解决问题 -- 若出现读写异常,需确认menuconfig中是否选择了正确的Norflash型号; - +- 若出现读写异常,需确认Norflash型号是否已经适配; +- FLASH_ADDR需要根据实际的flash大小来确定; - 由于开发板上的QSPI接口的NorFlash用于固件启动,因此不建议在不了解固件大小的情况下,使用qspi write写数据,因为这可能导致固件无法正常启动; ## 4. 修改历史记录 diff --git a/example/peripheral/qspi/src/qspi_example.c b/example/peripheral/qspi/src/qspi_example.c index 0c4afd0535a020f3e1659cde1aaa665739fc14e0..d12b1cd33048c2ec29e3462574c4e37c0a3b35e5 100644 --- a/example/peripheral/qspi/src/qspi_example.c +++ b/example/peripheral/qspi/src/qspi_example.c @@ -43,7 +43,7 @@ static xTaskHandle write_handle; static TimerHandle_t xOneShotTimer; /* write and read start address */ -#define FLASH_ADDR 0x700000 +#define FLASH_ADDR (7 * SZ_1M) /* write and read cs channel */ #define QSPI_CS_CHANNEL 0 diff --git a/example/peripheral/sdio/README.md b/example/peripheral/sdio/README.md index a14bba4317a4dfe5108c9343572b3455e736bb8f..df45cc8e8b4ab4d1e21f8ac7e61992acd5ddba5a 100644 --- a/example/peripheral/sdio/README.md +++ b/example/peripheral/sdio/README.md @@ -18,6 +18,8 @@ SD卡的通信依赖三种数据格式:命令包,响应包,数据包,控 - [Phytium FreeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk) - [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) +![](./figs/board.jpg) + ### 2.1 硬件配置方法 本例程支持的硬件平台包括 diff --git a/example/peripheral/sdio/configs/e2000d_aarch64_eg_configs b/example/peripheral/sdio/configs/e2000d_aarch64_eg_configs index 9a99079bd3671cf2b3ecb273c27d1c4048ae94e6..24897cad8f728924962ad72119c72c6da7e001fc 100644 --- a/example/peripheral/sdio/configs/e2000d_aarch64_eg_configs +++ b/example/peripheral/sdio/configs/e2000d_aarch64_eg_configs @@ -78,9 +78,9 @@ CONFIG_USE_NEW_LIBC=y # # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set +CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set -CONFIG_LOG_ERROR=y +# CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y diff --git a/example/peripheral/sdio/configs/e2000q_aarch32_eg_configs b/example/peripheral/sdio/configs/e2000q_aarch32_eg_configs new file mode 100644 index 0000000000000000000000000000000000000000..76430549524018226909f57a3d90255fbe1a41dc --- /dev/null +++ b/example/peripheral/sdio/configs/e2000q_aarch32_eg_configs @@ -0,0 +1,221 @@ + +# +# Freertos Configuration +# +CONFIG_TARGET_NAME="e2000q_freertos_a32" +# end of Freertos Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +CONFIG_TARGET_ARMV8_AARCH32=y +# CONFIG_TARGET_ARMV8_AARCH64 is not set +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +CONFIG_USE_SYS_TICK=y +CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_TARGET_E2000Q=y +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +# 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_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 +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# 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_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +CONFIG_LOG_EXTRA_INFO=y +# CONFIG_BOOTUP_DEBUG_PRINTS is not set + +# +# Linker Options +# +CONFIG_AARCH32_RAM_LD=y +# CONFIG_AARCH64_RAM_LD is not set +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +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 + +# +# Compiler Options +# +CONFIG_OUTPUT_BINARY=y +# end of Compiler Options +# end of Building Option + +# +# 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 +# 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 MMC Drivers +# +CONFIG_FREERTOS_USE_FSDIO=y +# end of Freertos MMC 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 +# end of Component Configuration + +# +# FreeRTOS Setting +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_AMP 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_TLSF=y +CONFIG_USE_SDMMC_CMD=y + +# +# SDMMC Configuration +# +CONFIG_SDMMC_PORT_FSDIO=y +# end of SDMMC Configuration + +# CONFIG_USE_CHERRY_USB is not set +# end of FreeRTOS Setting diff --git a/example/peripheral/sdio/configs/e2000q_aarch64_eg_configs b/example/peripheral/sdio/configs/e2000q_aarch64_eg_configs new file mode 100644 index 0000000000000000000000000000000000000000..c9591ec613c1d356244ec9935fc9035d16438bce --- /dev/null +++ b/example/peripheral/sdio/configs/e2000q_aarch64_eg_configs @@ -0,0 +1,217 @@ + +# +# Freertos Configuration +# +CONFIG_TARGET_NAME="e2000q_freertos_a64" +# end of Freertos Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +# CONFIG_TARGET_ARMV8_AARCH32 is not set +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +# CONFIG_USE_SYS_TICK is not set +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_TARGET_E2000Q=y +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +# 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_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 +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# 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_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +CONFIG_LOG_EXTRA_INFO=y +# CONFIG_BOOTUP_DEBUG_PRINTS is not set + +# +# Linker Options +# +# CONFIG_AARCH32_RAM_LD is not set +CONFIG_AARCH64_RAM_LD=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 +# end of Linker Options + +# +# Compiler Options +# +CONFIG_OUTPUT_BINARY=y +# end of Compiler Options +# end of Building Option + +# +# 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 +# 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 MMC Drivers +# +CONFIG_FREERTOS_USE_FSDIO=y +# end of Freertos MMC 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 +# end of Component Configuration + +# +# FreeRTOS Setting +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_AMP 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_TLSF=y +CONFIG_USE_SDMMC_CMD=y + +# +# SDMMC Configuration +# +CONFIG_SDMMC_PORT_FSDIO=y +# end of SDMMC Configuration + +# CONFIG_USE_CHERRY_USB is not set +# end of FreeRTOS Setting diff --git a/example/peripheral/sdio/figs/board.jpg b/example/peripheral/sdio/figs/board.jpg new file mode 100644 index 0000000000000000000000000000000000000000..55cde8fb06a6cb6cdfcea883005dbef8736bc0e5 Binary files /dev/null and b/example/peripheral/sdio/figs/board.jpg differ diff --git a/example/peripheral/sdio/src/cmd_sd.c b/example/peripheral/sdio/src/cmd_sd.c index 9c5b405f8a51821a9cc4b10721121b75ef2eb0e1..253adeb32b6e982660e93be1e5251071c07f2730 100644 --- a/example/peripheral/sdio/src/cmd_sd.c +++ b/example/peripheral/sdio/src/cmd_sd.c @@ -44,7 +44,7 @@ static void SdCmdUsage() { printf("usage:\r\n"); - printf(" sd rw \r\n"); + printf(" sd wr \r\n"); printf(" -- demo read and write by sdmmc\r\n"); } diff --git a/example/peripheral/sdio/src/sd_read_write.c b/example/peripheral/sdio/src/sd_read_write.c index 5cff1ad5e45a64ea176305471d91fb48e1633249..61a81f3122c7e4523b2a1726c4d16436534ddf17 100644 --- a/example/peripheral/sdio/src/sd_read_write.c +++ b/example/peripheral/sdio/src/sd_read_write.c @@ -27,11 +27,11 @@ #include "FreeRTOS.h" #include "task.h" -#include "ft_assert.h" -#include "ft_debug.h" +#include "fassert.h" +#include "fdebug.h" #include "fsleep.h" -#include "kernel.h" -#include "cache.h" +#include "fkernel.h" +#include "fcache.h" #include "fsdio_os.h" /************************** Constant Definitions *****************************/ diff --git a/example/peripheral/spi/src/sfud_read_write.c b/example/peripheral/spi/src/sfud_read_write.c index f6e6ec966c842f3b84a1b7e75291f9a34e54d535..b8f6839af0bf732fe363214a21710473f1f77f51 100644 --- a/example/peripheral/spi/src/sfud_read_write.c +++ b/example/peripheral/spi/src/sfud_read_write.c @@ -27,9 +27,9 @@ #include "FreeRTOS.h" #include "task.h" -#include "ft_debug.h" +#include "fdebug.h" #include "fsleep.h" -#include "kernel.h" +#include "fkernel.h" #include "sfud.h" diff --git a/example/peripheral/usb/cherryusb_host/src/usb_disk.c b/example/peripheral/usb/cherryusb_host/src/usb_disk.c index 6a54d8d9f98bbdd20e758c476e19c85b9c6b7c94..da825a8255f251cbccf466a0b565cb2c0de5119b 100644 --- a/example/peripheral/usb/cherryusb_host/src/usb_disk.c +++ b/example/peripheral/usb/cherryusb_host/src/usb_disk.c @@ -27,10 +27,10 @@ #include "FreeRTOS.h" #include "task.h" -#include "ft_assert.h" -#include "interrupt.h" -#include "cpu_info.h" -#include "ft_debug.h" +#include "fassert.h" +#include "finterrupt.h" +#include "fcpu_info.h" +#include "fdebug.h" #include "usbh_core.h" #include "usbh_msc.h" diff --git a/example/peripheral/usb/cherryusb_host/src/usb_host.c b/example/peripheral/usb/cherryusb_host/src/usb_host.c index 483322fdd4209e79ece6619dc4687e43255354fe..f01654ea3cbbcd1c015b8620eb968a3c00f9045d 100644 --- a/example/peripheral/usb/cherryusb_host/src/usb_host.c +++ b/example/peripheral/usb/cherryusb_host/src/usb_host.c @@ -28,11 +28,11 @@ #include "FreeRTOS.h" #include "task.h" -#include "ft_assert.h" -#include "interrupt.h" -#include "cpu_info.h" -#include "ft_debug.h" -#include "cache.h" +#include "fassert.h" +#include "finterrupt.h" +#include "fcpu_info.h" +#include "fdebug.h" +#include "fcache.h" #include "fmemory_pool.h" #include "usbh_core.h" diff --git a/example/peripheral/usb/cherryusb_host/src/usb_input.c b/example/peripheral/usb/cherryusb_host/src/usb_input.c index 11ec96a98af4f9c6eb31912ee4d3767647137900..a96a2c00b0ef5d2c8656b34014ba276beafb6055 100644 --- a/example/peripheral/usb/cherryusb_host/src/usb_input.c +++ b/example/peripheral/usb/cherryusb_host/src/usb_input.c @@ -28,10 +28,10 @@ #include "FreeRTOS.h" #include "task.h" -#include "ft_assert.h" -#include "interrupt.h" -#include "cpu_info.h" -#include "ft_debug.h" +#include "fassert.h" +#include "finterrupt.h" +#include "fcpu_info.h" +#include "fdebug.h" #include "usbh_core.h" #include "usbh_hid.h" diff --git a/example/peripheral/wdt/README.md b/example/peripheral/wdt/README.md index 2915b0219274c526327158f97466089a486fd844..574f21474edfa584da4719a0226558ac913b1d80 100644 --- a/example/peripheral/wdt/README.md +++ b/example/peripheral/wdt/README.md @@ -75,6 +75,8 @@ - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 diff --git a/example/peripheral/wdt/configs/e2000q_aarch32_eg_configs b/example/peripheral/wdt/configs/e2000q_aarch32_eg_configs index 4c8899a55d316135a340b4d69b76184ed4c751bb..186928ad9f03bd952452d4e7713cca78a9e1d65f 100644 --- a/example/peripheral/wdt/configs/e2000q_aarch32_eg_configs +++ b/example/peripheral/wdt/configs/e2000q_aarch32_eg_configs @@ -63,7 +63,7 @@ CONFIG_USE_WDT=y # # FWDT Configuration # -CONFIG_ENABLE_FWDT=y +CONFIG_USE_FWDT=y # end of FWDT Configuration # CONFIG_USE_DMA is not set @@ -132,6 +132,12 @@ CONFIG_OUTPUT_BINARY=y 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 # @@ -143,6 +149,49 @@ CONFIG_FREERTOS_USE_UART=y # CONFIG_FREERTOS_USE_WDT=y # end of Freertos Wdt Drivers + +# +# Freertos Eth Drivers +# +# CONFIG_FREERTOS_USE_XMAC 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 MMC Drivers +# +# CONFIG_FREERTOS_USE_FSDIO is not set +# end of Freertos MMC 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 # end of Component Configuration # @@ -150,6 +199,9 @@ CONFIG_FREERTOS_USE_WDT=y # # CONFIG_USE_LWIP is not set CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_SPIFFS is not set # CONFIG_USE_AMP is not set CONFIG_USE_LETTER_SHELL=y @@ -161,4 +213,8 @@ 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_TLSF=y +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/peripheral/wdt/configs/e2000q_aarch64_eg_configs b/example/peripheral/wdt/configs/e2000q_aarch64_eg_configs index 399c82a32e0ed15c6506964497b3f40c757f6431..bfebe8b9e5ba92528ed3ccd4db08cf38d1b3f736 100644 --- a/example/peripheral/wdt/configs/e2000q_aarch64_eg_configs +++ b/example/peripheral/wdt/configs/e2000q_aarch64_eg_configs @@ -63,7 +63,7 @@ CONFIG_USE_WDT=y # # FWDT Configuration # -CONFIG_ENABLE_FWDT=y +CONFIG_USE_FWDT=y # end of FWDT Configuration # CONFIG_USE_DMA is not set @@ -182,6 +182,12 @@ CONFIG_FREERTOS_USE_WDT=y # # 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 # end of Component Configuration # @@ -206,4 +212,5 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_USE_TLSF is not set # CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/peripheral/wdt/src/wdt_example.c b/example/peripheral/wdt/src/wdt_example.c index c5f072544fef3cb43caa7d8626277d2a3c70803d..f76abfb2946461e78b61de473d72130e4c8632e7 100644 --- a/example/peripheral/wdt/src/wdt_example.c +++ b/example/peripheral/wdt/src/wdt_example.c @@ -26,10 +26,10 @@ #include "task.h" #include "queue.h" #include "timers.h" -#include "generic_timer.h" +#include "fgeneric_timer.h" #include "fwdt.h" #include "fwdt_os.h" -#include "cpu_info.h" +#include "fcpu_info.h" #include "wdt_example.h" /* The periods assigned to the one-shot timers. */ diff --git a/example/storage/qspi_spiffs/README.md b/example/storage/qspi_spiffs/README.md index 8d3a1f054e0125636cfd93be5fa37d093bc2fc4e..cda3dd2f62c4eeba2ac87e72ad1ca8cde96a5fcc 100644 --- a/example/storage/qspi_spiffs/README.md +++ b/example/storage/qspi_spiffs/README.md @@ -18,8 +18,8 @@ - 3. 支持的 Flash 容量不能超过 128 MB - 4. 不支持坏块检测和坏块处理 -本例程通过Freertos下的SPIFFS测试,验证了QSPI Nor-flash文件系统的基本功能,如文件系统格式化,文件的创建、读写、删除和枚举等,例程在FT2000/4上测试通过,使用的Nor Flash介质型号是GD25Q256,容量为32MB; -E2000D上使用的Nor Flash介质型号是GD25Q128,容量为16MB; +本例程通过Freertos下的SPIFFS测试,验证了QSPI Nor-flash文件系统的基本功能,如文件系统格式化,文件的创建、读写、删除和枚举等,例程在FT2000/4上测试通过,使用的Nor Flash介质型号是GD25LQ256E,容量为32MB; +E2000D上使用的Nor Flash介质型号是GD25LQ128E,容量为16MB; ## 2. 如何使用例程 @@ -37,8 +37,6 @@ E2000D上使用的Nor Flash介质型号是GD25Q128,容量为16MB; - CONFIG_TARGET_D2000 - CONFIG_TARGET_E2000D -![hardware](./figs/hardware.png) - - 本例程适配了GD25Q256、GD25Q128、GD25Q64、S25FS256的Nor-Flash芯片,如使用其他型号,需自行参考适配 ![hardware](./figs/hardware.png) @@ -135,7 +133,8 @@ bootelf -p 0x90100000 >主要记录使用例程中可能会遇到的问题,给出相应的解决方案
-- FSPIFFS_IF_FORMAT决定初始化阶段是否格式化指定的区域,TRUE为格式化,FLASE为不格式化 +- FSPIFFS_IF_FORMAT决定初始化阶段是否格式化指定的区域,TRUE为格式化,FLASE为不格式化; +- FSPIFFS_START_ADDR和FSPIFFS_USE_SIZE需要根据实际的flash大小来确定; ## 4. 修改历史记录 diff --git a/example/storage/qspi_spiffs/src/qspi_spiffs_example.c b/example/storage/qspi_spiffs/src/qspi_spiffs_example.c index 548d28369e640d4f629bad2a415cc83515d14993..e12242e7781f8b0f7364ab8a4b2696ab2348fce3 100644 --- a/example/storage/qspi_spiffs/src/qspi_spiffs_example.c +++ b/example/storage/qspi_spiffs/src/qspi_spiffs_example.c @@ -23,7 +23,7 @@ #include #include #include -#include "kernel.h" +#include "fkernel.h" #include "FreeRTOSConfig.h" #include "FreeRTOS.h" #include "task.h" @@ -32,9 +32,9 @@ #include "timers.h" #include "qspi_spiffs_example.h" #include "strto.h" -#include "ft_assert.h" -#include "ft_debug.h" -#include "parameters.h" +#include "fassert.h" +#include "fdebug.h" +#include "fparameters.h" #include "spiffs_port.h" #include "sdkconfig.h" #ifdef CONFIG_SPIFFS_ON_FSPIM_SFUD diff --git a/example/storage/sata_fatfs/README.md b/example/storage/sata_fatfs/README.md index dccaf5b291524e09ff5f479043c69e9884f2f944..4cede421ccb495bfb36c13075f1725d425fd566c 100644 --- a/example/storage/sata_fatfs/README.md +++ b/example/storage/sata_fatfs/README.md @@ -65,12 +65,14 @@ - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 -- 具体使用方法为: - - 在当前目录下 - - 执行以上指令 +具体使用方法为: +- 在当前目录下 +- 执行以上指令 ### 2.3 构建和下载 @@ -103,7 +105,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 ``` diff --git a/example/storage/sata_fatfs/src/sata_fatfs_example.c b/example/storage/sata_fatfs/src/sata_fatfs_example.c index a04c938a1e62dcc869b49cb7cc8d83af94d3e69f..a76aa5ae500947e5d87eeb6c3bbd0a16d7f0dd65 100644 --- a/example/storage/sata_fatfs/src/sata_fatfs_example.c +++ b/example/storage/sata_fatfs/src/sata_fatfs_example.c @@ -32,9 +32,9 @@ #include "timers.h" #include "sata_fatfs_example.h" #include "strto.h" -#include "ft_assert.h" -#include "ft_debug.h" -#include "parameters.h" +#include "fassert.h" +#include "fdebug.h" +#include "fparameters.h" /* file system */ #include "ff.h" diff --git a/example/storage/spim_spiffs/Kconfig b/example/storage/spim_spiffs/Kconfig new file mode 100644 index 0000000000000000000000000000000000000000..0277fb8553f2132f097012a78633194f6173c156 --- /dev/null +++ b/example/storage/spim_spiffs/Kconfig @@ -0,0 +1,19 @@ +# +# For a description of the syntax of this configuration file, +# see tools/kconfiglib/kconfig-language.txt. +# + + +mainmenu "Phytium Freertos Configuration" + + menu "Freertos Configuration" + config TARGET_NAME + string "Build Target Name" + default "freertos" + help + Build Target name for the demo + +endmenu + +source "$(FREERTOS_SDK_ROOT)/Kconfig" + diff --git a/example/storage/spim_spiffs/README.md b/example/storage/spim_spiffs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b41445e0178487df6029af7b9c3adc88048a3e9d --- /dev/null +++ b/example/storage/spim_spiffs/README.md @@ -0,0 +1,135 @@ +# SPIFFS SPI Nor-flash 文件系统测试 +## 1. 例程介绍 + +>介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作
+ +[SPIFFS](https://github.com/pellepl/spiffs) 是一个面向SPI FLASH的文件系统, 它需要的系统资源极少,可以完全运行在RAM中不需要堆的支持, 有以下几个特点, + +- 1. 面向小型嵌入式系统,不要求系统支持堆和动态内存 +- 2. 尽可能少地进行擦除,只进行大块擦除,清除小块数据时采用标记的方法 +- 3. 支持负载均衡,尽可能延长 Flash 的使用寿命 +- 4. 内置文件系统的一致性检查,对文件系统损坏有一定的保护能力 +- 5. 使用方便,高度可配置 + +但是,SPIFFS 也存在以下几个缺陷, + +- 1. 不支持目录,SPIFFS 提供的是一个平面结构文件系统,路径 `tmp/myfile.txt` 会直接被创建成一个名字为 `tmp/myfile.txt` 的文件 +- 2. 不是实时的,一个写操作的持续时间可能比另一个长得多 +- 3. 支持的 Flash 容量不能超过 128 MB +- 4. 不支持坏块检测和坏块处理 + +本例程通过Freertos下的SPIFFS测试,验证了SPIM Nor-flash文件系统的基本功能,如文件系统格式化,文件的创建、读写、删除和枚举等。例程在E2000 test板上测试通过,使用的Nor Flash介质型号是GD25LQ128E,容量为16MB,如下: +![hardware](./figs/hardware.jpg) + +## 2. 如何使用例程 + +>描述开发平台准备,使用例程配置,构建和下载镜像的过程
+ +### 2.1 硬件配置方法 + +>哪些硬件平台是支持的,需要哪些外设,例程与开发板哪些IO口相关等(建议附录开发板照片,展示哪些IO口被引出)
+ +本例程支持的硬件平台包括 +- E2000D开发板 +- E2000S开发板 + +对应的配置项是 +- CONFIG_TARGET_E2000D + + +- 本例程适配了GD25Q256、GD25Q128、GD25Q64、S25FS256的Nor-Flash芯片,如使用其他型号,需自行参考适配 +### 2.2 SDK配置方法 + +>依赖哪些驱动、库和第三方组件,如何完成配置(列出需要使能的关键配置项)
+ +使能以下配置 + +- CONFIG_USE_SPI,使能SPI驱动组件 +- CONFIG_USE_FSPIM,选择FSPIM驱动 +- CONFIG_USE_IOMUX,使能IO复用驱动组件 +- CONFIG_ENABLE_FIOMUX,选择FIOMUX驱动 +- CONFIG_USE_GPIO,使能GPIO驱动组件 +- CONFIG_ENABLE_F_GPIO,选择FGPIO驱动 +- CONFIG_USE_SFUD,选择SFUD协议框架 +- CONFIG_SFUD_CTRL_F_SPIM,关联SFUD框架和FSPIM驱动 +- CONFIG_USE_SPIFFS CONFIG_SPIFFS_ON_FSPIM_SFUD,使能SPIFFS + +本例子已经提供好具体的编译指令,以下进行介绍: +- make 将目录下的工程进行编译 +- make clean 将目录下的工程进行清理 +- make boot 将目录下的工程进行编译,并将生成的elf 复制到目标地址 +- make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 +- make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make menuconfig 配置目录下的参数变量 +- make backup_kconfig 将目录下的sdkconfig 备份到./configs下 + +### 2.3 构建和下载 + +>描述构建、烧录下载镜像的过程,列出相关的命令
+ +#### 2.3.1 构建过程 + +- 在host侧完成配置 +配置成e2000d,对于其它平台,使用对应的默认配置,如ft2004 `make load_ft2004_aarch32` + +- 选择目标平台 +``` +make load_e2000d_aarch64 +``` + +- 选择例程需要的配置 +``` +make menuconfig +``` + +- 进行编译 +``` +make +``` + +- 将编译出的镜像放置到tftp目录下 +``` +make boot +``` + +#### 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 freertos.elf +bootelf -p 0x90100000 +``` + +### 2.4 输出与实验现象 + +>描述输入输出情况,列出存在哪些输出,对应的输出是什么(建议附录相关现象图片)
+程序启动后,依次创建Init、Read、Write任务,创建单次模式软件定时器用于删除任务,Init任务会首先初始化并挂载spim flash的部分区域(可通过FSPIFFS_IF_FORMAT选择是否进行格式化操作),随后创建一个文件,然后释放信号量通知Read和Write任务开始执行; + +- init完成,挂载文件系统完成,创建测试文件 +![init](./figs/init.png) + +- 读写任务周期性执行,有两个读任务,一个写任务 +![wr](./figs/wr.png) + +- 软件定时器触发,删除读写任务 +![delete](./figs/delete.png) + +## 3. 如何解决问题 + +>主要记录使用例程中可能会遇到的问题,给出相应的解决方案
+ +- FSPIFFS_IF_FORMAT决定初始化阶段是否格式化指定的区域,TRUE为格式化,FLASE为不格式化 + +## 4. 修改历史记录 + +>记录例程的重大修改记录,标明修改发生的版本号
+ +v0.1. 2022-10-27 首次合入 \ No newline at end of file diff --git a/example/storage/spim_spiffs/configs/e2000d_aarch32_eg_configs b/example/storage/spim_spiffs/configs/e2000d_aarch32_eg_configs new file mode 100644 index 0000000000000000000000000000000000000000..85b81d19e1ea112d60f8d46dc967d1f443766078 --- /dev/null +++ b/example/storage/spim_spiffs/configs/e2000d_aarch32_eg_configs @@ -0,0 +1,239 @@ + +# +# Freertos Configuration +# +CONFIG_TARGET_NAME="e2000d_freertos_a32" +# end of Freertos Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +CONFIG_TARGET_ARMV8_AARCH32=y +# CONFIG_TARGET_ARMV8_AARCH64 is not set +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +CONFIG_USE_SYS_TICK=y +CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +# CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_E2000Q is not set +CONFIG_TARGET_E2000D=y +# CONFIG_TARGET_E2000S is not set +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +# 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 +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# 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_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set + +# +# Linker Options +# +CONFIG_AARCH32_RAM_LD=y +# CONFIG_AARCH64_RAM_LD is not set +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +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 + +# +# Compiler Options +# +CONFIG_OUTPUT_BINARY=y +# end of Compiler Options +# end of Building Option + +# +# 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 +# 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 MMC Drivers +# +# CONFIG_FREERTOS_USE_FSDIO is not set +# end of Freertos MMC 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 +# end of Component Configuration + +# +# FreeRTOS Setting +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS 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_SPIFFS=y + +# +# SPIFFS Configuration +# +# CONFIG_SPIFFS_ON_FSPIM_SFUD is not set +CONFIG_SPIFFS_ON_FQSPI_SFUD=y +# end of SPIFFS Configuration + +# CONFIG_USE_AMP 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_TLSF=y +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set +# end of FreeRTOS Setting diff --git a/example/storage/spim_spiffs/configs/e2000d_aarch64_eg_configs b/example/storage/spim_spiffs/configs/e2000d_aarch64_eg_configs new file mode 100644 index 0000000000000000000000000000000000000000..86833babcea362706d1a0dad96787a9b91f15b21 --- /dev/null +++ b/example/storage/spim_spiffs/configs/e2000d_aarch64_eg_configs @@ -0,0 +1,236 @@ + +# +# Freertos Configuration +# +CONFIG_TARGET_NAME="e2000d_freertos_a64" +# end of Freertos Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +# CONFIG_TARGET_ARMV8_AARCH32 is not set +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +CONFIG_USE_SYS_TICK=y +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +# CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_E2000Q is not set +CONFIG_TARGET_E2000D=y +# CONFIG_TARGET_E2000S is not set +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +CONFIG_USE_SPI=y +CONFIG_USE_FSPIM=y +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 +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# 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_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set + +# +# Linker Options +# +# CONFIG_AARCH32_RAM_LD is not set +CONFIG_AARCH64_RAM_LD=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 +# end of Linker Options + +# +# Compiler Options +# +CONFIG_OUTPUT_BINARY=y +# end of Compiler Options +# end of Building Option + +# +# 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 +# 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=y +# 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 MMC Drivers +# +# CONFIG_FREERTOS_USE_FSDIO is not set +# end of Freertos MMC 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 +# end of Component Configuration + +# +# FreeRTOS Setting +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS is not set +CONFIG_USE_SFUD=y + +# +# SFUD Configuration +# +CONFIG_SFUD_CTRL_FSPIM=y +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_SPIFFS=y + +# +# SPIFFS Configuration +# +CONFIG_SPIFFS_ON_FSPIM_SFUD=y +# CONFIG_SPIFFS_ON_FQSPI_SFUD is not set +# end of SPIFFS Configuration + +# CONFIG_USE_AMP 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_TLSF=y +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set +# end of FreeRTOS Setting diff --git a/example/storage/spim_spiffs/figs/delete.png b/example/storage/spim_spiffs/figs/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..fb0d47c2e106319953300b8e2da62e54a44513b2 Binary files /dev/null and b/example/storage/spim_spiffs/figs/delete.png differ diff --git a/example/storage/spim_spiffs/figs/hardware.jpg b/example/storage/spim_spiffs/figs/hardware.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e655675198ab62038cc4360ea98c90617803c4b5 Binary files /dev/null and b/example/storage/spim_spiffs/figs/hardware.jpg differ diff --git a/example/storage/spim_spiffs/figs/init.png b/example/storage/spim_spiffs/figs/init.png new file mode 100644 index 0000000000000000000000000000000000000000..49fe3c33bf239f172ec58ed1cdf05b3631d3ab19 Binary files /dev/null and b/example/storage/spim_spiffs/figs/init.png differ diff --git a/example/storage/spim_spiffs/figs/wr.png b/example/storage/spim_spiffs/figs/wr.png new file mode 100644 index 0000000000000000000000000000000000000000..05b0cf56ceb81102d5b02ef24238cc6df1b51345 Binary files /dev/null and b/example/storage/spim_spiffs/figs/wr.png differ diff --git a/example/storage/spim_spiffs/inc/spim_spiffs_example.h b/example/storage/spim_spiffs/inc/spim_spiffs_example.h new file mode 100644 index 0000000000000000000000000000000000000000..84826977296f6b8686c934fee03c76499c9aeafa --- /dev/null +++ b/example/storage/spim_spiffs/inc/spim_spiffs_example.h @@ -0,0 +1,30 @@ +/* + * 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: spim_spiffs_example.h + * Date: 2022-06-17 10:42:40 + * LastEditTime: 2022-06-17 10:42:40 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#ifndef SPIM_SPIFFS_EXAMPLE_H +#define SPIM_SPIFFS_EXAMPLE_H + +/* spim spiffs read and write test */ +BaseType_t FFreeRTOSSpimSpiffsCreate(u32 spim_id); + +#endif // ! \ No newline at end of file diff --git a/example/storage/spim_spiffs/main.c b/example/storage/spim_spiffs/main.c new file mode 100644 index 0000000000000000000000000000000000000000..8f49ee06ea3bdc400c5dd13f057e5cb217f83182 --- /dev/null +++ b/example/storage/spim_spiffs/main.c @@ -0,0 +1,47 @@ +/* + * 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: main.c + * Date: 2022-06-17 08:17:59 + * LastEditTime: 2022-06-17 08:17:59 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#include "shell.h" +#include "shell_port.h" +#include +#include "spim_spiffs_example.h" + +int main(void) +{ + BaseType_t ret; + + ret = FFreeRTOSSpimSpiffsCreate(0); + if(ret != pdPASS) + goto FAIL_EXIT; + + ret = LSUserShellTask() ; + if(ret != pdPASS) + goto FAIL_EXIT; + + vTaskStartScheduler(); /* 启动任务,开启调度 */ + while (1); /* 正常不会执行到这里 */ + +FAIL_EXIT: + printf("failed 0x%x \r\n", ret); + return 0; +} diff --git a/example/storage/spim_spiffs/makefile b/example/storage/spim_spiffs/makefile new file mode 100644 index 0000000000000000000000000000000000000000..c1f632e855a09d5f79e458e1c21f110a88cb40ba --- /dev/null +++ b/example/storage/spim_spiffs/makefile @@ -0,0 +1,31 @@ +export PROJECT_DIR ?= $(shell pwd) + +export USR_SRC_DIR = $(PROJECT_DIR) \ + ./src +export USR_INC_DIR = $(PROJECT_DIR) \ + ./inc + +# 用户定义的编译目标文件上传路径 +ifeq ($(OS),Windows_NT) + USR_BOOT_DIR ?= $(subst \,/, $(PHYTIUM_DEV_PATH))/tftp +else + USR_BOOT_DIR ?= /mnt/d/tftboot +endif + + +# 设置启动镜像名 +BOOT_IMG_NAME ?= freertos + +# 指定编译freertos项目使用的makefile +include $(FREERTOS_SDK_ROOT)/make/build_freertos.mk + +# 完成编译 +boot: + make -j + @cp ./$(CONFIG_TARGET_NAME).elf $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).elf +ifdef CONFIG_OUTPUT_BINARY + @cp ./$(CONFIG_TARGET_NAME).bin $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).bin +endif + @ls $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).* -l + + diff --git a/example/storage/spim_spiffs/sdkconfig b/example/storage/spim_spiffs/sdkconfig new file mode 100644 index 0000000000000000000000000000000000000000..86833babcea362706d1a0dad96787a9b91f15b21 --- /dev/null +++ b/example/storage/spim_spiffs/sdkconfig @@ -0,0 +1,236 @@ + +# +# Freertos Configuration +# +CONFIG_TARGET_NAME="e2000d_freertos_a64" +# end of Freertos Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +# CONFIG_TARGET_ARMV8_AARCH32 is not set +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_USE_CACHE=y +CONFIG_USE_MMU=y +CONFIG_USE_SYS_TICK=y +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +# CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_E2000Q is not set +CONFIG_TARGET_E2000D=y +# CONFIG_TARGET_E2000S is not set +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +CONFIG_USE_SPI=y +CONFIG_USE_FSPIM=y +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 +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# 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_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set + +# +# Linker Options +# +# CONFIG_AARCH32_RAM_LD is not set +CONFIG_AARCH64_RAM_LD=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 +# end of Linker Options + +# +# Compiler Options +# +CONFIG_OUTPUT_BINARY=y +# end of Compiler Options +# end of Building Option + +# +# 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 +# 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=y +# 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 MMC Drivers +# +# CONFIG_FREERTOS_USE_FSDIO is not set +# end of Freertos MMC 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 +# end of Component Configuration + +# +# FreeRTOS Setting +# +# CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_FATFS is not set +CONFIG_USE_SFUD=y + +# +# SFUD Configuration +# +CONFIG_SFUD_CTRL_FSPIM=y +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_SPIFFS=y + +# +# SPIFFS Configuration +# +CONFIG_SPIFFS_ON_FSPIM_SFUD=y +# CONFIG_SPIFFS_ON_FQSPI_SFUD is not set +# end of SPIFFS Configuration + +# CONFIG_USE_AMP 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_TLSF=y +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set +# end of FreeRTOS Setting diff --git a/example/storage/spim_spiffs/sdkconfig.h b/example/storage/spim_spiffs/sdkconfig.h new file mode 100644 index 0000000000000000000000000000000000000000..58cde585f8022335463dd04463c7dd44f0d7aac0 --- /dev/null +++ b/example/storage/spim_spiffs/sdkconfig.h @@ -0,0 +1,207 @@ +#ifndef SDK_CONFIG_H__ +#define SDK_CONFIG_H__ + +/* Freertos Configuration */ + +#define CONFIG_TARGET_NAME "e2000d_freertos_a64" +/* end of Freertos Configuration */ + +/* Standalone Setting */ + +#define CONFIG_USE_FREERTOS + +/* Arch Configuration */ + +/* CONFIG_TARGET_ARMV8_AARCH32 is not set */ +#define CONFIG_TARGET_ARMV8_AARCH64 +#define CONFIG_USE_CACHE +#define CONFIG_USE_MMU +#define CONFIG_USE_SYS_TICK +/* CONFIG_MMU_DEBUG_PRINTS is not set */ +/* end of Arch Configuration */ + +/* Board Configuration */ + +/* CONFIG_TARGET_F2000_4 is not set */ +/* CONFIG_TARGET_D2000 is not set */ +/* CONFIG_TARGET_E2000Q is not set */ +#define CONFIG_TARGET_E2000D +/* CONFIG_TARGET_E2000S is not set */ +#define CONFIG_TARGET_E2000 +#define CONFIG_DEFAULT_DEBUG_PRINT_UART1 +/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ +/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* end of Board Configuration */ + +/* Components Configuration */ + +#define CONFIG_USE_SPI +#define CONFIG_USE_FSPIM +#define CONFIG_USE_QSPI + +/* Qspi Configuration */ + +#define CONFIG_USE_FQSPI +/* end of Qspi Configuration */ +#define CONFIG_USE_GIC +#define CONFIG_ENABLE_GICV3 +#define CONFIG_USE_SERIAL + +/* Usart Configuration */ + +#define CONFIG_ENABLE_Pl011_UART +/* 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 */ +/* end of Components Configuration */ +#define CONFIG_USE_NEW_LIBC +/* end of Standalone Setting */ + +/* Building Option */ + +/* CONFIG_LOG_VERBOS is not set */ +/* CONFIG_LOG_DEBUG is not set */ +/* CONFIG_LOG_INFO is not set */ +/* CONFIG_LOG_WARN is not set */ +#define CONFIG_LOG_ERROR +/* CONFIG_LOG_NONE is not set */ +#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ +/* CONFIG_LOG_EXTRA_INFO is not set */ +/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ + +/* Linker Options */ + +/* CONFIG_AARCH32_RAM_LD is not set */ +#define CONFIG_AARCH64_RAM_LD +/* CONFIG_USER_DEFINED_LD is not set */ +#define CONFIG_LINK_SCRIPT_ROM +#define CONFIG_ROM_START_UP_ADDR 0x80100000 +#define CONFIG_ROM_SIZE_MB 1 +#define CONFIG_LINK_SCRIPT_RAM +#define CONFIG_RAM_START_UP_ADDR 0x81000000 +#define CONFIG_RAM_SIZE_MB 64 +#define CONFIG_HEAP_SIZE 1 +#define CONFIG_STACK_SIZE 0x100000 +#define CONFIG_FPU_STACK_SIZE 0x1000 +/* end of Linker Options */ + +/* Compiler Options */ + +#define CONFIG_OUTPUT_BINARY +/* end of Compiler Options */ +/* end of Building Option */ + +/* Component Configuration */ + +/* Freertos Uart Drivers */ + +#define CONFIG_FREERTOS_USE_UART +/* end of Freertos Uart Drivers */ + +/* Freertos Pwm Drivers */ + +/* CONFIG_FREERTOS_USE_PWM is not set */ +/* end of Freertos Pwm Drivers */ + +/* Freertos Qspi Drivers */ + +#define CONFIG_FREERTOS_USE_QSPI +/* 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 */ +/* end of Freertos Eth Drivers */ + +/* Freertos Gpio Drivers */ + +/* CONFIG_FREERTOS_USE_GPIO is not set */ +/* end of Freertos Gpio Drivers */ + +/* Freertos Spim Drivers */ + +#define CONFIG_FREERTOS_USE_FSPIM +/* 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 MMC Drivers */ + +/* CONFIG_FREERTOS_USE_FSDIO is not set */ +/* end of Freertos MMC 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 */ +/* end of Component Configuration */ + +/* FreeRTOS Setting */ + +/* CONFIG_USE_LWIP is not set */ +#define CONFIG_USE_BACKTRACE +/* CONFIG_USE_FATFS is not set */ +#define CONFIG_USE_SFUD + +/* SFUD Configuration */ + +#define CONFIG_SFUD_CTRL_FSPIM +#define CONFIG_SFUD_CTRL_FQSPI +/* CONFIG_SFUD_QSPI_READ_MODE_READ is not set */ +/* CONFIG_SFUD_QSPI_READ_MODE_DUAL_READ is not set */ +#define CONFIG_SFUD_QSPI_READ_MODE_QUAD_READ +/* end of SFUD Configuration */ +#define CONFIG_USE_SPIFFS + +/* SPIFFS Configuration */ + +#define CONFIG_SPIFFS_ON_FSPIM_SFUD +/* CONFIG_SPIFFS_ON_FQSPI_SFUD is not set */ +/* end of SPIFFS Configuration */ +/* CONFIG_USE_AMP is not set */ +#define CONFIG_USE_LETTER_SHELL + +/* Letter Shell Configuration */ + +#define CONFIG_LS_PL011_UART +#define CONFIG_DEFAULT_LETTER_SHELL_USE_UART1 +/* CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set */ +/* CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set */ +/* end of Letter Shell Configuration */ +#define CONFIG_USE_TLSF +/* CONFIG_USE_SDMMC_CMD is not set */ +/* CONFIG_USE_CHERRY_USB is not set */ +/* end of FreeRTOS Setting */ + +#endif diff --git a/example/storage/spim_spiffs/src/spim_spiffs_example.c b/example/storage/spim_spiffs/src/spim_spiffs_example.c new file mode 100644 index 0000000000000000000000000000000000000000..b7967934a6f88c989d8ec8f30fb28a6e1b320530 --- /dev/null +++ b/example/storage/spim_spiffs/src/spim_spiffs_example.c @@ -0,0 +1,620 @@ +/* + * 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: spim_spiffs_example.c + * Date: 2022-07-11 11:32:48 + * LastEditTime: 2022-07-11 11:32:48 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ +#include +#include +#include +#include "fkernel.h" +#include "FreeRTOSConfig.h" +#include "FreeRTOS.h" +#include "task.h" +#include "semphr.h" +#include "fpinctrl.h" +#include "timers.h" +#include "spim_spiffs_example.h" +#include "strto.h" +#include "fassert.h" +#include "fdebug.h" +#include "fparameters.h" +#include "spiffs_port.h" +#include "sdkconfig.h" +#ifdef CONFIG_SPIFFS_ON_FSPIM_SFUD +#include "fspim_spiffs_port.h" +#endif + +enum +{ + FSPIFFS_OPS_OK = 0, + FSPIFFS_OPS_INIT_FAILED, + FSPIFFS_OPS_ALREADY_INITED, + FSPIFFS_OPS_MOUNT_FAILED, + FSPIFFS_OPS_FORMAT_FAILED, + FSPIFFS_OPS_NOT_YET_MOUNT, + FSPIFFS_OPS_OPEN_FILE_FAILED, + FSPIFFS_OPS_WRITE_FILE_FAILED, + FSPIFFS_OPS_READ_FILE_FAILED, + FSPIFFS_OPS_REMOVE_FILE_FAILED, + FSPIFFS_OPS_CLOSE_FILE_FAILED, +}; + +#define FSPIFFS_DEBUG_TAG "SPIFFS-SPIM" +#define FSPIFFS_ERROR(format, ...) FT_DEBUG_PRINT_E(FSPIFFS_DEBUG_TAG, format, ##__VA_ARGS__) +#define FSPIFFS_WARN(format, ...) FT_DEBUG_PRINT_W(FSPIFFS_DEBUG_TAG, format, ##__VA_ARGS__) +#define FSPIFFS_INFO(format, ...) FT_DEBUG_PRINT_I(FSPIFFS_DEBUG_TAG, format, ##__VA_ARGS__) +#define FSPIFFS_DEBUG(format, ...) FT_DEBUG_PRINT_D(FSPIFFS_DEBUG_TAG, format, ##__VA_ARGS__) + +/* spiffs start address and size */ +#define FSPIFFS_START_ADDR (0 * SZ_1M) +#define FSPIFFS_USE_SIZE SZ_1M + +#define FSPIFFS_RW_BUF_SIZE 64 + +/* if format flash, TRUE is need format, it tasks some time */ +#define FSPIFFS_IF_FORMAT TRUE + +/* 一个页大小两倍的一个RAM缓冲区, 用来加载和维护SPIFFS的逻辑页 */ +static volatile u8 fspiffs_work_buf[FSPIFFS_LOG_PAGE_SIZE * 2] = {0}; +static volatile u8 fspiffs_fds_buf[32 * 4] = {0}; +static volatile u8 fspiffs_cache_buf[(FSPIFFS_LOG_PAGE_SIZE + 32) * 4] = {0}; +static u8 fspiffs_rw_buf[FSPIFFS_RW_BUF_SIZE] = {0}; +static FSpiffs instance; +static spiffs_config config; +static boolean spiffs_inited = FALSE; +const char *file_name = "test.txt"; + +/************************** Constant Definitions *****************************/ + +/* The periods assigned to the one-shot timers. */ +#define ONE_SHOT_TIMER_PERIOD ( pdMS_TO_TICKS( 50000UL ) ) + +/* write and read task delay in milliseconds */ +#define TASK_DELAY_MS 3000UL + +/* write and read task number */ +#define READ_WRITE_TASK_NUM 3 +static xSemaphoreHandle xCountingSemaphore; + +static xTaskHandle spim_read1_handle; +static xTaskHandle spim_read2_handle; +static xTaskHandle spim_write_handle; +static TimerHandle_t xOneShotTimer; + +static void FFreeRTOSSpimSpiffsDelete(void); + +static int FSpiffsOpsMount(boolean do_format) +{ + int result = 0; + + if (do_format) + { + result = SPIFFS_mount(&instance.fs,/*挂载spiffs系统*/ + &config, + (u8_t *)fspiffs_work_buf, + + (u8_t *)fspiffs_fds_buf, + sizeof(fspiffs_fds_buf), + (u8_t *)fspiffs_cache_buf, + sizeof(fspiffs_cache_buf), + NULL); + + /* try mount to get status of filesystem */ + if ((SPIFFS_OK != result) && (SPIFFS_ERR_NOT_A_FS != result)) + { + /* if not a valid filesystem, continue to format, + other error cannot handle, just exit */ + FSPIFFS_ERROR("mount spiffs failed: %d", result); + return FSPIFFS_OPS_MOUNT_FAILED; + } + + /* must be unmounted prior to formatting */ + SPIFFS_unmount(&instance.fs); + + FSPIFFS_DEBUG("format spiffs in progress ...\r\n"); + result = SPIFFS_format(&instance.fs); + if (SPIFFS_OK != result) + { + FSPIFFS_ERROR("format spiffs failed: %d", result); + return FSPIFFS_OPS_FORMAT_FAILED; + } + } + + /* real mount */ + result = SPIFFS_mount(&instance.fs, + &config, + (u8_t *)fspiffs_work_buf, + (u8_t *)fspiffs_fds_buf, + sizeof(fspiffs_fds_buf), + (u8_t *)fspiffs_cache_buf, + sizeof(fspiffs_cache_buf), + NULL); + if (SPIFFS_OK != result) + { + FSPIFFS_ERROR("remount spiffs failed: %d, you may format the medium first", result); + return FSPIFFS_OPS_MOUNT_FAILED; + } + else + { + vPrintf("mount spiffs success !!! \r\n"); + instance.fs_ready = TRUE; + } + + return FSPIFFS_OPS_OK; +} + +static int FSpiffsOpsListAll(void) +{ + int ret = FSPIFFS_OPS_OK; + int result = SPIFFS_OK; + + if (FALSE == instance.fs_ready) + { + FSPIFFS_ERROR("please mount file system first !!!"); + return FSPIFFS_OPS_NOT_YET_MOUNT; + } + + static spiffs_DIR dir; + static struct spiffs_dirent entry; + + memset(&dir, 0, sizeof(dir)); + memset(&entry, 0, sizeof(entry)); + + struct spiffs_dirent *cur_entry = &entry; + (void)SPIFFS_opendir(&instance.fs, "/", &dir); + + while (NULL != (cur_entry = SPIFFS_readdir(&dir, cur_entry))) + { + printf("-- %s file-id: [0x%04x] page-id: [%d] file-size: %d\r\n", + cur_entry->name, + cur_entry->pix, + cur_entry->obj_id, + cur_entry->size); + } + + (void)SPIFFS_closedir(&dir); + return ret; +} + +int FSpiffsOpsCreateFile(const char *file_name) +{ + FASSERT((file_name) && (strlen(file_name) > 0)); + if (FALSE == instance.fs_ready) + { + FSPIFFS_ERROR("please mount file system first !!!"); + return FSPIFFS_OPS_NOT_YET_MOUNT; + } + + int ret = FSPIFFS_OPS_OK; + + /* create file */ + s32_t result = SPIFFS_creat(&instance.fs, file_name, 0); + if (result < 0) + { + FSPIFFS_ERROR("failed to create file %s", file_name); + return FSPIFFS_OPS_OPEN_FILE_FAILED; + } + + /* open file */ + spiffs_file fd = SPIFFS_open(&instance.fs, file_name, SPIFFS_RDONLY, 0); + if (0 > fd) + { + FSPIFFS_ERROR("failed to open file %s errno %d", file_name, SPIFFS_errno(&instance.fs)); + return FSPIFFS_OPS_OPEN_FILE_FAILED; + } + + /* check file status */ + static spiffs_stat status; + memset(&status, 0, sizeof(status)); + result = SPIFFS_fstat(&instance.fs, fd, &status); + if (result < 0) + { + FSPIFFS_ERROR("failed to get status of file %s errno %d", file_name, SPIFFS_errno(&instance.fs)); + ret = FSPIFFS_OPS_OPEN_FILE_FAILED; + goto err_exit; + } + + if (0 != strcmp(status.name, file_name)) + { + FSPIFFS_ERROR("created file name %s != %s", status.name, file_name); + ret = FSPIFFS_OPS_OPEN_FILE_FAILED; + goto err_exit; + } + + if (0 != status.size) + { + FSPIFFS_ERROR("invalid file size %d", status.size); + ret = FSPIFFS_OPS_OPEN_FILE_FAILED; + goto err_exit; + } + + vPrintf("create file %s success !!!\r\n", file_name); + +err_exit: + (void)SPIFFS_close(&instance.fs, fd); + return ret; +} + +int FSpiffsOpsWriteFile(const char *file_name, const char *str) +{ + FASSERT((file_name) && (strlen(file_name) > 0)); + FASSERT(str); + int ret = FSPIFFS_OPS_OK; + const u32 wr_len = strlen(str) + 1; + + spiffs_file fd = SPIFFS_open(&instance.fs, file_name, SPIFFS_RDWR | SPIFFS_TRUNC, 0); + if (0 > fd) + { + FSPIFFS_ERROR("failed to open file %s errno %d", file_name, SPIFFS_errno(&instance.fs)); + return FSPIFFS_OPS_OPEN_FILE_FAILED; + } + + int result = SPIFFS_write(&instance.fs, fd, (void *)str, wr_len); + if (result < 0) + { + FSPIFFS_ERROR("failed to write file %s errno %d", file_name, SPIFFS_errno(&instance.fs)); + ret = FSPIFFS_OPS_WRITE_FILE_FAILED; + goto err_exit; + } + + /* check file status */ + static spiffs_stat status; + memset(&status, 0, sizeof(status)); + result = SPIFFS_fstat(&instance.fs, fd, &status); + if (result < 0) + { + FSPIFFS_ERROR("failed to get status of file %s errno %d", file_name, SPIFFS_errno(&instance.fs)); + ret = FSPIFFS_OPS_WRITE_FILE_FAILED; + goto err_exit; + } + + if (status.size != wr_len) + { + FSPIFFS_ERROR("file write size %ld != %ld", status.size, wr_len); + ret = FSPIFFS_OPS_WRITE_FILE_FAILED; + goto err_exit; + } + + /* flush all pending writes from cache to flash */ + (void)SPIFFS_fflush(&instance.fs, fd); + vPrintf("write file %s with %d bytes success !!!\r\n", file_name, wr_len); +err_exit: + (void)SPIFFS_close(&instance.fs, fd); + return ret; +} + +int FSpiffsOpsReadFile(const char *file_name) +{ + FASSERT((file_name) && (strlen(file_name) > 0)); + int ret = FSPIFFS_OPS_OK; + int result = SPIFFS_OK; + + if (FALSE == instance.fs_ready) + { + FSPIFFS_ERROR("please mount file system first !!!"); + return FSPIFFS_OPS_NOT_YET_MOUNT; + } + + /* check file status */ + static spiffs_stat status; + + spiffs_flags open_flags = 0; + + /* open the file in read-only mode */ + open_flags = SPIFFS_RDWR; + spiffs_file fd = SPIFFS_open(&instance.fs, file_name, open_flags, 0); + if (0 > fd) + { + FSPIFFS_ERROR("failed to open file %s errno %d", file_name, SPIFFS_errno(&instance.fs)); + return FSPIFFS_OPS_OPEN_FILE_FAILED; + } + + /* check file status */ + memset(&status, 0, sizeof(status)); + result = SPIFFS_fstat(&instance.fs, fd, &status); + if (result < 0) + { + FSPIFFS_ERROR("failed to get status of file %s errno %d", file_name, SPIFFS_errno(&instance.fs)); + ret = FSPIFFS_OPS_OPEN_FILE_FAILED; + goto err_exit; + } + + s32_t offset = SPIFFS_lseek(&instance.fs, fd, 0, SPIFFS_SEEK_END); + if ((s32_t)status.size != offset) + { + FSPIFFS_ERROR("file %s spiffs:%ld! = fs:%ld", file_name, status.size, offset); + ret = FSPIFFS_OPS_OPEN_FILE_FAILED; + goto err_exit; + } + + memset(fspiffs_rw_buf, 0 , FSPIFFS_RW_BUF_SIZE); + + /* seek to offset and start read */ + if (0 > SPIFFS_lseek(&instance.fs, fd, 0, SPIFFS_SEEK_SET)) + { + FSPIFFS_ERROR("seek file failed !!!"); + ret = FSPIFFS_OPS_READ_FILE_FAILED; + goto err_exit; + } + + /*vPrintf("read %s from position %ld\n", file_name, SPIFFS_tell(&instance.fs, fd));*/ + + s32_t read_len = min((s32_t)FSPIFFS_RW_BUF_SIZE, (s32_t)status.size); + s32_t read_bytes = SPIFFS_read(&instance.fs, fd, (void *)fspiffs_rw_buf, read_len); + if (read_bytes < 0) + { + FSPIFFS_ERROR("failed to read file %s errno %d", file_name, SPIFFS_errno(&instance.fs)); + ret = FSPIFFS_OPS_READ_FILE_FAILED; + goto err_exit; + } + + vPrintf("read %s success, str = %s\n\n", file_name, fspiffs_rw_buf); + +err_exit : + /* close file */ + (void)SPIFFS_close(&instance.fs, fd); + + return ret; +} + + +static void FFreeRTOSSpimSpiffsInitTask(void *pvParameters) +{ + int result = 0; + + if (TRUE == spiffs_inited) + { + FSPIFFS_WARN("spiffs is already initialized"); + return; + } + + /* The spim_id to use is passed in via the parameter. + Cast this to a spim_id pointer. */ + u32 spim_id = (u32)(uintptr)pvParameters; + printf("spim_id: %d\n", spim_id); + + memset(&config, 0, sizeof(config)); + config = *FSpiffsGetDefaultConfig(); + config.phys_addr = FSPIFFS_START_ADDR; /* may use part of flash */ + config.phys_size = FSPIFFS_USE_SIZE; + + memset(&instance, 0, sizeof(instance)); + instance.fs_addr = FSPIFFS_START_ADDR; + instance.fs_size = FSPIFFS_USE_SIZE; + + result = FSpiffsInitialize(&instance, FSPIFFS_PORT_TO_FSPIM); + if (FSPIFFS_PORT_OK != result) + { + FSPIFFS_ERROR("initialize spiffs failed"); + return; + } + + FSpiffsOpsMount(FSPIFFS_IF_FORMAT); + + FSpiffsOpsCreateFile(file_name); + + spiffs_inited = TRUE; + + FSpiffsOpsListAll(); + + FSPIFFS_INFO("spiffs init success !!!\r\n"); + + for (int i = 0; i < READ_WRITE_TASK_NUM; i++) + { + xSemaphoreGive(xCountingSemaphore); + } + + vTaskDelete(NULL); + +} + + +static void FFreeRTOSSpimSpiffsReadTask(void *pvParameters) +{ + const char *pcTaskName = (char *) pvParameters; + const TickType_t xDelay = pdMS_TO_TICKS(TASK_DELAY_MS); + FError ret = FT_SUCCESS; + + xSemaphoreTake(xCountingSemaphore, portMAX_DELAY); + + /* As per most tasks, this task is implemented in an infinite loop. */ + for( ;; ) + { + /* Print out the name of this task. */ + vPrintf( pcTaskName ); + + FSpiffsOpsReadFile(file_name); + + /* Delay for a period. This time a call to vTaskDelay() is used which + places the task into the Blocked state until the delay period has + expired. The parameter takes a time specified in 'ticks', and the + pdMS_TO_TICKS() macro is used (where the xDelay constant is + declared) to convert TASK_DELAY_MS milliseconds into an equivalent time in + ticks. */ + vTaskDelay(xDelay); + } +} + + +static void FFreeRTOSSpimSpiffsWriteTask(void *pvParameters) +{ + const char *pcTaskName = "FFreeRTOSSpimSpiffsWriteTask is running\r\n"; + const TickType_t xDelay = pdMS_TO_TICKS(TASK_DELAY_MS); + FError ret = FT_SUCCESS; + char *string = "spiffs spim write"; + static char string_out[FSPIFFS_RW_BUF_SIZE] = {0}; + + static int i = 0; + + xSemaphoreTake(xCountingSemaphore, portMAX_DELAY); + + /* As per most tasks, this task is implemented in an infinite loop. */ + for (;;) + { + /* Print out the name of this task. */ + vPrintf( pcTaskName ); + i++; + sprintf(string_out, "%s-%d", string, i); + vPrintf( "write to %s, str = %s\n", file_name, string_out); + FSpiffsOpsWriteFile(file_name, string_out); + + /* Delay for a period. This time a call to vTaskDelay() is used which + places the task into the Blocked state until the delay period has + expired. The parameter takes a time specified in 'ticks', and the + pdMS_TO_TICKS() macro is used (where the xDelay constant is + declared) to convert TASK_DELAY_MS milliseconds into an equivalent time in + ticks. */ + vTaskDelay(xDelay); + } +} + +static void prvOneShotTimerCallback( TimerHandle_t xTimer ) +{ + /* Output a string to show the time at which the callback was executed. */ + vPrintf( "One-shot timer callback executing, delete SpimSpiffs ReadTask and WriteTask.\r\n" ); + + FFreeRTOSSpimSpiffsDelete(); +} + + +BaseType_t FFreeRTOSSpimSpiffsCreate(u32 spim_id)/* 主要任务函数 */ +{ + BaseType_t xReturn = pdPASS;/* 定义一个创建信息返回值,默认为 pdPASS */ + BaseType_t xTimerStarted = pdPASS; + + xCountingSemaphore = xSemaphoreCreateCounting(READ_WRITE_TASK_NUM, 0); + if (xCountingSemaphore == NULL) + { + printf("FFreeRTOSSpimSpiffsCreate xCountingSemaphore create failed.\r\n" ); + return pdFAIL; + } + + char *xString1 = "FFreeRTOSSpimSpiffsReadTask1 is running\r\n"; + char *xString2 = "FFreeRTOSSpimSpiffsReadTask2 is running\r\n"; + + taskENTER_CRITICAL(); /* 进入临界区 */ + + xReturn = xTaskCreate((TaskFunction_t )FFreeRTOSSpimSpiffsInitTask, /* 任务入口函数 */ + (const char* )"FFreeRTOSSpimSpiffsInitTask",/* 任务名字 */ + (uint16_t )4096, /* 任务栈大小 */ + (void* )(uintptr)spim_id,/* 任务入口函数参数 */ + (UBaseType_t )1, /* 任务的优先级 */ + NULL); /* 任务控制 */ + + xReturn = xTaskCreate((TaskFunction_t )FFreeRTOSSpimSpiffsReadTask, /* 任务入口函数 */ + (const char* )"FFreeRTOSSpimSpiffsReadTask",/* 任务名字 */ + (uint16_t )4096, /* 任务栈大小 */ + (void* )xString1,/* 任务入口函数参数 */ + (UBaseType_t )configMAX_PRIORITIES-1, /* 任务的优先级 */ + (TaskHandle_t* )&spim_read1_handle); /* 任务控制 */ + + xReturn = xTaskCreate((TaskFunction_t )FFreeRTOSSpimSpiffsReadTask, /* 任务入口函数 */ + (const char* )"FFreeRTOSSpimSpiffsReadTask",/* 任务名字 */ + (uint16_t )4096, /* 任务栈大小 */ + (void* )xString2,/* 任务入口函数参数 */ + (UBaseType_t )configMAX_PRIORITIES-1, /* 任务的优先级 */ + (TaskHandle_t* )&spim_read2_handle); /* 任务控制 */ + + xReturn = xTaskCreate((TaskFunction_t )FFreeRTOSSpimSpiffsWriteTask, /* 任务入口函数 */ + (const char* )"FFreeRTOSSpimSpiffsWriteTask",/* 任务名字 */ + (uint16_t )4096, /* 任务栈大小 */ + (void* )NULL,/* 任务入口函数参数 */ + (UBaseType_t )configMAX_PRIORITIES-1, /* 任务的优先级 */ + (TaskHandle_t* )&spim_write_handle); /* 任务控制 */ + + /* Create the one shot software timer, storing the handle to the created + software timer in xOneShotTimer. */ + xOneShotTimer = xTimerCreate( "OneShot Software Timer", /* Text name for the software timer - not used by FreeRTOS. */ + ONE_SHOT_TIMER_PERIOD, /* The software timer's period in ticks. */ + pdFALSE, /* Setting uxAutoRealod to pdFALSE creates a one-shot software timer. */ + 0, /* This example does not use the timer id. */ + prvOneShotTimerCallback ); /* The callback function to be used by the software timer being created. */ + + /* Check the timers were created. */ + if( xOneShotTimer != NULL ) + { + /* Start the software timers, using a block time of 0 (no block time). + The scheduler has not been started yet so any block time specified here + would be ignored anyway. */ + xTimerStarted = xTimerStart( xOneShotTimer, 0 ); + + /* The implementation of xTimerStart() uses the timer command queue, and + xTimerStart() will fail if the timer command queue gets full. The timer + service task does not get created until the scheduler is started, so all + commands sent to the command queue will stay in the queue until after + the scheduler has been started. Check both calls to xTimerStart() + passed. */ + if( xTimerStarted != pdPASS) + { + vPrintf("CreateSoftwareTimerTasks xTimerStart failed \r\n"); + } + } + else + { + vPrintf("CreateSoftwareTimerTasks xTimerCreate failed \r\n"); + } + + taskEXIT_CRITICAL(); + + return xReturn; +} + +static void FFreeRTOSSpimSpiffsDelete(void) +{ + BaseType_t xReturn = pdPASS; + + FSpiffsDeInitialize(&instance); + + if(spim_read1_handle) + { + vTaskDelete(spim_read1_handle); + vPrintf("Delete FFreeRTOSSpimSpiffsReadTask1 success\r\n"); + } + + if(spim_read2_handle) + { + vTaskDelete(spim_read2_handle); + vPrintf("Delete FFreeRTOSSpimSpiffsReadTask2 success\r\n"); + } + + if(spim_write_handle) + { + vTaskDelete(spim_write_handle); + vPrintf("Delete FFreeRTOSSpimSpiffsWriteTask success\r\n"); + } + + /* delete count sem */ + vSemaphoreDelete(xCountingSemaphore); + + /* delete timer */ + xReturn = xTimerDelete(xOneShotTimer, 0); + if(xReturn != pdPASS) + { + vPrintf("OneShot Software Timer Delete failed.\r\n"); + } + else + { + vPrintf("OneShot Software Timer Delete success.\r\n"); + } + +} + + + diff --git a/example/template/READEME.md b/example/template/READEME.md index 2599bc7784987a9bd2c45e43c7a4a565cdd81f4c..08cab5c69cf61c995c826c3c0ff1c8873f5e607f 100644 --- a/example/template/READEME.md +++ b/example/template/READEME.md @@ -11,7 +11,7 @@ * See the Phytium Public License for more details. * * - * FilePath: README.md + * FilePath: READEME.md * Date: 2022-02-24 13:42:19 * LastEditTime: 2022-03-21 17:02:58 * Description:  This file is for @@ -68,6 +68,8 @@ - make load_ft2004_aarch32 将预设32bit ft2004 下的配置加载至工程中 - make load_e2000d_aarch64 将预设64bit e2000d 下的配置加载至工程中 - make load_e2000d_aarch32 将预设32bit e2000d 下的配置加载至工程中 +- make load_e2000q_aarch64 将预设64bit e2000q 下的配置加载至工程中 +- make load_e2000q_aarch32 将预设32bit e2000q 下的配置加载至工程中 - make menuconfig 配置目录下的参数变量 - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 diff --git a/example/template/configs/e2000q_aarch32_eg_configs b/example/template/configs/e2000q_aarch32_eg_configs index f84f1ae3e7e3deb19a166334cfbe75d62f98117f..57c04828a9da09c0c133920c05fe7176bfa94062 100644 --- a/example/template/configs/e2000q_aarch32_eg_configs +++ b/example/template/configs/e2000q_aarch32_eg_configs @@ -2,7 +2,7 @@ # # Project Configuration # -CONFIG_TARGET_NAME="e2000q_freertos_a32" +CONFIG_TARGET_NAME="e2000d_freertos_a32" # end of Project Configuration # @@ -17,7 +17,7 @@ CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set CONFIG_USE_CACHE=y CONFIG_USE_MMU=y -CONFIG_USE_SYS_TICK=y +# CONFIG_USE_SYS_TICK is not set CONFIG_USE_AARCH64_L1_TO_AARCH32=y # end of Arch Configuration @@ -77,9 +77,9 @@ CONFIG_USE_NEW_LIBC=y # # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set -CONFIG_LOG_INFO=y +# CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set +CONFIG_LOG_ERROR=y # CONFIG_LOG_NONE is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y @@ -95,7 +95,7 @@ CONFIG_AARCH32_RAM_LD=y # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y CONFIG_ROM_START_UP_ADDR=0x80100000 -CONFIG_ROM_SIZE_MB=1 +CONFIG_ROM_SIZE_MB=2 CONFIG_LINK_SCRIPT_RAM=y CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 @@ -111,7 +111,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -# CONFIG_OUTPUT_BINARY is not set +CONFIG_OUTPUT_BINARY=y # end of Compiler Options # end of Building Option @@ -125,6 +125,12 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 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 # @@ -136,6 +142,49 @@ CONFIG_FREERTOS_USE_UART=y # # CONFIG_FREERTOS_USE_WDT is not set # end of Freertos Wdt Drivers + +# +# Freertos Eth Drivers +# +# CONFIG_FREERTOS_USE_XMAC 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 MMC Drivers +# +# CONFIG_FREERTOS_USE_FSDIO is not set +# end of Freertos MMC 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 # end of Component Configuration # @@ -147,5 +196,18 @@ CONFIG_USE_BACKTRACE=y # CONFIG_USE_SFUD is not set # CONFIG_USE_SPIFFS is not set # CONFIG_USE_AMP is not set -# CONFIG_USE_LETTER_SHELL 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_TLSF=y +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/template/configs/e2000q_aarch64_eg_configs b/example/template/configs/e2000q_aarch64_eg_configs index e10b84b5bbfd6e125bde38d0ae8d1e765088f9e4..205bf7fd935db838793cb5106e480c932927b80a 100644 --- a/example/template/configs/e2000q_aarch64_eg_configs +++ b/example/template/configs/e2000q_aarch64_eg_configs @@ -2,7 +2,7 @@ # # Project Configuration # -CONFIG_TARGET_NAME="e2000q_freertos_a64" +CONFIG_TARGET_NAME="e2000d_freertos_a64" # end of Project Configuration # @@ -17,7 +17,7 @@ CONFIG_USE_FREERTOS=y CONFIG_TARGET_ARMV8_AARCH64=y CONFIG_USE_CACHE=y CONFIG_USE_MMU=y -CONFIG_USE_SYS_TICK=y +# CONFIG_USE_SYS_TICK is not set # CONFIG_MMU_DEBUG_PRINTS is not set # end of Arch Configuration @@ -77,9 +77,9 @@ CONFIG_USE_NEW_LIBC=y # # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set -CONFIG_LOG_INFO=y +# CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set +CONFIG_LOG_ERROR=y # CONFIG_LOG_NONE is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_MASTER=y @@ -95,7 +95,7 @@ CONFIG_AARCH64_RAM_LD=y # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y CONFIG_ROM_START_UP_ADDR=0x80100000 -CONFIG_ROM_SIZE_MB=1 +CONFIG_ROM_SIZE_MB=2 CONFIG_LINK_SCRIPT_RAM=y CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 @@ -107,7 +107,7 @@ CONFIG_FPU_STACK_SIZE=0x1000 # # Compiler Options # -# CONFIG_OUTPUT_BINARY is not set +CONFIG_OUTPUT_BINARY=y # end of Compiler Options # end of Building Option @@ -121,6 +121,12 @@ CONFIG_FPU_STACK_SIZE=0x1000 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 # @@ -132,6 +138,49 @@ CONFIG_FREERTOS_USE_UART=y # # CONFIG_FREERTOS_USE_WDT is not set # end of Freertos Wdt Drivers + +# +# Freertos Eth Drivers +# +# CONFIG_FREERTOS_USE_XMAC 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 MMC Drivers +# +# CONFIG_FREERTOS_USE_FSDIO is not set +# end of Freertos MMC 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 # end of Component Configuration # @@ -143,5 +192,18 @@ CONFIG_USE_BACKTRACE=y # CONFIG_USE_SFUD is not set # CONFIG_USE_SPIFFS is not set # CONFIG_USE_AMP is not set -# CONFIG_USE_LETTER_SHELL 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_TLSF=y +# CONFIG_USE_SDMMC_CMD is not set +# CONFIG_USE_CHERRY_USB is not set # end of FreeRTOS Setting diff --git a/example/template/main.c b/example/template/main.c index 48f7c14b90ecde8c19ddcbe7a5912856d3a1224c..b157fbf01cb65960166a8e927fab8531cae38bd3 100644 --- a/example/template/main.c +++ b/example/template/main.c @@ -27,11 +27,11 @@ #include "FreeRTOS.h" #include "task.h" #include "queue.h" -#include "ft_types.h" -#include "ft_assert.h" -#include "generic_timer.h" -#include "interrupt.h" -#include "parameters.h" +#include "ftypes.h" +#include "fassert.h" +#include "fgeneric_timer.h" +#include "finterrupt.h" +#include "fparameters.h" #include "shell.h" #include "shell_port.h" diff --git a/install.py b/install.py index 581a123e50bdfc5bcb021c2a5750904d5c8c2a4a..aa2b9064c2d613ddcaffa67aba874628bdfc7551 100644 --- a/install.py +++ b/install.py @@ -86,9 +86,9 @@ os.system("chmod +x ./make/*.mk --silent ") os.system("chmod +x ./lib/Kconfiglib/*.py --silent ") # Add standalone sdk -standalone_sdk_v="c98d99f611a1aaf39d996e630a46e0213d390109" +standalone_sdk_v="0.4.0" standalone_path=freertos_sdk_path + '/standalone' -standalone_branche="master" +standalone_branche="release" standalone_remote="https://gitee.com/phytium_embedded/phytium-standalone-sdk.git" if not os.path.exists(standalone_path): diff --git a/make/standalone_dependence.mk b/make/standalone_dependence.mk index e3e9e40ddd4b59a0f478f3a8ec039796866b3e8b..b2dbf1013bf6da62b700f7ea684e72f43b148b12 100644 --- a/make/standalone_dependence.mk +++ b/make/standalone_dependence.mk @@ -6,7 +6,7 @@ include $(STANDALONE_DIR)/lib/lib.mk#libc 相关依赖 EXCL_SRC += $(STANDALONE_DIR)/common/fmemory_pool.c ifdef CONFIG_TARGET_ARMV8_AARCH64 -EXCL_SRC += $(STANDALONE_DIR)/arch/armv8/aarch64/gcc/boot.S +EXCL_SRC += $(STANDALONE_DIR)/arch/armv8/aarch64/gcc/fboot.S else -EXCL_SRC += $(STANDALONE_DIR)/arch/armv8/aarch32/gcc/vector.S +EXCL_SRC += $(STANDALONE_DIR)/arch/armv8/aarch32/gcc/fvector.S endif diff --git a/third-party/fatfs-0.1.3/port/fsata_controller/diskio.c b/third-party/fatfs-0.1.3/port/fsata_controller/diskio.c index 88dce42571919ba08787e556a3994c6eee0b14e5..d0fb49104863f032f7082d28188d2f94263a19d1 100644 --- a/third-party/fatfs-0.1.3/port/fsata_controller/diskio.c +++ b/third-party/fatfs-0.1.3/port/fsata_controller/diskio.c @@ -8,9 +8,9 @@ /*-----------------------------------------------------------------------*/ #include -#include "parameters.h" -#include "ft_debug.h" -#include "interrupt.h" +#include "fparameters.h" +#include "fdebug.h" +#include "finterrupt.h" #include "ff.h" #include "diskio.h" /* FatFs lower layer API */ #include "fsata.h" diff --git a/third-party/fatfs-0.1.3/port/fsata_pcie/diskio.c b/third-party/fatfs-0.1.3/port/fsata_pcie/diskio.c index 1043863af93c76e3b6cfb2edb035b9ca4804e8d4..27d10ccfee251047aafba985381fa8298a11b118 100644 --- a/third-party/fatfs-0.1.3/port/fsata_pcie/diskio.c +++ b/third-party/fatfs-0.1.3/port/fsata_pcie/diskio.c @@ -9,10 +9,10 @@ #include -#include "parameters.h" +#include "fparameters.h" -#include "ft_debug.h" -#include "interrupt.h" +#include "fdebug.h" +#include "finterrupt.h" #include "ff.h" #include "diskio.h" /* FatFs lower layer API */ #include "fpcie.h" diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch32/FreeRTOSConfig.h b/third-party/freertos/portable/GCC/ft_platform/aarch32/FreeRTOSConfig.h index 6c13b8e6953a5d12653d0c021c60ad010ce33d03..bf267016ee752e4332f15701d26f3bf32a1422d9 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch32/FreeRTOSConfig.h +++ b/third-party/freertos/portable/GCC/ft_platform/aarch32/FreeRTOSConfig.h @@ -29,8 +29,8 @@ #define FREERTOS_CONFIG_H #if !defined(__ASSEMBLER__) -#include "parameters.h" -#include "interrupt.h" +#include "fparameters.h" +#include "finterrupt.h" #endif /*----------------------------------------------------------- diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c b/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c index fd7978f98791a210d92b7f0ab5aa827b52984b6c..98a87b880b952e84f7462a207265a0a3b53c9e89 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c +++ b/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c @@ -28,7 +28,7 @@ /* Standard includes. */ #include #include -#include "aarch32.h" +#include "faarch32.h" /* Scheduler includes. */ #include "FreeRTOS.h" diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/FreeRTOSConfig.h b/third-party/freertos/portable/GCC/ft_platform/aarch64/FreeRTOSConfig.h index c1d031726955432da0062835079aba2f880879a6..594e8dd2934cbf4cae712c41722f3e03da0683d9 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch64/FreeRTOSConfig.h +++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/FreeRTOSConfig.h @@ -28,7 +28,7 @@ #ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H -#include "interrupt.h" +#include "finterrupt.h" /*----------------------------------------------------------- * Application specific definitions. diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c b/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c index fc5d395121e96f2411c310cdb2048adc8ae513a4..a3371d4384377476180a68f82f9f7d6c637b7e91 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c +++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c @@ -31,8 +31,8 @@ /* Scheduler includes. */ #include "FreeRTOS.h" #include "task.h" -#include "ft_types.h" -#include "interrupt.h" +#include "ftypes.h" +#include "finterrupt.h" #include "fgic_cpu_interface.h" #ifndef configUNIQUE_INTERRUPT_PRIORITIES #error configUNIQUE_INTERRUPT_PRIORITIES must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/portmacro.h b/third-party/freertos/portable/GCC/ft_platform/aarch64/portmacro.h index ad1b13647688783f28d95f26411cbcde5aecd275..6b84fab1f6796c0a56344ae2664c6062567bbc06 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch64/portmacro.h +++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/portmacro.h @@ -32,7 +32,7 @@ extern "C" { #endif -#include "ft_types.h" +#include "ftypes.h" /*----------------------------------------------------------- * Port specific definitions. * diff --git a/third-party/freertos/portable/freertos_configs.c b/third-party/freertos/portable/freertos_configs.c index 3e1b5059345c927ba7ccb97185597f77a194767e..f5c8f4e63fc5c4e032efbeca086dff76a107b377 100644 --- a/third-party/freertos/portable/freertos_configs.c +++ b/third-party/freertos/portable/freertos_configs.c @@ -23,16 +23,16 @@ #include "FreeRTOS.h" #include "task.h" -#include "ft_types.h" -#include "parameters.h" -#include "generic_timer.h" -#include "interrupt.h" +#include "ftypes.h" +#include "fparameters.h" +#include "fgeneric_timer.h" +#include "finterrupt.h" #include #include -#include "cpu_info.h" -#include "ft_assert.h" -#include "exception.h" -#include "f_printf.h" +#include "fcpu_info.h" +#include "fassert.h" +#include "fexception.h" +#include "fprintf.h" void vMainAssertCalled(const char *pcFileName, uint32_t ulLineNumber) { diff --git a/third-party/letter-shell-3.1/port/cmd/cmd_bootelf.c b/third-party/letter-shell-3.1/port/cmd/cmd_bootelf.c index 90ddf2c15ec244232f2b71bb275c2bd57e714d0d..5fc8e66a75da453d375cd35817e5064739ee82d1 100644 --- a/third-party/letter-shell-3.1/port/cmd/cmd_bootelf.c +++ b/third-party/letter-shell-3.1/port/cmd/cmd_bootelf.c @@ -24,7 +24,7 @@ #include #include "../src/shell.h" #include "strto.h" -#include "ft_elf.h" +#include "felf.h" static unsigned long image_load_addr = 0x80100000; diff --git a/third-party/letter-shell-3.1/port/cmd/cmd_codeloader.c b/third-party/letter-shell-3.1/port/cmd/cmd_codeloader.c index fba1446b9ad178518e5abfd8d17529600d403db8..d3e4bf388304171060de7ad39866ee14635fb4b0 100644 --- a/third-party/letter-shell-3.1/port/cmd/cmd_codeloader.c +++ b/third-party/letter-shell-3.1/port/cmd/cmd_codeloader.c @@ -10,7 +10,7 @@ #include #include "../src/shell.h" #include "strto.h" -#include "ft_elf.h" +#include "felf.h" static unsigned long image_load_addr = 0x80100000; diff --git a/third-party/letter-shell-3.1/port/cmd/cmd_echo.c b/third-party/letter-shell-3.1/port/cmd/cmd_echo.c index ae83b1c7846f1ac8cd3d8592a18d001ede525894..477b2720c3a61af2a4ad6175daee91b2a96b12d1 100644 --- a/third-party/letter-shell-3.1/port/cmd/cmd_echo.c +++ b/third-party/letter-shell-3.1/port/cmd/cmd_echo.c @@ -25,8 +25,8 @@ #include #include #include "../src/shell.h" -#include "ft_io.h" -#include "ft_types.h" +#include "fio.h" +#include "ftypes.h" static void EchoCmdUsage() { diff --git a/third-party/letter-shell-3.1/port/cmd/cmd_md.c b/third-party/letter-shell-3.1/port/cmd/cmd_md.c index c3868c162e2a5098c59363307f74c148be592f25..9860fb6e30752e7f93deeb1800c639894d69c030 100644 --- a/third-party/letter-shell-3.1/port/cmd/cmd_md.c +++ b/third-party/letter-shell-3.1/port/cmd/cmd_md.c @@ -25,8 +25,8 @@ #include #include #include "../src/shell.h" -#include "ft_io.h" -#include "ft_types.h" +#include "fio.h" +#include "ftypes.h" static void MdCmdUsage() { diff --git a/third-party/letter-shell-3.1/port/cmd/cmd_mw.c b/third-party/letter-shell-3.1/port/cmd/cmd_mw.c index 1b6d9504a12f9669defa0a951952d0667c2c0d98..477ebd547ad7a3aa99958e6b520a8c97536c5d40 100644 --- a/third-party/letter-shell-3.1/port/cmd/cmd_mw.c +++ b/third-party/letter-shell-3.1/port/cmd/cmd_mw.c @@ -25,8 +25,8 @@ #include #include #include "../src/shell.h" -#include "ft_io.h" -#include "ft_types.h" +#include "fio.h" +#include "ftypes.h" static void MwUsage() { diff --git a/third-party/letter-shell-3.1/port/cmd/cmd_os_stats.c b/third-party/letter-shell-3.1/port/cmd/cmd_os_stats.c index 46101732641fdab981909070288ab08f2b701f2d..52270073eda949be570900fadb8b6cdedad4928d 100644 --- a/third-party/letter-shell-3.1/port/cmd/cmd_os_stats.c +++ b/third-party/letter-shell-3.1/port/cmd/cmd_os_stats.c @@ -26,11 +26,13 @@ #include #include "string.h" -static uint8_t CPU_RunInfo[800] = {0}; //保存任务运行时间信息 +#define PS_LENGTH 10240 + +static uint8_t CPU_RunInfo[PS_LENGTH] = {0}; //保存任务运行时间信息 static int DisplayTaskStats(int argc, char *argv[]) { - memset(CPU_RunInfo,0,800); /*信息缓冲区清零*/ + memset(CPU_RunInfo, 0, PS_LENGTH); /*信息缓冲区清零*/ vTaskList((char *)&CPU_RunInfo); //获取任务运行时间信息 printf("---------------------------------------------\r\n"); @@ -38,7 +40,7 @@ static int DisplayTaskStats(int argc, char *argv[]) printf("%s", CPU_RunInfo); printf("---------------------------------------------\r\n"); - memset(CPU_RunInfo, 0, 800); //信息缓冲区清零 + memset(CPU_RunInfo, 0, PS_LENGTH); //信息缓冲区清零 vTaskGetRunTimeStats((char *)&CPU_RunInfo); diff --git a/third-party/letter-shell-3.1/port/cmd/cmd_reboot.c b/third-party/letter-shell-3.1/port/cmd/cmd_reboot.c index ac0d83c10f51179a2afa19f35de798509da60f15..edb079d3bc99e44c294e8cf994129c94f45177a6 100644 --- a/third-party/letter-shell-3.1/port/cmd/cmd_reboot.c +++ b/third-party/letter-shell-3.1/port/cmd/cmd_reboot.c @@ -22,8 +22,8 @@ */ #include "../src/shell.h" -#include "ft_types.h" -#include "psci.h" +#include "ftypes.h" +#include "fpsci.h" int RebootCmdEntry() { diff --git a/third-party/letter-shell-3.1/port/cmd/cmd_rw.c b/third-party/letter-shell-3.1/port/cmd/cmd_rw.c index 8cf1a3a9d4f63b56539a1228131c1054fede7ac0..e762f85cabd1d9052557b4711e89838ab7fc78be 100644 --- a/third-party/letter-shell-3.1/port/cmd/cmd_rw.c +++ b/third-party/letter-shell-3.1/port/cmd/cmd_rw.c @@ -26,9 +26,9 @@ #include #include "../src/shell.h" #include "../shell_port.h" -#include "ft_io.h" -#include "ft_types.h" -#include "ft_debug.h" +#include "fio.h" +#include "ftypes.h" +#include "fdebug.h" static int RwWriteRegister(u32 reg_addr, u32 reg_val, u32 bit_width) { diff --git a/third-party/letter-shell-3.1/port/cmd/cmd_sleep.c b/third-party/letter-shell-3.1/port/cmd/cmd_sleep.c index 24143669fc75bbc57d4ecb95932906f3b024b808..af1c27cf6d0b0ce1bb0810cfce1aee2de0c36f8d 100644 --- a/third-party/letter-shell-3.1/port/cmd/cmd_sleep.c +++ b/third-party/letter-shell-3.1/port/cmd/cmd_sleep.c @@ -25,8 +25,8 @@ #include #include #include "../src/shell.h" -#include "ft_io.h" -#include "ft_types.h" +#include "fio.h" +#include "ftypes.h" #include "fsleep.h" static void SleepCmdUsage() diff --git a/third-party/letter-shell-3.1/port/pl011/fpl011_os_port.c b/third-party/letter-shell-3.1/port/pl011/fpl011_os_port.c index 61d55595ab7c107a9372f0304bf607fb57e64769..f80831f0964dc1aef5a2a474dc9565d5e2bf8829 100644 --- a/third-party/letter-shell-3.1/port/pl011/fpl011_os_port.c +++ b/third-party/letter-shell-3.1/port/pl011/fpl011_os_port.c @@ -23,10 +23,10 @@ #include -#include "ft_assert.h" -#include "parameters.h" +#include "fassert.h" +#include "fparameters.h" #include "shell_port.h" -#include "interrupt.h" +#include "finterrupt.h" #include "fpl011_os.h" FtFreertosUart os_uart1; diff --git a/third-party/letter-shell-3.1/port/shell_port.c b/third-party/letter-shell-3.1/port/shell_port.c index 9285f511a20cab7fb53a7c65addb5d7f58f83466..7c3fde201021a89f36ee49504cd50aafa1718439 100644 --- a/third-party/letter-shell-3.1/port/shell_port.c +++ b/third-party/letter-shell-3.1/port/shell_port.c @@ -25,7 +25,7 @@ #include #include #include -#include "ft_assert.h" +#include "fassert.h" #include "shell_port.h" #include "FreeRTOS.h" #include "task.h" diff --git a/third-party/letter-shell-3.1/port/shell_port.h b/third-party/letter-shell-3.1/port/shell_port.h index 964134f5889d9ec5bfcf93bd32dd391d14fc9752..744d08d7b587911f15fedc40caef3301faebb86e 100644 --- a/third-party/letter-shell-3.1/port/shell_port.h +++ b/third-party/letter-shell-3.1/port/shell_port.h @@ -26,7 +26,7 @@ #define THIRD_LETTER_SHELL_OS_PORT_H #include "shell.h" -#include "ft_types.h" +#include "ftypes.h" #include "FreeRTOS.h" #include "task.h" diff --git a/third-party/libmetal/metal/system/freertos/ft_platform/sys.c b/third-party/libmetal/metal/system/freertos/ft_platform/sys.c index f4848fc64d880c1aa5370c9a1c8367c3cc214798..48191c95d6554bacd34a23707a23e4be13c6c364 100644 --- a/third-party/libmetal/metal/system/freertos/ft_platform/sys.c +++ b/third-party/libmetal/metal/system/freertos/ft_platform/sys.c @@ -27,10 +27,10 @@ #include #include #ifndef __aarch64__ -#include "cp15.h" +#include "fcp15.h" #endif -#include "mmu.h" -#include "cache.h" +#include "fmmu.h" +#include "fcache.h" #define _DISABLE_INTERRUPTS() \ __asm volatile("MSR DAIFSET, #2" :: \ diff --git a/third-party/lwip-2.1.2/apps/tftp/tftp.c b/third-party/lwip-2.1.2/apps/tftp/tftp.c index 408f4968adf3ec2c58866025cf5f816013927740..4a0dd5cd937f9792cb12a31db8e97df453e022bc 100644 --- a/third-party/lwip-2.1.2/apps/tftp/tftp.c +++ b/third-party/lwip-2.1.2/apps/tftp/tftp.c @@ -47,7 +47,8 @@ * This is simple TFTP client/server for the lwIP raw API. * You need to increase MEMP_NUM_SYS_TIMEOUT by one if you use TFTP! */ - +#include +#include "fdebug.h" #include "tftp_client.h" #include "tftp_server.h" @@ -88,8 +89,6 @@ enum tftp_error TFTP_ERROR_NO_SUCH_USER = 7 }; -#include - struct tftp_state { const struct tftp_context *ctx; @@ -234,8 +233,6 @@ resend_data(const ip_addr_t *addr, u16_t port) return ret; } -#include "ft_debug.h" - static void send_data(const ip_addr_t *addr, u16_t port) { @@ -265,8 +262,6 @@ send_data(const ip_addr_t *addr, u16_t port) return; } - //FtDumpHexByte((u8 *)&payload[2], 128); - pbuf_realloc(tftp_state.last_data, (u16_t)(TFTP_HEADER_LENGTH + ret)); resend_data(addr, port); } diff --git a/third-party/lwip-2.1.2/ports/fgmac/ethernetif.c b/third-party/lwip-2.1.2/ports/fgmac/ethernetif.c index 6369c05cd04af432dddd782d7e2e34f8f11ff9b4..9bcc11ff2f81580b4dae65f815af605ac77ad1fe 100644 --- a/third-party/lwip-2.1.2/ports/fgmac/ethernetif.c +++ b/third-party/lwip-2.1.2/ports/fgmac/ethernetif.c @@ -40,7 +40,7 @@ #include "../include/lwip/debug.h" #include "ethernetif.h" #include "sdkconfig.h" -#include "parameters.h" +#include "fparameters.h" #if LWIP_IPV6 #include "lwip/ethip6.h" @@ -51,8 +51,8 @@ #include "fgmac_hw.h" #include "fgmac_phy.h" -#include "ft_assert.h" -#include "interrupt.h" +#include "fassert.h" +#include "finterrupt.h" #ifndef SDK_CONFIG_H__ #error "Please include sdkconfig.h first" @@ -61,9 +61,9 @@ #ifndef CONFIG_USE_SYS_TICK #error "Please enable system tick by CONFIG_USE_SYS_TICK first" #endif -#include "generic_timer.h" +#include "fgeneric_timer.h" #include "fgmac.h" -#include "ft_debug.h" +#include "fdebug.h" /* The time to block waiting for input. */ #define TIME_WAITING_FOR_INPUT (portMAX_DELAY) diff --git a/third-party/lwip-2.1.2/ports/fgmac/ethernetif.h b/third-party/lwip-2.1.2/ports/fgmac/ethernetif.h index f6fb15ae24eb07540e10fbaa43dbab111f717910..c6843bf526b89f1a3c4e2757893e8339f4cd706c 100644 --- a/third-party/lwip-2.1.2/ports/fgmac/ethernetif.h +++ b/third-party/lwip-2.1.2/ports/fgmac/ethernetif.h @@ -27,7 +27,7 @@ #include "lwip/err.h" #include "lwip/netif.h" #include "fgmac.h" -#include "parameters.h" +#include "fparameters.h" #include "sdkconfig.h" #define GMAC_RX_DESCNUM CONFIG_GMAC_RX_DESCNUM diff --git a/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.c b/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.c index e0f3520ba67eb470532afddbd89b322d9d59f37b..887554b4b57eebc4a95166e0716ae720aac8adc9 100644 --- a/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.c +++ b/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.c @@ -29,13 +29,13 @@ #include #include "ft_os_gmac.h" #include "fgmac.h" -#include "ft_assert.h" -#include "ft_io.h" -#include "ft_assert.h" -#include "interrupt.h" +#include "fassert.h" +#include "fio.h" +#include "fassert.h" +#include "finterrupt.h" #include "list.h" -#include "cpu_info.h" -#include "ft_debug.h" +#include "fcpu_info.h" +#include "fdebug.h" #define OS_MAC_DEBUG_TAG "OS_MAC" diff --git a/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.h b/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.h index e555f3ea4c8f1a8403ca1e1aa73cc75a23a50c71..cb54b88fe310e2818e270735be7d2c913d4f1d00 100644 --- a/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.h +++ b/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.h @@ -32,7 +32,7 @@ #include "fgmac.h" #include "fgmac_hw.h" #include "fgmac_phy.h" -#include "parameters.h" +#include "fparameters.h" #include "lwip/netif.h" #include "ethernetif.h" diff --git a/third-party/lwip-2.1.2/ports/fgmac/lwip_port.c b/third-party/lwip-2.1.2/ports/fgmac/lwip_port.c index c44e484c604d29f3eb6a85df367b7440d407a5ae..3217749a8081fdfd4e3e9d2702ca56d5373e04d2 100644 --- a/third-party/lwip-2.1.2/ports/fgmac/lwip_port.c +++ b/third-party/lwip-2.1.2/ports/fgmac/lwip_port.c @@ -55,10 +55,10 @@ #include "netif/etharp.h" #include "lwip_port.h" -#include "parameters.h" -#include "ft_types.h" -#include "ft_debug.h" -#include "generic_timer.h" +#include "fparameters.h" +#include "ftypes.h" +#include "fdebug.h" +#include "fgeneric_timer.h" #if !NO_SYS #include "lwip/tcpip.h" diff --git a/third-party/lwip-2.1.2/ports/fxmac/ethernetif.c b/third-party/lwip-2.1.2/ports/fxmac/ethernetif.c index fb2161b01111d77566b1887913f0c65d7e7ff20b..6e5d1f6c98fea6ab39b551aa75d95a6aa8114eb5 100644 --- a/third-party/lwip-2.1.2/ports/fxmac/ethernetif.c +++ b/third-party/lwip-2.1.2/ports/fxmac/ethernetif.c @@ -37,7 +37,7 @@ #include "ethernetif.h" #include "lwip_port.h" #include "ft_os_xmac.h" -#include "ft_debug.h" +#include "fdebug.h" #define FXMAC_LWIP_NET_DEBUG_TAG "FXMAC_LWIP_NET" diff --git a/third-party/lwip-2.1.2/ports/fxmac/ethernetif.h b/third-party/lwip-2.1.2/ports/fxmac/ethernetif.h index 2e70c2229c59a468d5c11275c8e36f689764dcef..2b5d0e72255edf7e5feb896738a3c82c1fa52158 100644 --- a/third-party/lwip-2.1.2/ports/fxmac/ethernetif.h +++ b/third-party/lwip-2.1.2/ports/fxmac/ethernetif.h @@ -32,7 +32,7 @@ extern "C" { #include "netif/etharp.h" #include "lwip/sys.h" #include "lwip_port.h" -#include "f_printk.h" +#include "fprintk.h" #include "fxmac.h" #include "arch/cc.h" diff --git a/third-party/lwip-2.1.2/ports/fxmac/lwip_port.c b/third-party/lwip-2.1.2/ports/fxmac/lwip_port.c index aa8a246616f925390c56fef0349ae9284a5af55c..1bbeb399f5be1cc65b5d4055703310de44eeb8be 100644 --- a/third-party/lwip-2.1.2/ports/fxmac/lwip_port.c +++ b/third-party/lwip-2.1.2/ports/fxmac/lwip_port.c @@ -55,9 +55,9 @@ #include "netif/etharp.h" #include "lwip_port.h" -#include "parameters.h" -#include "f_printk.h" -#include "ft_debug.h" +#include "fparameters.h" +#include "fprintk.h" +#include "fdebug.h" #if !NO_SYS #include "lwip/tcpip.h" diff --git a/third-party/lwip-2.1.2/ports/fxmac/lwip_port.h b/third-party/lwip-2.1.2/ports/fxmac/lwip_port.h index d22c8ed8f941ba6e827ed132137c44f01bdf6ad7..e1cd379286ff4c3eb71e3e7da64227a78876b17a 100644 --- a/third-party/lwip-2.1.2/ports/fxmac/lwip_port.h +++ b/third-party/lwip-2.1.2/ports/fxmac/lwip_port.h @@ -28,7 +28,7 @@ #ifdef __cplusplus extern "C" { #endif -#include "ft_types.h" +#include "ftypes.h" #include "lwipopts.h" #include "lwip/netif.h" diff --git a/third-party/openamp/ports/helper.c b/third-party/openamp/ports/helper.c index 0b2acfb6b9a745b329f24e040256131e1653003a..ff813c1793005b95bbb8f99af6193af352024db2 100644 --- a/third-party/openamp/ports/helper.c +++ b/third-party/openamp/ports/helper.c @@ -25,7 +25,7 @@ #include #include "platform_info.h" #include -#include "cache.h" +#include "fcache.h" #include static void system_metal_logger(enum metal_log_level level, diff --git a/third-party/openamp/ports/phytium_os_rproc.c b/third-party/openamp/ports/phytium_os_rproc.c index 22623db673be5aee00378826572769f769b96a38..de2f0136dd4904838376f15e9dbd24270cd5115b 100644 --- a/third-party/openamp/ports/phytium_os_rproc.c +++ b/third-party/openamp/ports/phytium_os_rproc.c @@ -31,12 +31,12 @@ #include #include "platform_info.h" #include "sdkconfig.h" -#include "ft_debug.h" -#include "interrupt.h" +#include "fdebug.h" +#include "finterrupt.h" #include -#include "mmu.h" -#include "ft_types.h" -#include "cpu_info.h" +#include "fmmu.h" +#include "ftypes.h" +#include "fcpu_info.h" diff --git a/third-party/openamp/ports/platform_info.c b/third-party/openamp/ports/platform_info.c index c920d06dc741108309716c954cd5de67b4bc118d..0ef7fb7918c0e69f3f6e2d31c8d4bd62a6fac68b 100644 --- a/third-party/openamp/ports/platform_info.c +++ b/third-party/openamp/ports/platform_info.c @@ -33,8 +33,8 @@ #include "platform_info.h" #include "rsc_table.h" #include "sdkconfig.h" -#include "mmu.h" -#include "ft_debug.h" +#include "fmmu.h" +#include "fdebug.h" #include /************************** Constant Definitions *****************************/ diff --git a/third-party/sdmmc-1.0/port/fsdio/sdmmc_port.c b/third-party/sdmmc-1.0/port/fsdio/sdmmc_port.c index be83e31be7e401fd447716db46acef0e5a46943c..82056595f93b42a989816c50ca9f68d14bf24294 100644 --- a/third-party/sdmmc-1.0/port/fsdio/sdmmc_port.c +++ b/third-party/sdmmc-1.0/port/fsdio/sdmmc_port.c @@ -27,7 +27,7 @@ #include #include "fmemory_pool.h" -#include "parameters.h" +#include "fparameters.h" #include "sdmmc_port.h" #include "sdmmc_cmd.h" diff --git a/third-party/sdmmc-1.0/port/fsdio/sdmmc_port.h b/third-party/sdmmc-1.0/port/fsdio/sdmmc_port.h index 07bef992784e9a07acf6912381eb2416fa8ec4bc..a49b057b2a9cfd46e5f25ac3203f739493cf1188 100644 --- a/third-party/sdmmc-1.0/port/fsdio/sdmmc_port.h +++ b/third-party/sdmmc-1.0/port/fsdio/sdmmc_port.h @@ -31,11 +31,11 @@ extern "C" /***************************** Include Files *********************************/ #include -#include "ft_types.h" +#include "ftypes.h" #include "fsleep.h" -#include "kernel.h" -#include "ft_assert.h" -#include "ft_debug.h" +#include "fkernel.h" +#include "fassert.h" +#include "fdebug.h" /************************** Constant Definitions *****************************/ #define true TRUE diff --git a/third-party/sfud-1.1.0/inc/sfud_def.h b/third-party/sfud-1.1.0/inc/sfud_def.h index 0c4ad56fe1d813e6d94100b80cde1a544374a1a8..914b330e6994f71f1e2d9b4f588d06b9eaa45237 100644 --- a/third-party/sfud-1.1.0/inc/sfud_def.h +++ b/third-party/sfud-1.1.0/inc/sfud_def.h @@ -33,7 +33,7 @@ #include #include #include -#include "ft_debug.h" +#include "fdebug.h" #include #include "sfud_flash_def.h" diff --git a/third-party/sfud-1.1.0/inc/sfud_flash_def.h b/third-party/sfud-1.1.0/inc/sfud_flash_def.h index 0f8731f65e7eafc6c5c6c4adfb18de1a38c0686e..3024442e501c14a6692ef45f7829f770e5c08fc1 100644 --- a/third-party/sfud-1.1.0/inc/sfud_flash_def.h +++ b/third-party/sfud-1.1.0/inc/sfud_flash_def.h @@ -154,7 +154,8 @@ typedef struct { {"GD25LQ128E", SFUD_MF_ID_GIGADEVICE, 0x40, 0x18, 16L*1024L*1024L, SFUD_WM_PAGE_256B, 4096, 0xD8}, \ {"GD25QL256D", SFUD_MF_ID_GIGADEVICE, 0x60, 0x19, 32L*1024L*1024L, SFUD_WM_PAGE_256B, 4096, 0xD8}, \ {"BY25Q64BS", SFUD_MF_ID_BOYA, 0x40, 0x17, 8L*1024L*1024L, SFUD_WM_PAGE_256B, 4096, 0xD8}, \ - {"BY25Q32BS", SFUD_MF_ID_BOYA, 0x40, 0x16, 4L*1024L*1024L, SFUD_WM_PAGE_256B, 4096, 0xD8} \ + {"BY25Q32BS", SFUD_MF_ID_BOYA, 0x40, 0x16, 4L*1024L*1024L, SFUD_WM_PAGE_256B, 4096, 0xD8}, \ + {"BY25Q16BS", SFUD_MF_ID_BOYA, 0x40, 0x15, 2L*1024L*1024L, SFUD_WM_PAGE_256B, 4096, 0xD8} \ } #endif /* SFUD_USING_FLASH_INFO_TABLE */ diff --git a/third-party/sfud-1.1.0/ports/fqspi/fqspi_sfud_core.c b/third-party/sfud-1.1.0/ports/fqspi/fqspi_sfud_core.c index b5d0726a63835ca9be0163e759b64f0cf171d2f1..2c2fd2f21e68248a1898ae01d8b4f0c7bd62d29e 100644 --- a/third-party/sfud-1.1.0/ports/fqspi/fqspi_sfud_core.c +++ b/third-party/sfud-1.1.0/ports/fqspi/fqspi_sfud_core.c @@ -21,7 +21,7 @@ * ----- ------     --------    -------------------------------------- */ -#include "parameters.h" +#include "fparameters.h" #include "fqspi_sfud_core.h" #include "sdkconfig.h" #include "fqspi_os.h" diff --git a/third-party/sfud-1.1.0/ports/fspim/fspim_sfud_core.c b/third-party/sfud-1.1.0/ports/fspim/fspim_sfud_core.c index b75863dc66ea5729584ef12e3f179d99f3d5d50b..49edbc7ee6a3c945dcf4ac6c8bb2c1cf24c8e9dc 100644 --- a/third-party/sfud-1.1.0/ports/fspim/fspim_sfud_core.c +++ b/third-party/sfud-1.1.0/ports/fspim/fspim_sfud_core.c @@ -23,9 +23,10 @@ #include "FreeRTOS.h" #include "task.h" #include "semphr.h" +#include -#include "parameters.h" -#include "ft_assert.h" +#include "fparameters.h" +#include "fassert.h" #include "fsleep.h" #include "fspim_os.h" @@ -62,14 +63,14 @@ static FSpimSfudOs sfud_instance = .is_inited = FALSE }; -static sfud_err FSpimReadWrite(const sfud_spi *flash, const uint8_t *write_buf, size_t write_size, uint8_t *read_buf, +static sfud_err FSpimReadWrite(const sfud_spi *spi, const uint8_t *write_buf, size_t write_size, uint8_t *read_buf, size_t read_size) { sfud_err result = SFUD_SUCCESS; FError err = FT_SUCCESS; - FSpimSfudOs *user_data = (FSpimSfudOs *)flash->user_data; + FSpimSfudOs *user_data = (FSpimSfudOs *)spi->user_data; - SFUD_DEBUG("spi_write_read@%p beg+++++++++++++++++++++++++++++++++++++++++++++++++++", flash); + SFUD_DEBUG("spi_write_read@%p beg+++++++++++++++++++++++++++++++++++++++++++++++++++", spi); if (NULL != write_buf) { SFUD_DEBUG("++++ Write %d Bytes @%p: 0x%x, 0x%x, 0x%x", @@ -101,31 +102,38 @@ static sfud_err FSpimReadWrite(const sfud_spi *flash, const uint8_t *write_buf, ((read_size > 1)) ? read_buf[1] : 0xff, ((read_size > 2)) ? read_buf[2] : 0xff); } - SFUD_DEBUG("spi_write_read@%p end+++++++++++++++++++++++++++++++++++++++++++++++++++", flash); + SFUD_DEBUG("spi_write_read@%p end+++++++++++++++++++++++++++++++++++++++++++++++++++", spi); return result; } sfud_err FSpimProbe(sfud_flash *flash) { + sfud_spi *spi_p = &flash->spi; FSpimSfudOs *user_data = &sfud_instance; - /* sfud_spi_port_init will be called for each flash candidate, - and we just do controller init for the first time */ - if (FALSE == user_data->is_inited) + if (!memcmp(FSPIM2_SFUD_NAME, spi_p->name, strlen(FSPIM2_SFUD_NAME))) { - /* init spi controller */ - user_data->spi = FFreeRTOSSpimInit(user_data->spi_id, &user_data->spi_cfg); - if (NULL == user_data->spi) + /* sfud_spi_port_init will be called for each flash candidate, + and we just do controller init for the first time */ + if (FALSE == user_data->is_inited) { - return SFUD_ERR_NOT_FOUND; - } + /* init spi controller */ + user_data->spi = FFreeRTOSSpimInit(user_data->spi_id, &user_data->spi_cfg); + if (NULL == user_data->spi) + { + return SFUD_ERR_NOT_FOUND; + } - user_data->is_inited = TRUE; + user_data->is_inited = TRUE; + } + flash->spi.user_data = user_data; + flash->spi.wr = FSpimReadWrite; + } + else + { + return SFUD_ERR_NOT_FOUND; } - - flash->user_data = user_data; - flash->spi.wr = FSpimReadWrite; return SFUD_SUCCESS; } \ No newline at end of file diff --git a/third-party/sfud-1.1.0/ports/sfud_port.c b/third-party/sfud-1.1.0/ports/sfud_port.c index 02e69babae52697407c55ea665776c12e2e6548d..28190506d3ae75011597170e61958f203b40770d 100644 --- a/third-party/sfud-1.1.0/ports/sfud_port.c +++ b/third-party/sfud-1.1.0/ports/sfud_port.c @@ -35,7 +35,7 @@ #include #include #include "fsleep.h" -#include "ft_debug.h" +#include "fdebug.h" #include "FreeRTOS.h" #include "semphr.h" diff --git a/third-party/spiffs-0.3.7/config.md b/third-party/spiffs-0.3.7/config.md new file mode 100644 index 0000000000000000000000000000000000000000..221ece58671fa2c572cd2eced0931594f416d76f --- /dev/null +++ b/third-party/spiffs-0.3.7/config.md @@ -0,0 +1,197 @@ +# SPIFFS文件系统移植配置解释 +移植SPIFFS过程中需要对其文件目录`spiffs-0.3.7\src\default`下`spiffs_config.h`配置文件进行一定修改,来使其适配不同的应用环境。本文档介绍飞腾FreeTROS环境下SPIFFS的相关配置。 + +####github +在github上有wiki说明SPIFFS相关配置信息: +- http://github.com/pellepl/spiffs/wiki + +SPIFFS技术手册: +- http://blog.csdn.net/zhangjinxing_2006/article/details/75050611 + +####重要移植概述 +在SPIFFS暴露的配置中,由许多是不需要修改的。在用户移植的过程中,可以参考如下配置设置。 +#####基础函数库配置 +``` +#ifndef SPIFFS_CONFIG_H_ +#define SPIFFS_CONFIG_H_ + +// ----------- 8< ------------ +// Following includes are for the linux test build of spiffs +// These may/should/must be removed/altered/replaced in your target +#include +#include +#include +#include +#include + +#include "ft_types.h" +#include "ft_debug.h" + +#ifdef _SPIFFS_TEST +#include "testrunner.h" +#endif +// ----------- >8 ------------ +``` +在一系列C语言库函数后,我们加入了飞腾的定义库`"ft_types.h"`与debug库`"ft_debug.h"` + +#####Debug方式 +使用飞腾定义好的debug方法 +``` +// port debug printfs +// Set generic spiffs debug output call. +#ifndef SPIFFS_DBG +#define SPIFFS_DBG(_f, ...) FT_DEBUG_PRINT_D("SPIFFS", _f, ##__VA_ARGS__) +#endif +// Set spiffs debug output call for garbage collecting. +#ifndef SPIFFS_GC_DBG +#define SPIFFS_GC_DBG(_f, ...) FT_DEBUG_PRINT_D("SPIFFS-GC", _f, ##__VA_ARGS__) +#endif +// Set spiffs debug output call for caching. +#ifndef SPIFFS_CACHE_DBG +#define SPIFFS_CACHE_DBG(_f, ...) FT_DEBUG_PRINT_D("SPIFFS-CACHE", _f, ##__VA_ARGS__) +#endif +// Set spiffs debug output call for system consistency checks. +#ifndef SPIFFS_CHECK_DBG +#define SPIFFS_CHECK_DBG(_f, ...) FT_DEBUG_PRINT_D("SPIFFS-CHECK", _f, ##__VA_ARGS__) +#endif +// Set spiffs debug output call for all api invocations. +#ifndef SPIFFS_API_DBG +#define SPIFFS_API_DBG(_f, ...) FT_DEBUG_PRINT_D("SPIFFS-API", _f, ##__VA_ARGS__) +#endif +``` +#####Cache配置 +如果启用Cache缓存机制,会大大加速执行速度,但是必须为SPIFFS提供额外的RAM内存。强烈建议打开`SPIFFS_CACHE_WR`选项,这个选项会使得写入flash的数据进入缓存区,多次得到写入的数据后,再一次性写入flash。如果没有打开这个选项,所有对flash的写入都是直接的,这样会使得flash寿命减少。 +``` +// Enables/disable memory read caching of nucleus file system operations. +// If enabled, memory area must be provided for cache in SPIFFS_mount. + +#ifndef SPIFFS_CACHE +#define SPIFFS_CACHE 1 /* 在RAM中为SPIFFS提供缓存区 */ +#endif + +#if SPIFFS_CACHE + +// Enables memory write caching for file descriptors in hydrogen +#ifndef SPIFFS_CACHE_WR +#define SPIFFS_CACHE_WR 1 /* 使能文件描述符写缓存 */ +#endif + +#endif + +#ifndef SPIFFS_TEMPORAL_FD_CACHE +#define SPIFFS_TEMPORAL_FD_CACHE 1 /* 启用此选项可优化文件的打开。spiffs 获得的文件描述符越多,缓存就越有效。请注意,这会向每个文件描述符添加额外的 6 个字节 */ +#endif + +// Temporal file cache hit score. Each time a file is opened, all cached files +// will lose one point. If the opened file is found in cache, that entry will +// gain SPIFFS_TEMPORAL_CACHE_HIT_SCORE points. One can experiment with this +// value for the specific access patterns of the application. However, it must +// be between 1 (no gain for hitting a cached entry often) and 255. +#ifndef SPIFFS_TEMPORAL_CACHE_HIT_SCORE +#define SPIFFS_TEMPORAL_CACHE_HIT_SCORE 4 /* 启用文件缓存优先级系统 */ +#endif + + +``` +#####基本flash信息配置 +飞腾不止使用单个SPIFFS实例,故将`SPIFFS_SINGLETON`设为0。并且不需要预设flash信息为某一固定值,通过其他模块的接口,可以实现读取装在SPIM上的flash信息。对于一般用户来说,可以将此选项打开,并直接在SPIFFS层面设置好相关配置。 +``` +#ifndef SPIFFS_SINGLETON +#define SPIFFS_SINGLETON 0 /* 0表示只使用单个SPIFFS实例 */ +#endif + +#if SPIFFS_SINGLETON + +// Instead of giving parameters in config struct, singleton build must +// give parameters in defines below. +#ifndef SPIFFS_CFG_PHYS_SZ +#define SPIFFS_CFG_PHYS_SZ(ignore) (1024*1024*2) /* flash分配给SPIFFS的容量 2MB */ +#endif + +#ifndef SPIFFS_CFG_PHYS_ERASE_SZ +#define SPIFFS_CFG_PHYS_ERASE_SZ(ignore) (65536) /* flash擦除单位 */ +#endif + +#ifndef SPIFFS_CFG_PHYS_ADDR +#define SPIFFS_CFG_PHYS_ADDR(ignore) (0) /* flash起始物理地址 */ +#endif + +#ifndef SPIFFS_CFG_LOG_PAGE_SZ +#define SPIFFS_CFG_LOG_PAGE_SZ(ignore) (256) /* 页大小,写数据的单位,为256的整数倍 */ +#endif + +#ifndef SPIFFS_CFG_LOG_BLOCK_SZ +#define SPIFFS_CFG_LOG_BLOCK_SZ(ignore) (65536) /* 块大小,一般与 flash 擦除单位保持一致 */ +#endif + +#endif +``` +如果不能正确配置这些类型,可能会由溢出和一堆其他问题造成死循环。在您无法弄清楚文件系统的需求配置时,可以选择将容量设置稍大一点,因为如果设置得太小,会导致更加严重的后果。 +#####flash文件系统检查 +打开flash检查magic开关,设置启用按文件系统长度来检查flash配置,保证flash配置符合SPIFFS要求,如果进一步打开`SPIFFS_USE_MAGIC_LENGTH`,则会进一步比较挂载文件系统与flash配置长度是否一致。 +``` +#ifndef SPIFFS_USE_MAGIC +#define SPIFFS_USE_MAGIC (1) +#endif + +#if SPIFFS_USE_MAGIC + +// Only valid when SPIFFS_USE_MAGIC is enabled. If SPIFFS_USE_MAGIC_LENGTH is +// enabled, the magic will also be dependent on the length of the filesystem. +// For example, a filesystem configured and formatted for 4 megabytes will not +// be accepted for mounting with a configuration defining the filesystem as 2 +// megabytes. +#ifndef SPIFFS_USE_MAGIC_LENGTH +#define SPIFFS_USE_MAGIC_LENGTH (1) +#endif + +#endif +``` +#####上锁操作 +为了适配FreeRTOS这种多任务的实时操作系统,需要打开SPIFFS的上锁功能开关,并将写好的上锁和解锁接口告诉SPIFFS。 +``` +extern void FSpiffsSemLock(void); +extern void FSpiffsSemUnlock(void); + +// SPIFFS_LOCK and SPIFFS_UNLOCK protects spiffs from reentrancy on api level +// These should be defined on a multithreaded system + +// define this to enter a mutex if you're running on a multithreaded system +#ifndef SPIFFS_LOCK +#define SPIFFS_LOCK(fs) FSpiffsSemLock() +#endif + +// define this to exit a mutex if you're running on a multithreaded system +#ifndef SPIFFS_UNLOCK +#define SPIFFS_UNLOCK(fs) FSpiffsSemUnlock() +#endif +``` +锁函数定义 +``` +void FSpiffsSemLock(void) +{ + xSemaphoreTake(xSpiffsSemaphore, portMAX_DELAY); +} + +void FSpiffsSemUnlock(void) +{ + xSemaphoreGive(xSpiffsSemaphore); +} +``` +#####读写函数接口 +在创建的SPIFFS文件系统config实例中,需要添加读写文件与擦除数据的操作 +``` +static const spiffs_config cfg = + { + .phys_addr = FSPIFFS_FLASH_START_ADDR, /* start spiffs at start of spi flash */ + .phys_size = FSPIFFS_FLASH_SIZE, /* flash_capcity in use */ + .phys_erase_block = FSPIFFS_LOG_BLOCK_SIZE, /* according to datasheet */ + .log_block_size = FSPIFFS_LOG_BLOCK_SIZE, /* let us not complicate things */ + .log_page_size = FSPIFFS_LOG_PAGE_SIZE, /* as we said */ + .hal_read_f = FSpiffsRead, + .hal_write_f = FSpiffsWrite, + .hal_erase_f = FSpiffsErase + }; +``` +其中文件系统的地址、大小等参数由读取到的flash或者具体的用例确定,而读写操作的函数是基于sfud库中的函数实现的 + diff --git a/third-party/spiffs-0.3.7/inc/spiffs_nucleus.h b/third-party/spiffs-0.3.7/inc/spiffs_nucleus.h index 3d77d508a1ae4027ed716eae8e93165cb0503fe8..e710ecf5af693eefdd6512bed5e25f85b6428c00 100644 --- a/third-party/spiffs-0.3.7/inc/spiffs_nucleus.h +++ b/third-party/spiffs-0.3.7/inc/spiffs_nucleus.h @@ -389,6 +389,7 @@ typedef struct { u8_t ix; // last access of this cache page u32_t last_access; + union { // type read cache struct { diff --git a/third-party/spiffs-0.3.7/ports/fqspi/fqspi_spiffs_port.c b/third-party/spiffs-0.3.7/ports/fqspi/fqspi_spiffs_port.c index 6b9f4dccf03cc83ca190a1ccc3936567d9b5f633..1e780efa2d9e01ebc8989bd682a9b8a4ef6e9f0c 100644 --- a/third-party/spiffs-0.3.7/ports/fqspi/fqspi_spiffs_port.c +++ b/third-party/spiffs-0.3.7/ports/fqspi/fqspi_spiffs_port.c @@ -23,9 +23,9 @@ /***************************** Include Files *********************************/ #include -#include "kernel.h" -#include "ft_debug.h" -#include "ft_assert.h" +#include "fkernel.h" +#include "fdebug.h" +#include "fassert.h" #include "fsleep.h" #include "sfud.h" #include "fqspi_spiffs_port.h" diff --git a/third-party/spiffs-0.3.7/ports/fqspi/fqspi_spiffs_port.h b/third-party/spiffs-0.3.7/ports/fqspi/fqspi_spiffs_port.h index eeb8c6525e89b01d0a6810ca542e5a35fbfe45ad..983c3107d04e23eae542a96dedad5eddb407f914 100644 --- a/third-party/spiffs-0.3.7/ports/fqspi/fqspi_spiffs_port.h +++ b/third-party/spiffs-0.3.7/ports/fqspi/fqspi_spiffs_port.h @@ -29,7 +29,7 @@ extern "C" { #endif /***************************** Include Files *********************************/ -#include "ft_types.h" +#include "ftypes.h" #include "spiffs_port.h" /************************** Constant Definitions *****************************/ diff --git a/third-party/spiffs-0.3.7/ports/fspim/fspim_spiffs_port.c b/third-party/spiffs-0.3.7/ports/fspim/fspim_spiffs_port.c new file mode 100644 index 0000000000000000000000000000000000000000..aaaa8b9fb912b23ff1cab3dbae42731c5b384a20 --- /dev/null +++ b/third-party/spiffs-0.3.7/ports/fspim/fspim_spiffs_port.c @@ -0,0 +1,202 @@ +/* + * 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: fspim_spiffs_port.c + * Date: 2022-02-10 14:53:42 + * LastEditTime: 2022-02-18 08:24:47 + * Description:  This files is for + * + * Modify History: + * Ver   Who        Date         Changes + * ----- ------     --------    -------------------------------------- + */ + +/***************************** Include Files *********************************/ +#include + +#include "fkernel.h" +#include "fdebug.h" +#include "fassert.h" + +#include "sfud.h" +#include "fspim_spiffs_port.h" + +/************************** Constant Definitions *****************************/ +#define FSPIFFS_FLASH_START_ADDR 0x0 +#define FSPIFFS_FLASH_SIZE SZ_1M +/**************************** Type Definitions *******************************/ + +/************************** Variable Definitions *****************************/ +static boolean is_sfud_ready = FALSE; +static const sfud_flash *flash_instance = NULL; +static const fsize_t flash_id = SFUD_FSPIM2_INDEX; + +/***************** Macros (Inline Functions) Definitions *********************/ +#define FSPIM_DEBUG_TAG "SPIM-SPIFFS" +#define FSPIM_ERROR(format, ...) FT_DEBUG_PRINT_E(FSPIM_DEBUG_TAG, format, ##__VA_ARGS__) +#define FSPIM_WARN(format, ...) FT_DEBUG_PRINT_W(FSPIM_DEBUG_TAG, format, ##__VA_ARGS__) +#define FSPIM_INFO(format, ...) FT_DEBUG_PRINT_I(FSPIM_DEBUG_TAG, format, ##__VA_ARGS__) +#define FSPIM_DEBUG(format, ...) FT_DEBUG_PRINT_D(FSPIM_DEBUG_TAG, format, ##__VA_ARGS__) + +/************************** Function Prototypes ******************************/ +static s32_t FSpiffsRead(struct spiffs_t *fs, u32_t addr, u32_t size, u8_t *buf) +{ + FASSERT_MSG(fs, "NULL fs instance"); + FASSERT_MSG(buf, "NULL buffer"); + if ((FALSE == is_sfud_ready) || (NULL == flash_instance)) + { + FSPIM_ERROR("sfud not ready"); + return FSPIFFS_SPIM_PORT_SFUD_NOT_READY; + } + + sfud_err result = sfud_read(flash_instance, + (u32)addr, + (fsize_t)size, + (u8 *)buf); + if (SFUD_SUCCESS != result) + { + FSPIM_ERROR("read failed: %d", result); + return FSPIFFS_SPIM_PORT_SFUD_IO_ERROR; + } + + FSPIM_DEBUG("sfud read success"); + return FSPIFFS_SPIM_PORT_OK; +} + +static s32_t FSpiffsWrite(struct spiffs_t *fs, u32_t addr, u32_t size, u8_t *buf) +{ + FASSERT_MSG(fs, "NULL fs instance"); + FASSERT_MSG(buf, "NULL buffer"); + if ((FALSE == is_sfud_ready) || (NULL == flash_instance)) + { + FSPIM_ERROR("sfud not ready"); + return FSPIFFS_SPIM_PORT_SFUD_NOT_READY; + } + + sfud_err result = sfud_write(flash_instance, + (u32)addr, + (fsize_t)size, + (const u8 *)buf); + if (SFUD_SUCCESS != result) + { + FSPIM_ERROR("write failed: %d", result); + return FSPIFFS_SPIM_PORT_SFUD_IO_ERROR; + } + + FSPIM_DEBUG("sfud write success"); + return FSPIFFS_SPIM_PORT_OK; +} + +static s32_t FSpiffsErase(struct spiffs_t *fs, u32_t addr, u32_t size) +{ + FASSERT_MSG(fs, "NULL fs instance"); + if ((FALSE == is_sfud_ready) || (NULL == flash_instance)) + { + FSPIM_ERROR("sfud not ready"); + return FSPIFFS_SPIM_PORT_SFUD_NOT_READY; + } + + sfud_err result = sfud_erase(flash_instance, + (u32)addr, + (fsize_t)(size)); + if (SFUD_SUCCESS != result) + { + FSPIM_ERROR("erase failed: %d", result); + return FSPIFFS_SPIM_PORT_SFUD_IO_ERROR; + } + + FSPIM_DEBUG("sfud erase success"); + return FSPIFFS_SPIM_PORT_OK; +} + +int FSpiffsSpimInitialize(FSpiffs *const instance) +{ + FASSERT(instance); + if (FT_COMPONENT_IS_READY == instance->fs_ready) + { + FSPIM_ERROR("little-fs already inited and mounted"); + return FSPIFFS_SPIM_PORT_ALREADY_INITED; + } + + if ((TRUE == is_sfud_ready) || (NULL != flash_instance)) + { + FSPIM_ERROR("sfud already inited"); + return FSPIFFS_SPIM_PORT_ALREADY_INITED; + } + + int sfud_ret = sfud_init(); + if (SFUD_SUCCESS != sfud_ret) + { + FSPIM_ERROR("sfud init failed: %d", sfud_ret); + return FSPIFFS_SPIM_PORT_SFUD_INIT_FAILED; + } + + flash_instance = sfud_get_device(flash_id); + if (NULL == flash_instance) + { + FSPIM_ERROR("get sfud flash failed"); + return FSPIFFS_SPIM_PORT_SFUD_INIT_FAILED; + } + + if ((flash_instance->chip.capacity < (instance->fs_addr + instance->fs_size)) || + (FSPIFFS_LOG_BLOCK_SIZE % flash_instance->chip.erase_gran)) + { + FSPIM_ERROR("flash not support !!! capacity %d < space %d, erase_gran %d %% %d != 0", + flash_instance->chip.capacity, + (instance->fs_addr + instance->fs_size), + FSPIFFS_LOG_BLOCK_SIZE, + flash_instance->chip.erase_gran); + return FSPIFFS_SPIM_PORT_SFUD_INIT_FAILED; + } + + if (flash_instance->chip.capacity < SZ_1M) + { + printf("%d KB %s is current selected device.\r\n", + flash_instance->chip.capacity / SZ_1K, + flash_instance->name); + } + else + { + printf("%d MB %s is current selected device.\r\n", + flash_instance->chip.capacity / SZ_1M, + flash_instance->name); + } + + is_sfud_ready = TRUE; + /* instance->fs_ready will be set after mount filesystem */; + return FSPIFFS_SPIM_PORT_OK; +} + +void FSpiffsSpimDeInitialize(FSpiffs *const instance) +{ + memset(instance, 0, sizeof(FSpiffs)); + is_sfud_ready = FALSE; + return; +} + +const spiffs_config *FSpiffsSpimGetDefaultConfig(void) +{ + static const spiffs_config cfg = + { + .phys_addr = FSPIFFS_FLASH_START_ADDR, /* start spiffs at start of spi flash */ + .phys_size = FSPIFFS_FLASH_SIZE, /* flash_capcity in use */ + .phys_erase_block = FSPIFFS_LOG_BLOCK_SIZE, /* according to datasheet */ + .log_block_size = FSPIFFS_LOG_BLOCK_SIZE, /* let us not complicate things */ + .log_page_size = FSPIFFS_LOG_PAGE_SIZE, /* as we said */ + .hal_read_f = FSpiffsRead, + .hal_write_f = FSpiffsWrite, + .hal_erase_f = FSpiffsErase + }; + + return (const spiffs_config *)&cfg; +} \ No newline at end of file diff --git a/third-party/spiffs-0.3.7/ports/fspim/fspim_spiffs_port.h b/third-party/spiffs-0.3.7/ports/fspim/fspim_spiffs_port.h new file mode 100644 index 0000000000000000000000000000000000000000..57fd335e200082ce6c168054cc6189940ee0356f --- /dev/null +++ b/third-party/spiffs-0.3.7/ports/fspim/fspim_spiffs_port.h @@ -0,0 +1,65 @@ +/* + * 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: fspim_spiffs_port.h + * Date: 2022-02-10 14:53:42 + * LastEditTime: 2022-02-18 08:24:52 + * Description:  This files is for + * + * Modify History: + * Ver   Who        Date         Changes + * ----- ------     --------    -------------------------------------- + */ + +#ifndef FSPIM_SPIFFS_PORT_H +#define FSPIM_SPIFFS_PORT_H + +#ifdef __cplusplus +extern "C" +{ +#endif +/***************************** Include Files *********************************/ +#include "ftypes.h" + +#include "spiffs_port.h" +/************************** Constant Definitions *****************************/ +enum +{ + FSPIFFS_SPIM_PORT_OK = 0, + FSPIFFS_SPIM_PORT_SFUD_INIT_FAILED, + FSPIFFS_SPIM_PORT_SFUD_NOT_READY, + FSPIFFS_SPIM_PORT_SFUD_IO_ERROR, + FSPIFFS_SPIM_PORT_ALREADY_INITED, +}; + +/* 根据SPIFFS的技术手册,最优页尺寸可以参考公式 + ~~~ Logical Page Size = Logical Block Size / 256 ~~~ + */ +#define FSPIFFS_LOG_PAGE_SIZE 256 /* size of logic page */ +#define FSPIFFS_LOG_BLOCK_SIZE (FSPIFFS_LOG_PAGE_SIZE * 256) +/**************************** Type Definitions *******************************/ + +/************************** Variable Definitions *****************************/ + +/***************** Macros (Inline Functions) Definitions *********************/ + +/************************** Function Prototypes ******************************/ +int FSpiffsSpimInitialize(FSpiffs *const instance); +void FSpiffsSpimDeInitialize(FSpiffs *const instance); +const spiffs_config *FSpiffsSpimGetDefaultConfig(void); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/third-party/spiffs-0.3.7/ports/spiffs_config.h b/third-party/spiffs-0.3.7/ports/spiffs_config.h index e4420eeb442d98c78590b96373c4a370f8351069..055b3a8df9e23296fb0dcfc3aff29e2662afae5e 100644 --- a/third-party/spiffs-0.3.7/ports/spiffs_config.h +++ b/third-party/spiffs-0.3.7/ports/spiffs_config.h @@ -17,8 +17,8 @@ #include #include -#include "ft_types.h" -#include "ft_debug.h" +#include "ftypes.h" +#include "fdebug.h" #ifdef _SPIFFS_TEST #include "testrunner.h" @@ -106,7 +106,7 @@ // Enable/disable statistics on caching. Debug/test purpose only. #ifndef SPIFFS_CACHE_STATS -#define SPIFFS_CACHE_STATS 1 +#define SPIFFS_CACHE_STATS 0 #endif #endif @@ -123,7 +123,7 @@ // Enable/disable statistics on gc. Debug/test purpose only. #ifndef SPIFFS_GC_STATS -#define SPIFFS_GC_STATS 1 +#define SPIFFS_GC_STATS 0 #endif // Garbage collecting examines all pages in a block which and sums up @@ -291,7 +291,7 @@ extern void FSpiffsSemUnlock(void); // directly. If all available descriptors become opened, all cache memory is // lost. #ifndef SPIFFS_TEMPORAL_FD_CACHE -#define SPIFFS_TEMPORAL_FD_CACHE 1 +#define SPIFFS_TEMPORAL_FD_CACHE 1 /* 启用此选项可优化文件的打开。spiffs 获得的文件描述符越多,缓存就越有效。请注意,这会向每个文件描述符添加额外的 6 个字节 */ #endif // Temporal file cache hit score. Each time a file is opened, all cached files diff --git a/third-party/spiffs-0.3.7/ports/spiffs_port.c b/third-party/spiffs-0.3.7/ports/spiffs_port.c index 65431ee4fe1fb9032d82a3a9e8d83b1306d5fb39..190ca0a965fd22fff680d270bcedc61ec7948578 100644 --- a/third-party/spiffs-0.3.7/ports/spiffs_port.c +++ b/third-party/spiffs-0.3.7/ports/spiffs_port.c @@ -24,7 +24,7 @@ /***************************** Include Files *********************************/ #include "sdkconfig.h" -#include "ft_assert.h" +#include "fassert.h" #include "FreeRTOSConfig.h" #include "FreeRTOS.h" #include "task.h" diff --git a/third-party/spiffs-0.3.7/ports/spiffs_port.h b/third-party/spiffs-0.3.7/ports/spiffs_port.h index f9b42e95cb3e7264870f9daae5b58504870f84ed..ea7e1983cf60387b67acbddaffeed1a30d99b16b 100644 --- a/third-party/spiffs-0.3.7/ports/spiffs_port.h +++ b/third-party/spiffs-0.3.7/ports/spiffs_port.h @@ -29,7 +29,7 @@ extern "C" { #endif /***************************** Include Files *********************************/ -#include "ft_types.h" +#include "ftypes.h" #include "spiffs.h" /************************** Constant Definitions *****************************/ @@ -66,4 +66,4 @@ const spiffs_config *FSpiffsGetDefaultConfig(void); } #endif -#endif \ No newline at end of file +#endif diff --git a/third-party/tlsf-3.1.0/port/fmemory_pool.c b/third-party/tlsf-3.1.0/port/fmemory_pool.c index 4343e3d624f0d29c7bb662e030f630ca54632337..15b74b03f9c45145c7199db2145e7c739d1af0a5 100644 --- a/third-party/tlsf-3.1.0/port/fmemory_pool.c +++ b/third-party/tlsf-3.1.0/port/fmemory_pool.c @@ -25,10 +25,10 @@ #include #include -#include "ft_types.h" -#include "ft_assert.h" -#include "kernel.h" -#include "ft_debug.h" +#include "ftypes.h" +#include "fassert.h" +#include "fkernel.h" +#include "fdebug.h" #include "tlsf.h" diff --git a/third-party/tlsf-3.1.0/port/fmemory_pool.h b/third-party/tlsf-3.1.0/port/fmemory_pool.h index 6c5c6bd3c45eb51194d288db8754b34ebe611bc6..8c79f216dcfc8da73e438589afee491760bbc033 100644 --- a/third-party/tlsf-3.1.0/port/fmemory_pool.h +++ b/third-party/tlsf-3.1.0/port/fmemory_pool.h @@ -36,7 +36,7 @@ extern "C" #include "event_groups.h" #include "semphr.h" -#include "ft_error_code.h" +#include "ferror_code.h" #include "tlsf.h" #include "fslink_list.h" diff --git a/third-party/tlsf-3.1.0/port/fslink_list.h b/third-party/tlsf-3.1.0/port/fslink_list.h new file mode 100644 index 0000000000000000000000000000000000000000..c9769b796db0290af0b7df2abacefa04d711bf17 --- /dev/null +++ b/third-party/tlsf-3.1.0/port/fslink_list.h @@ -0,0 +1,226 @@ +/* + * 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: fslink_list.h + * Date: 2021-12-02 13:18:02 + * LastEditTime: 2022-02-17 18:02:59 + * Description:  This files is for singal link list definition + * + * Modify History: + * Ver   Who        Date         Changes + * ----- ------     --------    -------------------------------------- + * 1.0 zhugengyu 2021/12/2 init + */ + +#ifndef _FT_SLINK_LIST_H_ +#define _FT_SLINK_LIST_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "ftypes.h" +#include "fkernel.h" + +/** + * Single List structure + */ +struct FSListNode_ +{ + struct FSListNode_ *next; /**< point to next node. */ +}; +typedef struct FSListNode_ FSListNode; /**< Type for single list. */ + +/** + * @name: FSListInit + * @msg: initialize a single list + * @return {*} + * @param {FSListNode} *l the single list to be initialized + */ +static void FSListInit(FSListNode *l) +{ + l->next = NULL; +} + +/** + * @name: FSListAppend + * @msg: append node at the tail of list + * @return {*} + * @param {FSListNode} *l the single list + * @param {FSListNode} *n the node to append + */ +static void FSListAppend(FSListNode *l, FSListNode *n) +{ + FSListNode *node; + + node = l; + while (node->next) node = node->next; + + /* append the node to the tail */ + node->next = n; + n->next = NULL; +} + +/** + * @name: FSListInsert + * @msg: insert node at list after l node + * @return {*} + * @param {FSListNode} *l the single list node at list + * @param {FSListNode} *n the node to append + */ +static void FSListInsert(FSListNode *l, FSListNode *n) +{ + n->next = l->next; + l->next = n; +} + +/** + * @name: FSListLen + * @msg: get length of single list + * @return {*} + * @param {FSListNode} *l the single list + */ +static unsigned int FSListLen(const FSListNode *l) +{ + unsigned int len = 0; + const FSListNode *list = l->next; + while (list != NULL) + { + list = list->next; + len ++; + } + + return len; +} + +/** + * @name: FSListFirst + * @msg: get first node of single list + * @return {*} + * @param {FSListNode} *l the single list + */ +static FSListNode *FSListFirst(FSListNode *l) +{ + return l->next; +} + +/** + * @name: FSListFirst + * @msg: get last node of single list + * @return {*} + * @param {FSListNode} *l the single list + */ +static FSListNode *FSListTail(FSListNode *l) +{ + while (l->next) l = l->next; + + return l; +} + +/** + * @name: FSListFirst + * @msg: get next node of single list + * @return {*} + * @param {FSListNode} *l the single list + */ +static FSListNode *FSListNext(FSListNode *n) +{ + return n->next; +} + +/** + * @name: FSListIsEmpty + * @msg: check if single list is empty + * @return {*} + * @param {FSListNode} *l the single list + */ +static boolean FSListIsEmpty(FSListNode *l) +{ + return l->next == NULL; +} + +/** + * @name: FSListRemove + * @msg: remove node from single list + * @return {*} + * @param {FSListNode} *l the single list + * @param {FSListNode} *n node to remove + */ +static FSListNode *FSListRemove(FSListNode *l, FSListNode *n) +{ + /* remove slist head */ + FSListNode *node = l; + while (node->next && node->next != n) node = node->next; + + /* remove node */ + if (node->next != (FSListNode *)0) node->next = node->next->next; + + return l; +} + +/** + * @brief get the struct for this single list node + * @param node the entry point + * @param type the type of structure + * @param member the name of list in structure + */ +#define FSLIST_ENTRY(node, type, member) \ + CONTAINER_OF(node, type, member) + +/** + * FSLIST_FOR_EACH - iterate over a single list + * @pos: the FSListNode * to use as a loop cursor. + * @head: the head for your single list. + */ +#define FSLIST_FOR_EACH(pos, head) \ + for (pos = (head)->next; pos != NULL; pos = pos->next) + +/** + * FSLIST_FOR_EACH_ENTRY - iterate over single list of given type + * @pos: the type * to use as a loop cursor. + * @head: the head for your single list. + * @member: the name of the list_struct within the struct. + */ +#define FSLIST_FOR_EACH_ENTRY(pos, head, member) \ + for (pos = FSLIST_ENTRY((head)->next, typeof(*pos), member); \ + &pos->member != (NULL); \ + pos = FSLIST_ENTRY(pos->member.next, typeof(*pos), member)) + +/** + * FSLIST_FOR_FIRST_ENTRY - get the first element from a slist + * @ptr: the slist head to take the element from. + * @type: the type of the struct this is embedded in. + * @member: the name of the slist_struct within the struct. + * + * Note, that slist is expected to be not empty. + */ +#define FSLIST_FOR_FIRST_ENTRY(ptr, type, member) \ + FSLIST_ENTRY((ptr)->next, type, member) + +/** + * FSLIST_TAIL_ENTRY - get the tail element from a slist + * @ptr: the slist head to take the element from. + * @type: the type of the struct this is embedded in. + * @member: the name of the slist_struct within the struct. + * + * Note, that slist is expected to be not empty. + */ +#define FSLIST_TAIL_ENTRY(ptr, type, member) \ + FSLIST_ENTRY(FSListTail(ptr), type, member) + +#ifdef __cplusplus +} +#endif + +#endif // ! \ No newline at end of file diff --git a/third-party/tlsf-3.1.0/src/tlsf.c b/third-party/tlsf-3.1.0/src/tlsf.c index b4e1d348c1cf294a811645a6617ff265748a180a..7e6dd91990824da7425a9796fde55744baf5f33d 100644 --- a/third-party/tlsf-3.1.0/src/tlsf.c +++ b/third-party/tlsf-3.1.0/src/tlsf.c @@ -5,8 +5,8 @@ #include #include -#include "ft_types.h" -#include "ft_assert.h" +#include "ftypes.h" +#include "fassert.h" #include "tlsf.h" #if defined(__cplusplus)