diff --git a/README.md b/README.md index 07082b5ff..962f981c0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Phytium-Standalone-SDK -**v1.2.0** [ReleaseNote](./doc/ChangeLog.md) +**v1.3.0** [ReleaseNote](./doc/ChangeLog.md) ## 1. 项目概要 @@ -80,15 +80,16 @@ release 分支:发布分支,包含核心启动代码、芯片外设驱动、 - 目前支持在Windows和Linux上使用SDK,支持在x86_64和ARM AARCH64设备上完成交叉编译 -![windows](./doc/fig/windows.png)![linux](./doc/fig/linux.png)![输入图片说明](./doc/fig/kylin.png) +![windows](./doc/fig/windows.png)![linux](./doc/fig/linux.png)![输入图片说明](./doc/fig/kylin.png)![phystudio](./doc/reference/ide/figs/phystudio_brand.png) -- 参考[Windows10 WSL快速入门](./doc/reference/usr/install_windos_wsl.md),[Windows10 快速入门](./doc/reference/usr/install_windows.md),[Linux aarch64 快速入门](./doc/reference/usr/install_linux_aarch64.md), [Linux x86_64 快速入门](./doc/reference/usr/install_linux_x86_64.md) +- 参考[Windows10 WSL快速入门](./doc/reference/usr/install_windos_wsl.md),[Windows10 快速入门](./doc/reference/usr/install_windows.md),[Linux aarch64 快速入门](./doc/reference/usr/install_linux_aarch64.md), [Linux x86_64 快速入门](./doc/reference/usr/install_linux_x86_64.md), [PhyStudio用户手册快速入门](./doc/reference/ide/ide.md) - 参考[使用说明](./doc/reference/usr/usage.md), 新建Phytium Standalone SDK的应用工程,与开发板建立连接 - 参考[例程](./example),开始使用SDK - 参考[板卡](./doc/reference/usr/how_to_add_board.md),添加自定义板卡 - 参考[体系架构](./doc/reference/usr/how_to_set_architecture.md),配置工程体系架构 - 参考[编译选项](./doc/reference/usr/how_to_build_project.md),配置工程编译选项 - 参考[飞腾派](./doc/reference/usr/use_in_phytium_pi.md), 在飞腾派中使用SDK进行开发,参考[飞腾派镜像制作](./doc/reference/usr/partition_in_phytium_pi.md),制作用于裸机开发的飞腾派镜像 +![](./doc/reference/ide/figs/phystudio_main.png) --- ## 3. 硬件参考 diff --git a/board/d2000_test/fio_mux.c b/board/d2000_test/fio_mux.c index e65d822d1..ce43c973c 100644 --- a/board/d2000_test/fio_mux.c +++ b/board/d2000_test/fio_mux.c @@ -32,6 +32,9 @@ FIOCtrl ioctrl; #define FBOARD_IO_DEBUG_TAG "FBOARD_IO-CFG" #define FBOARD_IO_ERROR(format, ...) FT_DEBUG_PRINT_E(FBOARD_IO_DEBUG_TAG, format, ##__VA_ARGS__) +#define FBOARD_IO_WARN(format, ...) FT_DEBUG_PRINT_W(FBOARD_IO_DEBUG_TAG, format, ##__VA_ARGS__) +#define FBOARD_IO_INFO(format, ...) FT_DEBUG_PRINT_I(FBOARD_IO_DEBUG_TAG, format, ##__VA_ARGS__) +#define FBOARD_IO_DEBUG(format, ...) FT_DEBUG_PRINT_D(FBOARD_IO_DEBUG_TAG, format, ##__VA_ARGS__) /*****************************************************************************/ /** @@ -96,14 +99,10 @@ void FIOPadSetCanMux(u32 can_id) { FIOCtrlSetFunc(&ioctrl, FIOCTRL_NTRST_SWJ_PAD, FIOCTRL_FUNC1); /* can1-tx: func 1 */ FIOCtrlSetFunc(&ioctrl, FIOCTRL_SWDO_SWJ_PAD, FIOCTRL_FUNC1); /* can1-rx: func 1 */ - } - else if (can_id == FCAN2_ID) - { - } else { - FBOARD_IO_ERROR("Can id error"); + FBOARD_IO_DEBUG("No preconfiguration for CAN-%d iopad mux info.\r\n", can_id); } } diff --git a/board/e2000d_demo/fio_mux.c b/board/e2000d_demo/fio_mux.c index ad6642115..e7fd78897 100644 --- a/board/e2000d_demo/fio_mux.c +++ b/board/e2000d_demo/fio_mux.c @@ -144,7 +144,7 @@ void FIOPadSetCanMux(u32 can_id) } else { - FBOARD_IO_ERROR("can id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for CAN-%d iopad mux info.\r\n", can_id); } } @@ -179,7 +179,7 @@ void FIOPadSetQspiMux(u32 qspi_id, u32 cs_id) } else { - FBOARD_IO_ERROR("qspi cs id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for QSPI cs-%d iopad mux info.\r\n", cs_id); } } @@ -287,7 +287,7 @@ void FIOPadSetPwmMux(u32 pwm_id, u32 pwm_channel) break; default: - FBOARD_IO_ERROR("pwm id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for PWM-%d iopad mux info.\r\n", pwm_id); break; } } @@ -331,13 +331,13 @@ void FIOPadSetAdcMux(u32 adc_id, u32 adc_channel) FIOPadSetFunc(&iopad_ctrl, FIOPAD_E43_REG0_OFFSET, FIOPAD_FUNC7);/* adc0-7: func 7 */ break; default: - FBOARD_IO_ERROR("adc %d channel %d is error.\r\n", adc_id, adc_channel); + FBOARD_IO_DEBUG("No preconfiguration for ADC-%d channel-%d iopad mux info.\r\n", adc_id, adc_channel); break; } } else { - FBOARD_IO_ERROR("adc %d channel %d is error.\r\n", adc_id, adc_channel); + FBOARD_IO_DEBUG("No preconfiguration for ADC-%d iopad mux info.\r\n", adc_id); } } diff --git a/board/e2000q_demo/fio_mux.c b/board/e2000q_demo/fio_mux.c index 5cb58b648..5acbede7c 100644 --- a/board/e2000q_demo/fio_mux.c +++ b/board/e2000q_demo/fio_mux.c @@ -191,7 +191,7 @@ void FIOPadSetCanMux(u32 can_id) } else { - FBOARD_IO_ERROR("can id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for CAN-%d iopad mux info.\r\n", can_id); } } @@ -228,7 +228,7 @@ void FIOPadSetQspiMux(u32 qspi_id, u32 cs_id) } else { - FBOARD_IO_ERROR("qspi cs id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for QSPI cs-%d iopad mux info.\r\n", cs_id); } } @@ -335,7 +335,7 @@ void FIOPadSetPwmMux(u32 pwm_id, u32 pwm_channel) break; default: - FBOARD_IO_ERROR("pwm id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for PWM-%d iopad mux info.\r\n", pwm_id); break; } } diff --git a/board/firefly/fio_mux.c b/board/firefly/fio_mux.c index 1963fb5e5..959eceee6 100644 --- a/board/firefly/fio_mux.c +++ b/board/firefly/fio_mux.c @@ -61,6 +61,10 @@ void FIOPadSetSpimMux(u32 spim_id) FIOPadGetFunc(&iopad_ctrl, FIOPAD_W53_REG0_OFFSET), FIOPadGetFunc(&iopad_ctrl, FIOPAD_U55_REG0_OFFSET), FIOPadGetFunc(&iopad_ctrl, FIOPAD_U53_REG0_OFFSET)); } + else + { + FBOARD_IO_DEBUG("No preconfiguration for SPI-%d iopad mux info.\r\n", spim_id); + } } /** @@ -80,7 +84,7 @@ void FIOPadSetGpioMux(u32 gpio_id, u32 pin_id) FIOPadSetFunc(&iopad_ctrl, FIOPAD_N43_REG0_OFFSET, FIOPAD_FUNC6); break; default: - FBOARD_IO_ERROR("pin_id error."); + FBOARD_IO_DEBUG("No preconfiguration for GPIO-%d pin-%d iopad mux info.\r\n", gpio_id, pin_id); break; } } @@ -104,7 +108,7 @@ void FIOPadSetGpioMux(u32 gpio_id, u32 pin_id) FIOPadSetFunc(&iopad_ctrl, FIOPAD_AW55_REG0_OFFSET, FIOPAD_FUNC5); break; default: - FBOARD_IO_ERROR("pin_id error."); + FBOARD_IO_DEBUG("No preconfiguration for GPIO-%d pin-%d iopad mux info.\r\n", gpio_id, pin_id); break; } } @@ -116,7 +120,7 @@ void FIOPadSetGpioMux(u32 gpio_id, u32 pin_id) FIOPadSetFunc(&iopad_ctrl, FIOPAD_A37_REG0_OFFSET, FIOPAD_FUNC6); break; default: - FBOARD_IO_ERROR("pin_id error."); + FBOARD_IO_DEBUG("No preconfiguration for GPIO-%d pin-%d iopad mux info.\r\n", gpio_id, pin_id); break; } } @@ -131,7 +135,7 @@ void FIOPadSetGpioMux(u32 gpio_id, u32 pin_id) FIOPadSetFunc(&iopad_ctrl, FIOPAD_A51_REG0_OFFSET, FIOPAD_FUNC6); break; default: - FBOARD_IO_ERROR("pin_id error."); + FBOARD_IO_DEBUG("No preconfiguration for GPIO-%d pin-%d iopad mux info.\r\n", gpio_id, pin_id); break; } } @@ -150,13 +154,13 @@ void FIOPadSetGpioMux(u32 gpio_id, u32 pin_id) FIOPadSetFunc(&iopad_ctrl, FIOPAD_AA47_REG0_OFFSET, FIOPAD_FUNC6); break; default: - FBOARD_IO_ERROR("pin_id error."); + FBOARD_IO_DEBUG("No preconfiguration for GPIO-%d pin-%d iopad mux info.\r\n", gpio_id, pin_id); break; } } else { - FBOARD_IO_ERROR("Gpio id error."); + FBOARD_IO_DEBUG("No preconfiguration for GPIO-%d iopad mux info.\r\n", gpio_id); } } @@ -182,7 +186,7 @@ void FIOPadSetCanMux(u32 can_id) } else { - FBOARD_IO_ERROR("can id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for CAN-%d iopad mux info.\r\n", can_id); } } @@ -201,7 +205,7 @@ void FIOPadSetQspiMux(u32 qspi_id, u32 cs_id) } else { - FBOARD_IO_ERROR("qspi id id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for QSPI-%d iopad mux info.\r\n", qspi_id); } if (cs_id == FQSPI_CS_0) @@ -231,11 +235,11 @@ void FIOPadSetPwmMux(u32 pwm_id, u32 pwm_channel) } else { - FBOARD_IO_ERROR("pwm channel is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for PWM-%d channel-%d iopad mux info.\r\n", pwm_id, pwm_channel); } break; default: - FBOARD_IO_ERROR("pwm id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for PWM-%d iopad mux info.\r\n", pwm_id); break; } } @@ -275,7 +279,7 @@ void FIOPadSetMioMux(u32 mio_id) } break; default: - FBOARD_IO_ERROR("mio id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for MIO-%d iopad mux info.\r\n", mio_id); break; } } @@ -297,7 +301,7 @@ void FIOPadSetTachoMux(u32 pwm_in_id) FIOPadSetFunc(&iopad_ctrl, FIOPAD_AE59_REG0_OFFSET, FIOPAD_FUNC1); break; default: - FBOARD_IO_ERROR("pwm_in id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for pwm-in-%d iopad mux info.\r\n", pwm_in_id); break; } } @@ -321,7 +325,7 @@ void FIOPadSetUartMux(u32 uart_id) FIOPadSetFunc(&iopad_ctrl, FIOPAD_A49_REG0_OFFSET, FIOPAD_FUNC0); break; default: - FBOARD_IO_ERROR("Uart id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for UART-%d iopad mux info.\r\n", uart_id); break; } } diff --git a/board/ft2004_dsk/fio_mux.c b/board/ft2004_dsk/fio_mux.c index 1ee46716d..c571d9a00 100644 --- a/board/ft2004_dsk/fio_mux.c +++ b/board/ft2004_dsk/fio_mux.c @@ -32,6 +32,9 @@ FIOCtrl ioctrl; #define FBOARD_IO_DEBUG_TAG "FBOARD_IO-CFG" #define FBOARD_IO_ERROR(format, ...) FT_DEBUG_PRINT_E(FBOARD_IO_DEBUG_TAG, format, ##__VA_ARGS__) +#define FBOARD_IO_WARN(format, ...) FT_DEBUG_PRINT_W(FBOARD_IO_DEBUG_TAG, format, ##__VA_ARGS__) +#define FBOARD_IO_INFO(format, ...) FT_DEBUG_PRINT_I(FBOARD_IO_DEBUG_TAG, format, ##__VA_ARGS__) +#define FBOARD_IO_DEBUG(format, ...) FT_DEBUG_PRINT_D(FBOARD_IO_DEBUG_TAG, format, ##__VA_ARGS__) /*****************************************************************************/ /** @@ -90,14 +93,10 @@ void FIOPadSetCanMux(u32 can_id) { FIOCtrlSetFunc(&ioctrl, FIOCTRL_NTRST_SWJ_PAD, FIOCTRL_FUNC1); /* can1-tx: func 1 */ FIOCtrlSetFunc(&ioctrl, FIOCTRL_SWDO_SWJ_PAD, FIOCTRL_FUNC1); /* can1-rx: func 1 */ - } - else if (can_id == FCAN2_ID) - { - } else { - FBOARD_IO_ERROR("Can id error"); + FBOARD_IO_DEBUG("No preconfiguration for CAN-%d iopad mux info.\r\n", can_id); } } diff --git a/board/pd2308_demo/fio_mux.c b/board/pd2308_demo/fio_mux.c index 9d6a9821a..aace9de4d 100644 --- a/board/pd2308_demo/fio_mux.c +++ b/board/pd2308_demo/fio_mux.c @@ -167,7 +167,7 @@ void FIOPadSetQspiMux(u32 qspi_id, u32 cs_id) } else { - FBOARD_IO_ERROR("qspi cs id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for QSPI cs-%d iopad mux info.\r\n", cs_id); } } @@ -207,7 +207,7 @@ void FIOPadSetPwmMux(u32 pwm_id, u32 pwm_channel) break; default: - FBOARD_IO_ERROR("pwm id is error.\r\n"); + FBOARD_IO_DEBUG("No preconfiguration for PWM-%d iopad mux info.\r\n", pwm_id); break; } } diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index 524cc885a..982389f2b 100755 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,3 +1,48 @@ +# Phytium Standalone SDK 2024-03-25 v1.3.0 ChangeLog + +Change Log since 2024-3-19 + +## example + +- solve compile problem when use no-letter-shell mode +- solve fp print err in SD examples +- solve print err in SERIAL exmaples +- README update +- solve the oversize interval problem in generic_timer physical example + +## board + +- update iomux err output into debug form + +# Phytium Standalone SDK 2024-03-19 ChangeLog + +Change Log since 2024-03-18 + +## driver + +- modify function FXmacDetect:return error when phy_status is not a standard value. + +## third-party + +- add FXmacBdRingUnAlloc call when system run into some problems after FXmacBdRingAlloc. +- adjusted the location of interrupt protection code, which make the system more robust. +- Changing the order in which resources are released, which solved problems with tx buffers not being cleared in time. +- add the code which can clear the netif when call function LwipPortAdd. + +# Phytium Standalone SDK 2024-03-14 ChangeLog + +Change Log since 2024-03-19 + +## IDE + +- Add IDE related document + +Change Log since 2024-03-13 + +## example + +- update I2C, PIN, SD, SFUD, SPIFFS, SPI, SERIAL etc. examples to adapt to new auto test tool + # Phytium Standalone SDK 2024-03-13 ChangeLog Change Log since 2024-03-08 diff --git a/doc/fig/kylin.png b/doc/fig/kylin.png index 034448a82..457597bd8 100644 Binary files a/doc/fig/kylin.png and b/doc/fig/kylin.png differ diff --git a/doc/fig/linux.png b/doc/fig/linux.png index a9e7c11a6..1a94f4ffd 100644 Binary files a/doc/fig/linux.png and b/doc/fig/linux.png differ diff --git a/doc/fig/windows.png b/doc/fig/windows.png index 4389fb08c..c4b25359c 100644 Binary files a/doc/fig/windows.png and b/doc/fig/windows.png differ diff --git a/doc/reference/ide/debug.md b/doc/reference/ide/debug.md new file mode 100644 index 000000000..9fcad39cb --- /dev/null +++ b/doc/reference/ide/debug.md @@ -0,0 +1,139 @@ +## 调试教程 + +### 创建调试配置 + +* 点击调试按钮下拉框,进入Debug Configurations. + ![](pic/pic.png) + +* 单击左上角红框中图标,或者双击Phytium GDB OpenOCD Debugging,创建调试配置。 + ![](pic/pic1.png) + +* 选中工程,Main选项卡中C/C++ Application自动填充好工程编译后生成的同名二进制文件。 + ![](pic/pic3.png) + +* Debugger选项卡中,包含启动openocd和gdb的调试配置。Probe对应使用的调试适配器。选择不同的Probe会有不同的Config options启动脚本来启动openocd。 + ![](pic/pic2.png) + +* Startup选项卡,包括一些用于配置调试会话的openocd选项。 + ![](pic/pic4.png) + 上述字段会按照如下顺序生成命令发送给gdb: + +```csharp +monitor reset init +monitor halt +monitor arm semihosting enable +symbol-file ".../wdt/Debug/est.elf" +load ".../wdt/Debug/est.elf" +monitor gdb_breakpoint_override hardware +break main +monitor reset halt +monitor halt +``` + +* Common选项卡,选择调试配置保存的位置。选择Local file,即保存在本地工作区;选择Shared file,即保存在工程中。 + ![](pic/pic5.png) + +### 启动调试会话 + +* 启动调试会话前,确保: + + * 开发板具有JTAG接口,并且通过调试适配器将开发板的JTAG接口和主机的USB接口连接起来。 + + * 开发板上电。 + +* 选中工程,完成调试配置后,点击Debug按钮,启动调试,默认断点在main函数入口。 + ![](pic/pic6.png) + +* 如果需要再次启动同一工程的调试,可以点击Debug下拉图标,选择第一项,启动调试。 + ![](pic/pic7.png) + +* 注意:启动调试会话时,Phytium的视图会发生更改。 + +* 如果成功启动了调试会话,可以看到openocd和aarch-none-elf-gdb这两个进程。 + ![](pic/pic8.png) + +* 同时,PhyStudio中的视图会从Edit视图切换到Debug视图,Debug视图中会展示: + + * 函数调用堆栈。 + + * 源代码视图显示断点位置。 + + * Variables、Expressions、Breaks等视图也会处于打开状态。 + + * Console视图打开。 + + 如果是第一次在PhyStudio进入调试,可能会弹出一个确认视图切换的对话框,点击Switch按钮切换即可。 + ![](pic/pic9.png) + ![](pic/pic10.png) + + ### 调试应用 + +* 基本调试功能位于顶部的栏中。下图按钮从左至右依次为: + ![](pic/pic11.png) + + * Resume:继续执行程序;如果没有断点就一直执行,直到执行结束;如果运行过程中有断点,就跳转到该断点。 + + * Suspend:停止执行。 + + * Terminate:终止调试会话。 + + * Connect/Disconnect:断开调试连接,已禁用。 + + * Step Into:下一步,若下一步是函数,则会进入函数体内部执行。 + + * Step Over:下一步,不会进入函数体。 + + * Step Return:从进入的函数中跳出来或者跳转到所在函数中的下一个断点。 + +* Variables视图 + ![](pic/variables.png) + 该视图中自动填充调试程序的上下文中存在的变量。包含三列: + + * Name 变量名称。 + + * Type 变量数据类型。 + + * Value 变量的值。 + +* 注:该视图不允许添加或删除行,只允许自动填充变量。 + +* Breakpoints视图 + 显示当前所有断点信息。 + + ![](pic/breakpoint.png) + + 添加断点方式:在源代码区域。双击需要添加的断点的代码显示代码行数的位置。 + + ![](pic/pic12.png) + +* Disassembly视图 + + 点击红框中图标将会跳出Disassembly视图,可以查看对应执行的汇编指令。 + + ![](pic/pic13.png) + +* Console视图 + + 显示openocd进程执行情况。 + ![](pic/console.png) + +* Registers视图 + 显示所有寄存器的值。 + ![](pic/registers.png) + +* Problems视图 + 显示编译、运行和调试过程中产生的警告和错误信息。 + ![](pic/problems.png) + +* Executables视图 + ![](pic/executables.png) + +* Debugger Console视图 + 显示gdb调试信息。 + ![](pic/debugger.png) + 可添加需要监测的地址,监测该地址中的值的变化。 + ![](pic/memory.png) + +* Terminal视图 + 点击Window->Show View->Terminal,生成该视图,显示连接开发板的串口信息。 + ![](pic/terminal.png) \ No newline at end of file diff --git a/doc/reference/ide/figs/add_debug_config.png b/doc/reference/ide/figs/add_debug_config.png new file mode 100644 index 000000000..a54d13921 Binary files /dev/null and b/doc/reference/ide/figs/add_debug_config.png differ diff --git a/doc/reference/ide/figs/add_include.png b/doc/reference/ide/figs/add_include.png new file mode 100644 index 000000000..e691f87a6 Binary files /dev/null and b/doc/reference/ide/figs/add_include.png differ diff --git a/doc/reference/ide/figs/breakpoints.png b/doc/reference/ide/figs/breakpoints.png new file mode 100644 index 000000000..c171ecf77 Binary files /dev/null and b/doc/reference/ide/figs/breakpoints.png differ diff --git a/doc/reference/ide/figs/build_done.png b/doc/reference/ide/figs/build_done.png new file mode 100644 index 000000000..2f30a971c Binary files /dev/null and b/doc/reference/ide/figs/build_done.png differ diff --git a/doc/reference/ide/figs/build_elf.png b/doc/reference/ide/figs/build_elf.png new file mode 100644 index 000000000..12ff71d94 Binary files /dev/null and b/doc/reference/ide/figs/build_elf.png differ diff --git a/doc/reference/ide/figs/cmsis_dap_device.png b/doc/reference/ide/figs/cmsis_dap_device.png new file mode 100644 index 000000000..ef1ebfb48 Binary files /dev/null and b/doc/reference/ide/figs/cmsis_dap_device.png differ diff --git a/doc/reference/ide/figs/com_number.png b/doc/reference/ide/figs/com_number.png new file mode 100644 index 000000000..c815bf87d Binary files /dev/null and b/doc/reference/ide/figs/com_number.png differ diff --git a/doc/reference/ide/figs/config_tftp.png b/doc/reference/ide/figs/config_tftp.png new file mode 100644 index 000000000..c8cfd9525 Binary files /dev/null and b/doc/reference/ide/figs/config_tftp.png differ diff --git a/doc/reference/ide/figs/debug_as.png b/doc/reference/ide/figs/debug_as.png new file mode 100644 index 000000000..f9df327ae Binary files /dev/null and b/doc/reference/ide/figs/debug_as.png differ diff --git a/doc/reference/ide/figs/debug_config_menu.png b/doc/reference/ide/figs/debug_config_menu.png new file mode 100644 index 000000000..0c4b1b0dd Binary files /dev/null and b/doc/reference/ide/figs/debug_config_menu.png differ diff --git a/doc/reference/ide/figs/debug_info.png b/doc/reference/ide/figs/debug_info.png new file mode 100644 index 000000000..0329afd73 Binary files /dev/null and b/doc/reference/ide/figs/debug_info.png differ diff --git a/doc/reference/ide/figs/debug_output.png b/doc/reference/ide/figs/debug_output.png new file mode 100644 index 000000000..feabd4d0e Binary files /dev/null and b/doc/reference/ide/figs/debug_output.png differ diff --git a/doc/reference/ide/figs/directory.png b/doc/reference/ide/figs/directory.png new file mode 100644 index 000000000..a0933824a Binary files /dev/null and b/doc/reference/ide/figs/directory.png differ diff --git a/doc/reference/ide/figs/disassembly.png b/doc/reference/ide/figs/disassembly.png new file mode 100644 index 000000000..d382d6555 Binary files /dev/null and b/doc/reference/ide/figs/disassembly.png differ diff --git a/doc/reference/ide/figs/e2000_terminal.png b/doc/reference/ide/figs/e2000_terminal.png new file mode 100644 index 000000000..aa7cabe69 Binary files /dev/null and b/doc/reference/ide/figs/e2000_terminal.png differ diff --git a/doc/reference/ide/figs/git_addurl.png b/doc/reference/ide/figs/git_addurl.png new file mode 100644 index 000000000..c85805505 Binary files /dev/null and b/doc/reference/ide/figs/git_addurl.png differ diff --git a/doc/reference/ide/figs/git_commit.png b/doc/reference/ide/figs/git_commit.png new file mode 100644 index 000000000..d428d95d3 Binary files /dev/null and b/doc/reference/ide/figs/git_commit.png differ diff --git a/doc/reference/ide/figs/git_createfile.png b/doc/reference/ide/figs/git_createfile.png new file mode 100644 index 000000000..1a95b4b28 Binary files /dev/null and b/doc/reference/ide/figs/git_createfile.png differ diff --git a/doc/reference/ide/figs/git_createremote.png b/doc/reference/ide/figs/git_createremote.png new file mode 100644 index 000000000..029e35677 Binary files /dev/null and b/doc/reference/ide/figs/git_createremote.png differ diff --git a/doc/reference/ide/figs/git_perspective.png b/doc/reference/ide/figs/git_perspective.png new file mode 100644 index 000000000..84d81afe9 Binary files /dev/null and b/doc/reference/ide/figs/git_perspective.png differ diff --git a/doc/reference/ide/figs/git_push.png b/doc/reference/ide/figs/git_push.png new file mode 100644 index 000000000..61956bd59 Binary files /dev/null and b/doc/reference/ide/figs/git_push.png differ diff --git a/doc/reference/ide/figs/git_pushresult.png b/doc/reference/ide/figs/git_pushresult.png new file mode 100644 index 000000000..49a109aef Binary files /dev/null and b/doc/reference/ide/figs/git_pushresult.png differ diff --git a/doc/reference/ide/figs/git_remotes.png b/doc/reference/ide/figs/git_remotes.png new file mode 100644 index 000000000..56540c214 Binary files /dev/null and b/doc/reference/ide/figs/git_remotes.png differ diff --git a/doc/reference/ide/figs/git_reposselect.png b/doc/reference/ide/figs/git_reposselect.png new file mode 100644 index 000000000..544ca9d86 Binary files /dev/null and b/doc/reference/ide/figs/git_reposselect.png differ diff --git a/doc/reference/ide/figs/git_shareproj.png b/doc/reference/ide/figs/git_shareproj.png new file mode 100644 index 000000000..83aa9be5e Binary files /dev/null and b/doc/reference/ide/figs/git_shareproj.png differ diff --git a/doc/reference/ide/figs/gitclone_branch.png b/doc/reference/ide/figs/gitclone_branch.png new file mode 100644 index 000000000..567ecaa5b Binary files /dev/null and b/doc/reference/ide/figs/gitclone_branch.png differ diff --git a/doc/reference/ide/figs/gitclone_finish.png b/doc/reference/ide/figs/gitclone_finish.png new file mode 100644 index 000000000..dd71b1e12 Binary files /dev/null and b/doc/reference/ide/figs/gitclone_finish.png differ diff --git a/doc/reference/ide/figs/gitclone_repository.png b/doc/reference/ide/figs/gitclone_repository.png new file mode 100644 index 000000000..b4c605a1f Binary files /dev/null and b/doc/reference/ide/figs/gitclone_repository.png differ diff --git a/doc/reference/ide/figs/gitrepos_create.png b/doc/reference/ide/figs/gitrepos_create.png new file mode 100644 index 000000000..2a159d369 Binary files /dev/null and b/doc/reference/ide/figs/gitrepos_create.png differ diff --git a/doc/reference/ide/figs/gitview.png b/doc/reference/ide/figs/gitview.png new file mode 100644 index 000000000..2c3afae78 Binary files /dev/null and b/doc/reference/ide/figs/gitview.png differ diff --git a/doc/reference/ide/figs/gpio_src.png b/doc/reference/ide/figs/gpio_src.png new file mode 100644 index 000000000..d0fc2d55f Binary files /dev/null and b/doc/reference/ide/figs/gpio_src.png differ diff --git a/doc/reference/ide/figs/host_ip.png b/doc/reference/ide/figs/host_ip.png new file mode 100644 index 000000000..08013e6df Binary files /dev/null and b/doc/reference/ide/figs/host_ip.png differ diff --git a/doc/reference/ide/figs/import_makefile_project.png b/doc/reference/ide/figs/import_makefile_project.png new file mode 100644 index 000000000..3b625d3b8 Binary files /dev/null and b/doc/reference/ide/figs/import_makefile_project.png differ diff --git a/doc/reference/ide/figs/import_project.png b/doc/reference/ide/figs/import_project.png new file mode 100644 index 000000000..7ae70aeaa Binary files /dev/null and b/doc/reference/ide/figs/import_project.png differ diff --git a/doc/reference/ide/figs/install_dir.png b/doc/reference/ide/figs/install_dir.png new file mode 100644 index 000000000..16986231f Binary files /dev/null and b/doc/reference/ide/figs/install_dir.png differ diff --git a/doc/reference/ide/figs/install_ide.png b/doc/reference/ide/figs/install_ide.png new file mode 100644 index 000000000..ac7c27567 Binary files /dev/null and b/doc/reference/ide/figs/install_ide.png differ diff --git a/doc/reference/ide/figs/install_ok.png b/doc/reference/ide/figs/install_ok.png new file mode 100644 index 000000000..9da7a0dd8 Binary files /dev/null and b/doc/reference/ide/figs/install_ok.png differ diff --git a/doc/reference/ide/figs/installing.png b/doc/reference/ide/figs/installing.png new file mode 100644 index 000000000..84f0cbabe Binary files /dev/null and b/doc/reference/ide/figs/installing.png differ diff --git a/doc/reference/ide/figs/license.png b/doc/reference/ide/figs/license.png new file mode 100644 index 000000000..173778468 Binary files /dev/null and b/doc/reference/ide/figs/license.png differ diff --git a/doc/reference/ide/figs/main_page.png b/doc/reference/ide/figs/main_page.png new file mode 100644 index 000000000..46df675a4 Binary files /dev/null and b/doc/reference/ide/figs/main_page.png differ diff --git a/doc/reference/ide/figs/makefile_project.png b/doc/reference/ide/figs/makefile_project.png new file mode 100644 index 000000000..ae31a8442 Binary files /dev/null and b/doc/reference/ide/figs/makefile_project.png differ diff --git a/doc/reference/ide/figs/makefile_project_wizard.png b/doc/reference/ide/figs/makefile_project_wizard.png new file mode 100644 index 000000000..1d92e9004 Binary files /dev/null and b/doc/reference/ide/figs/makefile_project_wizard.png differ diff --git a/doc/reference/ide/figs/managedproj_config.png b/doc/reference/ide/figs/managedproj_config.png new file mode 100644 index 000000000..33730033a Binary files /dev/null and b/doc/reference/ide/figs/managedproj_config.png differ diff --git a/doc/reference/ide/figs/memory.png b/doc/reference/ide/figs/memory.png new file mode 100644 index 000000000..7cf468231 Binary files /dev/null and b/doc/reference/ide/figs/memory.png differ diff --git a/doc/reference/ide/figs/new_file.png b/doc/reference/ide/figs/new_file.png new file mode 100644 index 000000000..d239d9809 Binary files /dev/null and b/doc/reference/ide/figs/new_file.png differ diff --git a/doc/reference/ide/figs/new_file_wizard.png b/doc/reference/ide/figs/new_file_wizard.png new file mode 100644 index 000000000..6bdbd1d0e Binary files /dev/null and b/doc/reference/ide/figs/new_file_wizard.png differ diff --git a/doc/reference/ide/figs/new_proj.png b/doc/reference/ide/figs/new_proj.png new file mode 100644 index 000000000..80b40b59e Binary files /dev/null and b/doc/reference/ide/figs/new_proj.png differ diff --git a/doc/reference/ide/figs/open_new_terminal.png b/doc/reference/ide/figs/open_new_terminal.png new file mode 100644 index 000000000..706f2114c Binary files /dev/null and b/doc/reference/ide/figs/open_new_terminal.png differ diff --git a/doc/reference/ide/figs/phystudio_brand.png b/doc/reference/ide/figs/phystudio_brand.png new file mode 100644 index 000000000..3b6846433 Binary files /dev/null and b/doc/reference/ide/figs/phystudio_brand.png differ diff --git a/doc/reference/ide/figs/phystudio_main.png b/doc/reference/ide/figs/phystudio_main.png new file mode 100644 index 000000000..111bb7f75 Binary files /dev/null and b/doc/reference/ide/figs/phystudio_main.png differ diff --git a/doc/reference/ide/figs/proj_explorer.png b/doc/reference/ide/figs/proj_explorer.png new file mode 100644 index 000000000..5b1513eba Binary files /dev/null and b/doc/reference/ide/figs/proj_explorer.png differ diff --git a/doc/reference/ide/figs/proj_folder.png b/doc/reference/ide/figs/proj_folder.png new file mode 100644 index 000000000..bf436c376 Binary files /dev/null and b/doc/reference/ide/figs/proj_folder.png differ diff --git a/doc/reference/ide/figs/project_wizard.png b/doc/reference/ide/figs/project_wizard.png new file mode 100644 index 000000000..cf18bedb1 Binary files /dev/null and b/doc/reference/ide/figs/project_wizard.png differ diff --git a/doc/reference/ide/figs/registers.png b/doc/reference/ide/figs/registers.png new file mode 100644 index 000000000..fad32afad Binary files /dev/null and b/doc/reference/ide/figs/registers.png differ diff --git a/doc/reference/ide/figs/sdk_open_location.png b/doc/reference/ide/figs/sdk_open_location.png new file mode 100644 index 000000000..beb3885fd Binary files /dev/null and b/doc/reference/ide/figs/sdk_open_location.png differ diff --git a/doc/reference/ide/figs/sdk_path.png b/doc/reference/ide/figs/sdk_path.png new file mode 100644 index 000000000..ce7442164 Binary files /dev/null and b/doc/reference/ide/figs/sdk_path.png differ diff --git a/doc/reference/ide/figs/sdk_path_change.png b/doc/reference/ide/figs/sdk_path_change.png new file mode 100644 index 000000000..ed7364c07 Binary files /dev/null and b/doc/reference/ide/figs/sdk_path_change.png differ diff --git a/doc/reference/ide/figs/sdk_path_configprj.png b/doc/reference/ide/figs/sdk_path_configprj.png new file mode 100644 index 000000000..f02a72e2f Binary files /dev/null and b/doc/reference/ide/figs/sdk_path_configprj.png differ diff --git a/doc/reference/ide/figs/sdkconfig_menu.png b/doc/reference/ide/figs/sdkconfig_menu.png new file mode 100644 index 000000000..92a3fa0cf Binary files /dev/null and b/doc/reference/ide/figs/sdkconfig_menu.png differ diff --git a/doc/reference/ide/figs/select_import_proj.png b/doc/reference/ide/figs/select_import_proj.png new file mode 100644 index 000000000..a46e5b7fd Binary files /dev/null and b/doc/reference/ide/figs/select_import_proj.png differ diff --git a/doc/reference/ide/figs/serial_port.png b/doc/reference/ide/figs/serial_port.png new file mode 100644 index 000000000..aa1459c63 Binary files /dev/null and b/doc/reference/ide/figs/serial_port.png differ diff --git a/doc/reference/ide/figs/set_tftp.png b/doc/reference/ide/figs/set_tftp.png new file mode 100644 index 000000000..7297b5571 Binary files /dev/null and b/doc/reference/ide/figs/set_tftp.png differ diff --git a/doc/reference/ide/figs/step_debug.png b/doc/reference/ide/figs/step_debug.png new file mode 100644 index 000000000..9e55b3f23 Binary files /dev/null and b/doc/reference/ide/figs/step_debug.png differ diff --git a/doc/reference/ide/figs/terminal_tool.png b/doc/reference/ide/figs/terminal_tool.png new file mode 100644 index 000000000..51ea17d65 Binary files /dev/null and b/doc/reference/ide/figs/terminal_tool.png differ diff --git a/doc/reference/ide/figs/tftp_file_list.png b/doc/reference/ide/figs/tftp_file_list.png new file mode 100644 index 000000000..4eb642f3c Binary files /dev/null and b/doc/reference/ide/figs/tftp_file_list.png differ diff --git a/doc/reference/ide/figs/tftp_toolbar_started.png b/doc/reference/ide/figs/tftp_toolbar_started.png new file mode 100644 index 000000000..d0b5047e5 Binary files /dev/null and b/doc/reference/ide/figs/tftp_toolbar_started.png differ diff --git a/doc/reference/ide/figs/tftp_upload.png b/doc/reference/ide/figs/tftp_upload.png new file mode 100644 index 000000000..25a9ff222 Binary files /dev/null and b/doc/reference/ide/figs/tftp_upload.png differ diff --git a/doc/reference/ide/figs/tftp_view.png b/doc/reference/ide/figs/tftp_view.png new file mode 100644 index 000000000..52470b106 Binary files /dev/null and b/doc/reference/ide/figs/tftp_view.png differ diff --git a/doc/reference/ide/figs/toggle_build.png b/doc/reference/ide/figs/toggle_build.png new file mode 100644 index 000000000..d050f9fbd Binary files /dev/null and b/doc/reference/ide/figs/toggle_build.png differ diff --git a/doc/reference/ide/figs/uninstall_ide.png b/doc/reference/ide/figs/uninstall_ide.png new file mode 100644 index 000000000..486a070b0 Binary files /dev/null and b/doc/reference/ide/figs/uninstall_ide.png differ diff --git a/doc/reference/ide/figs/uninstall_ide_2.png b/doc/reference/ide/figs/uninstall_ide_2.png new file mode 100644 index 000000000..9d3d48386 Binary files /dev/null and b/doc/reference/ide/figs/uninstall_ide_2.png differ diff --git a/doc/reference/ide/figs/use_dap_or_jlink.png b/doc/reference/ide/figs/use_dap_or_jlink.png new file mode 100644 index 000000000..8f152cf3e Binary files /dev/null and b/doc/reference/ide/figs/use_dap_or_jlink.png differ diff --git a/doc/reference/ide/figs/welcome_page.png b/doc/reference/ide/figs/welcome_page.png new file mode 100644 index 000000000..71d227cb5 Binary files /dev/null and b/doc/reference/ide/figs/welcome_page.png differ diff --git a/doc/reference/ide/figs/workspace.png b/doc/reference/ide/figs/workspace.png new file mode 100644 index 000000000..36e150c3a Binary files /dev/null and b/doc/reference/ide/figs/workspace.png differ diff --git a/doc/reference/ide/ide.md b/doc/reference/ide/ide.md new file mode 100644 index 000000000..02dbd4e81 --- /dev/null +++ b/doc/reference/ide/ide.md @@ -0,0 +1,396 @@ +# PhyStudio IDE 开发环境 + +- PhyStudio 基于 Eclipse CDT C/C++ 开发,可以便利开发人员在集成开发环境中开发面向 Phytium 系列 CPU 平台的 Standalone 应用程序。本开发环境集成了编辑、编译、网络下载和调试等基础功能,还有管理工程硬件平台、配置 SDK 和 TFTP 服务器等附加功能,可以简化开发工具的安装流程、提升开发调试体验、增加 Standalone 应用程序的开发体验 + +- PhyStudio 目前支持 Windows x64 操作系统 +- PhyStudio 目前支持 E2000 D/Q Demo 板(开发下载和调试)和飞腾派(开发和下载) + +- PhyStudio 集成了如下运行环境 + - `OpenJDK17`,开源的 JAVA SE 平台实现 + - `Python 3.8`,Python 平台支持 + - `Eclipse Embedded CDT 2023-03`,基于开源 Eclipse 环境进行了修改 + - `OpenOCD 0.12.0`, 本环境中的 openocd.exe 基于开源软件修改后编译,如果需要修改后的源码,可以联系 `opensource_embedded@phytium.com.cn` 获取 + - `xpack-aarch64-none-elf-gcc-11.3.1-1.2`, xpack 发布的[64位交叉编译链](https://github.com/xpack-dev-tools/aarch64-none-elf-gcc-xpack),用于 Windows 环境交叉编译 ARM64 目标码 + - `xpack-arm-none-eabi-gcc-12.2.1-1.2-win32-x64`,xpack 发布的[32位交叉编译链](https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack),用于 Windows 环境交叉编译 ARM32 目标码 + - `xpack-windows-build-tools-4.3.0-1`, xpack 发布的[Windows平台构建工具](xpack-windows-build-tools-4.3.0-1),包含 win32 平台的 make, busybox 工具 + - `Phytium Standalone SDK`,用于 Phytium 系列 CPU 的 嵌入式软件开发工具包 + +## 1. 快速开始 + +### 1.1 下载 PhyStudio 安装包 + +- 从下面的链接中下载开发环境安装包 + +- [PhyStudio_Setup_V0.1.3.exe](https://pan.baidu.com/s/1azuFUjzg0jZgilQB4r1OlA) +> 提取码: phyt + +### 1.2 安装/卸载 PhyStudio + +- 安装 PhyStudio 通过双击安装包 .exe 文件,安装界面如图所示 + +![](./figs/install_ide.png) + +![](./figs/license.png) + +![](./figs/directory.png) + +![](./figs/install_dir.png) + +![](./figs/installing.png) + +- 点击`安装`后,开始安装,等待安装完成后,勾选`运行 PhyStudio`,然后点击`完成`启动 PhyStudio + +![](./figs/install_ok.png) + +- 启动后会提示选择一个 workspace, 选择一个目录点击 `Launch`即可,勾选`Use this as the default and do not ask again`下次启动会记住这次选择不再询问 + +![](./figs/workspace.png) + +- 卸载 PhyStudio 通过双击安装目录下的 uninst.exe 完成 + +![](./figs/uninstall_ide.png) +![](./figs/uninstall_ide_2.png) + +- 卸载完成后手动删除安装目录即可 + +### 1.3 工作主界面介绍 + +- PhyStudio 基于 Eclipse 平台开发,界面风格继承自 Eclipse,启动后的欢迎界面如下图所示,从上至下,依次是使用文档中心,使用 issue 提交中心、管理 SDK 的入口,以及导入managed工程和makefile工程 + +![](./figs/welcome_page.png) + +- 创建/导入工程后进入工作主界面,如下图所示,主界面主要包括四大区域: + - 工程视图区 + - 编辑区 + - 透视图区 + - 信息输出区 + +- 其中,工程视图区顾名思义是管理特定工程项目的,通过在工程视图选中一个工程,在菜单栏可以进行编译、调试等操作,同时,一些常用操作会在工具栏以图标的形式提供快捷方式 +- 编辑区提供编码、调试视图等一系列特定功能,窗口可以移动、关闭、最大化和最小化 +- 透视图定义了当前界面呈现的菜单栏,工具栏,以及功能窗口集合及其布局,不同透视图提供了完成特定类型任务的功能集合,例如 C 透视图组合了项目开发,源文件编辑,项目构建等常用的开发功能窗口,菜单和功能按钮,调试透视图包含了调试项目程序常用的调试功能窗口,菜单和功能按钮 +- 信息输出区提供了各种信息的输出窗口,包括编译过程信息,调试过程信息、串口终端信息等 + +![](./figs/main_page.png) + +### 1.4 Phytium Standalone SDK管理 + 在PhyStudio中SDK可以分为全局SDK和工程SDK: + 1. 全局的SDK作用是在创建工程的时候提供模板示例工程,并初始化工程 + 2. 工程的SDK作用是提供头文件包含,组件文件链接等 + +#### 1.4.1 修改全局SDK路径 +- 在离线的情况下,可以提前下载好Phytium Standalone SDK,然后在工具栏点击SDK Manage下拉菜单->Config SDK Path配置新的SDK路径,点击`Apply and Close`后就会加载新的SDK模板工程,可能会耗时几分钟 + +![](./figs/sdk_path_change.png) + +#### 1.4.2 在线更新SDK +- 如果用户需要在现有的SDK上面进行更新,则需要按照上面步骤先找到SDK Path(默认是PhyStudio的安装路径) + +- 进入 Phytium Standalone SDK 的路径,通过 git 工具更新 SDK,需要注意的是可能会出现冲突 + +``` +cd ./phytium_standalone_sdk +git remote add pub https://gitee.com/phytium_embedded/phytium-standalone-sdk.git +git fetch pub +git pull +``` + +- 进入 `tools\export_ide` 目录,双击运行脚本 `gen_proj.bat`,将 Standalone SDK 的 example 转换为 PhyStudio 工程 + +- Phytium Standalone SDK 资源的详细介绍可以[参考](https://gitee.com/phytium_embedded/phytium-standalone-sdk) + +#### 1.4.3 修改工程的SDK路径 +- 全局的SDK主要是在创建工程的时候加载模板工程并给工程设置初始的SDK路径,对创建完成的工程不生效 +- 如果某个工程需要修改SDK的路径,选中工程右键点击Properties->Resource->Linked Resources->SDK_DIR,按照下图的操作进行修改 + +![](./figs/sdk_path_configprj.png) + +#### 1.4.4 打开工程的SDK路径 +- 通过选中工程,右键菜单选择`Open SDK Location`可以打开工程所在的SDK目录,如下图所示: + +![](./figs/sdk_open_location.png) + +### 1.5 导入或新建项目 +PhyStudio支持`Managed工程`和`makefile工程`两种类型,用户需要根据自己的使用场景和使用习惯进行选择,两者的区别如下: +- `Managed工程`通过界面配置,编译时会自动生成makefile文件,工程的用户文件保存在Workspace下面,通过文件链接的方式引用SDK +- `makefile工程`配置编译选项需要修改makefile文件,工程保存在SDK的example目录下面,使用灵活度较高 + +#### 1.5.1 Managed工程 +在PhyStudio中可以创建一个空的工程或者基于SDK的example导入工程此类工程,推荐通过导入的方式创建,以导入example工程为例: +- 点击 File > New > Import Phytium Project,可以导入现有的 Phytium Standalone SDK 工程 + +![](./figs/import_project.png) + +- 进入项目导入界面后,选择一个导入例程,选择运行平台,如 e2000d 和运行模式,如 aarch64,最后点击 Finish 开始导入 + +![](./figs/project_wizard.png) + +- 等待一段时间导入完成,然后可以通过工程浏览器查看文件 + +![](./figs/proj_explorer.png) + +![](./figs/proj_folder.png) + +- 如上图所示,其中 + - inc 和 src 是工程的头文件和源文件目录,文件存在在 workspace 的工程目录下 + - SDK 是工程依赖的 Standalone SDK 目录,以文件链接的方式存在,不在工程目录下 + - linkscripts 是工程编译依赖的链接脚本 + - README.md 和 fig 是工程的说明文档及相关图片 + - sdkconfig 是用于本工程的 SDK 配置 +- 配置编译和链接选项,选中工程右键点击Properties->C/C++ Build->Settings->Tool Settings,如果是配置汇编的选项则是在GNU Arm Cross Assembler下,C和C++同理,链接选项在Linker下面配置。以包含C的头文件路径为例,在GNU Arm Cross C Compiler下面进行配置,需要注意的是,在选择路径的时候可以选择Workspace或者File system,如果头文件路径是在工程内就选择Workspace,然后找到对应工程下面的文件夹: + +![](./figs/managedproj_config.png) + +- 此外,可以通过 File > New > Phytium Project,进入工程创建向导,创建一个新的项目 + +![](./figs/new_proj.png) + +- 创建完成后的工程与导入的工程类似 + + +#### 1.5.2 Makefile工程 +此工程类型需要用户自己管理makefile源文件以及头文件的编译,开发方式与命令行方式一样,适用于比较熟悉makefile的用户,目前支持通过SDK的示例工程导入,需要注意的是此类工程是完全链接SDK下的示例工程 + +- 点击 File > New > Import Phytium Makefile Project,可以导入现有的 Phytium Standalone SDK 工程 + +![](./figs/import_makefile_project.png) + +- 进入项目导入界面后,选择一个导入例程,选择运行平台,如 e2000d 和运行模式,如 aarch64,最后点击 Finish 开始导入 + +![](./figs/makefile_project_wizard.png) + +- 等待一段时间导入完成并初始化后,然后可以通过工程浏览器查看文件 + +![](./figs/makefile_project.png) + +- 如上图所示,其中 + - inc 和 src 是工程的头文件和源文件目录,文件存在于SDK的example目录下 + - SDK 是工程依赖的 Standalone SDK 目录,以文件链接的方式存在,不在工程目录下 + - linkscripts 是工程编译依赖的链接脚本 + - README.md 和 fig 是工程的说明文档及相关图片 + - sdkconfig 是用于本工程的 SDK 配置 + - makefile 用于编译的makefile,用户需要自己管理 + +- 配置编译链接选项可以直接修改makefile或者配置sdkconfig来实现,sdkconfig的配置方式将在后面章节中进行介绍 + +- 如果增加了新的头文件和源文件需要在makefile中进行添加,才能编译通过。如果增加了工程路径之外的源文件编译和头文件包含,除了在makefile中添加之外,还需要在工程中配置头文件的包含路径,才能在编辑器中找到符号表,右键选中工程点击Properties->C/C++ General->Paths and Symbols->选择为Assembly/C/C++添加头文件路径。配置宏定义和库文件路径分别是在Symbols和Library Paths下 + +![](./figs/add_include.png) + +### 1.6 配置和构建项目 + +#### 1.6.1 配置sdkconfig +PhyStudio支持通过sdkconfig配置工程,`Makefile工程`类型支持绝大多数的sdkconfig配置,而`Managed工程`目前仅支持配置组件,其他的一些配置通过sdkconfig可能不会生效,如编译选项,target类型等。 +- 双击工程浏览器(Project Explorer)中的 sdkconfig 进入 SDK 配置界面 + +![](./figs/sdkconfig_menu.png) + +- 在 SDK 配置界面可以按需要选择或者删除配置,例如,选中 Drivers configuration > Use gpio 和 Use FGPIO,然后按 Ctrl + S 保存配置后,工程会新增一个 fgpio 的路径,后面就可以使用 GPIO 驱动了 + +![](./figs/gpio_src.png) + +#### 1.6.2 构建项目 + +- 完成配置后选中编译的工程,点击工具栏的`Build`图标开始编译 + +![](./figs/toggle_build.png) + +![](./figs/build_done.png) + +- 编译完成后,生成的 ELF 文件保存在 Debug 目录下 + +![](./figs/build_elf.png) + +### 1.7 使用串口工具连接开发板 + +- 启动开发板,PhyStudio 所在的主机通过串口连接开发板 + +![](./figs/com_number.png) + +- 在 Windows > Show View > Terminal 中启动串口终端工具,通过`Open a Terminal` 启动一个新的串口终端, + +![](./figs/terminal_tool.png) +![](./figs/open_new_terminal.png) + +- 这里连接的是串口 COM5,点击`OK`连接成功后可以和开发板进行交互 + +![](./figs/com5.png) +![](./figs/e2000_terminal.png) + +> 注意有些开发板启动后默认会进入 Linux 环境,要进行后续开发和调试,需要在 U-Boot 界面中修改 bootcmd 使得开发板启动后停留在 U-Boot 界面 + +### 1.8 通过网络下载程序 + +- 对于有网口的开发板,可以使用 TFTP 直接将镜像加载到开发板上进行启动,首先需要用网线连接开发板,PhyStudio 主机侧连接开发板的网络需要配置好 ip 网段与开发板后续配置的 ip 配套 +- 如下图所示,进入连接开发板的网络适配器配置,PhyStudio 主机侧的 ip 地址设置为 `192.168.4.50`,子网掩码设置为 `255.255.255.0`,网关设置为 `192.168.4.1` + +![](./figs/host_ip.png) + +- 然后点击 PhyStudio 的 Window > Show View > TFTPServerView,配置 TFTP 服务 + +![](./figs/tftp_view.png) + +- 点击 `Config FTP Server` 进入配置界面 + +![](./figs/config_tftp.png) + +- 配置 `Listener Host` 为之前设置的主机 ip `192.168.4.50`,TFTP 服务的路径默认为安装路径下的tftp目录,也可以进行修改,配置完成后点击 `Apply and Close` 生效配置 + +![](./figs/set_tftp.png) + +- 配置完成之后点击`Start FTP server`按钮启动 TFTP 服务,启动成功之后按钮状态显示为这样![](./figs/tftp_toolbar_started.png),对工程进行编译,elf文件会自动拷贝到TFTP目录下面去,用户也可以手动拖拽elf文件到TFTP视图中去。*注意:如果启动失败,请检查网络配置、是否已经启动过TFTP服务了,或是端口被占用。* + +![](./figs/tftp_file_list.png) + + +- 在连接开发板的串口终端中,依次输入下列命令,配置开发板网络,加载并启动镜像 get-start.elf + +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 0xa0100000 get-start.elf +bootelf -p 0xa0100000 +``` + +> 镜像的名字根据实际情况设置 + +![](./figs/tftp_upload.png) + +- 随后可以看到开发板的运行输出 + +### 1.9 启动程序调试运行 + +- 对于有 FJTAG 接口的开发板,可以使用调试运行功能,首先参考[jtag_debugging.md](../jtag_debugging/jtag_debugging.md)进行硬件连接 + +> 目前支持 FJTAG 调试的开发板包括 E2000 D/Q Demo 板 + +- 如果使用 CMSIS DAP/DAPLink 作为 JTAG 适配器,连接成功后,设备管理器上应该会看到枚举出的 HID 设备 + +> 具体设备类型取决于 CMSIS DAP 的生成厂家 + +![](./figs/cmsis_dap_device.png) + +- 如果使用 Jlink 作为适配器,连接成功后,设备管理器上应该会看到枚举出的 Bulk 设备 + +> 注意 PhyStudio 使用 OpenOCD 作为调试代理,用 Jlink 作为适配器时不能使用 Jlink 的官方驱动,必须用 libusb 将 Jlink 设备识别为 USB Bulk 设备,相关内容可以参考 [Using J-Link with OpenOCD](https://wiki.segger.com/OpenOCD),[解决 OpenOCD 不能识别 J-Link的方法](https://blog.csdn.net/weixin_45467056/article/details/119886361) + +- 用适配器连接 PhyStudio 主机和开发板后,在 PhyStudio 的工程中创建调试配置,通过 Debug Configurations 进入调试配置界面,双击 Phytium GDB OpenOCD Debug 创建一个调试配置 + +![](./figs/add_debug_config.png) + +![](./figs/debug_config_menu.png) + +- 进入调试配置界面,一般只需要选择适配器(Probe)是 Jlink 还是 DAP,其他配置可以参考 Eclipse OpenOCD 的[配置说明](https://eclipse-embed-cdt.github.io/debug/openocd/)修改,修改完成后点击`Apply`保存配置 + +![](./figs/use_dap_or_jlink.png) + +- 然后复位开发板,保证开发板停留在 U-Boot 界面,然后选中待调试的工程,点击 `Debug As` 启动调试 + +![](./figs/debug_as.png) + +- 启动调试后进入调试视图,默认会停在在 main 函数入口断点 + +![](./figs/debug_output.png) +- 如果启动后调试后没有显示符号表,可能是elf文件较大还在下载中,请耐心等待一会。或者是没有勾选sdkconfig中的Generate debug symbols选项,勾选之后重新编译即可 +- 在调试过程中,通过工具栏的`Step Into`、`Step Over` 和 `Continue` 等控制程序的运行 + +![](./figs/step_debug.png) + +- 通过`Variables`、`Breakpoints` 和 `Expressions` 等窗口进行调试观察 + +![](./figs/debug_info.png) + +![](./figs/breakpoints.png) + +- 通过 Windows > Show View > Disassembly 查看反汇编信息 + +![](./figs/disassembly.png) + +- 通过 Windows > Show View > Register 查看实时寄存器信息 + +![](./figs/registers.png) + +> 选择 Number Format > Hex 可以显示16进制的寄存器值 + +- 通过 Windows > Show View > Memory 查看运行实时内存 + +![](./figs/memory.png) + +### 1.10 Git版本控制 +- PhyStudio加入了EGit插件,支持git版本控制,具体使用方法参照官方文档[EGit用户指导](https://wiki.eclipse.org/EGit/User_Guide "EGit用户指导"),这里介绍一些基本的用法 +#### 1.10.1 从远程仓库克隆 +- 点击右上角的按钮,切换到Git透视图,如下图所示,或者点击菜单栏的Window->Show View->Other..->Git->Git Repositories + +![](./figs/git_perspective.png) + +- 在Git视图中点击克隆远程仓库的按钮,输入仓库地址,输入用户名和密码,点击Next按钮 + +![](./figs/gitclone_repository.png) + +- 选择需要克隆的分支,然后点击Next按钮 + +![](./figs/gitclone_branch.png) + +- 选择目录,然后点击Finish按钮,等待克隆完成之后会在Git视图中显示 + +![](./figs/gitclone_finish.png) +![](./figs/gitview.png) + +#### 1.10.2 创建一个新的Git仓库 +- 在Git视图中点击创建Git新仓库按钮,选择仓库目录,点击`Create`按钮 + +![](./figs/gitrepos_create.png) + +- 创建完之后关联远程仓库,在仓库的Remotes节点上面右键点击`Create Remote..`按钮,然后在弹出的对话框中点击`Create`按钮 + +![](./figs/git_createremote.png) + +- 点击左侧的`Change..`按钮,在右侧输入仓库地址和用户名密码,点击`Finish`按钮,然后点击左侧的`Save`按钮 + +![](./figs/git_addurl.png) + +- 添加完成后在仓库下就能看见远程仓库,如果没有显示就点击一下Git视图的刷新按钮 + +![](./figs/git_remotes.png) + +#### 1.10.3 把代码推送到远程仓库 + +- 如果代码还没有加入到git仓库里面,需要右键点击工程->Team->Share Project.. + +![](./figs/git_shareproj.png) + +- 选择一个已有的仓库或者新建一个仓库然后选择,点击`Finish`按钮,此时工程代码已经被添加到了代码库。注意:如果代码已经添加到仓库了,直接忽略添加的步骤。 + +![](./figs/git_reposselect.png) + +- 右键选择工程->Team->Commit,把要提交的内容从Unstaged Changes加入到Staged Changes中去,然后输入提交信息,最后点击`Commit`按钮 + +![](./figs/git_commit.png) + +- 右键选择工程->Team->Push Branch 'master',在弹出的对话框中点击`Push`按钮进行推送。 +> 注意: 如果推送失败,有可能是远程分支上面的提交没有同步,此时可能需要fetch、pull或是merge之后才能进行推送 + +![](./figs/git_push.png) +![](./figs/git_pushresult.png) + + +### 1.11 开发技巧 +#### 1.11.1 常用快捷键 + Alt+/ 代码提示 + F3或者Ctrl+鼠标左键 查看定义或声明 + F4 查看继承关系 + Ctrl+Alt+H 选中函数,查看调用关系 + Ctrl+Shift+G 查看所有引用 + Ctrl+Shift+F 格式化代码(可能和其他应用的快捷键冲突) + Ctrl+H 全局搜索 + Ctrl+D 删除当前行 + Ctrl+Alt+ ↓或↑ 向下或者向上复制 + Ctrl+/ 注释当前行, 再按则取消注释 + Ctrl+Shift+/ 块注释 + Ctrl+Shift+\ 取消块注释 + Alt+ ←或→ 光标定位到前一个或者后一个位置 + Ctrl+Q 定位到最后编辑的地方 + Ctrl+K 参照选中的 Word 快速定位到下一个 + Ctrl+L 定位到某行 + Shift+Enter 在当前行的下一行插入空行 + diff --git a/doc/reference/ide/pic/breakpoint.png b/doc/reference/ide/pic/breakpoint.png new file mode 100644 index 000000000..68c557c63 Binary files /dev/null and b/doc/reference/ide/pic/breakpoint.png differ diff --git a/doc/reference/ide/pic/console.png b/doc/reference/ide/pic/console.png new file mode 100644 index 000000000..18593001d Binary files /dev/null and b/doc/reference/ide/pic/console.png differ diff --git a/doc/reference/ide/pic/debugger.png b/doc/reference/ide/pic/debugger.png new file mode 100644 index 000000000..0e684a911 Binary files /dev/null and b/doc/reference/ide/pic/debugger.png differ diff --git a/doc/reference/ide/pic/executables.png b/doc/reference/ide/pic/executables.png new file mode 100644 index 000000000..d4b69a36c Binary files /dev/null and b/doc/reference/ide/pic/executables.png differ diff --git a/doc/reference/ide/pic/memory.png b/doc/reference/ide/pic/memory.png new file mode 100644 index 000000000..36e04916d Binary files /dev/null and b/doc/reference/ide/pic/memory.png differ diff --git a/doc/reference/ide/pic/pic.png b/doc/reference/ide/pic/pic.png new file mode 100644 index 000000000..0613c2648 Binary files /dev/null and b/doc/reference/ide/pic/pic.png differ diff --git a/doc/reference/ide/pic/pic1.png b/doc/reference/ide/pic/pic1.png new file mode 100644 index 000000000..266b11808 Binary files /dev/null and b/doc/reference/ide/pic/pic1.png differ diff --git a/doc/reference/ide/pic/pic10.png b/doc/reference/ide/pic/pic10.png new file mode 100644 index 000000000..aa6fbcab4 Binary files /dev/null and b/doc/reference/ide/pic/pic10.png differ diff --git a/doc/reference/ide/pic/pic11.png b/doc/reference/ide/pic/pic11.png new file mode 100644 index 000000000..98800eb90 Binary files /dev/null and b/doc/reference/ide/pic/pic11.png differ diff --git a/doc/reference/ide/pic/pic12.png b/doc/reference/ide/pic/pic12.png new file mode 100644 index 000000000..1f25f1755 Binary files /dev/null and b/doc/reference/ide/pic/pic12.png differ diff --git a/doc/reference/ide/pic/pic13.png b/doc/reference/ide/pic/pic13.png new file mode 100644 index 000000000..6abf8ef8b Binary files /dev/null and b/doc/reference/ide/pic/pic13.png differ diff --git a/doc/reference/ide/pic/pic2.png b/doc/reference/ide/pic/pic2.png new file mode 100644 index 000000000..df27eeefb Binary files /dev/null and b/doc/reference/ide/pic/pic2.png differ diff --git a/doc/reference/ide/pic/pic3.png b/doc/reference/ide/pic/pic3.png new file mode 100644 index 000000000..c7f58b103 Binary files /dev/null and b/doc/reference/ide/pic/pic3.png differ diff --git a/doc/reference/ide/pic/pic4.png b/doc/reference/ide/pic/pic4.png new file mode 100644 index 000000000..43b6956c9 Binary files /dev/null and b/doc/reference/ide/pic/pic4.png differ diff --git a/doc/reference/ide/pic/pic5.png b/doc/reference/ide/pic/pic5.png new file mode 100644 index 000000000..81a5ca5eb Binary files /dev/null and b/doc/reference/ide/pic/pic5.png differ diff --git a/doc/reference/ide/pic/pic6.png b/doc/reference/ide/pic/pic6.png new file mode 100644 index 000000000..e80aa5b56 Binary files /dev/null and b/doc/reference/ide/pic/pic6.png differ diff --git a/doc/reference/ide/pic/pic7.png b/doc/reference/ide/pic/pic7.png new file mode 100644 index 000000000..4b13da36f Binary files /dev/null and b/doc/reference/ide/pic/pic7.png differ diff --git a/doc/reference/ide/pic/pic8.png b/doc/reference/ide/pic/pic8.png new file mode 100644 index 000000000..7f796339a Binary files /dev/null and b/doc/reference/ide/pic/pic8.png differ diff --git a/doc/reference/ide/pic/pic9.png b/doc/reference/ide/pic/pic9.png new file mode 100644 index 000000000..db91cc81d Binary files /dev/null and b/doc/reference/ide/pic/pic9.png differ diff --git a/doc/reference/ide/pic/problems.png b/doc/reference/ide/pic/problems.png new file mode 100644 index 000000000..7438fb31b Binary files /dev/null and b/doc/reference/ide/pic/problems.png differ diff --git a/doc/reference/ide/pic/registers.png b/doc/reference/ide/pic/registers.png new file mode 100644 index 000000000..e7fe508d3 Binary files /dev/null and b/doc/reference/ide/pic/registers.png differ diff --git a/doc/reference/ide/pic/terminal.png b/doc/reference/ide/pic/terminal.png new file mode 100644 index 000000000..8934c0619 Binary files /dev/null and b/doc/reference/ide/pic/terminal.png differ diff --git a/doc/reference/ide/pic/variables.png b/doc/reference/ide/pic/variables.png new file mode 100644 index 000000000..061314873 Binary files /dev/null and b/doc/reference/ide/pic/variables.png differ diff --git a/drivers/eth/fxmac/fxmac_phy.c b/drivers/eth/fxmac/fxmac_phy.c index 2b424081e..178f6248d 100644 --- a/drivers/eth/fxmac/fxmac_phy.c +++ b/drivers/eth/fxmac/fxmac_phy.c @@ -63,7 +63,7 @@ static FError FXmacDetect(FXmac *instance_p, u32 *phy_addr_p) ret = FXmacPhyRead(instance_p, phy_addr, PHY_IDENTIFIER_1_REG, &phy_id1_reg); ret |= FXmacPhyRead(instance_p, phy_addr, PHY_IDENTIFIER_2_REG, &phy_id2_reg); FXMAC_INFO("Phy id1 reg is 0x%x, Phy id2 reg is 0x%x", phy_id1_reg , phy_id2_reg); - if ((ret == FT_SUCCESS) && (phy_id2_reg != 0) && (phy_id1_reg != 0xffff) && (phy_id1_reg != 0xffff)) + if ((ret == FT_SUCCESS) && (phy_id2_reg != 0) && (phy_id2_reg != 0xffff) && (phy_id1_reg != 0xffff)) { *phy_addr_p = phy_addr; phy_addr_b = phy_addr; @@ -73,7 +73,7 @@ static FError FXmacDetect(FXmac *instance_p, u32 *phy_addr_p) } } - return FT_SUCCESS; + return FXMAC_PHY_IS_NOT_FOUND; } /** diff --git a/drivers/spi/fspim/fspim.h b/drivers/spi/fspim/fspim.h index e6368b615..dbf98a72f 100644 --- a/drivers/spi/fspim/fspim.h +++ b/drivers/spi/fspim/fspim.h @@ -180,7 +180,7 @@ const FSpimConfig *FSpimLookupConfig(u32 instance_id); /* 完成FSPIM驱动实例的初始化,使之可以使用*/ FError FSpimCfgInitialize(FSpim *instance_p, const FSpimConfig *cofig_p); -/* 完成I2C驱动实例去使能,清零实例数据 */ +/* 完成FSPIM驱动实例去使能,清零实例数据 */ void FSpimDeInitialize(FSpim *instance_p); /* FSPIM临时修改参数操作 */ diff --git a/example/network/lwip_iperf/README.md b/example/network/lwip_iperf/README.md index 875f00b8e..5ec1a9e01 100644 --- a/example/network/lwip_iperf/README.md +++ b/example/network/lwip_iperf/README.md @@ -119,18 +119,35 @@ lwip iperfc ``` ![iperf_client_example_result](./fig/iperf_client_example.png) +![iperf_client_test_result](./fig/iperf_client_test.png) #### 2.4.2 网卡iperf server测试例程 (lwip_iperf_server_example.c) ``` lwip iperfs ``` ![iperf_server_example_result](./fig/iperf_server_example.png) +![iperf_server_test_result](./fig/iperf_server_test.png) ## 3. 如何解决问题 >主要记录使用例程中可能会遇到的问题,给出相应的解决方案
+- Q: 如何静态配置开发板的ip地址? +- A: ipv4下在board_mac_config静态变量中修改如下成员变量即可: + +``` + .ipaddr="192.168.4.10", + .gw="192.168.4.1", + .netmask="255.255.255.0", +``` + +- A: ipv6下在board_mac_config静态变量中修改如下成员变量即可: + +``` + .mac_address={0x98, 0x0e, 0x24, 0x00, 0x11, 0x1}, +``` + ## 4. 修改历史记录 >记录例程的重大修改记录,标明修改发生的版本号
diff --git a/example/network/lwip_iperf/fig/iperf_client_test.png b/example/network/lwip_iperf/fig/iperf_client_test.png new file mode 100644 index 000000000..fd3b7ea03 Binary files /dev/null and b/example/network/lwip_iperf/fig/iperf_client_test.png differ diff --git a/example/network/lwip_iperf/fig/iperf_server_test.png b/example/network/lwip_iperf/fig/iperf_server_test.png new file mode 100644 index 000000000..442f65814 Binary files /dev/null and b/example/network/lwip_iperf/fig/iperf_server_test.png differ diff --git a/example/network/lwip_iperf/src/lwip_iperf_client_example.c b/example/network/lwip_iperf/src/lwip_iperf_client_example.c index 955414b18..a79424d39 100644 --- a/example/network/lwip_iperf/src/lwip_iperf_client_example.c +++ b/example/network/lwip_iperf/src/lwip_iperf_client_example.c @@ -13,7 +13,7 @@ * * FilePath: lwip_iperf_client_example.c * Created Date: 2023-10-18 14:30:04 - * Last Modified: 2024-03-11 11:30:12 + * Last Modified: 2024-03-19 11:00:11 * Description: This file is for lwip iperf client example function implementation. * * Modify History: diff --git a/example/network/lwip_iperf/src/lwip_iperf_server_example.c b/example/network/lwip_iperf/src/lwip_iperf_server_example.c index 19209b8bf..8cf431250 100644 --- a/example/network/lwip_iperf/src/lwip_iperf_server_example.c +++ b/example/network/lwip_iperf/src/lwip_iperf_server_example.c @@ -13,7 +13,7 @@ * * FilePath: lwip_iperf_server_example.c * Created Date: 2023-10-16 15:16:18 - * Last Modified: 2024-03-11 11:36:39 + * Last Modified: 2024-03-19 11:00:11 * Description: This file is for lwip iperf server example function implementation. * * Modify History: diff --git a/example/network/lwip_jumbo/README.md b/example/network/lwip_jumbo/README.md index 4cea42cc6..50c9a5d0d 100644 --- a/example/network/lwip_jumbo/README.md +++ b/example/network/lwip_jumbo/README.md @@ -25,7 +25,8 @@ >哪些硬件平台是支持的,需要哪些外设,例程与开发板哪些IO口相关等(建议附录开发板照片,展示哪些IO口被引出)
- 请将主机与开发板上的网口直连,排除链路上其他节点的干扰 -- 需要手动配置主机网卡,在设备管理器中将主机网卡的巨帧模式打开,使其具备发送接收巨帧的能力 +- 需要手动配置主机网卡,在设备管理器中将主机网卡的巨帧模式打开,使其具备发送接收巨帧的能力,参考下图: +![jumbo_en_hsot](fig/jumbo_en_host.png) ### 2.2 SDK配置方法 @@ -119,6 +120,32 @@ lwip jumbo >主要记录使用例程中可能会遇到的问题,给出相应的解决方案
+- Q: 如何静态配置开发板的ip地址? +- A: ipv4下在board_mac_config静态变量中修改如下成员变量即可: + +``` + .ipaddr="192.168.4.10", + .gw="192.168.4.1", + .netmask="255.255.255.0", +``` + +- A: ipv6下在board_mac_config静态变量中修改如下成员变量即可: + +``` + .mac_address={0x98, 0x0e, 0x24, 0x00, 0x11, 0x1}, +``` + +- Q: 巨帧模式开启后,主机端ping不通开发板? +- A: 可能有以下几个方面的原因 +1. 开发板与主机网口未进行直连,链路中间有路由器等设备。 +2. 主机网卡未开启巨帧模式,参考上面硬件配置方法章节进行配置。 +3. 需要手工调整开发板网卡的mtu大小,以适应网络传输路径上的mtu,保证主机和开发板的mtu一致。 +- 参考以下命令和图片进行网卡mtu调整: +``` +ifconfig mtu +``` +![mtu_set](fig/mtuset.png) + ## 4. 修改历史记录 >记录例程的重大修改记录,标明修改发生的版本号
\ No newline at end of file diff --git a/example/network/lwip_jumbo/fig/jumbo_en_host.png b/example/network/lwip_jumbo/fig/jumbo_en_host.png new file mode 100644 index 000000000..670a02655 Binary files /dev/null and b/example/network/lwip_jumbo/fig/jumbo_en_host.png differ diff --git a/example/network/lwip_jumbo/fig/mtuset.png b/example/network/lwip_jumbo/fig/mtuset.png new file mode 100644 index 000000000..838298aae Binary files /dev/null and b/example/network/lwip_jumbo/fig/mtuset.png differ diff --git a/example/network/lwip_jumbo/src/lwip_jumbo_example.c b/example/network/lwip_jumbo/src/lwip_jumbo_example.c index a217aa05b..e47bfe8f1 100644 --- a/example/network/lwip_jumbo/src/lwip_jumbo_example.c +++ b/example/network/lwip_jumbo/src/lwip_jumbo_example.c @@ -13,7 +13,7 @@ * * FilePath: lwip_jumbo_example.c * Created Date: 2023-11-08 16:05:47 - * Last Modified: 2024-03-11 11:38:44 + * Last Modified: 2024-03-19 11:00:22 * Description: This file is for lwip jumbo example function implementation. * * Modify History: diff --git a/example/network/lwip_multicast/README.md b/example/network/lwip_multicast/README.md index 8f9dd4dba..2eb4018de 100644 --- a/example/network/lwip_multicast/README.md +++ b/example/network/lwip_multicast/README.md @@ -112,12 +112,34 @@ lwip multicast ``` ![multicast_example_result](./fig/multicast_example_result.png) +![multicast_example_ping](./fig/multicast_ping.png) ## 3. 如何解决问题 >主要记录使用例程中可能会遇到的问题,给出相应的解决方案
+- Q: 如何静态配置开发板的ip地址? +- A: ipv4下在board_mac_config静态变量中修改如下成员变量即可: + +``` + .ipaddr="192.168.4.10", + .gw="192.168.4.1", + .netmask="255.255.255.0", +``` + +- A: ipv6下在board_mac_config静态变量中修改如下成员变量即可: + +``` + .mac_address={0x98, 0x0e, 0x24, 0x00, 0x11, 0x1}, +``` + +- Q: 如何静态配置例程中网卡要加入的组播地址? +- A: lwip_multicast_example.c中修改如下宏定义IGMP_MULTICAST_IP_ADDRESS即可: +``` + #define IGMP_MULTICAST_IP_ADDRESS "224.10.10.3" +``` + ## 4. 修改历史记录 >记录例程的重大修改记录,标明修改发生的版本号
\ No newline at end of file diff --git a/example/network/lwip_multicast/fig/multicast_ping.png b/example/network/lwip_multicast/fig/multicast_ping.png new file mode 100644 index 000000000..18ca6743f Binary files /dev/null and b/example/network/lwip_multicast/fig/multicast_ping.png differ diff --git a/example/network/lwip_multicast/src/lwip_multicast_example.c b/example/network/lwip_multicast/src/lwip_multicast_example.c index 0f9a496a9..ccdc289db 100644 --- a/example/network/lwip_multicast/src/lwip_multicast_example.c +++ b/example/network/lwip_multicast/src/lwip_multicast_example.c @@ -13,7 +13,7 @@ * * FilePath: lwip_multicast_example.c * Created Date: 2023-10-26 11:30:40 - * Last Modified: 2024-03-11 11:41:02 + * Last Modified: 2024-03-19 11:00:35 * Description: This file is for lwip multicast example function implementation. * * Modify History: diff --git a/example/network/lwip_startup/README.md b/example/network/lwip_startup/README.md index f9e028fc5..d942db975 100644 --- a/example/network/lwip_startup/README.md +++ b/example/network/lwip_startup/README.md @@ -123,6 +123,7 @@ lwip ipv4 ``` ![ipv4_example_result](./fig/ipv4_example_result.png) +![ipv4_example_ping](./fig/ipv4_ping.png) #### 2.4.2 网卡ipv6模式初始化测试例程 (lwip_ipv6_example.c) @@ -131,6 +132,7 @@ lwip ipv6 ``` ![ipv6_example_result](./fig/ipv6_example_result.png) +![ipv6_example_ping](./fig/ipv6_ping.png) #### 2.4.3 网卡dhcp模式初始化测试例程 (lwip_dhcp_example.c) @@ -139,11 +141,27 @@ lwip dhcp ``` ![dhcp_example_result](./fig/dhcp_example_result.png) +![dhcp_example_ping](./fig/dhcp_ping.png) ## 3. 如何解决问题 >主要记录使用例程中可能会遇到的问题,给出相应的解决方案
+- Q: 如何静态配置开发板的ip地址? +- A: ipv4地址在board_mac_config静态变量中修改如下成员变量即可: + +``` + .ipaddr="192.168.4.10", + .gw="192.168.4.1", + .netmask="255.255.255.0", +``` + +- A: ipv6地址在board_mac_config静态变量中修改如下成员变量即可: + +``` + .mac_address={0x98, 0x0e, 0x24, 0x00, 0x11, 0x1}, +``` + ## 4. 修改历史记录 >记录例程的重大修改记录,标明修改发生的版本号
diff --git a/example/network/lwip_startup/fig/dhcp_ping.png b/example/network/lwip_startup/fig/dhcp_ping.png new file mode 100644 index 000000000..062a6114d Binary files /dev/null and b/example/network/lwip_startup/fig/dhcp_ping.png differ diff --git a/example/network/lwip_startup/fig/ipv4_ping.png b/example/network/lwip_startup/fig/ipv4_ping.png new file mode 100644 index 000000000..642d08426 Binary files /dev/null and b/example/network/lwip_startup/fig/ipv4_ping.png differ diff --git a/example/network/lwip_startup/fig/ipv6_ping.png b/example/network/lwip_startup/fig/ipv6_ping.png new file mode 100644 index 000000000..f29cc8ef0 Binary files /dev/null and b/example/network/lwip_startup/fig/ipv6_ping.png differ diff --git a/example/network/lwip_startup/src/lwip_dhcp_example.c b/example/network/lwip_startup/src/lwip_dhcp_example.c index cbb90ea49..d33c4ef0e 100644 --- a/example/network/lwip_startup/src/lwip_dhcp_example.c +++ b/example/network/lwip_startup/src/lwip_dhcp_example.c @@ -13,7 +13,7 @@ * * FilePath: lwip_dhcp.c * Created Date: 2023-09-28 09:49:27 - * Last Modified: 2024-03-11 11:42:50 + * Last Modified: 2024-03-19 11:01:50 * Description: This file is for lwip dhcp example function implementation. * * Modify History: diff --git a/example/network/lwip_startup/src/lwip_ipv4_example.c b/example/network/lwip_startup/src/lwip_ipv4_example.c index b796c4eef..e3c587a99 100644 --- a/example/network/lwip_startup/src/lwip_ipv4_example.c +++ b/example/network/lwip_startup/src/lwip_ipv4_example.c @@ -13,7 +13,7 @@ * * FilePath: lwip_ipv4_example.c * Created Date: 2023-09-20 11:29:05 - * Last Modified: 2024-03-11 11:43:37 + * Last Modified: 2024-03-19 11:01:50 * Description: This file is for lwip ipv4 example function implementation. * * Modify History: diff --git a/example/network/lwip_startup/src/lwip_ipv6_example.c b/example/network/lwip_startup/src/lwip_ipv6_example.c index 053fec1c0..12fde3f87 100644 --- a/example/network/lwip_startup/src/lwip_ipv6_example.c +++ b/example/network/lwip_startup/src/lwip_ipv6_example.c @@ -13,7 +13,7 @@ * * FilePath: lwip_ipv6.c * Created Date: 2023-09-28 09:49:14 - * Last Modified: 2024-03-11 11:44:10 + * Last Modified: 2024-03-19 11:01:50 * Description: This file is for lwip ipv6 example function implementation. * * Modify History: diff --git a/example/network/raw_api/tcp_client/README.md b/example/network/raw_api/tcp_client/README.md index 58c4099c0..4fc4286f5 100644 --- a/example/network/raw_api/tcp_client/README.md +++ b/example/network/raw_api/tcp_client/README.md @@ -4,7 +4,7 @@ > ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作`
` -本例程通过对接FGMAC驱动和LWIP网络协议栈,利用raw api,实现了下述功能, +本例程利用LWIP网络协议栈中的raw api实现了下述功能: - LWIP网络协议栈初始化 - 建立开发板到主机的tcp连接 @@ -39,7 +39,8 @@ DEMO开发板图片示例如下所示 本例程需要, -- 使能LWIP +- LWIP组件,依赖 USE_LWIP +- Letter Shell组件,依赖 USE_LETTER_SHELL 对应的配置项是, @@ -48,15 +49,13 @@ DEMO开发板图片示例如下所示 - 本例子已经提供好具体的编译指令,以下进行介绍: - - make 将目录下的工程进行编译 - - make clean 将目录下的工程进行清理 - - make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - - make list_kconfig 将支持的配置文件罗列出来 - - make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch32_demo_baremetal 预设32bit e2000d demo板下的配置加载至工程中 - - make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_baremetal 预设64bit e2000d demo板下的配置加载至工程中 - - make menuconfig 配置目录下的参数变量 - - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - + 1. make 将目录下的工程进行编译 + 2. make clean 将目录下的工程进行清理 + 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 + 4. make list_kconfig 当前工程支持哪些配置文件 + 5. make load_kconfig LOAD_CONFIG_NAME=`` 将预设配置加载至工程中 + 6. make menuconfig 配置目录下的参数变量 + 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - 具体使用方法为: - 在当前目录下 @@ -74,7 +73,7 @@ DEMO开发板图片示例如下所示 - 选择目标平台 ``` -make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_baremetal +make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_tcpclient ``` - 选择例程需要的配置 @@ -175,22 +174,18 @@ $ tcpclientclose - Q: 如果先在开发板输入tcp_client,再开启服务器端是否可行? - A: 不可行!此时开发板程序会自我终止tcp连接,释放tcp相关资源。如果想重新连接服务器,需要先打开tcp服务器,再在开发板中输入tcp_client命令,确保例程正常运行; -- Q: 为什么ping包的延时会在2ms左右? -- A: 因为mac ping指令中,读取外部网络包的执行周期为2ms,可以在LwipEchoPing函数中自行修改; -- Q: 如何指定开发板的ip地址? -- A: ipv4下在LwipEchoInit函数中修改如下变量即可: +- Q: 如何配置tcp client的local ip与local port以及remote ip 与remote port? +- A: 在tcp_client.c中修改如下变量tmp_ip以及修改宏定义TCP_CLIENT_PORT,TCP_SERVER_PORT即可: ``` - IP4_ADDR(&ipaddr, 192, 168, 4, 10); - IP4_ADDR(&netmask, 255, 255, 255, 0); - IP4_ADDR(&gw, 192, 168, 4, 1); -``` + #define TCP_CLIENT_PORT 0 + #define TCP_SERVER_PORT 5001 + ...... -- A: 从ipv6的probe和ping包的ip地址来看,ipv6的地址是根据其mac地址来设置的,在LwipEchoInit函数中修改如下变量即可: - -``` - unsigned char mac_ethernet_address[] = - {0x00, 0x04, 0x66, 0x00, 0x11, 0x22}; + IP_ADDR4(&tmp_ip, 192, 168, 4, 10); + tcp_bind(client_pcb, &tmp_ip, TCP_CLIENT_PORT); + IP_ADDR4(&tmp_ip, 192, 168, 4, 50); + ret = tcp_connect(client_pcb, &tmp_ip, TCP_SERVER_PORT, client_connected); ``` ## 4. 修改历史记录 diff --git a/example/network/raw_api/tcp_server/README.md b/example/network/raw_api/tcp_server/README.md index 9dbe27c83..7130a165d 100644 --- a/example/network/raw_api/tcp_server/README.md +++ b/example/network/raw_api/tcp_server/README.md @@ -4,7 +4,7 @@ > ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作`
` -本例程通过对接FGMAC驱动和LWIP网络协议栈,利用raw api,实现了下述功能, +本例程利用LWIP网络协议栈中的raw api实现了下述功能: - LWIP网络协议栈初始化 - 建立主机到开发板的tcp连接 @@ -39,7 +39,8 @@ DEMO开发板图片示例如下所示 本例程需要, -- 使能LWIP +- LWIP组件,依赖 USE_LWIP +- Letter Shell组件,依赖 USE_LETTER_SHELL 对应的配置项是, @@ -48,15 +49,13 @@ DEMO开发板图片示例如下所示 - 本例子已经提供好具体的编译指令,以下进行介绍: - - make 将目录下的工程进行编译 - - make clean 将目录下的工程进行清理 - - make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - - make list_kconfig 将支持的配置文件罗列出来 - - make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch32_demo_baremetal 预设32bit e2000d demo板下的配置加载至工程中 - - make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_baremetal 预设64bit e2000d demo板下的配置加载至工程中 - - make menuconfig 配置目录下的参数变量 - - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - + 1. make 将目录下的工程进行编译 + 2. make clean 将目录下的工程进行清理 + 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 + 4. make list_kconfig 当前工程支持哪些配置文件 + 5. make load_kconfig LOAD_CONFIG_NAME=`` 将预设配置加载至工程中 + 6. make menuconfig 配置目录下的参数变量 + 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - 具体使用方法为: - 在当前目录下 @@ -74,7 +73,7 @@ DEMO开发板图片示例如下所示 - 选择目标平台 ``` -make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_baremetal +make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_tcpserver ``` - 选择例程需要的配置 @@ -162,28 +161,18 @@ nc 192.168.4.10 5003 > ``主要记录使用例程中可能会遇到的问题,给出相应的解决方案`
` -- Q: 为什么ping包的延时会在2ms左右? -- A: 因为mac ping指令中,读取外部网络包的执行周期为2ms,可以在LwipEchoPing函数中自行修改; -- Q: 如何指定开发板的ip地址? -- A: ipv4下在LwipEchoInit函数中修改如下变量即可: - -``` - IP4_ADDR(&ipaddr, 192, 168, 4, 10); - IP4_ADDR(&netmask, 255, 255, 255, 0); - IP4_ADDR(&gw, 192, 168, 4, 1); -``` +- Q: 为何开发板上收到数据与主机发送数据不一致? +- A: 路由器具有upnp服务,会向网络中的节点发送广播数据包,而这个数据包被开发板收到,并且打印在了开发板上,可以尝试将路由器的upnp服务关闭 + ![tcpserver](./fig/tcp_server.png) -- A: 从ipv6的probe和ping包的ip地址来看,ipv6的地址是根据其mac地址来设置的,在LwipEchoInit函数中修改如下变量即可: +- Q: 如何配置tcp server的ip地址以及监听端口? +- A: 在tcp_server.c中修改如下变量local_ip以及5003即可: ``` - unsigned char mac_ethernet_address[] = - {0x00, 0x04, 0x66, 0x00, 0x11, 0x22}; + IP_ADDR4(&local_ip, 192, 168, 4, 10); + ret = tcp_bind(pcb, &local_ip, 5003); ``` -- Q: 为何开发板上收到数据与主机发送数据不一致? -- A: 路由器具有upnp服务,会向网络中的节点发送广播数据包,而这个数据包被开发板收到,并且打印在了开发板上,可以尝试将路由器的upnp服务关闭 - ![tcpserver](./fig/tcp_server.png) - ## 4. 修改历史记录 > ``记录例程的重大修改记录,标明修改发生的版本号 `
` diff --git a/example/network/raw_api/udp_client/README.md b/example/network/raw_api/udp_client/README.md index 9a606f3df..d8ca3e590 100644 --- a/example/network/raw_api/udp_client/README.md +++ b/example/network/raw_api/udp_client/README.md @@ -4,7 +4,7 @@ > ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作`
` -本例程通过对接FGMAC驱动和LWIP网络协议栈,利用raw api,实现了下述功能, +本例程利用LWIP网络协议栈中的raw api实现了下述功能: - LWIP网络协议栈初始化 - 开发板向网络主机发送udp数据包 @@ -38,7 +38,8 @@ DEMO开发板图片示例如下所示 本例程需要, -- 使能LWIP +- LWIP组件,依赖 USE_LWIP +- Letter Shell组件,依赖 USE_LETTER_SHELL 对应的配置项是, @@ -47,14 +48,13 @@ DEMO开发板图片示例如下所示 - 本例子已经提供好具体的编译指令,以下进行介绍: - - make 将目录下的工程进行编译 - - make clean 将目录下的工程进行清理 - - make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - - make list_kconfig 将支持的配置文件罗列出来 - - make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch32_demo_baremetal 预设32bit e2000d demo板下的配置加载至工程中 - - make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_baremetal 预设64bit e2000d demo板下的配置加载至工程中 - - make menuconfig 配置目录下的参数变量 - - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 + 1. make 将目录下的工程进行编译 + 2. make clean 将目录下的工程进行清理 + 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 + 4. make list_kconfig 当前工程支持哪些配置文件 + 5. make load_kconfig LOAD_CONFIG_NAME=`` 将预设配置加载至工程中 + 6. make menuconfig 配置目录下的参数变量 + 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - 具体使用方法为: - 在当前目录下 @@ -72,7 +72,7 @@ DEMO开发板图片示例如下所示 - 选择目标平台 ``` -make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_baremetal +make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_udpclient ``` - 选择例程需要的配置 @@ -163,22 +163,18 @@ $ udpclient > ``主要记录使用例程中可能会遇到的问题,给出相应的解决方案`
` -- Q: 为什么ping包的延时会在2ms左右? -- A: 因为mac ping指令中,读取外部网络包的执行周期为2ms,可以在LwipEchoPing函数中自行修改; -- Q: 如何指定开发板的ip地址? -- A: ipv4下在LwipEchoInit函数中修改如下变量即可: -``` - IP4_ADDR(&ipaddr, 192, 168, 4, 10); - IP4_ADDR(&netmask, 255, 255, 255, 0); - IP4_ADDR(&gw, 192, 168, 4, 1); -``` - -- A: 从ipv6的probe和ping包的ip地址来看,ipv6的地址是根据其mac地址来设置的,在LwipEchoInit函数中修改如下变量即可: +- Q: 如何配置udp client的local ip与local port以及remote ip 与remote port? +- A: 在udp_client.c中修改如下变量ipaddr以及修改宏定义UDP_ECHO_PORT即可: ``` - unsigned char mac_ethernet_address[] = - {0x00, 0x04, 0x66, 0x00, 0x11, 0x22}; + #define UDP_ECHO_PORT 5001 + ...... + + IP_ADDR4(&ipaddr, 192, 168, 4, 10); + udp_bind(client_pcb, &ipaddr, UDP_ECHO_PORT); + IP_ADDR4(&ipaddr, 192, 168, 4, 50); + udp_connect(client_pcb, &ipaddr, 5002); ``` ## 4. 修改历史记录 diff --git a/example/network/raw_api/udp_client/src/udp_client.c b/example/network/raw_api/udp_client/src/udp_client.c index 5a73e6627..da464534a 100644 --- a/example/network/raw_api/udp_client/src/udp_client.c +++ b/example/network/raw_api/udp_client/src/udp_client.c @@ -50,9 +50,9 @@ void UdpClient(void) /*bind the local port and local ip */ ip_addr_t ipaddr; - IP_ADDR4(&ipaddr, 192, 168, 4, 10); + IP_ADDR4(&ipaddr, 192, 168, 4, 10); udp_bind(client_pcb, &ipaddr, UDP_ECHO_PORT); - IP_ADDR4(&ipaddr, 192, 168, 4, 50); + IP_ADDR4(&ipaddr, 192, 168, 4, 50); udp_connect(client_pcb, &ipaddr, 5002); /*applying for memory resources*/ diff --git a/example/network/raw_api/udp_server/README.md b/example/network/raw_api/udp_server/README.md index a85cab608..159424cbd 100644 --- a/example/network/raw_api/udp_server/README.md +++ b/example/network/raw_api/udp_server/README.md @@ -4,7 +4,7 @@ > ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作`
` -本例程通过对接FGMAC驱动和LWIP网络协议栈,利用raw api,实现了下述功能, +本例程利用LWIP网络协议栈中的raw api实现了下述功能: - LWIP网络协议栈初始化 - 开发板上建立一个UDP服务端,监听网络中的udp数据 @@ -37,9 +37,9 @@ DEMO开发板图片示例如下所示 > ``依赖哪些驱动、库和第三方组件,如何完成配置(列出需要使能的关键配置项)`
` -本例程需要, - -- 使能LWIP +本例程需要: +- LWIP组件,依赖 USE_LWIP +- Letter Shell组件,依赖 USE_LETTER_SHELL 对应的配置项是, @@ -48,14 +48,13 @@ DEMO开发板图片示例如下所示 - 本例子已经提供好具体的编译指令,以下进行介绍: - - make 将目录下的工程进行编译 - - make clean 将目录下的工程进行清理 - - make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 - - make list_kconfig 将支持的配置文件罗列出来 - - make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch32_demo_baremetal 预设32bit e2000d demo板下的配置加载至工程中 - - make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_baremetal 预设64bit e2000d demo板下的配置加载至工程中 - - make menuconfig 配置目录下的参数变量 - - make backup_kconfig 将目录下的sdkconfig 备份到./configs下 + 1. make 将目录下的工程进行编译 + 2. make clean 将目录下的工程进行清理 + 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 + 4. make list_kconfig 当前工程支持哪些配置文件 + 5. make load_kconfig LOAD_CONFIG_NAME=`` 将预设配置加载至工程中 + 6. make menuconfig 配置目录下的参数变量 + 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - 具体使用方法为: - 在当前目录下 @@ -73,7 +72,7 @@ DEMO开发板图片示例如下所示 - 选择目标平台 ``` -make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_baremetal +make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_udpserver ``` - 选择例程需要的配置 @@ -157,30 +156,23 @@ nc -u 192.168.4.10 5001 ![udpserver](./fig/udp_server.png) - 主机端实验输出结果 - ![host-udp](./fig/host_udp.png) +![host-udp](./fig/host_udp.png) ## 3. 如何解决问题 > ``主要记录使用例程中可能会遇到的问题,给出相应的解决方案`
` -- Q: 为什么ping包的延时会在2ms左右? -- A: 因为mac ping指令中,读取外部网络包的执行周期为2ms,可以在LwipEchoPing函数中自行修改; -- Q: 如何指定开发板的ip地址? -- A: ipv4下在LwipEchoInit函数中修改如下变量即可: - -``` - IP4_ADDR(&ipaddr, 192, 168, 4, 10); - IP4_ADDR(&netmask, 255, 255, 255, 0); - IP4_ADDR(&gw, 192, 168, 4, 1); -``` - -- A: 从ipv6的probe和ping包的ip地址来看,ipv6的地址是根据其mac地址来设置的,在LwipEchoInit函数中修改如下变量即可: +- Q: 如何配置udp server的ip地址以及监听端口? +- A: 在udp_server.c中修改如下变量ipaddr以及修改宏定义UDP_ECHO_PORT即可: ``` - unsigned char mac_ethernet_address[] = - {0x00, 0x04, 0x66, 0x00, 0x11, 0x22}; + #define UDP_ECHO_PORT 5001 + ...... + + ip_addr_t ipaddr; + IP_ADDR4(&ipaddr, 192, 168, 4, 10); + udp_bind(server_pcb, &ipaddr, UDP_ECHO_PORT); ``` - ## 4. 修改历史记录 > ``记录例程的重大修改记录,标明修改发生的版本号 `
` diff --git a/example/network/raw_api/udp_server/src/udp_server.c b/example/network/raw_api/udp_server/src/udp_server.c index 259d3b3f0..ab11e91cf 100644 --- a/example/network/raw_api/udp_server/src/udp_server.c +++ b/example/network/raw_api/udp_server/src/udp_server.c @@ -67,7 +67,7 @@ void UdpServerInit(void) } /* 绑定端口号 */ ip_addr_t ipaddr; - IP_ADDR4(&ipaddr, 192, 168, 4, 10); + IP_ADDR4(&ipaddr, 192, 168, 4, 10); udp_bind(server_pcb, &ipaddr, UDP_ECHO_PORT); /* 注册接收数据回调函数 */ diff --git a/example/peripherals/dma/ddma/configs/e2000d_aarch32_demo_ddma_spim.config b/example/peripherals/dma/ddma/configs/e2000d_aarch32_demo_ddma_spim.config index e120af87f..1c71b647e 100755 --- a/example/peripherals/dma/ddma/configs/e2000d_aarch32_demo_ddma_spim.config +++ b/example/peripherals/dma/ddma/configs/e2000d_aarch32_demo_ddma_spim.config @@ -51,6 +51,7 @@ CONFIG_TARGET_E2000D=y # CONFIG_TARGET_E2000S is not set # CONFIG_TARGET_FT2004 is not set # CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_PD2308 is not set CONFIG_SOC_NAME="e2000" CONFIG_TARGET_TYPE_NAME="d" CONFIG_SOC_CORE_NUM=2 @@ -59,7 +60,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_TARGET_E2000=y -# CONFIG_USE_SPINLOCK is not set CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set @@ -165,6 +165,7 @@ CONFIG_ENABLE_FSATA=y # CONFIG_USE_MEDIA is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set # end of Drivers configuration # diff --git a/example/peripherals/dma/ddma/configs/e2000d_aarch64_demo_ddma_spim.config b/example/peripherals/dma/ddma/configs/e2000d_aarch64_demo_ddma_spim.config index 0852ffe88..87e97151c 100755 --- a/example/peripherals/dma/ddma/configs/e2000d_aarch64_demo_ddma_spim.config +++ b/example/peripherals/dma/ddma/configs/e2000d_aarch64_demo_ddma_spim.config @@ -45,6 +45,7 @@ CONFIG_TARGET_E2000D=y # CONFIG_TARGET_E2000S is not set # CONFIG_TARGET_FT2004 is not set # CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_PD2308 is not set CONFIG_SOC_NAME="e2000" CONFIG_TARGET_TYPE_NAME="d" CONFIG_SOC_CORE_NUM=2 @@ -53,7 +54,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_TARGET_E2000=y -# CONFIG_USE_SPINLOCK is not set CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set @@ -159,6 +159,7 @@ CONFIG_ENABLE_FSATA=y # CONFIG_USE_MEDIA is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set # end of Drivers configuration # diff --git a/example/peripherals/dma/ddma/configs/e2000q_aarch32_demo_ddma_spim.config b/example/peripherals/dma/ddma/configs/e2000q_aarch32_demo_ddma_spim.config index 3109da557..564631a15 100755 --- a/example/peripherals/dma/ddma/configs/e2000q_aarch32_demo_ddma_spim.config +++ b/example/peripherals/dma/ddma/configs/e2000q_aarch32_demo_ddma_spim.config @@ -51,6 +51,7 @@ CONFIG_TARGET_E2000Q=y # CONFIG_TARGET_E2000S is not set # CONFIG_TARGET_FT2004 is not set # CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_PD2308 is not set CONFIG_SOC_NAME="e2000" CONFIG_TARGET_TYPE_NAME="q" CONFIG_SOC_CORE_NUM=4 @@ -59,7 +60,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_TARGET_E2000=y -# CONFIG_USE_SPINLOCK is not set CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set @@ -164,6 +164,7 @@ CONFIG_ENABLE_FSATA=y # CONFIG_USE_MEDIA is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set # end of Drivers configuration # diff --git a/example/peripherals/dma/ddma/configs/e2000q_aarch64_demo_ddma_spim.config b/example/peripherals/dma/ddma/configs/e2000q_aarch64_demo_ddma_spim.config index 23bb0ccca..f3c550786 100755 --- a/example/peripherals/dma/ddma/configs/e2000q_aarch64_demo_ddma_spim.config +++ b/example/peripherals/dma/ddma/configs/e2000q_aarch64_demo_ddma_spim.config @@ -45,6 +45,7 @@ CONFIG_TARGET_E2000Q=y # CONFIG_TARGET_E2000S is not set # CONFIG_TARGET_FT2004 is not set # CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_PD2308 is not set CONFIG_SOC_NAME="e2000" CONFIG_TARGET_TYPE_NAME="q" CONFIG_SOC_CORE_NUM=4 @@ -53,7 +54,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_TARGET_E2000=y -# CONFIG_USE_SPINLOCK is not set CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set @@ -158,6 +158,7 @@ CONFIG_ENABLE_FSATA=y # CONFIG_USE_MEDIA is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set # end of Drivers configuration # diff --git a/example/peripherals/dma/ddma/configs/phytiumpi_aarch32_firefly_ddma_spim.config b/example/peripherals/dma/ddma/configs/phytiumpi_aarch32_firefly_ddma_spim.config index 4d3d2e6b7..37043004c 100755 --- a/example/peripherals/dma/ddma/configs/phytiumpi_aarch32_firefly_ddma_spim.config +++ b/example/peripherals/dma/ddma/configs/phytiumpi_aarch32_firefly_ddma_spim.config @@ -51,6 +51,7 @@ CONFIG_TARGET_PHYTIUMPI=y # CONFIG_TARGET_E2000S is not set # CONFIG_TARGET_FT2004 is not set # CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_PD2308 is not set CONFIG_SOC_NAME="phytiumpi" CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 @@ -58,7 +59,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_TARGET_E2000=y -# CONFIG_USE_SPINLOCK is not set CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set @@ -163,6 +163,7 @@ CONFIG_ENABLE_FSATA=y # CONFIG_USE_MEDIA is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set # end of Drivers configuration # diff --git a/example/peripherals/dma/ddma/configs/phytiumpi_aarch64_firefly_ddma_spim.config b/example/peripherals/dma/ddma/configs/phytiumpi_aarch64_firefly_ddma_spim.config index 8f0896a14..82efbcdac 100755 --- a/example/peripherals/dma/ddma/configs/phytiumpi_aarch64_firefly_ddma_spim.config +++ b/example/peripherals/dma/ddma/configs/phytiumpi_aarch64_firefly_ddma_spim.config @@ -45,6 +45,7 @@ CONFIG_TARGET_PHYTIUMPI=y # CONFIG_TARGET_E2000S is not set # CONFIG_TARGET_FT2004 is not set # CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_PD2308 is not set CONFIG_SOC_NAME="phytiumpi" CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 @@ -52,7 +53,6 @@ CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_TARGET_E2000=y -# CONFIG_USE_SPINLOCK is not set CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set @@ -157,6 +157,7 @@ CONFIG_ENABLE_FSATA=y # CONFIG_USE_MEDIA is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set # end of Drivers configuration # diff --git a/example/peripherals/dma/ddma/inc/ddma_spim_lookback_example.h b/example/peripherals/dma/ddma/inc/ddma_spim_lookback_example.h index d46789eee..e9ee0aada 100755 --- a/example/peripherals/dma/ddma/inc/ddma_spim_lookback_example.h +++ b/example/peripherals/dma/ddma/inc/ddma_spim_lookback_example.h @@ -82,7 +82,7 @@ extern "C" #define FSPIM_BIT_16_DISABLE FALSE /*spim test mode enable or disable*/ -#define SPIM_TEST_MODE_ENABLE FALSE +#define SPIM_TEST_MODE_ENABLE TRUE enum { diff --git a/example/peripherals/dma/ddma/sdkconfig b/example/peripherals/dma/ddma/sdkconfig index e120af87f..82efbcdac 100755 --- a/example/peripherals/dma/ddma/sdkconfig +++ b/example/peripherals/dma/ddma/sdkconfig @@ -9,8 +9,8 @@ CONFIG_ARCH_NAME="armv8" # # Arm architecture configuration # -# CONFIG_ARCH_ARMV8_AARCH64 is not set -CONFIG_ARCH_ARMV8_AARCH32=y +CONFIG_ARCH_ARMV8_AARCH64=y +# CONFIG_ARCH_ARMV8_AARCH32 is not set # # Compiler configuration @@ -18,48 +18,41 @@ CONFIG_ARCH_ARMV8_AARCH32=y CONFIG_ARM_GCC_SELECT=y # CONFIG_ARM_CLANG_SELECT is not set CONFIG_TOOLCHAIN_NAME="gcc" -CONFIG_TARGET_ARMV8_AARCH32=y -CONFIG_ARCH_EXECUTION_STATE="aarch32" - -# -# Fpu configuration -# -CONFIG_CRYPTO_NEON_FP_ARMV8=y -# CONFIG_VFPV4 is not set -# CONFIG_VFPV4_D16 is not set -# CONFIG_VFPV3 is not set -# CONFIG_VFPV3_D16 is not set -CONFIG_ARM_MFPU="crypto-neon-fp-armv8" -CONFIG_MFLOAT_ABI_HARD=y -# CONFIG_MFLOAT_ABI_SOFTFP is not set -CONFIG_ARM_MFLOAT_ABI="hard" -# end of Fpu configuration +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_ARCH_EXECUTION_STATE="aarch64" +CONFIG_ARM_NEON=y +CONFIG_ARM_CRC=y +CONFIG_ARM_CRYPTO=y +CONFIG_ARM_FLOAT_POINT=y +# CONFIG_GCC_CODE_MODEL_TINY is not set +CONFIG_GCC_CODE_MODEL_SMALL=y +# CONFIG_GCC_CODE_MODEL_LARGE is not set # end of Compiler configuration CONFIG_USE_CACHE=y CONFIG_USE_MMU=y -CONFIG_USE_AARCH64_L1_TO_AARCH32=y +CONFIG_BOOT_WITH_FLUSH_CACHE=y +# CONFIG_MMU_DEBUG_PRINTS is not set # end of Arm architecture configuration # end of Arch configuration # # Soc configuration # -# CONFIG_TARGET_PHYTIUMPI is not set +CONFIG_TARGET_PHYTIUMPI=y # CONFIG_TARGET_E2000Q is not set -CONFIG_TARGET_E2000D=y +# CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set # CONFIG_TARGET_FT2004 is not set # CONFIG_TARGET_D2000 is not set -CONFIG_SOC_NAME="e2000" -CONFIG_TARGET_TYPE_NAME="d" -CONFIG_SOC_CORE_NUM=2 +# CONFIG_TARGET_PD2308 is not set +CONFIG_SOC_NAME="phytiumpi" +CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_TARGET_E2000=y -# CONFIG_USE_SPINLOCK is not set CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set @@ -68,22 +61,21 @@ CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # # Board Configuration # -CONFIG_E2000D_DEMO_BOARD=y -CONFIG_BOARD_NAME="demo" - -# -# IO mux configuration when board start up -# +CONFIG_BOARD_NAME="firefly" # CONFIG_USE_SPI_IOPAD is not set # CONFIG_USE_GPIO_IOPAD is not set # CONFIG_USE_CAN_IOPAD is not set # CONFIG_USE_QSPI_IOPAD is not set # CONFIG_USE_PWM_IOPAD is not set -# CONFIG_USE_ADC_IOPAD is not set # CONFIG_USE_MIO_IOPAD is not set # CONFIG_USE_TACHO_IOPAD is not set # CONFIG_USE_UART_IOPAD is not set # CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_FIREFLY_DEMO_BOARD=y + +# +# IO mux configuration when board start up +# # end of IO mux configuration when board start up # CONFIG_CUS_DEMO_BOARD is not set @@ -165,6 +157,7 @@ CONFIG_ENABLE_FSATA=y # CONFIG_USE_MEDIA is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set # end of Drivers configuration # @@ -246,11 +239,6 @@ CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0x80100000 CONFIG_IMAGE_MAX_LENGTH=0x1000000 CONFIG_HEAP_SIZE=1 -CONFIG_SVC_STACK_SIZE=0x1000 -CONFIG_SYS_STACK_SIZE=0x1000 -CONFIG_IRQ_STACK_SIZE=0x1000 -CONFIG_ABORT_STACK_SIZE=0x1000 -CONFIG_FIQ_STACK_SIZE=0x1000 -CONFIG_UNDEF_STACK_SIZE=0x1000 +CONFIG_STACK_SIZE=0x400 # end of Linker Options # end of Build setup diff --git a/example/peripherals/dma/ddma/sdkconfig.h b/example/peripherals/dma/ddma/sdkconfig.h index 2fc392830..727e4e728 100755 --- a/example/peripherals/dma/ddma/sdkconfig.h +++ b/example/peripherals/dma/ddma/sdkconfig.h @@ -10,53 +10,47 @@ /* Arm architecture configuration */ -/* CONFIG_ARCH_ARMV8_AARCH64 is not set */ -#define CONFIG_ARCH_ARMV8_AARCH32 +#define CONFIG_ARCH_ARMV8_AARCH64 +/* CONFIG_ARCH_ARMV8_AARCH32 is not set */ /* Compiler configuration */ #define CONFIG_ARM_GCC_SELECT /* CONFIG_ARM_CLANG_SELECT is not set */ #define CONFIG_TOOLCHAIN_NAME "gcc" -#define CONFIG_TARGET_ARMV8_AARCH32 -#define CONFIG_ARCH_EXECUTION_STATE "aarch32" - -/* Fpu configuration */ - -#define CONFIG_CRYPTO_NEON_FP_ARMV8 -/* CONFIG_VFPV4 is not set */ -/* CONFIG_VFPV4_D16 is not set */ -/* CONFIG_VFPV3 is not set */ -/* CONFIG_VFPV3_D16 is not set */ -#define CONFIG_ARM_MFPU "crypto-neon-fp-armv8" -#define CONFIG_MFLOAT_ABI_HARD -/* CONFIG_MFLOAT_ABI_SOFTFP is not set */ -#define CONFIG_ARM_MFLOAT_ABI "hard" -/* end of Fpu configuration */ +#define CONFIG_TARGET_ARMV8_AARCH64 +#define CONFIG_ARCH_EXECUTION_STATE "aarch64" +#define CONFIG_ARM_NEON +#define CONFIG_ARM_CRC +#define CONFIG_ARM_CRYPTO +#define CONFIG_ARM_FLOAT_POINT +/* CONFIG_GCC_CODE_MODEL_TINY is not set */ +#define CONFIG_GCC_CODE_MODEL_SMALL +/* CONFIG_GCC_CODE_MODEL_LARGE is not set */ /* end of Compiler configuration */ #define CONFIG_USE_CACHE #define CONFIG_USE_MMU -#define CONFIG_USE_AARCH64_L1_TO_AARCH32 +#define CONFIG_BOOT_WITH_FLUSH_CACHE +/* CONFIG_MMU_DEBUG_PRINTS is not set */ /* end of Arm architecture configuration */ /* end of Arch configuration */ /* Soc configuration */ -/* CONFIG_TARGET_PHYTIUMPI is not set */ +#define CONFIG_TARGET_PHYTIUMPI /* CONFIG_TARGET_E2000Q is not set */ -#define CONFIG_TARGET_E2000D +/* CONFIG_TARGET_E2000D is not set */ /* CONFIG_TARGET_E2000S is not set */ /* CONFIG_TARGET_FT2004 is not set */ /* CONFIG_TARGET_D2000 is not set */ -#define CONFIG_SOC_NAME "e2000" -#define CONFIG_TARGET_TYPE_NAME "d" -#define CONFIG_SOC_CORE_NUM 2 +/* CONFIG_TARGET_PD2308 is not set */ +#define CONFIG_SOC_NAME "phytiumpi" +#define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 #define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 #define CONFIG_TARGET_E2000 -/* CONFIG_USE_SPINLOCK is not set */ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ @@ -64,21 +58,20 @@ /* Board Configuration */ -#define CONFIG_E2000D_DEMO_BOARD -#define CONFIG_BOARD_NAME "demo" - -/* IO mux configuration when board start up */ - +#define CONFIG_BOARD_NAME "firefly" /* CONFIG_USE_SPI_IOPAD is not set */ /* CONFIG_USE_GPIO_IOPAD is not set */ /* CONFIG_USE_CAN_IOPAD is not set */ /* CONFIG_USE_QSPI_IOPAD is not set */ /* CONFIG_USE_PWM_IOPAD is not set */ -/* CONFIG_USE_ADC_IOPAD is not set */ /* CONFIG_USE_MIO_IOPAD is not set */ /* CONFIG_USE_TACHO_IOPAD is not set */ /* CONFIG_USE_UART_IOPAD is not set */ /* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ +#define CONFIG_FIREFLY_DEMO_BOARD + +/* IO mux configuration when board start up */ + /* end of IO mux configuration when board start up */ /* CONFIG_CUS_DEMO_BOARD is not set */ @@ -151,6 +144,7 @@ /* CONFIG_USE_MEDIA is not set */ /* CONFIG_USE_SCMI_MHU is not set */ /* CONFIG_USE_I2S is not set */ +/* CONFIG_USE_I3C is not set */ /* end of Drivers configuration */ /* Third-party configuration */ @@ -223,12 +217,7 @@ #define CONFIG_IMAGE_LOAD_ADDRESS 0x80100000 #define CONFIG_IMAGE_MAX_LENGTH 0x1000000 #define CONFIG_HEAP_SIZE 1 -#define CONFIG_SVC_STACK_SIZE 0x1000 -#define CONFIG_SYS_STACK_SIZE 0x1000 -#define CONFIG_IRQ_STACK_SIZE 0x1000 -#define CONFIG_ABORT_STACK_SIZE 0x1000 -#define CONFIG_FIQ_STACK_SIZE 0x1000 -#define CONFIG_UNDEF_STACK_SIZE 0x1000 +#define CONFIG_STACK_SIZE 0x400 /* end of Linker Options */ /* end of Build setup */ diff --git a/example/peripherals/dma/gdma/README.md b/example/peripherals/dma/gdma/README.md index 37b5b75c1..f3de6b32c 100644 --- a/example/peripherals/dma/gdma/README.md +++ b/example/peripherals/dma/gdma/README.md @@ -4,9 +4,9 @@ >介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作
-本例程示范了example中的PIN功能使用: +本例程示范了example中的GDMA功能使用: -- 此例程已在E2000 TESTA 板上完成测试 +- 此例程已在E2000上完成测试 - E2000最多支持 16 个独立通道,共享一组对外总线,各通道支持独立时钟关断 - 每个通道读写支持 16 个 Outstanding,全局读写支持 16 个 Outstanding diff --git a/example/peripherals/generic_timer/src/physical_counter.c b/example/peripherals/generic_timer/src/physical_counter.c index 7a4069147..19878fae4 100644 --- a/example/peripherals/generic_timer/src/physical_counter.c +++ b/example/peripherals/generic_timer/src/physical_counter.c @@ -86,6 +86,7 @@ static void FGenericPhysicalTimerHandler(s32 vector, void *param) GenericTimerStop(GENERIC_TIMER_ID0); InterruptMask(GENERIC_TIMER_NS_IRQ_NUM); printf("\nphysical_counter example [failure].\r\n"); + goto next; } if(count == 20) @@ -123,7 +124,7 @@ void FGenericPhysicalTimerStart(void) GenericTimerSetTimerValue(GENERIC_TIMER_ID0, ticks_per_beat); GenericTimerInterruptEnable(GENERIC_TIMER_ID0); GenericTimerStart(GENERIC_TIMER_ID0); - + fsleep_millisec(500); } void FGenericPhysicalTimerStop(void) diff --git a/example/peripherals/generic_timer/src/virtual_counter.c b/example/peripherals/generic_timer/src/virtual_counter.c index 3ceb8148e..78b5002f4 100644 --- a/example/peripherals/generic_timer/src/virtual_counter.c +++ b/example/peripherals/generic_timer/src/virtual_counter.c @@ -84,6 +84,7 @@ static void FGenericVirtualTimerHandler(s32 vector, void *param) GenericTimerStop(GENERIC_TIMER_ID0); InterruptMask(GENERIC_TIMER_NS_IRQ_NUM); printf("\nvirtual_counter example [failure].\r\n"); + goto next; } if(count == 20) @@ -121,6 +122,7 @@ void FGenericVirtualTimerStart(void) GenericTimerSetTimerValue(GENERIC_TIMER_ID1, ticks_per_beat); GenericTimerInterruptEnable(GENERIC_TIMER_ID1); GenericTimerStart(GENERIC_TIMER_ID1); + fsleep_millisec(500); } void FGenericVirtualTimerStop(void) diff --git a/example/peripherals/gicv3/README.md b/example/peripherals/gicv3/README.md index 782b97f66..468bf8262 100644 --- a/example/peripherals/gicv3/README.md +++ b/example/peripherals/gicv3/README.md @@ -78,6 +78,7 @@ - make config_e2000q_aarch32 将预设32bit E2000Q 下的配置加载至主核与从核的工程中 - make config_phytiumpi_aarch64 将预设64bit phytiumpi 下的配置加载至主核与从核的工程中 - make config_phytiumpi_aarch32 将预设32bit phytiumpi 下的配置加载至主核与从核的工程中 +- make config_pd2308_aarch64 将预设64bit pd2308 下的配置加载至主核与从核的工程中 - make image 根据预设的参数,生成的ELF 执行文件拷贝至对应的TFTP目录下 - make menuconfig_master 配置主核中的相关参数 - make menuconfig_slave 配置从核中的相关参数 diff --git a/example/peripherals/i2c/src/i2c_ds1339_rtc_example.c b/example/peripherals/i2c/src/i2c_ds1339_rtc_example.c index e9f7d6ad0..9b1144010 100644 --- a/example/peripherals/i2c/src/i2c_ds1339_rtc_example.c +++ b/example/peripherals/i2c/src/i2c_ds1339_rtc_example.c @@ -337,4 +337,4 @@ err: } return 0; -} +} \ No newline at end of file diff --git a/example/peripherals/i2s/i2s_board/README.md b/example/peripherals/i2s/i2s_board/README.md index 5dbdb7c4f..7d55d4e6e 100644 --- a/example/peripherals/i2s/i2s_board/README.md +++ b/example/peripherals/i2s/i2s_board/README.md @@ -70,7 +70,7 @@ E2000Q对应的配置项是: - 在host侧完成配置 >配置成E2000D,对于其它平台,使用对应的默认配置,如E2000d 32位: ``` -$ make load_kconfigl=e2000d_aarch32_E2000D_demo_baremetal +$ make load_kconfigl=e2000d_aarch32_demo_i2s ``` - 在host侧完成构建 diff --git a/example/peripherals/i2s/i2s_dp/README.md b/example/peripherals/i2s/i2s_dp/README.md index ac34c98a5..4690a96ae 100644 --- a/example/peripherals/i2s/i2s_dp/README.md +++ b/example/peripherals/i2s/i2s_dp/README.md @@ -69,7 +69,7 @@ E2000Q对应的配置项是: - 在host侧完成配置 >配置成E2000D,对于其它平台,使用对应的默认配置,如E2000d 32位: ``` -$ make load_kconfigl=e2000d_aarch32_E2000D_demo_baremetal +$ make load_kconfigl=e2000d_aarch32_demo_i2s ``` - 在host侧完成构建 diff --git a/example/peripherals/iopad/main.c b/example/peripherals/iopad/main.c index e3ceb5b47..424e0f9bd 100644 --- a/example/peripherals/iopad/main.c +++ b/example/peripherals/iopad/main.c @@ -54,8 +54,8 @@ int main() LSUserShellLoop(); #else /* if shell command is not enabled, run example one by one */ - FPinGetCurrentSettingExample(); - FPinModifySettingExample(); + FIopadGetCurrentSettingExample(); + FIopadModifySettingExample(); #endif return 0; } \ No newline at end of file diff --git a/example/peripherals/iopad/src/iopad_get_config_example.c b/example/peripherals/iopad/src/iopad_get_config_example.c index 1faf2b8c5..3a1d96982 100644 --- a/example/peripherals/iopad/src/iopad_get_config_example.c +++ b/example/peripherals/iopad/src/iopad_get_config_example.c @@ -95,7 +95,12 @@ int FIopadGetCurrentSettingExample(void) int ret = 0; uintptr iopad_off; - FIOPadCfgInitialize(&iopad_ctrl, FIOPadLookupConfig(FIOPAD0_ID)); + ret = FIOPadCfgInitialize(&iopad_ctrl, FIOPadLookupConfig(FIOPAD0_ID)); + if (ret) + { + printf("IOPAD init fail.\n"); + goto exit; + } /* iopad is in continuous array */ for (iopad_off = beg_off; iopad_off <= end_off; iopad_off += sizeof(u32)) { @@ -107,14 +112,15 @@ int FIopadGetCurrentSettingExample(void) FIOPadDeInitialize(&iopad_ctrl); +exit: if (0 == ret) { - printf("%s@%d: get pin setting example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: IOPAD get pin setting example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: get pin setting example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); + printf("%s@%d: IOPAD get pin setting example [failure].\r\n", __func__, __LINE__); } - return 0; + return ret; } \ No newline at end of file diff --git a/example/peripherals/iopad/src/iopad_set_config_example.c b/example/peripherals/iopad/src/iopad_set_config_example.c index bd29f4857..b485c3301 100644 --- a/example/peripherals/iopad/src/iopad_set_config_example.c +++ b/example/peripherals/iopad/src/iopad_set_config_example.c @@ -109,7 +109,7 @@ int FIopadModifySettingExample(void) FPinGetIoPadSetting(FIOPAD_AW47_REG0_OFFSET); FIOPadDeInitialize(&iopad_ctrl); - printf("%s@%d: set pin setting example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: IOPAD set pin setting example [success].\r\n", __func__, __LINE__); printf("Failed if you cannot input char by uart-1 \r\n"); return 0; } \ No newline at end of file diff --git a/example/peripherals/ipc/semaphore/README.md b/example/peripherals/ipc/semaphore/README.md index 49f0cb403..e99fba5e3 100644 --- a/example/peripherals/ipc/semaphore/README.md +++ b/example/peripherals/ipc/semaphore/README.md @@ -1,4 +1,4 @@ -# Example Template +# Semaphore Example ## 1. 例程介绍 diff --git a/example/peripherals/pcie/inc/pcie_enumerate_example.h b/example/peripherals/pcie/inc/pcie_enumerate_example.h index d3e8e7643..1da73a146 100644 --- a/example/peripherals/pcie/inc/pcie_enumerate_example.h +++ b/example/peripherals/pcie/inc/pcie_enumerate_example.h @@ -13,7 +13,7 @@ * * FilePath: pcie_ep_rc_example.h * Created Date: 2023-08-03 13:28:35 - * Last Modified: 2023-08-08 09:00:19 + * Last Modified: 2024-03-20 19:14:19 * Description: This file is for ep and rc test configurations * * Modify History: @@ -111,6 +111,8 @@ struct FPcieCapabilityInfo #define PCIE_ECAM_INSTANCE_ID FPCIE_ECAM_INSTANCE0 #define PCIEC_RC_INSTANCE_ID FPCIEC_INSTANCE2_INDEX +/* entry function */ +int FPcieConfigReadExample(void); #ifdef __cplusplus } diff --git a/example/peripherals/pcie/main.c b/example/peripherals/pcie/main.c index f520d538e..68e3dce08 100644 --- a/example/peripherals/pcie/main.c +++ b/example/peripherals/pcie/main.c @@ -13,7 +13,7 @@ * * FilePath: main.c * Created Date: 2023-06-16 13:26:03 - * Last Modified: 2024-03-08 14:41:13 + * Last Modified: 2024-03-20 19:12:46 * Description: This file shows us the main source code of rc * * Modify History: @@ -32,7 +32,7 @@ #include "shell_port.h" #endif - +#include "pcie_enumerate_example.h" int main(void) { diff --git a/example/peripherals/pin/README.md b/example/peripherals/pin/README.md index 9473d0287..3644fc879 100644 --- a/example/peripherals/pin/README.md +++ b/example/peripherals/pin/README.md @@ -45,7 +45,7 @@ > ``哪些硬件平台是支持的,需要哪些外设,例程与开发板哪些IO口相关等(建议附录开发板照片,展示哪些IO口被引出)`
` ![pin_gpio_intr_board](./figs/pin_gpio_intr_board.png) -对于GPIO中断触发测试用例(pin_gpio_intr_example),利用杜邦线短接 GPIO 4-A-11与 GPIO 4-A-12 ,即将上图红色框内的第二排排从右往左数第 4 与第 5 个引脚用杜邦线短接。 +对于GPIO中断触发测试用例(pin_gpio_intr_example)和寄存器操作测试例程 (pin_gpio_low_level_example.c),利用杜邦线短接 GPIO 4-A-11与 GPIO 4-A-12 ,即将上图红色框内的第二排排从右往左数第 4 与第 5 个引脚用杜邦线短接。 ![pin_gpio_pwm_board](./figs/pin_gpio_pwm_board.png) 对于GPIO脉冲宽度调制测试(pin_gpio_pwm_example),需要将中断测试中使用到的两个引脚与逻辑分析仪连接。注意,逻辑分析仪需要接地(见红色杜邦线)。 diff --git a/example/peripherals/pin/src/pin_gpio_intr_example.c b/example/peripherals/pin/src/pin_gpio_intr_example.c index b03107e9d..5177ace6d 100644 --- a/example/peripherals/pin/src/pin_gpio_intr_example.c +++ b/example/peripherals/pin/src/pin_gpio_intr_example.c @@ -44,7 +44,6 @@ #include "fgpio.h" - #include "pin_common.h" #include "pin_gpio_intr_example.h" /************************** Constant Definitions *****************************/ @@ -180,7 +179,7 @@ int FPinGpioIntrExample(void) if (ret != 0) { printf("Fail to init ctrl or pins."); - return FGPIO_ERR_NOT_INIT; + goto exit; } FGpioSetDirection(&input_pin_instance, FGPIO_DIR_INPUT); @@ -244,15 +243,16 @@ int FPinGpioIntrExample(void) InterruptMask(irq_num); +exit: /* print message on example run result */ if (1 == intr_flag) { printf("%s@%d: pin GPIO intr example [success].\r\n", __func__, __LINE__); + return 0; } else { printf("%s@%d: pin GPIO intr example [failure].\r\n", __func__, __LINE__); - } - - return 0; + return 1; + } } diff --git a/example/peripherals/pin/src/pin_gpio_low_level_example.c b/example/peripherals/pin/src/pin_gpio_low_level_example.c index 01cf805a3..43fb455a9 100644 --- a/example/peripherals/pin/src/pin_gpio_low_level_example.c +++ b/example/peripherals/pin/src/pin_gpio_low_level_example.c @@ -127,11 +127,11 @@ int FPinGpioLowLevelExample(void) if (1 == flag) { printf("%s@%d: pin GPIO low level example [success].\r\n", __func__, __LINE__); + return 0; } else { printf("%s@%d: pin GPIO low level example [failure].\r\n", __func__, __LINE__); + return 1; } - - return 0; } diff --git a/example/peripherals/pin/src/pin_gpio_pwm_example.c b/example/peripherals/pin/src/pin_gpio_pwm_example.c index 8e8bdbdb0..020b2eba8 100644 --- a/example/peripherals/pin/src/pin_gpio_pwm_example.c +++ b/example/peripherals/pin/src/pin_gpio_pwm_example.c @@ -223,7 +223,7 @@ int FPinGpioPwmExample(void) if (ret != 0) { printf("Fail to init ctrl or pins."); - return FGPIO_ERR_NOT_INIT; + goto exit; } FGpioSetDirection(&output_pin_instance_1, FGPIO_DIR_OUTPUT); @@ -259,6 +259,7 @@ int FPinGpioPwmExample(void) FPwmStop(&pwm_output_2); FGpioDeInitialize(&pwm_ctrl_instance); +exit: /* print message on example run result */ if (0 == ret) { @@ -270,5 +271,5 @@ int FPinGpioPwmExample(void) } printf("Console part finish, you should check the actual pwm wave on oscilloscope.\r\n"); - return 0; + return ret; } diff --git a/example/peripherals/pmbus/src/pmbus_mp_detect_example.c b/example/peripherals/pmbus/src/pmbus_mp_detect_example.c index ae7a31aea..f2193d603 100644 --- a/example/peripherals/pmbus/src/pmbus_mp_detect_example.c +++ b/example/peripherals/pmbus/src/pmbus_mp_detect_example.c @@ -224,12 +224,11 @@ int FPmbusMpDetectExample(void) end: if (0 == err) { - printf("\r\n%s@%d: PMBus MP-chip detect example success !!! \r\n", __func__, __LINE__); - printf("[system_example_pass]\r\n"); + printf("\r\n%s@%d: PMBus MP-chip detect example [success].\r\n", __func__, __LINE__); } else { - printf("\r\n%s@%d: PMBus MP-chip detect example failed !!!, err = %d \r\n", __func__, __LINE__, err); + printf("\r\n%s@%d: PMBus MP-chip detect example [failure].\r\n", __func__, __LINE__); } return err; diff --git a/example/peripherals/pmbus/src/pmbus_mp_voltage_example.c b/example/peripherals/pmbus/src/pmbus_mp_voltage_example.c index a6d139f5c..06baf701e 100644 --- a/example/peripherals/pmbus/src/pmbus_mp_voltage_example.c +++ b/example/peripherals/pmbus/src/pmbus_mp_voltage_example.c @@ -343,12 +343,11 @@ int FPmbusMpVoltageExample(void) end: if (0 == err) { - printf("\r\n%s@%d: PMBus MP-chip voltage change example success !!! \r\n", __func__, __LINE__); - printf("[system_example_pass]\r\n"); + printf("\r\n%s@%d: PMBus MP-chip voltage change example [success].\r\n", __func__, __LINE__); } else { - printf("\r\n%s@%d: PMBus MP-chip voltage change example failed !!!, err = %d \r\n", __func__, __LINE__, err); + printf("\r\n%s@%d: PMBus MP-chip voltage change example [failure].\r\n", __func__, __LINE__); } return err; diff --git a/example/peripherals/sd/README.md b/example/peripherals/sd/README.md index b43e1d6a0..6624bb988 100644 --- a/example/peripherals/sd/README.md +++ b/example/peripherals/sd/README.md @@ -134,6 +134,7 @@ sd sdif_tf_bench_example ![sdif_tf_bench_example_result](./figs/sdif_tf_bench.png) - SD-1 控制器 TF 卡分区识别测试例程 (sdif_tf_partition_example) +>注意:需要提前在卡中导入分区表才能使用该用例 ``` sd sdif_tf_partition_example diff --git a/example/peripherals/sd/main.c b/example/peripherals/sd/main.c index 99f1fd1cc..d57ef4b8a 100644 --- a/example/peripherals/sd/main.c +++ b/example/peripherals/sd/main.c @@ -28,11 +28,24 @@ #endif #ifdef CONFIG_USE_LETTER_SHELL -#include "shell_port.h" + #include "shell_port.h" #endif #include "fsl_sdmmc_osa.h" +#if defined(CONFIG_FSL_SDMMC_USE_FSDIF) + #include "sdif_tf_detect_example.h" + #include "sdif_tf_read_write_example.h" + #include "sdif_tf_bench_example.h" + #include "sdif_emmc_detect_example.h" + #include "sdif_emmc_read_write_example.h" + #include "sdif_emmc_bench_example.h" +#endif + +#if defined(CONFIG_FSL_SDMMC_USE_FSDMMC) + #include "sdmmc_tf_detect_example.h" + #include "sdmmc_tf_read_write_example.h" +#endif /************************** Constant Definitions *****************************/ /**************************** Type Definitions *******************************/ @@ -52,6 +65,21 @@ int main() #else /* if shell command is not enabled, run example one by one */ +#if defined(CONFIG_FSL_SDMMC_USE_FSDIF) + FSdifSDHCCardDetectExample(); + FSdifSDHCCardReadWriteExample(); + FSdifSDHCCardBenchExample(); + FSdifEmmcDetectExample(); + FSdifEmmcReadWriteExample(); + FSdifEmmcBenchExample(); +#endif + +#if defined(CONFIG_FSL_SDMMC_USE_FSDMMC) + FSdmmcTfCardDetectExample(); + FSdmmcTfCardReadWriteExample(); +#endif + #endif + return 0; -} +} \ No newline at end of file diff --git a/example/peripherals/sd/src/cmd_sd.c b/example/peripherals/sd/src/cmd_sd.c index 0f0541de5..c1dd74e4f 100644 --- a/example/peripherals/sd/src/cmd_sd.c +++ b/example/peripherals/sd/src/cmd_sd.c @@ -142,7 +142,7 @@ static int FSdExampleEntry(int argc, char *argv[]) #ifndef CONFIG_PD2308_DEMO_BOARD else if (!strcmp(argv[1], "sdif_emmc_detect_example")) { - ret = FSdifEmmcDetectExample(); + ret = FSdifEmmcDetectExample(); } else if (!strcmp(argv[1], "sdif_emmc_read_write_example")) { diff --git a/example/peripherals/sd/src/sdif/sdif_emmc_bench_example.c b/example/peripherals/sd/src/sdif/sdif_emmc_bench_example.c index 6c7dcbb35..c1bf873ec 100644 --- a/example/peripherals/sd/src/sdif/sdif_emmc_bench_example.c +++ b/example/peripherals/sd/src/sdif/sdif_emmc_bench_example.c @@ -135,11 +135,11 @@ int FSdifEmmcBenchExample(void) time_cast = FSdifGetTick() - start_time; trans_time = (double)time_cast / GenericTimerFrequecy(); trans_speed = (double)SD_BENCH_SIZE / SZ_1M / trans_time; - printf("Write benchmark success, total time: %d.%03dSec, total size: %ld MB, speed: %f MB/sec\r\n", + printf("Write benchmark success, total time: %d.%03dSec, total size: %d MB, speed: %d MB/sec\r\n", FSdifTickCastSeconds(time_cast), FSdifTickCastMilliSec(time_cast), - SD_BENCH_SIZE / SZ_1M, - trans_speed); + (int)(SD_BENCH_SIZE / SZ_1M), + (int)trans_speed); /* this forced type casting is to avoid floating-point printing error */ } /* do read bench */ @@ -174,17 +174,20 @@ int FSdifEmmcBenchExample(void) time_cast = FSdifGetTick() - start_time; trans_time = (double)time_cast / GenericTimerFrequecy(); trans_speed = (double)SD_BENCH_SIZE / SZ_1M / trans_time; - printf("Read benchmark success, total time: %d.%03dSec, total size: %ld MB, speed: %f MB/sec\r\n", + printf("Read benchmark success, total time: %d.%03dSec, total size: %d MB, speed: %d MB/sec\r\n", FSdifTickCastSeconds(time_cast), FSdifTickCastMilliSec(time_cast), - SD_BENCH_SIZE / SZ_1M, - trans_speed); + (int)(SD_BENCH_SIZE / SZ_1M), + (int)trans_speed); /* this forced type casting is to avoid floating-point printing error */ } + printf("%s@%d: SD eMMC bench example [success].\r\n", __func__, __LINE__); + err_exit: if (kStatus_Success != err) { - FSD_ERROR("TF card read/write failed."); + FSD_ERROR("eMMC bench fail."); + printf("%s@%d: SD eMMC bench example [failure].\r\n", __func__, __LINE__); } MMC_Deinit(&s_inst.card); diff --git a/example/peripherals/sd/src/sdif/sdif_emmc_detect_example.c b/example/peripherals/sd/src/sdif/sdif_emmc_detect_example.c index 454661a6f..939e0b136 100644 --- a/example/peripherals/sd/src/sdif/sdif_emmc_detect_example.c +++ b/example/peripherals/sd/src/sdif/sdif_emmc_detect_example.c @@ -98,11 +98,11 @@ int FSdifEmmcDetectExample(void) err_exit: if (0 == err) { - printf("%s@%d: eMMC detect example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: SD eMMC detect example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: eMMC detect example failed !!!, ret = %d \r\n", __func__, __LINE__, err); + printf("%s@%d: SD eMMC detect example [failure].\r\n", __func__, __LINE__); } MMC_Deinit(&s_inst.card); diff --git a/example/peripherals/sd/src/sdif/sdif_emmc_read_write_example.c b/example/peripherals/sd/src/sdif/sdif_emmc_read_write_example.c index 8788f2c39..50543bceb 100644 --- a/example/peripherals/sd/src/sdif/sdif_emmc_read_write_example.c +++ b/example/peripherals/sd/src/sdif/sdif_emmc_read_write_example.c @@ -115,7 +115,7 @@ int FSdifEmmcReadWriteExample(void) if ((kStatus_Success == err)) { FtDumpHexByte(rw_buf, SD_BLOCK_SIZE * min((u32)2, (u32)3)); - printf("%s@%d: eMMC read and write example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: SD eMMC read and write example [success].\r\n", __func__, __LINE__); } else { @@ -126,13 +126,9 @@ int FSdifEmmcReadWriteExample(void) } err_exit: - if (0 == err) + if (err) { - printf("%s@%d: eMMC detect example success !!! \r\n", __func__, __LINE__); - } - else - { - printf("%s@%d: eMMC detect example failed !!!, ret = %d \r\n", __func__, __LINE__, err); + printf("%s@%d: SD eMMC read and write example [failure].\r\n", __func__, __LINE__); } MMC_Deinit(&s_inst.card); diff --git a/example/peripherals/sd/src/sdif/sdif_sdio_detect_example.c b/example/peripherals/sd/src/sdif/sdif_sdio_detect_example.c index 2f312c8dc..75fd2f7e8 100644 --- a/example/peripherals/sd/src/sdif/sdif_sdio_detect_example.c +++ b/example/peripherals/sd/src/sdif/sdif_sdio_detect_example.c @@ -160,11 +160,11 @@ int FSdifSdioCardDetectExample(void) err_exit: if (0 == err) { - printf("%s@%d: SDIO card detect example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: SDIO card detect example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: SDIO card detect example failed !!!, err = %d \r\n", __func__, __LINE__, err); + printf("%s@%d: SDIO card detect example [failure].\r\n", __func__, __LINE__); } SDIO_Deinit(&s_inst.card); diff --git a/example/peripherals/sd/src/sdif/sdif_tf_bench_example.c b/example/peripherals/sd/src/sdif/sdif_tf_bench_example.c index ea5892c7e..a93c54822 100644 --- a/example/peripherals/sd/src/sdif/sdif_tf_bench_example.c +++ b/example/peripherals/sd/src/sdif/sdif_tf_bench_example.c @@ -142,11 +142,11 @@ int FSdifTfCardBenchExample(boolean is_uhs_card, uint32_t card_clock) time_cast = FSdifGetTick() - start_time; trans_time = (double)time_cast / GenericTimerFrequecy(); trans_speed = (double)SD_BENCH_SIZE / SZ_1M / trans_time; - printf("Write benchmark success, total time: %d.%03dSec, total size: %ld MB, speed: %f MB/sec\r\n", + printf("Write benchmark success, total time: %d.%03dSec, total size: %d MB, speed: %d MB/sec\r\n", FSdifTickCastSeconds(time_cast), FSdifTickCastMilliSec(time_cast), - SD_BENCH_SIZE / SZ_1M, - trans_speed); + (int)(SD_BENCH_SIZE / SZ_1M), + (int)trans_speed); /* this forced type casting is to avoid floating-point printing error */ } /* do read bench */ @@ -181,17 +181,20 @@ int FSdifTfCardBenchExample(boolean is_uhs_card, uint32_t card_clock) time_cast = FSdifGetTick() - start_time; trans_time = (double)time_cast / GenericTimerFrequecy(); trans_speed = (double)SD_BENCH_SIZE / SZ_1M / trans_time; - printf("Read benchmark success, total time: %d.%03dSec, total size: %ld MB, speed: %f MB/sec\r\n", + printf("Read benchmark success, total time: %d.%03dSec, total size: %d MB, speed: %d MB/sec\r\n", FSdifTickCastSeconds(time_cast), FSdifTickCastMilliSec(time_cast), - SD_BENCH_SIZE / SZ_1M, - trans_speed); + (int)(SD_BENCH_SIZE / SZ_1M), + (int)trans_speed); /* this forced type casting is to avoid floating-point printing error */ } + printf("%s@%d: SD TF bench example [success].\r\n", __func__, __LINE__); + err_exit: if (kStatus_Success != err) { - FSD_ERROR("TF card read/write failed."); + FSD_ERROR("SD TF card bench fail."); + printf("%s@%d: SD TF bench example [failure].\r\n", __func__, __LINE__); } SD_Deinit(&s_inst.card); diff --git a/example/peripherals/sd/src/sdif/sdif_tf_detect_example.c b/example/peripherals/sd/src/sdif/sdif_tf_detect_example.c index 26edee333..a1bd5a879 100644 --- a/example/peripherals/sd/src/sdif/sdif_tf_detect_example.c +++ b/example/peripherals/sd/src/sdif/sdif_tf_detect_example.c @@ -106,11 +106,11 @@ int FSdifTFCardDetectExample(boolean is_uhs_card, uint32_t card_clock) err_exit: if (0 == err) { - printf("%s@%d: TF card detect example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: SD TF card detect example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: TF card detect example failed !!!, err = %d \r\n", __func__, __LINE__, err); + printf("%s@%d: SD TF card detect example [failure].\r\n", __func__, __LINE__); } SD_Deinit(&s_inst.card); diff --git a/example/peripherals/sd/src/sdif/sdif_tf_partition_example.c b/example/peripherals/sd/src/sdif/sdif_tf_partition_example.c index 7fe67d8e9..6a81cb233 100644 --- a/example/peripherals/sd/src/sdif/sdif_tf_partition_example.c +++ b/example/peripherals/sd/src/sdif/sdif_tf_partition_example.c @@ -121,11 +121,11 @@ int FSdifTFCardPartitionExample(boolean is_uhs_card, uint32_t card_clock) err_exit: if (0 == err) { - printf("%s@%d: TF card partiton detect example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: SD TF card partiton detect example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: TF card partiton detect example failed !!!, err = %d \r\n", __func__, __LINE__, err); + printf("%s@%d: SD TF card partiton detect example [failure].\r\n", __func__, __LINE__); } SD_Deinit(&s_inst.card); diff --git a/example/peripherals/sd/src/sdif/sdif_tf_read_write_example.c b/example/peripherals/sd/src/sdif/sdif_tf_read_write_example.c index 0891c5d6b..8cf66d72a 100644 --- a/example/peripherals/sd/src/sdif/sdif_tf_read_write_example.c +++ b/example/peripherals/sd/src/sdif/sdif_tf_read_write_example.c @@ -130,7 +130,7 @@ int FSdifTfCardReadWriteExample(boolean is_uhs_card, uint32_t card_clock) if ((kStatus_Success == err)) { FtDumpHexByte(rw_buf, SD_BLOCK_SIZE * min((u32)2, (u32)SD_USE_BLOCK)); - printf("%s@%d: TF card read and write example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: SD TF card read and write example [success].\r\n", __func__, __LINE__); } else { @@ -144,7 +144,7 @@ err_exit: if (kStatus_Success != err) { FSD_ERROR("TF card read/write failed."); - printf("%s@%d: TF card read and write example failed !!!, err = %d \r\n", __func__, __LINE__, err); + printf("%s@%d: SD TF card read and write example [failure].\r\n", __func__, __LINE__, err); } SD_Deinit(&s_inst.card); diff --git a/example/peripherals/sd/src/sdmmc/sdmmc_tf_detect_example.c b/example/peripherals/sd/src/sdmmc/sdmmc_tf_detect_example.c index 13dff46aa..7ed1da5db 100644 --- a/example/peripherals/sd/src/sdmmc/sdmmc_tf_detect_example.c +++ b/example/peripherals/sd/src/sdmmc/sdmmc_tf_detect_example.c @@ -101,11 +101,11 @@ int FSdmmcTfCardDetectExample(void) err_exit: if (0 == err) { - printf("%s@%d: TF card detect example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: SD TF card detect example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: TF card detect example failed !!!, err = %d \r\n", __func__, __LINE__, err); + printf("%s@%d: SD TF card detect example [failure].\r\n", __func__, __LINE__); } SD_Deinit(&s_inst.card); diff --git a/example/peripherals/sd/src/sdmmc/sdmmc_tf_read_write_example.c b/example/peripherals/sd/src/sdmmc/sdmmc_tf_read_write_example.c index 97fb012be..16aede1ab 100644 --- a/example/peripherals/sd/src/sdmmc/sdmmc_tf_read_write_example.c +++ b/example/peripherals/sd/src/sdmmc/sdmmc_tf_read_write_example.c @@ -124,7 +124,7 @@ int FSdmmcTfCardReadWriteExample(void) if ((kStatus_Success == err)) { FtDumpHexByte(rw_buf, SD_BLOCK_SIZE * min((u32)2, (u32)SD_USE_BLOCK)); - printf("%s@%d: TF card read and write example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: SD TF card read and write example [success].\r\n", __func__, __LINE__); } else { @@ -135,13 +135,9 @@ int FSdmmcTfCardReadWriteExample(void) } err_exit: - if (0 == err) + if (err) { - printf("%s@%d: TF card read write example success !!! \r\n", __func__, __LINE__); - } - else - { - printf("%s@%d: TF card read write example failed !!!, err = %d \r\n", __func__, __LINE__, err); + printf("%s@%d: SD TF card read write example [failure].\r\n", __func__, __LINE__); } SD_Deinit(&s_inst.card); diff --git a/example/peripherals/serial/README.md b/example/peripherals/serial/README.md index 947c329ac..809494415 100644 --- a/example/peripherals/serial/README.md +++ b/example/peripherals/serial/README.md @@ -132,6 +132,7 @@ bootelf -p 0x90100000 > ``描述输入输出情况,列出存在哪些输出,对应的输出是什么(建议附录相关现象图片)`
` #### 2.4.1 UART中断模式测试例程 (serial_intr_example.c) +> 该用例不需要额外接串口,可以使用内回环模式进行测试 ``` uart intr_example @@ -140,6 +141,7 @@ uart intr_example ![intr_example_result](./fig/intr_example_result.png) #### 2.4.2 UART轮询模式测试例程 (serial_poll_example.c) +> 该用例不需要额外接串口,可以使用内回环模式进行测试 ``` uart poll_example @@ -148,6 +150,7 @@ uart poll_example ![poll_example_result](./fig/poll_example_result.png) #### 2.4.3 MIO复用测试例程 (serial_mio_example.c) +> 默认使用三线串口进行测试 需要配合使用XCOM软件,查看串口接收,点击发送 @@ -161,6 +164,7 @@ XCOM界面显示 ![mio_example_result_2](./fig/mio_example_result_2.png) #### 2.4.4 SERIAL流控测试例程 (serial_flow_example.c) +> 只能使用五线串口进行测试 需要配合使用XCOM软件,查看串口接收,点击发送 @@ -174,6 +178,7 @@ XCOM界面显示 ![flow_example_result_2](./fig/flow_example_result_2.png) #### 2.4.5 DDMA传输测试例程 (serial_ddma_example.c) +> 默认使用五线串口进行测试 需要配合使用XCOM软件,查看串口接收,点击发送 @@ -187,6 +192,7 @@ XCOM界面显示 ![ddma_example_result_2](./fig/ddma_example_result_2.png) #### 2.4.6 DDMA传输流控测试例程 (serial_ddma_flow_example.c) +> 只能使用五线串口进行测试 需要配合使用XCOM软件,查看串口接收,点击发送 @@ -199,7 +205,8 @@ SHELL界面显示 XCOM界面显示 ![ddma_flow_example_result_2](./fig/ddma_flow_example_result_2.png) -#### 2.4.4 DDMA与MIO复用配合传输测试例程 (serial_ddma_mio_example.c) +#### 2.4.7 DDMA与MIO复用配合传输测试例程 (serial_ddma_mio_example.c) +> 默认使用五线串口进行测试 需要配合使用XCOM软件,查看串口接收,点击发送 diff --git a/example/peripherals/serial/main.c b/example/peripherals/serial/main.c index 7d5a76d4f..dc33b3f41 100644 --- a/example/peripherals/serial/main.c +++ b/example/peripherals/serial/main.c @@ -34,7 +34,6 @@ #include "serial_poll_example.h" #include "serial_intr_example.h" - /************************** Constant Definitions *****************************/ /**************************** Type Definitions *******************************/ @@ -58,4 +57,4 @@ int main() FSerialIntrExample(); #endif return 0; -} +} \ No newline at end of file diff --git a/example/peripherals/serial/src/serial_ddma_example.c b/example/peripherals/serial/src/serial_ddma_example.c index 7ed872a64..3330001e4 100644 --- a/example/peripherals/serial/src/serial_ddma_example.c +++ b/example/peripherals/serial/src/serial_ddma_example.c @@ -345,6 +345,7 @@ int FSerialDdmaExample() } memset(rx_buf, 0, sizeof(rx_buf)); + memset(rx_recv_data, 0, sizeof(rx_recv_data)); FU8buff2U32buff(tx_buf, tx_send_data, trans_size); /* DDMA only support 32-bit data, but UART tx and rx registers are 8-bit */ printf("Uart DDMA test \r\n"); @@ -364,7 +365,6 @@ int FSerialDdmaExample() FU32buff2U8buff(rx_recv_data, rx_buf, trans_size); printf("After test ..... \r\n"); printf("tx buf ===> \r\n"); - printf("tx buf ===> \r\n"); FtDumpHexByte((u8 *)tx_send_data, trans_size); printf("rx buf <=== \r\n"); FtDumpHexByte((u8 *)rx_recv_data, trans_size); @@ -380,12 +380,12 @@ int FSerialDdmaExample() /* print message on example run result */ if (0 == ret) { - printf("%s@%d: Serial ddma example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: Serial ddma example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Serial ddma example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); + printf("%s@%d: Serial ddma example [failure].\r\n", __func__, __LINE__); } - return 0; + return ret; } diff --git a/example/peripherals/serial/src/serial_ddma_flow_example.c b/example/peripherals/serial/src/serial_ddma_flow_example.c index 38ff6a080..67cd2b69d 100644 --- a/example/peripherals/serial/src/serial_ddma_flow_example.c +++ b/example/peripherals/serial/src/serial_ddma_flow_example.c @@ -384,12 +384,12 @@ int FSerialDdmaFlowExample() /* print message on example run result */ if (0 == ret) { - printf("%s@%d: Serial ddma in flow mode example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: Serial ddma in flow mode example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Serial ddma in flow mode example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); + printf("%s@%d: Serial ddma in flow mode example [failure].\r\n", __func__, __LINE__); } - return 0; + return ret; } diff --git a/example/peripherals/serial/src/serial_ddma_mio_example.c b/example/peripherals/serial/src/serial_ddma_mio_example.c index ea583666d..73292b16f 100644 --- a/example/peripherals/serial/src/serial_ddma_mio_example.c +++ b/example/peripherals/serial/src/serial_ddma_mio_example.c @@ -407,17 +407,19 @@ int FSerialDdmaMioExample() { FSERIAL_ERROR("FSerialDdmaDeinit() erroe ==> UART id: %d", UART_CONTROLLER_ID); } + /*deinit iopad*/ FIOMuxDeInit(); + /* print message on example run result */ if (0 == ret) { - printf("%s@%d: Serial ddma example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: Serial ddma example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Serial ddma example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); + printf("%s@%d: Serial ddma example [failure].\r\n", __func__, __LINE__); } - return 0; + return ret; } diff --git a/example/peripherals/serial/src/serial_flow_example.c b/example/peripherals/serial/src/serial_flow_example.c index 8e23627a7..5279248ea 100644 --- a/example/peripherals/serial/src/serial_flow_example.c +++ b/example/peripherals/serial/src/serial_flow_example.c @@ -257,12 +257,12 @@ int FSerialFlowExample() /* print message on example run result */ if (0 == ret) { - printf("%s@%d: Serial flow example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: Serial flow example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Serial flow example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); + printf("%s@%d: Serial flow example [failure].\r\n", __func__, __LINE__); } - return 0; + return ret; } \ No newline at end of file diff --git a/example/peripherals/serial/src/serial_intr_example.c b/example/peripherals/serial/src/serial_intr_example.c index 78889f382..032390dd1 100644 --- a/example/peripherals/serial/src/serial_intr_example.c +++ b/example/peripherals/serial/src/serial_intr_example.c @@ -287,18 +287,21 @@ int FSerialIntrExample() } } - /*deinit iopad*/ + #ifdef CONFIG_TARGET_E2000 + /*deinit iopad*/ FIOMuxDeInit(); #endif + if (0 == ret) { - printf("%s@%d: Serial intr example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: Serial intr example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Serial intr example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); + printf("%s@%d: Serial intr example [failure].\r\n", __func__, __LINE__); } - return 0; + + return ret; } diff --git a/example/peripherals/serial/src/serial_mio_example.c b/example/peripherals/serial/src/serial_mio_example.c index edce42f05..eb52fea88 100644 --- a/example/peripherals/serial/src/serial_mio_example.c +++ b/example/peripherals/serial/src/serial_mio_example.c @@ -301,12 +301,12 @@ int FSerialMioExample() /* print message on example run result */ if (0 == ret) { - printf("%s@%d: Serial mio example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: Serial mio example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Serial mio example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); + printf("%s@%d: Serial mio example [failure].\r\n", __func__, __LINE__); } - return 0; + return ret; } \ No newline at end of file diff --git a/example/peripherals/serial/src/serial_poll_example.c b/example/peripherals/serial/src/serial_poll_example.c index 33fa0fb85..dee006e2b 100644 --- a/example/peripherals/serial/src/serial_poll_example.c +++ b/example/peripherals/serial/src/serial_poll_example.c @@ -211,17 +211,19 @@ int FSerialPollExample() break; } } + #ifdef CONFIG_TARGET_E2000 FIOMuxDeInit(); #endif + /* print message on example run result */ if (0 == ret) { - printf("%s@%d: Serial poll example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: Serial poll example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Serial poll example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); + printf("%s@%d: Serial poll example [failure].\r\n", __func__, __LINE__); } return 0; diff --git a/example/peripherals/spi/main.c b/example/peripherals/spi/main.c index 724c9c33e..09ea5cec4 100644 --- a/example/peripherals/spi/main.c +++ b/example/peripherals/spi/main.c @@ -33,8 +33,6 @@ #include "spim_polled_loopback_mode_example.h" #include "spim_intr_loopback_mode_example.h" - - /************************** Constant Definitions *****************************/ /**************************** Type Definitions *******************************/ @@ -46,18 +44,15 @@ /************************** Function Prototypes ******************************/ /************************** Function *****************************************/ - int main() { #ifdef CONFIG_USE_LETTER_SHELL /* if shell command is enabled, register example entry as shell command */ LSUserShellLoop(); #else - FSpimPolledLoopbackExample(); - FSpimIntrLoopbackExample(); - #endif + return 0; -} +} \ No newline at end of file diff --git a/example/peripherals/spi/src/spim_intr_loopback_mode_example.c b/example/peripherals/spi/src/spim_intr_loopback_mode_example.c index 15738804d..1d24987c8 100644 --- a/example/peripherals/spi/src/spim_intr_loopback_mode_example.c +++ b/example/peripherals/spi/src/spim_intr_loopback_mode_example.c @@ -84,7 +84,7 @@ int FSpimIntrLoopbackExample() if (ret != FT_SUCCESS) { FSPIM_ERROR("Spim init failed!!!\r\n"); - return FSPIM_ERR_NOT_READY; + goto exit; } /*spim interrupt init and loopback mode test*/ @@ -92,21 +92,21 @@ int FSpimIntrLoopbackExample() if (ret != FT_SUCCESS) { FSPIM_ERROR(" Spim intr loopback test failed!!!\r\n"); - return FSPIM_ERR_TRANS_FAIL; + goto exit; } /*spim deinit*/ FSpimOpsDeInit(); +exit: if (ret == FT_SUCCESS) { - printf("%s@%d: Spim intr loopback mode example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: Spim intr loopback mode example [success].\r\n", __func__, __LINE__); + return 0; } else { - printf("%s@%d: Spim intr loopback mode example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); - return FSPIM_ERR_TRANS_FAIL; + printf("%s@%d: Spim intr loopback mode example [failure].\r\n", __func__, __LINE__); + return 1; } - - return 0; } \ No newline at end of file diff --git a/example/peripherals/spi/src/spim_polled_loopback_mode_example.c b/example/peripherals/spi/src/spim_polled_loopback_mode_example.c index 21604f5a3..db244d66c 100644 --- a/example/peripherals/spi/src/spim_polled_loopback_mode_example.c +++ b/example/peripherals/spi/src/spim_polled_loopback_mode_example.c @@ -79,29 +79,29 @@ int FSpimPolledLoopbackExample() if (ret != FT_SUCCESS) { FSPIM_ERROR("Spim init failed!!!\r\n"); - return FSPIM_ERR_NOT_READY; + goto exit; } /*spim loopback mode test*/ ret = FSpimLoopBack(bytes, FSPIM_OPS_LOOPBACK_POLL_FIFO); if (ret != FT_SUCCESS) { - FSPIM_ERROR(" Spim polled loopback test failed!!!\r\n"); - return FSPIM_ERR_TRANS_FAIL; + FSPIM_ERROR("Spim polled loopback test failed!!!\r\n"); + goto exit; } /*spim deinit*/ FSpimOpsDeInit(); +exit: if (ret == FT_SUCCESS) { - printf("%s@%d: Spim polled loopback mode example success !!! \r\n", __func__, __LINE__); + printf("%s@%d: Spim polled loopback mode example [success].\r\n", __func__, __LINE__); + return 0; } else { - printf("%s@%d: Spim polled loopback mode example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); - return FSPIM_ERR_TRANS_FAIL; + printf("%s@%d: Spim polled loopback mode example [failure].\r\n", __func__, __LINE__); + return 1; } - - return ret; } \ No newline at end of file diff --git a/example/python/README.md b/example/python/README.md index b89fb895b..4bb33e15c 100644 --- a/example/python/README.md +++ b/example/python/README.md @@ -167,7 +167,7 @@ bootelf -p 0x90100000 - 启动后串口可以直接使用shell -![template_test](./fig/template_test.png) +![repl](figs/micropython_repl.png) ## 3. 如何解决问题 diff --git a/example/storage/memory_pool_test/main.c b/example/storage/memory_pool_test/main.c index b92a592e4..6dd8a2892 100644 --- a/example/storage/memory_pool_test/main.c +++ b/example/storage/memory_pool_test/main.c @@ -43,5 +43,6 @@ int main() /* if shell command is not enabled, run example one by one */ MemoryPoolBasicExample(); #endif + return 0; } \ No newline at end of file diff --git a/example/storage/memory_pool_test/src/memory_pool_basic_example.c b/example/storage/memory_pool_test/src/memory_pool_basic_example.c index c60294464..aa1f0c5ee 100644 --- a/example/storage/memory_pool_test/src/memory_pool_basic_example.c +++ b/example/storage/memory_pool_test/src/memory_pool_basic_example.c @@ -111,7 +111,7 @@ int MemoryPoolBasicExample(void) else { FMEMP_ERROR("FMempMalloc() failed."); - ret = 1; + ret = FMEMP_ERR_BAD_MALLOC; goto err_ret; } @@ -126,7 +126,7 @@ int MemoryPoolBasicExample(void) else { FMEMP_ERROR("FMempMallocAlign() failed."); - ret = 1; + ret = FMEMP_ERR_BAD_MALLOC; goto err_ret; } @@ -140,7 +140,7 @@ int MemoryPoolBasicExample(void) else { FMEMP_ERROR("FMempMallocAlign() failed."); - ret = 1; + ret = FMEMP_ERR_BAD_MALLOC; goto err_ret; } @@ -154,7 +154,7 @@ int MemoryPoolBasicExample(void) else { FMEMP_ERROR("FMempMallocAlign() failed."); - ret = 1; + ret = FMEMP_ERR_BAD_MALLOC; goto err_ret; } @@ -167,7 +167,7 @@ int MemoryPoolBasicExample(void) else { FMEMP_ERROR("FMempCalloc() failed."); - ret = 1; + ret = FMEMP_ERR_BAD_MALLOC; goto err_ret; } @@ -181,12 +181,13 @@ int MemoryPoolBasicExample(void) else { FMEMP_ERROR("FMempRealloc() failed."); - ret = 1; + ret = FMEMP_ERR_BAD_MALLOC; goto err_ret; } /* test FMempFree api */ FMemListAll(&memp); + err_ret: if (&memp) { @@ -210,11 +211,11 @@ err_ret: if (ret == 0) { printf("%s@%d: Memory pool basic example [success].\r\n", __func__, __LINE__); + return 0; } else { printf("%s@%d: Memory pool basic example [failure].\r\n", __func__, __LINE__); + return 1; } - - return ret; } \ No newline at end of file diff --git a/example/storage/sfud/src/sfud_qspi_probe_example.c b/example/storage/sfud/src/sfud_qspi_probe_example.c index 39d59658f..87764f85f 100644 --- a/example/storage/sfud/src/sfud_qspi_probe_example.c +++ b/example/storage/sfud/src/sfud_qspi_probe_example.c @@ -90,11 +90,13 @@ int FSfudQspiProbeExample(void) if (sfud_init()) { printf("Sfud init fail!"); - ret = 1; + ret = SFUD_ERR_INIT_FAILED; + goto exit; } ret = SfudInfo(); +exit: if (ret == 0) { printf("%s@%d: Sfud probe example [success].\r\n", __func__, __LINE__); diff --git a/example/storage/sfud/src/sfud_qspi_wr_example.c b/example/storage/sfud/src/sfud_qspi_wr_example.c index 4c8f6c24c..a76ad8930 100644 --- a/example/storage/sfud/src/sfud_qspi_wr_example.c +++ b/example/storage/sfud/src/sfud_qspi_wr_example.c @@ -71,14 +71,16 @@ int FSfudQspiWRExample(void) if (sfud_init()) { printf("Sfud init fail!"); - return SFUD_ERR_INIT_FAILED; + ret = SFUD_ERR_INIT_FAILED; + goto exit; } flash = sfud_get_device(SFUD_CONTROLLER_ID); if (flash == NULL || !flash->init_ok) { FSFUD_ERROR("Flash on qspi controller %d is not found!", SFUD_CONTROLLER_ID); - return SFUD_ERR_NOT_FOUND; + ret = SFUD_ERR_NOT_FOUND; + goto exit; } rw_start_addr = flash->chip.capacity - FLASH_WR_OFFSET; @@ -88,7 +90,7 @@ int FSfudQspiWRExample(void) if (ret) { FSFUD_ERROR("Sfud erase fail."); - return SFUD_ERR_WRITE; + goto exit; } ret = sfud_read(flash, rw_start_addr, SFUD_FLASH_LEN, read_buf); @@ -100,7 +102,7 @@ int FSfudQspiWRExample(void) else { FSFUD_ERROR("Sfud read fail."); - return SFUD_ERR_READ; + goto exit; } sprintf(write_buf, "write whatever u like to 0x%x", rw_start_addr); @@ -109,7 +111,7 @@ int FSfudQspiWRExample(void) if (ret) { FSFUD_ERROR("Sfud write fail."); - return SFUD_ERR_WRITE; + goto exit; } ret = sfud_read(flash, rw_start_addr, SFUD_FLASH_LEN, read_buf); @@ -121,13 +123,13 @@ int FSfudQspiWRExample(void) else { FSFUD_ERROR("Sfud read fail."); - return SFUD_ERR_READ; + goto exit; } - + +exit: if (ret == 0) { printf("%s@%d: Sfud qspi read write example [success].\r\n", __func__, __LINE__); - printf("[system_example_pass]\r\n"); } else { diff --git a/example/storage/sfud/src/sfud_spi_bench_example.c b/example/storage/sfud/src/sfud_spi_bench_example.c index b1b07c4b6..ad0ba322d 100644 --- a/example/storage/sfud/src/sfud_spi_bench_example.c +++ b/example/storage/sfud/src/sfud_spi_bench_example.c @@ -100,21 +100,24 @@ int FSfudSpiBenchExample(void) if (SFUD_CONTROLLER_ID == SFUD_FQSPI0_INDEX) { FSFUD_ERROR("Cannot bench on qspi to avoid damaging firmware."); - return SFUD_ERR_NOT_FOUND; + ret = SFUD_ERR_NOT_FOUND; + goto exit_free; } /* this function will probe all spi and qspi controllers on board */ if (sfud_init()) { printf("Sfud init fail!"); - return SFUD_ERR_INIT_FAILED; + ret = SFUD_ERR_INIT_FAILED; + goto exit_free; } flash = sfud_get_device(SFUD_CONTROLLER_ID); if (flash == NULL || !flash->init_ok) { FSFUD_ERROR("Flash on spi-%d is not found!", SFUD_CONTROLLER_ID); - return SFUD_ERR_NOT_FOUND; + ret = SFUD_ERR_NOT_FOUND; + goto exit_free; } u32 size = flash->chip.capacity; @@ -225,6 +228,7 @@ int FSfudSpiBenchExample(void) else { FSFUD_ERROR("Allocate buffer failed."); + ret = SFUD_ERR_TX_BUF_OUT_OF_BOUND; goto exit_free; } @@ -236,12 +240,11 @@ exit_free: if (ret == 0) { - printf("%s@%d: Sfud spi bench example success !!! \r\n", __func__, __LINE__); - printf("[system_example_pass]\r\n"); + printf("%s@%d: Sfud spi bench example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Sfud spi bench example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); + printf("%s@%d: Sfud spi bench example [failure].\r\n", __func__, __LINE__); } return ret; diff --git a/example/storage/sfud/src/sfud_spi_probe_example.c b/example/storage/sfud/src/sfud_spi_probe_example.c index 232e75a49..d1d11c161 100644 --- a/example/storage/sfud/src/sfud_spi_probe_example.c +++ b/example/storage/sfud/src/sfud_spi_probe_example.c @@ -94,11 +94,13 @@ int FSfudSpiProbeExample(void) if (sfud_init()) { printf("Sfud init fail!"); - ret = 1; + ret = SFUD_ERR_INIT_FAILED; + goto exit; } ret = SfudInfo(); +exit: if (ret == 0) { printf("%s@%d: SFUD spi probe example [success].\r\n", __func__, __LINE__); diff --git a/example/storage/sfud/src/sfud_spi_wr_example.c b/example/storage/sfud/src/sfud_spi_wr_example.c index dd285ae2e..722969ea4 100644 --- a/example/storage/sfud/src/sfud_spi_wr_example.c +++ b/example/storage/sfud/src/sfud_spi_wr_example.c @@ -75,14 +75,16 @@ int FSfudSpiWRExample(void) if (sfud_init()) { printf("Sfud init fail!"); - return SFUD_ERR_INIT_FAILED; + ret = SFUD_ERR_INIT_FAILED; + goto exit; } flash = sfud_get_device(SFUD_CONTROLLER_ID); if (flash == NULL || !flash->init_ok) { FSFUD_ERROR("Flash on spi controller %d is not found!", SFUD_CONTROLLER_ID); - return SFUD_ERR_NOT_FOUND; + ret = SFUD_ERR_NOT_FOUND; + goto exit; } rw_start_addr = flash->chip.capacity - FLASH_WR_OFFSET; @@ -92,7 +94,7 @@ int FSfudSpiWRExample(void) if (ret) { FSFUD_ERROR("Sfud erase fail."); - return SFUD_ERR_WRITE; + goto exit; } ret = sfud_read(flash, rw_start_addr, SFUD_FLASH_LEN, read_buf); @@ -104,7 +106,7 @@ int FSfudSpiWRExample(void) else { FSFUD_ERROR("Sfud read fail."); - return SFUD_ERR_READ; + goto exit; } sprintf(write_buf, "write whatever u like to 0x%x", rw_start_addr); @@ -113,7 +115,7 @@ int FSfudSpiWRExample(void) if (ret) { FSFUD_ERROR("Sfud write fail."); - return SFUD_ERR_WRITE; + goto exit; } ret = sfud_read(flash, rw_start_addr, SFUD_FLASH_LEN, read_buf); @@ -125,17 +127,17 @@ int FSfudSpiWRExample(void) else { FSFUD_ERROR("Sfud read fail."); - return SFUD_ERR_READ; + goto exit; } - + +exit: if (ret == 0) { - printf("%s@%d: Sfud spi read write example success!!!\r\n", __func__, __LINE__); - printf("[system_example_pass]\r\n"); + printf("%s@%d: Sfud spi read write example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Sfud spi read write example failed !!!, ret = %d \r\n", __func__, __LINE__, ret); + printf("%s@%d: Sfud spi read write example [failure].\r\n", __func__, __LINE__); } return ret; diff --git a/example/storage/spiffs/main.c b/example/storage/spiffs/main.c index 3e84fe31e..6a08d3b8e 100644 --- a/example/storage/spiffs/main.c +++ b/example/storage/spiffs/main.c @@ -50,10 +50,12 @@ int main() FSpiffsSpiMountExample(); FSpiffsSpiBasicExample(); #endif + #if defined(CONFIG_E2000D_DEMO_BOARD) || defined(CONFIG_E2000Q_DEMO_BOARD) FSpiffsQspiMountExample(); FSpiffsQspiBasicExample(); #endif + #endif return 0; } \ No newline at end of file diff --git a/example/storage/spiffs/src/spiffs_qspi_basic_example.c b/example/storage/spiffs/src/spiffs_qspi_basic_example.c index 8582c04d7..cfe187a90 100644 --- a/example/storage/spiffs/src/spiffs_qspi_basic_example.c +++ b/example/storage/spiffs/src/spiffs_qspi_basic_example.c @@ -504,48 +504,56 @@ int FSpiffsQspiBasicExample(void) if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SfudSpiffsInit failed.\n"); + goto exit; } ret = SfudSpiffMount(); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SfudSpiffMount failed.\n"); + goto exit; } ret = SpiffsCreateFile(file_name); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsCreateFile failed.\n"); + goto exit; } ret = SpiffsWriteFile(file_name, str); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsWriteFile failed.\n"); + goto exit; } ret = SpiffsReadFile(file_name); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsReadFile failed.\n"); + goto exit; } ret =SpiffsListAll(); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsListAll failed.\n"); + goto exit; } ret =SpiffsStatus(); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsStatus failed.\n"); + goto exit; } ret =SpiffsRemoveFile(file_name); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsRemoveFile failed.\n"); + goto exit; } /*sfud spiffs unmount*/ @@ -554,13 +562,14 @@ int FSpiffsQspiBasicExample(void) /*sfud spiffs deinit*/ SpiffsDeInit(); +exit: if (ret == 0) { - printf("%s@%d: Sfud qspi spiffs basic example [success].\r\n", __func__, __LINE__); + printf("%s@%d: SPIFFS qspi basic example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Sfud qspi spiffs basic example [failure].\r\n", __func__, __LINE__); + printf("%s@%d: SPIFFS qspi basic example [failure].\r\n", __func__, __LINE__); } return ret; diff --git a/example/storage/spiffs/src/spiffs_qspi_mount_example.c b/example/storage/spiffs/src/spiffs_qspi_mount_example.c index d6816cc43..b7f7ecae7 100644 --- a/example/storage/spiffs/src/spiffs_qspi_mount_example.c +++ b/example/storage/spiffs/src/spiffs_qspi_mount_example.c @@ -201,6 +201,7 @@ int FSpiffsQspiMountExample(void) if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SfudSpiffsInit failed.\n"); + goto exit; } /*sfud spiffs momunt*/ @@ -208,6 +209,7 @@ int FSpiffsQspiMountExample(void) if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SfudSpiffMount failed.\n"); + goto exit; } /*sfud spiffs unmount*/ @@ -216,13 +218,14 @@ int FSpiffsQspiMountExample(void) /*sfud spiffs deinit*/ SpiffsDeInit(); +exit: if (ret == 0) { - printf("%s@%d: Sfud qspi spiffs mount example [success].\r\n", __func__, __LINE__); + printf("%s@%d: SPIFFS qspi mount example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Sfud qspi spiffs mount example [failure].\r\n", __func__, __LINE__); + printf("%s@%d: SPIFFS qspi mount example [failure].\r\n", __func__, __LINE__); } return ret; diff --git a/example/storage/spiffs/src/spiffs_spi_basic_example.c b/example/storage/spiffs/src/spiffs_spi_basic_example.c index 46b9eb241..7ded719e4 100644 --- a/example/storage/spiffs/src/spiffs_spi_basic_example.c +++ b/example/storage/spiffs/src/spiffs_spi_basic_example.c @@ -508,48 +508,56 @@ int FSpiffsSpiBasicExample(void) if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SfudSpiffsInit failed.\n"); + goto exit; } ret = SfudSpiffMount(); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SfudSpiffMount failed.\n"); + goto exit; } ret = SpiffsCreateFile(file_name); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsCreateFile failed.\n"); + goto exit; } ret = SpiffsWriteFile(file_name, str); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsWriteFile failed.\n"); + goto exit; } ret = SpiffsReadFile(file_name); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsReadFile failed.\n"); + goto exit; } ret =SpiffsListAll(); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsListAll failed.\n"); + goto exit; } ret =SpiffsStatus(); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsStatus failed.\n"); + goto exit; } ret =SpiffsRemoveFile(file_name); if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SpiffsRemoveFile failed.\n"); + goto exit; } /*sfud spiffs unmount*/ @@ -558,14 +566,14 @@ int FSpiffsSpiBasicExample(void) /*sfud spiffs deinit*/ SpiffsDeInit(); +exit: if (ret == 0) { - printf("%s@%d: Sfud spi spiffs basic example [success].\r\n", __func__, __LINE__); - printf("[system_example_pass]\r\n"); + printf("%s@%d: SPIFFS spi basic example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Sfud spi spiffs basic example [failure].\r\n", __func__, __LINE__); + printf("%s@%d: SPIFFS spi basic example [failure].\r\n", __func__, __LINE__); } return ret; diff --git a/example/storage/spiffs/src/spiffs_spi_mount_example.c b/example/storage/spiffs/src/spiffs_spi_mount_example.c index b8ef81e81..5ce3de4ad 100644 --- a/example/storage/spiffs/src/spiffs_spi_mount_example.c +++ b/example/storage/spiffs/src/spiffs_spi_mount_example.c @@ -205,6 +205,7 @@ int FSpiffsSpiMountExample(void) if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SfudSpiffsInit failed.\n"); + goto exit; } /*sfud spiffs momunt*/ @@ -212,6 +213,7 @@ int FSpiffsSpiMountExample(void) if (ret != FSPIFFS_EXAMPLE_OK) { FSFUD_ERROR("SfudSpiffMount failed.\n"); + goto exit; } /*sfud spiffs unmount*/ @@ -220,13 +222,14 @@ int FSpiffsSpiMountExample(void) /*sfud spiffs deinit*/ SpiffsDeInit(); +exit: if (ret == 0) { - printf("%s@%d: Sfud spi spiffs mount example [success].\r\n", __func__, __LINE__); + printf("%s@%d: SPIFFS spi mount example [success].\r\n", __func__, __LINE__); } else { - printf("%s@%d: Sfud spi spiffs mount example [failure].\r\n", __func__, __LINE__); + printf("%s@%d: SPIFFS spi mount example [failure].\r\n", __func__, __LINE__); } return ret; diff --git a/example/system/amp/amp_tools_example/amp/README.md b/example/system/amp/amp_tools_example/amp/README.md index 47b9e794c..4ec3153b7 100644 --- a/example/system/amp/amp_tools_example/amp/README.md +++ b/example/system/amp/amp_tools_example/amp/README.md @@ -49,10 +49,10 @@ - 在host侧完成配置 -> 配置成E2000D,如E2000d 32位,根据amp_config.conf文件的配置,为config2: +> 配置成E2000D,如E2000d 32位,根据amp_config.conf文件的配置,为config3: ``` -$ make amp_make AMP_CONFIG=config2 +$ make amp_make AMP_CONFIG=config3 ``` - host侧设置重启host侧tftp服务器 diff --git a/example/system/arch/armv8/psci/makefile b/example/system/arch/armv8/psci/makefile index e22a5730c..1f5e56837 100644 --- a/example/system/arch/armv8/psci/makefile +++ b/example/system/arch/armv8/psci/makefile @@ -10,6 +10,26 @@ include $(SDK_DIR)/tools/build/amp_makeall.mk USR_BOOT_DIR ?= /mnt/d/tftboot +config_d2000_aarch64: + $(MAKE) load_kconfig LOAD_CONFIG_NAME=d2000_aarch64_test_boot + $(MAKE) -C ./psci_test load_kconfig LOAD_CONFIG_NAME=d2000_aarch64_test_psci + $(MAKE) -C ./psci_test/psci_slave load_kconfig LOAD_CONFIG_NAME=d2000_aarch64_test_psci_slave + +config_d2000_aarch32: + $(MAKE) load_kconfig LOAD_CONFIG_NAME=d2000_aarch32_test_boot + $(MAKE) -C ./psci_test load_kconfig LOAD_CONFIG_NAME=d2000_aarch32_test_psci + $(MAKE) -C ./psci_test/psci_slave load_kconfig LOAD_CONFIG_NAME=d2000_aarch32_test_psci_slave + +config_ft2004_aarch64: + $(MAKE) load_kconfig LOAD_CONFIG_NAME=ft2004_aarch64_dsk_boot + $(MAKE) -C ./psci_test load_kconfig LOAD_CONFIG_NAME=ft2004_aarch64_dsk_psci + $(MAKE) -C ./psci_test/psci_slave load_kconfig LOAD_CONFIG_NAME=ft2004_aarch64_dsk_psci_slave + +config_ft2004_aarch32: + $(MAKE) load_kconfig LOAD_CONFIG_NAME=ft2004_aarch32_dsk_boot + $(MAKE) -C ./psci_test load_kconfig LOAD_CONFIG_NAME=ft2004_aarch32_dsk_psci + $(MAKE) -C ./psci_test/psci_slave load_kconfig LOAD_CONFIG_NAME=ft2004_aarch32_dsk_psci_slave + config_pd2308_aarch64: $(MAKE) load_kconfig LOAD_CONFIG_NAME=pd2308_aarch64_demo_boot $(MAKE) -C ./psci_test load_kconfig LOAD_CONFIG_NAME=pd2308_aarch64_demo_psci diff --git a/example/system/cxx/cryptopp/main.cpp b/example/system/cxx/cryptopp/main.cpp index db0df83c8..670984f39 100644 --- a/example/system/cxx/cryptopp/main.cpp +++ b/example/system/cxx/cryptopp/main.cpp @@ -38,7 +38,6 @@ using namespace std; int main() { - #ifdef CONFIG_USE_LETTER_SHELL /* if shell command is enabled, register example entry as shell command */ LSUserShellLoop(); @@ -49,7 +48,7 @@ int main() (void)FCryptoPPMd5Example(); (void)FCryptoPPMd4Example(); (void)FCryptoPPAdler32Example(); - cout << "Crypto++ test finished !!!" << endl; + cout << "Crypto++ test [success]." << endl; #endif return 0; diff --git a/example/system/cxx/get-start/main.cpp b/example/system/cxx/get-start/main.cpp index 6aac9e85d..7f07d19bb 100644 --- a/example/system/cxx/get-start/main.cpp +++ b/example/system/cxx/get-start/main.cpp @@ -39,12 +39,10 @@ using namespace std; int main() { int ret = 0; - #ifdef CONFIG_USE_LETTER_SHELL /* if shell command is enabled, register example entry as shell command */ LSUserShellLoop(); #else - /* if shell command is not enabled, run example one by one */ cout << "Hello baremetal C++" << endl; @@ -82,7 +80,7 @@ int main() RUN_CASE(FStlStringExample, failed); RUN_CASE(FStlSortExample, failed); - cout << "C++ test finished !!!" << endl; + cout << "C++ test [success]." << endl; failed: #endif diff --git a/example/system/unwind/README.md b/example/system/unwind/README.md index eda9e05b7..74cfb6a79 100644 --- a/example/system/unwind/README.md +++ b/example/system/unwind/README.md @@ -37,11 +37,11 @@ - 本例子已经提供好具体的编译指令,以下进行介绍: 1. make 将目录下的工程进行编译 - 2. make clean 将目录下的工程进行清理 - 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 + 2. make clean 将目录下的工程进行清理 + 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 4. make list_kconfig 当前工程支持哪些配置文件 5. make load_kconfig LOAD_CONFIG_NAME=`` 将预设配置加载至工程中 - 6. make menuconfig 配置目录下的参数变量 + 6. make menuconfig 配置目录下的参数变量 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - 具体使用方法为: @@ -54,10 +54,10 @@ - 在host侧完成配置 -> 配置成E2000D,对于其它平台,使用对应的默认配置,如E2000d 32位: +> 配置成E2000D,对于其它平台,使用对应的默认配置,如E2000D 64位: ``` -$ make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch32_demo_unwind +$ make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_unwind ``` - 在host侧完成构建 @@ -125,6 +125,7 @@ addr2line -e .elf -a -f 80103cd0 80100e00 80100de4 80100dcc 80100b #### 2.4.3 当出现指令未定义时使用unwind 功能 - 注意此指令使用之后,程序将会陷入异常中,只能通过复位之后才能使用 +- aarch32与aarch64下的地址输出可能不一样 ``` unwind undef @@ -148,4 +149,4 @@ addr2line -e .elf -a -f 80103cd0 80102468 80100478 80100bb0 801096 > ``记录例程的重大修改记录,标明修改发生的版本号 `
` > -> v1.1.1 版本首次引入 +> v1.1.1 版本首次引入 \ No newline at end of file diff --git a/install.py b/install.py index 33d869848..348e500c9 100755 --- a/install.py +++ b/install.py @@ -35,7 +35,7 @@ import shutil ### environment constant sdk_profile_path = "/etc/profile.d/phytium_dev.sh" -sdk_version = "v1.2.0" +sdk_version = "v1.3.0" ### functions def rm_line(str, file_path): diff --git a/third-party/fatfs-0.1.4/port/fsata_controller/diskio_sata_controller.c b/third-party/fatfs-0.1.4/port/fsata_controller/diskio_sata_controller.c index bf88501b4..98bafb844 100644 --- a/third-party/fatfs-0.1.4/port/fsata_controller/diskio_sata_controller.c +++ b/third-party/fatfs-0.1.4/port/fsata_controller/diskio_sata_controller.c @@ -111,7 +111,7 @@ static int FSataInit(void) if (FSATA_SUCCESS != ret) { FSataCfgDeInitialize(instance_p); - FSATA_ERROR("FSataAhciInit sata failed, ret: 0x%x.", ret); + FSATA_DEBUG("FSataAhciInit sata failed, ret: 0x%x.", ret); continue; } diff --git a/third-party/lwip-2.1.2/ports/fxmac/fxmac_lwip_port.c b/third-party/lwip-2.1.2/ports/fxmac/fxmac_lwip_port.c index 99cda1df3..8b0b3e234 100644 --- a/third-party/lwip-2.1.2/ports/fxmac/fxmac_lwip_port.c +++ b/third-party/lwip-2.1.2/ports/fxmac/fxmac_lwip_port.c @@ -213,10 +213,7 @@ FError FXmacSgsend(FXmacLwipPort *instance_p, struct pbuf *p) FError status; FXmacBdRing *txring; u32 bdindex; - sys_prot_t lev; u32 max_fr_size; - - lev = sys_arch_protect(); txring = &(FXMAC_GET_TXRING(instance_p->instance)); @@ -228,7 +225,6 @@ FError FXmacSgsend(FXmacLwipPort *instance_p, struct pbuf *p) status = FXmacBdRingAlloc(txring, n_pbufs, &txbdset); if (status != FT_SUCCESS) { - sys_arch_unprotect(lev); FXMAC_LWIP_PORT_XMAC_PRINT_E("sgsend: Error allocating TxBD\r\n"); return ERR_GENERAL; } @@ -239,9 +235,8 @@ FError FXmacSgsend(FXmacLwipPort *instance_p, struct pbuf *p) if (instance_p->buffer.tx_pbufs_storage[bdindex]) { - sys_arch_unprotect(lev); FXMAC_LWIP_PORT_XMAC_PRINT_E("PBUFS not available\r\n"); - return ERR_GENERAL; + goto err; } /* Send the data from the pbuf to the interface, one pbuf at a @@ -302,9 +297,8 @@ FError FXmacSgsend(FXmacLwipPort *instance_p, struct pbuf *p) status = FXmacBdRingToHw(txring, n_pbufs, txbdset); if (status != FT_SUCCESS) { - sys_arch_unprotect(lev); FXMAC_LWIP_PORT_XMAC_PRINT_E("sgsend: Error submitting TxBD\r\n"); - return ERR_GENERAL; + goto err; } if ((instance_p->instance).config.caps & FXMAC_CAPS_TAILPTR) @@ -319,8 +313,9 @@ FError FXmacSgsend(FXmacLwipPort *instance_p, struct pbuf *p) FXMAC_NWCTRL_OFFSET) | FXMAC_NWCTRL_STARTTX_MASK)); - sys_arch_unprotect(lev); - + return FT_SUCCESS; +err: + FXmacBdRingUnAlloc(txring, n_pbufs, txbdset); return status; } @@ -1340,7 +1335,8 @@ FError FXmacLwipPortTx(FXmacLwipPort *instance_p, void *tx_buf) } p = tx_buf; - + sys_prot_t lev; + lev=sys_arch_protect(); /* check if space is available to send */ freecnt = IsTxSpaceAvailable(instance_p); @@ -1352,8 +1348,7 @@ FError FXmacLwipPortTx(FXmacLwipPort *instance_p, void *tx_buf) if (IsTxSpaceAvailable(instance_p)) { - FXmacLwipPortOutput(instance_p, p); - ret = FT_SUCCESS; + ret = FXmacLwipPortOutput(instance_p, p); } else { @@ -1363,7 +1358,7 @@ FError FXmacLwipPortTx(FXmacLwipPort *instance_p, void *tx_buf) FXMAC_LWIP_PORT_XMAC_PRINT_E("pack dropped, no space\r\n"); ret = FREERTOS_XMAC_NO_VALID_SPACE; } - + sys_arch_unprotect(lev); return ret; } diff --git a/third-party/lwip-2.1.2/ports/lwip_port.c b/third-party/lwip-2.1.2/ports/lwip_port.c index fd412e8f5..8476bd832 100644 --- a/third-party/lwip-2.1.2/ports/lwip_port.c +++ b/third-party/lwip-2.1.2/ports/lwip_port.c @@ -137,7 +137,7 @@ struct netif *LwipPortAdd(struct netif *netif, return NULL; } - + memset(netif,0,sizeof(struct netif)); /* set mac address */ netif->hwaddr_len = 6; for (i = 0; i < 6; i++) @@ -375,6 +375,9 @@ void LwipPortStop(struct netif *netif,u32 dhcp_en) #endif } + printf("netif_remove\n"); + netif_remove(netif); + if (emac->ops.eth_deinit) { /* remove mac controler resource */ @@ -385,8 +388,6 @@ void LwipPortStop(struct netif *netif,u32 dhcp_en) { LWIP_PORT_ERROR("emac->ops.eth_deinit is null"); } - printf("netif_remove\n"); - netif_remove(netif); #if !NO_SYS /* delete rx thread */ sys_thread_delete(emac->rx_thread_handle); diff --git a/third-party/micropython/ports/mpy_main.c b/third-party/micropython/ports/mpy_main.c index d77c3c3b7..c791b4745 100644 --- a/third-party/micropython/ports/mpy_main.c +++ b/third-party/micropython/ports/mpy_main.c @@ -13,7 +13,7 @@ * * FilePath: mpy_main.c * Created Date: 2023-12-01 15:22:57 - * Last Modified: 2024-01-23 09:18:25 + * Last Modified: 2024-03-22 16:57:58 * Description: This file is for the main function of micropython * * Modify History: @@ -34,13 +34,14 @@ #include "py/mperrno.h" #include "shared/runtime/pyexec.h" #include "mpy_uart.h" +#include "py/stackctrl.h" #if MICROPY_VFS #include "extmod/vfs_fat.h" #include "lib/oofatfs/ff.h" #include "extmod/vfs.h" #include "mpy_sd.h" -static mp_init__filesystem(void); +static void mp_init__filesystem(void); static const char fresh_boot_py[] = "# hello.py -- run hello.py\r\n"; #endif @@ -104,13 +105,14 @@ void MP_WEAK __assert_func(const char *file, int line, const char *func, const c #endif #if MICROPY_VFS -static mp_init__filesystem(void) +static void mp_init__filesystem(void) { fs_user_mount_t *vfs_fat = m_new_obj_maybe(fs_user_mount_t); mp_vfs_mount_t *vfs = m_new_obj_maybe(mp_vfs_mount_t); if (vfs == NULL || vfs_fat == NULL) { mp_printf(&mp_plat_print, "MPY: can't create vfs filesystem\n"); + return; } vfs_fat->blockdev.flags = MP_BLOCKDEV_FLAG_FREE_OBJ; pyb_sd_init_vfs(vfs_fat); @@ -122,7 +124,7 @@ static mp_init__filesystem(void) if (res != FR_OK) { mp_printf(&mp_plat_print, "MPY: can't create sd filesystem\n"); - return -MP_ENODEV; + return; } } vfs->str = "/sd"; diff --git a/third-party/micropython/ports/mpy_uart.c b/third-party/micropython/ports/mpy_uart.c index 3f511f067..73a1b0c2e 100644 --- a/third-party/micropython/ports/mpy_uart.c +++ b/third-party/micropython/ports/mpy_uart.c @@ -13,7 +13,7 @@ * * FilePath: mpy_uart.c * Created Date: 2023-12-01 15:22:57 - * Last Modified: 2024-01-18 19:50:33 + * Last Modified: 2024-03-22 16:53:09 * Description: This file is for the uart of micropython * * Modify History: @@ -59,7 +59,7 @@ int mp_hal_stdin_rx_chr(void) } // Send string of given length -void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) +void mp_hal_stdout_tx_strn(char *str, mp_uint_t len) { FPl011BlockSend(&serial, str, len); } diff --git a/third-party/micropython/ports/mpy_uart.h b/third-party/micropython/ports/mpy_uart.h index 41d69f178..0a0564f41 100644 --- a/third-party/micropython/ports/mpy_uart.h +++ b/third-party/micropython/ports/mpy_uart.h @@ -33,7 +33,7 @@ extern "C" int mp_hal_stdin_rx_chr(void); -void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len); +void mp_hal_stdout_tx_strn(char *str, mp_uint_t len); void MpySerialConfig(void); diff --git a/third-party/micropython/ports/user/mpy_sd.c b/third-party/micropython/ports/user/mpy_sd.c index f55d20744..9d08688f9 100644 --- a/third-party/micropython/ports/user/mpy_sd.c +++ b/third-party/micropython/ports/user/mpy_sd.c @@ -13,7 +13,7 @@ * * FilePath: mpy_sd.c * Created Date: 2023-12-01 15:22:57 - * Last Modified: 2024-01-25 20:05:44 + * Last Modified: 2024-03-22 16:51:54 * Description: This file is for the sd function of micropython * * Modify History: @@ -111,7 +111,7 @@ s_inst_config.hostType = kSDMMCHOST_TYPE_FSDMMC; /****************************************************************************** DEFINE PRIVATE FUNCTIONS ******************************************************************************/ -STATIC mp_obj_t pyb_sd_init_helper(pybsd_obj_t *self, const mp_arg_val_t *args) +STATIC mp_obj_t pyb_sd_init_helper(pybsd_obj_t *self, const mp_map_t *args) { status_t err = 0; err = pyb_ft_sd_hw_init(self); @@ -139,11 +139,9 @@ STATIC mp_obj_t pyb_sd_make_new(const mp_obj_type_t *type, size_t n_args, size_t mp_map_t kw_args; mp_map_init_fixed_table(&kw_args, n_kw, all_args + n_args); - // setup and initialize the object - mp_obj_t self = &pyb_sd_type; - pyb_sd_init_helper(self, &kw_args); - // return self; - return (mp_obj_t)self; + mp_obj_t self = MP_OBJ_NULL; + + return self; } STATIC mp_obj_t pyb_sd_init(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) diff --git a/tools/build/boot_code/sdkconfig b/tools/build/boot_code/sdkconfig index 0e13f0064..fcb9b2f49 100644 --- a/tools/build/boot_code/sdkconfig +++ b/tools/build/boot_code/sdkconfig @@ -40,39 +40,39 @@ CONFIG_FPEN=y # # Soc configuration # -# CONFIG_TARGET_PHYTIUMPI is not set +CONFIG_TARGET_PHYTIUMPI=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set # CONFIG_TARGET_FT2004 is not set # CONFIG_TARGET_D2000 is not set -CONFIG_TARGET_PD2308=y -CONFIG_SOC_NAME="pd2308" -CONFIG_SOC_CORE_NUM=8 +CONFIG_SOC_NAME="phytiumpi" +CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 -CONFIG_USE_SPINLOCK=y +CONFIG_TARGET_E2000=y +# CONFIG_USE_SPINLOCK is not set CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set -CONFIG_SPIN_MEM=0x80000000 # end of Soc configuration # # Board Configuration # -CONFIG_BOARD_NAME="demo" +CONFIG_BOARD_NAME="firefly" # CONFIG_USE_SPI_IOPAD is not set # CONFIG_USE_GPIO_IOPAD is not set # CONFIG_USE_CAN_IOPAD is not set # CONFIG_USE_QSPI_IOPAD is not set # CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set # CONFIG_USE_TACHO_IOPAD is not set # CONFIG_USE_UART_IOPAD is not set # CONFIG_USE_THIRD_PARTY_IOPAD is not set -CONFIG_PD2308_DEMO_BOARD=y +CONFIG_FIREFLY_DEMO_BOARD=y # # IO mux configuration when board start up @@ -149,7 +149,6 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_MEDIA is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set -# CONFIG_USE_I3C is not set # end of Drivers configuration # @@ -167,15 +166,7 @@ CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y # CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter shell configuration -CONFIG_USE_AMP=y -# CONFIG_USE_LIBMETAL is not set - -# -# OpenAmp -# -# CONFIG_USE_OPENAMP is not set -# end of OpenAmp - +# CONFIG_USE_AMP is not set # CONFIG_USE_YMODEM is not set # CONFIG_USE_SFUD is not set CONFIG_USE_BACKTRACE=y @@ -197,10 +188,11 @@ CONFIG_OUTPUT_BINARY=y # # Optimization options # -CONFIG_DEBUG_NOOPT=y -# CONFIG_DEBUG_CUSTOMOPT is not set +# CONFIG_DEBUG_NOOPT is not set +CONFIG_DEBUG_CUSTOMOPT=y # CONFIG_DEBUG_FULLOPT is not set # CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +CONFIG_DEBUG_OPTLEVEL="-O2" CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y CONFIG_DEBUG_LINK_MAP=y # CONFIG_CCACHE is not set @@ -236,7 +228,7 @@ CONFIG_USE_COMPILE_CHAIN=y # CONFIG_DEFAULT_LINKER_SCRIPT=y # CONFIG_USER_DEFINED_LD is not set -CONFIG_IMAGE_LOAD_ADDRESS=0x80100000 +CONFIG_IMAGE_LOAD_ADDRESS=0x91000000 CONFIG_IMAGE_MAX_LENGTH=0x1000000 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x400 diff --git a/tools/build/boot_code/sdkconfig.h b/tools/build/boot_code/sdkconfig.h index ae5adec0a..220a67464 100644 --- a/tools/build/boot_code/sdkconfig.h +++ b/tools/build/boot_code/sdkconfig.h @@ -38,38 +38,38 @@ /* Soc configuration */ -/* CONFIG_TARGET_PHYTIUMPI is not set */ +#define CONFIG_TARGET_PHYTIUMPI /* CONFIG_TARGET_E2000Q is not set */ /* CONFIG_TARGET_E2000D is not set */ /* CONFIG_TARGET_E2000S is not set */ /* CONFIG_TARGET_FT2004 is not set */ /* CONFIG_TARGET_D2000 is not set */ -#define CONFIG_TARGET_PD2308 -#define CONFIG_SOC_NAME "pd2308" -#define CONFIG_SOC_CORE_NUM 8 +#define CONFIG_SOC_NAME "phytiumpi" +#define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 #define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 -#define CONFIG_USE_SPINLOCK +#define CONFIG_TARGET_E2000 +/* CONFIG_USE_SPINLOCK is not set */ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ -#define CONFIG_SPIN_MEM 0x80000000 /* end of Soc configuration */ /* Board Configuration */ -#define CONFIG_BOARD_NAME "demo" +#define CONFIG_BOARD_NAME "firefly" /* CONFIG_USE_SPI_IOPAD is not set */ /* CONFIG_USE_GPIO_IOPAD is not set */ /* CONFIG_USE_CAN_IOPAD is not set */ /* CONFIG_USE_QSPI_IOPAD is not set */ /* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_MIO_IOPAD is not set */ /* CONFIG_USE_TACHO_IOPAD is not set */ /* CONFIG_USE_UART_IOPAD is not set */ /* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ -#define CONFIG_PD2308_DEMO_BOARD +#define CONFIG_FIREFLY_DEMO_BOARD /* IO mux configuration when board start up */ @@ -138,7 +138,6 @@ /* CONFIG_USE_MEDIA is not set */ /* CONFIG_USE_SCMI_MHU is not set */ /* CONFIG_USE_I2S is not set */ -/* CONFIG_USE_I3C is not set */ /* end of Drivers configuration */ /* Third-party configuration */ @@ -153,13 +152,7 @@ /* 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_AMP -/* CONFIG_USE_LIBMETAL is not set */ - -/* OpenAmp */ - -/* CONFIG_USE_OPENAMP is not set */ -/* end of OpenAmp */ +/* CONFIG_USE_AMP is not set */ /* CONFIG_USE_YMODEM is not set */ /* CONFIG_USE_SFUD is not set */ #define CONFIG_USE_BACKTRACE @@ -179,10 +172,11 @@ /* Optimization options */ -#define CONFIG_DEBUG_NOOPT -/* CONFIG_DEBUG_CUSTOMOPT is not set */ +/* CONFIG_DEBUG_NOOPT is not set */ +#define CONFIG_DEBUG_CUSTOMOPT /* CONFIG_DEBUG_FULLOPT is not set */ /* CONFIG_DEBUG_ENABLE_ALL_WARNING is not set */ +#define CONFIG_DEBUG_OPTLEVEL "-O2" #define CONFIG_DEBUG_OPT_UNUSED_SECTIONS #define CONFIG_DEBUG_LINK_MAP /* CONFIG_CCACHE is not set */ @@ -214,7 +208,7 @@ #define CONFIG_DEFAULT_LINKER_SCRIPT /* CONFIG_USER_DEFINED_LD is not set */ -#define CONFIG_IMAGE_LOAD_ADDRESS 0x80100000 +#define CONFIG_IMAGE_LOAD_ADDRESS 0x91000000 #define CONFIG_IMAGE_MAX_LENGTH 0x1000000 #define CONFIG_HEAP_SIZE 1 #define CONFIG_STACK_SIZE 0x400 diff --git a/tools/export_ide/templates/template_proj/.cproject b/tools/export_ide/templates/template_proj/.cproject deleted file mode 100644 index 74a46ba61..000000000 --- a/tools/export_ide/templates/template_proj/.cproject +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tools/export_ide/templates/template_proj/.project b/tools/export_ide/templates/template_proj/.project deleted file mode 100644 index 778188971..000000000 --- a/tools/export_ide/templates/template_proj/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - template_proj - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.phytium.studio.core.FTProjectNature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - SDK_DIR - $%7BECLIPSE_HOME%7D/phytium-standalone-sdk - - - diff --git a/tools/export_ide/templates/template_proj/.settings/language.settings.xml b/tools/export_ide/templates/template_proj/.settings/language.settings.xml deleted file mode 100644 index 4200ae3d9..000000000 --- a/tools/export_ide/templates/template_proj/.settings/language.settings.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file