diff --git a/ChangeLog.md b/ChangeLog.md new file mode 100644 index 0000000000000000000000000000000000000000..f2067b54cc0c74276430914d3f29d2fd0f40aa97 --- /dev/null +++ b/ChangeLog.md @@ -0,0 +1,14 @@ +# PhyStudio v0.1.1 ChangeLog + +Change Log sinc v0.0.1 + +## ide + +- add PhyStudio reference doc +- add PhyStudio download link + +## terminal + +- add terminal env reference doc +- add jtag debugging reference doc +- add terminal env package download link \ No newline at end of file diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 259e28431f741d74fca8b5da403414ce4c41d206..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# PhyStudio - -#### Description -PhyStudio发布仓库 - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 54eda4502a6edb6ef060d4eceb39d0c47848940a..0a36876b09eda53746a36e6e9f69a3228a7cab12 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,61 @@ # PhyStudio -#### 介绍 -PhyStudio发布仓库 +- 当前版本: [v0.1.1](./ChangeLog.md) -#### 软件架构 -软件架构说明 +- 本项目是 PhyStudio 工具发布仓库,PhyStudio 是面向 Phytium 系列 CPU 的嵌入式软件开发工具包,整体分为两个部分: + - 1. 命令行开发环境,提供交叉编译链和使用 [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk.git), [Phytium FreeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk.git) 的最小环境 + - 2. 集成开发环境,提供交叉编译链和编辑、编译、调试和下载 Phytium Standalone SDK 工程的完整环境 +## 集成开发环境 -#### 安装教程 +![](./ide/figs/project_wizard.png) +![](./ide/figs/disassembly.png) -1. xxxx -2. xxxx -3. xxxx +- Windows 平台的集成开发环境基于 Eclipse CDT C/C++ 开发,提供了完整的 SDK 工程管理、代码编辑、编译构建功能,能够通过 J-Link/CMSIS DAP 等工具在开发板上完成镜像下载和调试,集成 TFTP 服务支持通过网络快速下载镜像到开发板 +- 具体内容可以[参考](./ide/ide.md) +- 下载路径 [PhyStudio_Setup_V0.1.1.exe](https://pan.baidu.com/s/1UIiYRHWjx15fHjj8nJX0Zw) +> 提取码: PHYT -#### 使用说明 +- 支持的平台包括 + - 硬件架构: AARCH64 + - 硬件平台: E2000D/Q Demo 板,飞腾派 + - SDK类型: Phytium Standalone SDK + - 调试适配器: J-Link, CMSIS-DAP, DAP-Link -1. xxxx -2. xxxx -3. xxxx +- 支持的特性包括 + - 导入 SDK 例程(支持部分例程)作为 PhyStudio 工程,以及新建 PhyStudio 工程 + - 编辑 C/C++/汇编代码,高亮提示和快速查找符号 + - 使用 CDT 配置器配置 PhyStudio 工程编译、链接选项 + - 使用 Sdkconfig 配置界面配置 PhyStudio 工程 + - 集成 TFTP 服务器,通过网口上传镜像到开发板启动 + - 集成 OpenOCD, GDB,通过 JTAG 接口下载和调试 Elf 镜像 -#### 参与贡献 +## 命令行开发环境 -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +### Windows 平台 +![](./terminal/windows_x64/figs/msys2_env.png) -#### 特技 +- Windows 平台的命令行开发环境基于 Msys2 开发,提供了交叉编译链、构建和调试工具,开发者可以获得类似 Linux 的开发体验,能够编译 SDK 工程,通过 Jlink/CMSIS DAP 等工具在开发板上完成镜像下载和调试 +- 具体内容可以[参考](./terminal/windows_x64/terminal_msys64.md) +- 下载路径 [env_msys64.exe](https://pan.baidu.com/s/1UIiYRHWjx15fHjj8nJX0Zw) +> 提取码: PHYT -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +### Linux x64 平台 (Ubuntu) + +![](./terminal/linux_x64/figs/ubuntu_env.png) + +- Linux 命令行开发环境提供了交叉编译链、构建和调试工具,能够编译 SDK 工程,通过 J-Link/CMSIS DAP 等工具在开发板上完成镜像下载和调试 +- 具体内容可以[参考](./terminal/linux_x64/terminal_ubuntu_x64.md) +- 下载 [env_ubuntu_x64.tar.gz](https://pan.baidu.com/s/1UIiYRHWjx15fHjj8nJX0Zw) +> 提取码: PHYT + +- 支持的平台包括 + - 硬件架构: AARCH64,AARCH32 + - 硬件平台: E2000D/Q Demo 板,飞腾派,D2000 Demo 板 + - SDK类型: Phytium Standalone SDK,Phytium FreeRTOS SDK + - 调试适配器: J-Link, CMSIS-DAP, DAP-Link + +- 支持的特性包括 + - 编译 SDK 自带的例程和新建 SDK makefile 工程 + - 集成 OpenOCD, GDB,通过 JTAG 接口下载和调试 Elf 镜像 \ No newline at end of file diff --git a/ide/figs/add_debug_config.png b/ide/figs/add_debug_config.png new file mode 100644 index 0000000000000000000000000000000000000000..cc225a71213178c0c8728d63953234ee97db548b Binary files /dev/null and b/ide/figs/add_debug_config.png differ diff --git a/ide/figs/breakpoints.png b/ide/figs/breakpoints.png new file mode 100644 index 0000000000000000000000000000000000000000..c171ecf775da3ae6fdb9ae32e8cc42cadd7cf237 Binary files /dev/null and b/ide/figs/breakpoints.png differ diff --git a/ide/figs/build_done.png b/ide/figs/build_done.png new file mode 100644 index 0000000000000000000000000000000000000000..2f30a971c6d2d6afe2e6c594432f834db083bfe9 Binary files /dev/null and b/ide/figs/build_done.png differ diff --git a/ide/figs/build_elf.png b/ide/figs/build_elf.png new file mode 100644 index 0000000000000000000000000000000000000000..12ff71d94693764e5573bdb37142755a92538231 Binary files /dev/null and b/ide/figs/build_elf.png differ diff --git a/ide/figs/cmsis_dap_device.png b/ide/figs/cmsis_dap_device.png new file mode 100644 index 0000000000000000000000000000000000000000..ef1ebfb48992e4dd4ce31cb77aad2b5d7141cc6a Binary files /dev/null and b/ide/figs/cmsis_dap_device.png differ diff --git a/ide/figs/com_number.png b/ide/figs/com_number.png new file mode 100644 index 0000000000000000000000000000000000000000..c815bf87da218cca8ce60e635e5605b550bbba84 Binary files /dev/null and b/ide/figs/com_number.png differ diff --git a/ide/figs/config_tftp.png b/ide/figs/config_tftp.png new file mode 100644 index 0000000000000000000000000000000000000000..c8cfd9525a228869e1a2155ad6bc6bb743e7933f Binary files /dev/null and b/ide/figs/config_tftp.png differ diff --git a/ide/figs/debug_as.png b/ide/figs/debug_as.png new file mode 100644 index 0000000000000000000000000000000000000000..f9df327ae282dd19d2452c0648ca6f68f2f8e235 Binary files /dev/null and b/ide/figs/debug_as.png differ diff --git a/ide/figs/debug_config_menu.png b/ide/figs/debug_config_menu.png new file mode 100644 index 0000000000000000000000000000000000000000..ae74b02afbf4aea66020e261456fbf4a6f15c961 Binary files /dev/null and b/ide/figs/debug_config_menu.png differ diff --git a/ide/figs/debug_info.png b/ide/figs/debug_info.png new file mode 100644 index 0000000000000000000000000000000000000000..0329afd73cd44853da9c1657e086c90ac6aae766 Binary files /dev/null and b/ide/figs/debug_info.png differ diff --git a/ide/figs/debug_output.png b/ide/figs/debug_output.png new file mode 100644 index 0000000000000000000000000000000000000000..feabd4d0e51750421ce0d7a8062fdff7176ea86e Binary files /dev/null and b/ide/figs/debug_output.png differ diff --git a/ide/figs/directory.png b/ide/figs/directory.png new file mode 100644 index 0000000000000000000000000000000000000000..a033a3219a97ec86a5de3e106103c4e6bcf1c0c3 Binary files /dev/null and b/ide/figs/directory.png differ diff --git a/ide/figs/disassembly.png b/ide/figs/disassembly.png new file mode 100644 index 0000000000000000000000000000000000000000..d382d655575a44e2dc475bc344450a0fc47e89b3 Binary files /dev/null and b/ide/figs/disassembly.png differ diff --git a/ide/figs/e2000_terminal.png b/ide/figs/e2000_terminal.png new file mode 100644 index 0000000000000000000000000000000000000000..aa7cabe69e377c413de3ecd1ac7d9cbb0e1781de Binary files /dev/null and b/ide/figs/e2000_terminal.png differ diff --git a/ide/figs/gpio_src.png b/ide/figs/gpio_src.png new file mode 100644 index 0000000000000000000000000000000000000000..d0fc2d55f58cfd64e6d90cc0c4bfc8e7a96db2ea Binary files /dev/null and b/ide/figs/gpio_src.png differ diff --git a/ide/figs/host_ip.png b/ide/figs/host_ip.png new file mode 100644 index 0000000000000000000000000000000000000000..08013e6df8f24e49ef8a1e213fdcd01620dddb03 Binary files /dev/null and b/ide/figs/host_ip.png differ diff --git a/ide/figs/import_project.png b/ide/figs/import_project.png new file mode 100644 index 0000000000000000000000000000000000000000..47ab76f34314c082f1ed29b6d6524c1d3a8a66f8 Binary files /dev/null and b/ide/figs/import_project.png differ diff --git a/ide/figs/install_dir.png b/ide/figs/install_dir.png new file mode 100644 index 0000000000000000000000000000000000000000..e988f4f73adf004ee56e6cf896476e012f85f6a0 Binary files /dev/null and b/ide/figs/install_dir.png differ diff --git a/ide/figs/install_ide.png b/ide/figs/install_ide.png new file mode 100644 index 0000000000000000000000000000000000000000..6fce437cd68f9c35a67f43d519badd312883e401 Binary files /dev/null and b/ide/figs/install_ide.png differ diff --git a/ide/figs/install_ok.png b/ide/figs/install_ok.png new file mode 100644 index 0000000000000000000000000000000000000000..ff98fcaef8bd285e825f5bb4a8f63c9208e98f35 Binary files /dev/null and b/ide/figs/install_ok.png differ diff --git a/ide/figs/installing.png b/ide/figs/installing.png new file mode 100644 index 0000000000000000000000000000000000000000..28c86932d2a060f5f99c47123dd1d07816ca3167 Binary files /dev/null and b/ide/figs/installing.png differ diff --git a/ide/figs/license.png b/ide/figs/license.png new file mode 100644 index 0000000000000000000000000000000000000000..af3c055df2a7d9d99cf9174d5b14456a2dcdb482 Binary files /dev/null and b/ide/figs/license.png differ diff --git a/ide/figs/main_page.png b/ide/figs/main_page.png new file mode 100644 index 0000000000000000000000000000000000000000..28d1e8df5928f80e597ef9104cabaab43f51d4c8 Binary files /dev/null and b/ide/figs/main_page.png differ diff --git a/ide/figs/memory.png b/ide/figs/memory.png new file mode 100644 index 0000000000000000000000000000000000000000..7cf4682312f09fd70e9437e90783a585ce4199fa Binary files /dev/null and b/ide/figs/memory.png differ diff --git a/ide/figs/new_proj.png b/ide/figs/new_proj.png new file mode 100644 index 0000000000000000000000000000000000000000..3813b8fb375cfd3ffaa581611d22cd3901dfddaa Binary files /dev/null and b/ide/figs/new_proj.png differ diff --git a/ide/figs/open_new_terminal.png b/ide/figs/open_new_terminal.png new file mode 100644 index 0000000000000000000000000000000000000000..706f2114c6db38d61496a9d534cfbfa912d5f286 Binary files /dev/null and b/ide/figs/open_new_terminal.png differ diff --git a/ide/figs/proj_explorer.png b/ide/figs/proj_explorer.png new file mode 100644 index 0000000000000000000000000000000000000000..e0d21107c2c8aadb70abb9705fdaff3474a0b881 Binary files /dev/null and b/ide/figs/proj_explorer.png differ diff --git a/ide/figs/proj_folder.png b/ide/figs/proj_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..bf436c376b1ddbb5816c14542e5e1d7ac3182e93 Binary files /dev/null and b/ide/figs/proj_folder.png differ diff --git a/ide/figs/project_wizard.png b/ide/figs/project_wizard.png new file mode 100644 index 0000000000000000000000000000000000000000..1d5161a2f996cc58bbc231bd548903f8c6d46181 Binary files /dev/null and b/ide/figs/project_wizard.png differ diff --git a/ide/figs/registers.png b/ide/figs/registers.png new file mode 100644 index 0000000000000000000000000000000000000000..fad32afad4a5346047f86978adc7c4af0fa2ff55 Binary files /dev/null and b/ide/figs/registers.png differ diff --git a/ide/figs/sdk_path.png b/ide/figs/sdk_path.png new file mode 100644 index 0000000000000000000000000000000000000000..ce7442164171cb3ebcdaf30c1e2e490bdef4983b Binary files /dev/null and b/ide/figs/sdk_path.png differ diff --git a/ide/figs/sdkconfig_menu.png b/ide/figs/sdkconfig_menu.png new file mode 100644 index 0000000000000000000000000000000000000000..92a3fa0cf04d27c162c38012d335420e15f6b833 Binary files /dev/null and b/ide/figs/sdkconfig_menu.png differ diff --git a/ide/figs/select_import_proj.png b/ide/figs/select_import_proj.png new file mode 100644 index 0000000000000000000000000000000000000000..a46e5b7fd50e45a93d63fba60b60762da0d0e083 Binary files /dev/null and b/ide/figs/select_import_proj.png differ diff --git a/ide/figs/serial_port.png b/ide/figs/serial_port.png new file mode 100644 index 0000000000000000000000000000000000000000..aa1459c637d04612af374ee3671c2c65e6af2786 Binary files /dev/null and b/ide/figs/serial_port.png differ diff --git a/ide/figs/set_tftp.png b/ide/figs/set_tftp.png new file mode 100644 index 0000000000000000000000000000000000000000..a5f6b558d858c50ba30c6b571a5607e1fcb18632 Binary files /dev/null and b/ide/figs/set_tftp.png differ diff --git a/ide/figs/step_debug.png b/ide/figs/step_debug.png new file mode 100644 index 0000000000000000000000000000000000000000..9e55b3f232ada790a45a3b97de4ce8e8c686f1a2 Binary files /dev/null and b/ide/figs/step_debug.png differ diff --git a/ide/figs/terminal_tool.png b/ide/figs/terminal_tool.png new file mode 100644 index 0000000000000000000000000000000000000000..51ea17d6556cad7b61f9bc5830e27840f4a0fa8e Binary files /dev/null and b/ide/figs/terminal_tool.png differ diff --git a/ide/figs/tftp_file_list.png b/ide/figs/tftp_file_list.png new file mode 100644 index 0000000000000000000000000000000000000000..5416f7c95ea4fef2ceac2f1c226eeaddd8d8a72d Binary files /dev/null and b/ide/figs/tftp_file_list.png differ diff --git a/ide/figs/tftp_upload.png b/ide/figs/tftp_upload.png new file mode 100644 index 0000000000000000000000000000000000000000..25a9ff2229f9f4bfe79fe5cbf39dda205ab3e599 Binary files /dev/null and b/ide/figs/tftp_upload.png differ diff --git a/ide/figs/tftp_view.png b/ide/figs/tftp_view.png new file mode 100644 index 0000000000000000000000000000000000000000..52470b1069470814a92d1223a1a875c5b3c3644b Binary files /dev/null and b/ide/figs/tftp_view.png differ diff --git a/ide/figs/toggle_build.png b/ide/figs/toggle_build.png new file mode 100644 index 0000000000000000000000000000000000000000..d050f9fbdfbeba5a3c7985bf4f20419718be4095 Binary files /dev/null and b/ide/figs/toggle_build.png differ diff --git a/ide/figs/uninstall_ide.png b/ide/figs/uninstall_ide.png new file mode 100644 index 0000000000000000000000000000000000000000..a32e69ab33e9068e133a7f2b1a547b4d34816678 Binary files /dev/null and b/ide/figs/uninstall_ide.png differ diff --git a/ide/figs/uninstall_ide_2.png b/ide/figs/uninstall_ide_2.png new file mode 100644 index 0000000000000000000000000000000000000000..2af8515041bea61e189461e08576e34de5750461 Binary files /dev/null and b/ide/figs/uninstall_ide_2.png differ diff --git a/ide/figs/use_dap_or_jlink.png b/ide/figs/use_dap_or_jlink.png new file mode 100644 index 0000000000000000000000000000000000000000..74a0126aecb58ebdf4767b86fdfc734320489598 Binary files /dev/null and b/ide/figs/use_dap_or_jlink.png differ diff --git a/ide/figs/welcome_page.png b/ide/figs/welcome_page.png new file mode 100644 index 0000000000000000000000000000000000000000..9c6786376435de0f8400bf546a156902579812cc Binary files /dev/null and b/ide/figs/welcome_page.png differ diff --git a/ide/figs/workspace.png b/ide/figs/workspace.png new file mode 100644 index 0000000000000000000000000000000000000000..4022230a04e29a2fc9cbadab09ea8ce89ff46c04 Binary files /dev/null and b/ide/figs/workspace.png differ diff --git a/ide/ide.md b/ide/ide.md new file mode 100644 index 0000000000000000000000000000000000000000..8d4f6338afd29393cf4d02c9fb872cf9213a4e0e --- /dev/null +++ b/ide/ide.md @@ -0,0 +1,253 @@ +# PhyStudio IDE 开发环境 + +- PhyStudio 基于 Eclipse CDT C/C++ 开发,可以便利开发人员在集成开发环境中开发面向 Phytium 系列 CPU 平台的 Standalone 应用程序。本开发环境集成了编辑、编译、网络下载和调试等基础功能,还有管理工程硬件平台、配置 SDK 和 TFTP 服务器等附加功能,可以简化开发工具的安装流程、提升开发调试体验、增加 Standalone 应用程序的开发体验 + +- PhyStudio 目前支持 Windows x64 操作系统 +- PhyStudio 目前支持 E2000 D/Q Demo 板(开发下载和调试)和飞腾派(开发和下载) + +- PhyStudio 集成了如下运行环境 +- 1. `OpenJDK17`,开源的 JAVA SE 平台实现 +- 2. `Python 3.8`,Python 平台支持 +- 3. `Eclipse Embedded CDT 2023-03`,基于开源 Eclipse 环境进行了修改 +- 4. `OpenOCD 0.12.0`, 本环境中的 openocd.exe 基于开源软件修改后编译,如果需要修改后的源码,可以联系 `opensource_embedded@phytium.com.cn` 获取 +- 5. `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 目标码 +- 6. `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 目标码 +- 7. `xpack-windows-build-tools-4.3.0-1`, xpack 发布的[Windows平台构建工具](xpack-windows-build-tools-4.3.0-1),包含 win32 平台的 make, busybox 工具 +- 8. Phytium Standalone SDK,用于 Phytium 系列 CPU 的 嵌入式软件开发工具包 + +## 快速开始 + +### 下载 PhyStudio 安装包 + +- 从下面的链接中下载开发环境安装包 + +- [PhyStudio_Setup_V0.1.1.exe](https://pan.baidu.com/s/1UIiYRHWjx15fHjj8nJX0Zw) +> 提取码: PHYT + +### 安装/卸载 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) + +- 卸载完成后手动删除安装目录即可 + +### 工作主界面介绍 + +- PhyStudio 基于 Eclipse 平台开发,界面风格继承自 Eclipse,启动后的欢迎界面如下图所示,从上至下,依次是使用文档中心,使用 issue 提交中心、管理 SDK 的入口,以及工程导入和新建的入口 +![](./figs/welcome_page.png) + +- 创建/导入工程后进入工作主界面,如下图所示,主界面主要包括四大区域 +- 1. 工程窗口区 +- 2. 功能窗口区 +- 3. 透视图区 +- 4. 信息输出区 + +- 其中,工程窗口区顾名思义是管理特定工程项目的,通过在工程窗口选中一个工程,在菜单栏可以进行编译、调试等操作,同时,一些常用操作会在工具栏以图标的形式提供快捷方式 +- 功能窗口区提供编码、调试视图等一系列特定功能,功能窗口可以移动、关闭、最大化和最小化 + +![](./figs/main_page.png) + +- 透视图定义了当前界面呈现的菜单栏,工具栏,以及功能窗口集合及其布局,不同透视图提供了完成特定类型任务的功能集合,例如 C 透视图组合了项目开发,源文件编辑,项目构建等常用的开发功能窗口,菜单和功能按钮,调试透视图包含了调试项目程序常用的调试功能窗口,菜单和功能按钮 +- 信息输出区提供了各种信息的输出窗口,包括编译过程信息,调试过程信息、串口终端信息等 + +### 更新 Phytium Standalone SDK + +- 安装好 PhyStudio 后,需要在线更新 SDK 的版本,进入 Preferences > Phytium > SDK Path,找到 Phytium Standalone SDK 的路径 + +![](./figs/sdk_path.png) + +- 进入 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_eclipse_proj` 目录,双击运行脚本 `tools\export_eclipse_proj`,将 Standalone SDK 的 example 转换为 PhyStudio 工程 + +- Phytium Standalone SDK 资源的详细介绍可以[参考](https://gitee.com/phytium_embedded/phytium-standalone-sdk) + +### 导入或新建项目 + +- 点击 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 配置 + +- 此外,可以通过 File > New > Phytium Project,进入工程创建向导,创建一个新的项目 + +![](./figs/new_proj.png) + +- 创建完成后的工程与导入的工程类似 + +### 配置和构建项目 + +- 双击工程浏览器(Project Explorer)中的 sdkconfig 进入 SDK 配置界面 + +![](./figs/sdkconfig_menu.png) + +- 在 SDK 配置界面可以按需要选择或者删除配置,例如,选中 Drivers configuration > Use gpio 和 Use FGPIO,然后按 Ctrl + S 保存配置后,工程会新增一个 fgpio 的路径,后面就可以使用 GPIO 驱动了 + +![](./figs/gpio_src.png) + +- 完成配置后点击工具栏的`Build`图标开始编译 + +![](./figs/toggle_build.png) + +![](./figs/build_done.png) + +- 编译完成后,生成的 ELF 文件保存在 Debug 目录下 + +![](./figs/build_elf.png) + +### 使用串口工具连接开发板 + +- 启动开发板,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 界面 + +### 通过网络下载程序 + +- 对于有网口的开发板,可以使用 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 服务的根目录为工程编译输出目录,配置完成后点击 `Apply and Close` 生效配置 + +![](./figs/set_tftp.png) + +- 配置完成后可以看到之前编译好的镜像 get-start.elf,之后点击`Start FTP server` 启动 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) + +- 随后可以看到开发板的运行输出 + +### 启动程序调试运行 + +- 对于有 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) + +- 在调试过程中,通过工具栏的`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) diff --git a/terminal/jtag_debugging/jtag_debugging.md b/terminal/jtag_debugging/jtag_debugging.md new file mode 100644 index 0000000000000000000000000000000000000000..dc2979f9aafb6131852955e9233b042cb9f8cfc2 --- /dev/null +++ b/terminal/jtag_debugging/jtag_debugging.md @@ -0,0 +1,333 @@ +# JTAG 调试器 + +- 本文将介绍如何使用 Phytium 系列 CPU 的 OpenOCD 调试环境,以及如何使用 GDB 来调试 Phytium Standalone 应用程序 + +## 工作原理 + +> 介绍 FJTAG 接口、OpenOCD 和 GDB 如何相互连接,从而实现 Phytium 系列 CPU 的调试功能 + +参考[sdk例程](https://gitee.com/phytium_embedded/phytium-standalone-sdk/tree/master/example/system/jtag_debugging)中README.md的例程介绍 + +## 选择 Phytium 目标板 + +### E2000D/Q Demo 板 + +介绍如何在 E2000D/Q Demo 板上连接 JTAG 适配器和调试上位机 + +参考[sdk例程](https://gitee.com/phytium_embedded/phytium-standalone-sdk/tree/master/example/system/jtag_debugging)中的硬件配置方法。 + +### 调试范例 + +> 通过调试一个 Standalone 例程,演示调试的方法 + +参考[sdk例程](https://gitee.com/phytium_embedded/phytium-standalone-sdk/tree/master/example/system/jtag_debugging) + +### PhyStudio 调试 Standalone 程序 + +> 介绍如何使用 PhyStudio 工程进行调试 + +- [参考](../ide/ide.md) 中的`调试功能`相关介绍 + +### 命令行终端调试 Standalone 程序 + +> 介绍如何在命令行终端调试一个 Standalone 例程 + +* 目前支持Windows(Msys终端)和linux平台(Ubuntu20.04和Centos7),下述测试在VMVare+Centos7环境下完成。 + +* Ubuntu下安装依赖 + +> sudo apt-get install build-essential pkg-config autoconf automake libtool libusb-dev libusb-1.0-0-dev libsysfs-dev + +>sudo apt-get install libhidapi-dev libjaylink-dev + + hidapi对应DAP适配器, jaylink对应JLink适配器。 +* Centos下安装依赖 + +> yum install libtool libsystf autoconf automake libusb +> libusb-1.x libhidapi libjaylink(需通过源码编译安装) + +* 各依赖的版本要求: + + *autoconf >= 2.69* + *automake >= 1.14* + *gcc >= 8.0* + *GLIBC库 >= 2.34* + +#### 1\. 编译程序镜像 + +make menuconfig 设置以下编译选项: + +* 关闭 CONFIG_DEBUG_NOOPT,不进行编译优化 + +![Alt text](pic/image36.png) + +* 使能 CONFIG_DEBUG_SYMBOLS,将调试符号完整地编译进入 ELF 镜像 + +![Alt text](pic/image37.png) + +* 使能 CONFIG_OUTPUT_ASM_DIS,CONFIG_DEBUG_LINK_MAP,输出反汇编文件,方便调试时查阅符号 + +![Alt text](pic/image38.png) + +#### 2\. 启动 OpenOCD 调试代理 + +> 介绍 OpenOCD 的启动方法和基础命令 +> 介绍通过 telnet 登录 OpenOCD 后台 + +* 启动开发板; + +* 进入openocd安装目录,执行open_dap_attach.sh脚本(./open_dap_attach.sh) + +![Alt text](pic/image.png) + +* openocd进程会监听3333端口 + +![Alt text](pic/image-1.png) + +#### 3\. 下载镜像文件 + +* 另外开启一个终端,把编译sdk生成的镜像文件baremetal.elf移动到\*/openocd_0.12.0/image下。 + +![Alt text](pic/image-2.png) + +#### 4\. 启动 GDB 调试器 + +> 介绍 GDB 的启动方法和基础命令 +> 介绍 gdbinit 文件的使用 + +1)设置启动gdb的环境变量,添加的路径为aarch-none-elf-gdb所在的位置(不同用户存放的位置不一致) + +> export PATH=$PATH:/mnt/env_centos_x64/xpack-aarch64-none-elf-gcc-12.2.1-1.2-linux-x64/bin + +2)启动aarch64-none-elf-gdb (启动gdb的位置最好与baremetal.elf所在位置一致,否则在gdb中启动elf文件需要使用补全elf所在路径) + +> cd \*\*\*/openocd_0.12/image\ +> aarch64-none-elf-gdb + +![Alt text](pic/image-3.png) + +3)gdb连接openocd + +* gdb中执行命令: + +> set remotetimeout 100000\ +> target extended-remote localhost:3333 + +![Alt text](pic/image-4.png) + +* 此时另一终端中的openocd显示已接收连接。 + +![Alt text](pic/image-5.png) + +#### 5\. 启动镜像文件 + +* 载入镜像文件 + +> monitor init\ +> monitor gdb_breakpoint_override hardware\ +> load baremetal.elf + +![Alt text](pic/image-6.png) + +* 导入符号表 + +> file baremetal.elf + +> ![Alt text](pic/image-7.png) + +#### 6\. 设置和清除断点 + +1)设置断点:break or b 命令; + +* 设置断点在符号(特定函数入口) + +> b func + +![Alt text](pic/image-8.png) + +* 设置断点在特定地址 + +> b \*addr + +![Alt text](pic/image-9.png) + +2)查看断点:info breakpoints; i breakpoints命令 + +![Alt text](pic/image-10.png) + +3)删除断点:delete命令 + +> delete 断点序号 + +![Alt text](pic/image-11.png) + +#### 7\. 暂停和恢复程序运行 + +* 通过break命令暂停程序,详见第6条。 + +* continue指令恢复程序运行 (注:在开发板上调试不支持使用run指令,因为调试程序已在开发板上运行) + +![Alt text](pic/image-12.png) + +* 通过串口工具输入指令(md)触发断点 + +* + +![Alt text](pic/image-14.png) + +#### 8\. 单步执行代码 + +* 介绍 step 单步运行 c 代码 + +> step or s\ +> next or n + +![Alt text](pic/image-21.png) + +两者区别:next单步到程序源代码的下一行,不进入函数;step单步到程序执行的下一行,进入函数。 + +#### 10\. 查看断点上下文的代码 + +> list or l 命令 + +* 首先设置断点,再使用list命令查看断点上下文代码。 + +![Alt text](pic/image-20.png) + +#### 11\. 查看函数调用栈 + +> backtrace or bt + +![Alt text](pic/image-15.png) + +> frame 栈帧序号 //切换栈帧 + +![Alt text](pic/image-16.png) + +#### 12\. 查看并设置系统寄存器 + +1)查看通用寄存器 + +> info registers or i registers + +![Alt text](pic/image-17.png) + +2)查看全部寄存器 + +> info all-registers + +3)查看某一该寄存器 + +> info registers 寄存器名称 + +![Alt text](pic/image-18.png) + +4)设置(PC)寄存器的值 + +> set var $pc=xxxxxx + +#### 13\. 查看并设置内存 + +> x / addr \[参数为可选项\] + +|参数|含义|可选值| +|-|-|-| +|n|显示的内存长度|| +|f|显示的格式(默认16进制)|x(16进制)、d(十进制)、u(十进制无符号整型)、o(八进制)、t(二进制)、c(字符格式)、f(浮点格式) ...| +|u|当前地址往后请求的位宽大小|b(单字节)、h(双字节)、w(四字节)、g(八字节)| + +示例: + +![Alt text](pic/image-19.png) + +#### 14\. 观察和设置程序变量 + +1)查看变量值 + +* 查看全局和静态变量 + +> info variables + +![Alt text](pic/image-22.png) + +* 显示当前栈中的局部变量 + +> info locals + +![Alt text](pic/image-23.png) + +* 打印某一具体变量的值 + +> print var or p var\ +> display var //(display没有缩写形式) + +![Alt text](pic/image-25.png) + +2)设置变量值 + +> print var=x + +![Alt text](pic/image-26.png) + +> set var=x or +> set var \_var=x + +* 注:第一个var作为gdb参数使用,用在变量名称和gdb参数相冲突的场景 + +![Alt text](pic/image-27.png) + +#### 15\. 设置条件断点 + +含义:条件满足时,产生断点。 + +> b breakpoint if \[condition\] + +![Alt text](pic/image-28.png) + +> condition breakpoint_num var==x + +![Alt text](pic/image-29.png) + +#### 16\. 设置监测断点 + +含义:监测的值发生变化时,产生断点。 + +> watch \*addr + +![Alt text](pic/image-30.png) + +> watch \[condition\] + +![Alt text](pic/image-31.png) + +> watch var + +![Alt text](pic/image-32.png) + +#### 17\. 汇编指令 + +* 查看当前执行及其后20条指令 + +> display /20i $pc + +![Alt text](pic/image-34.png) + +* 调出汇编指令窗口配合调试 + +> layout asm + +* 注:快捷键\[ctrl+x+a\]可退出窗口 + +![Alt text](pic/image-33.png) + +* 进入下一条汇编指令 + +> si or ni 指令 + +![Alt text](pic/image-35.png) + +#### 18\. 结束调试会话 + +> monitor shutdown //在gdb中关闭openocd + +> quit or q //退出gd \ No newline at end of file diff --git a/terminal/jtag_debugging/pic/image-1.png b/terminal/jtag_debugging/pic/image-1.png new file mode 100644 index 0000000000000000000000000000000000000000..9e3825e739c09d0e01994a91f13e884b317ff3c5 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-1.png differ diff --git a/terminal/jtag_debugging/pic/image-10.png b/terminal/jtag_debugging/pic/image-10.png new file mode 100644 index 0000000000000000000000000000000000000000..5b6f8fb81f9f7422153ec0af4fda3cbcae226b82 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-10.png differ diff --git a/terminal/jtag_debugging/pic/image-11.png b/terminal/jtag_debugging/pic/image-11.png new file mode 100644 index 0000000000000000000000000000000000000000..0e83debe26f96f69b3388a0c5d087e3ef3f9eb3e Binary files /dev/null and b/terminal/jtag_debugging/pic/image-11.png differ diff --git a/terminal/jtag_debugging/pic/image-12.png b/terminal/jtag_debugging/pic/image-12.png new file mode 100644 index 0000000000000000000000000000000000000000..a48c6b41cbf12a7640855ff47bf6aadaa41d2344 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-12.png differ diff --git a/terminal/jtag_debugging/pic/image-13.png b/terminal/jtag_debugging/pic/image-13.png new file mode 100644 index 0000000000000000000000000000000000000000..22a6d6f08065d04128b20bfded3afbcea318df6d Binary files /dev/null and b/terminal/jtag_debugging/pic/image-13.png differ diff --git a/terminal/jtag_debugging/pic/image-14.png b/terminal/jtag_debugging/pic/image-14.png new file mode 100644 index 0000000000000000000000000000000000000000..7e0f30429150f914ea67d06247a4fd4ede97474f Binary files /dev/null and b/terminal/jtag_debugging/pic/image-14.png differ diff --git a/terminal/jtag_debugging/pic/image-15.png b/terminal/jtag_debugging/pic/image-15.png new file mode 100644 index 0000000000000000000000000000000000000000..7bd55ead48b7bbab85e8bd5fe2a79a0e3e2a66f1 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-15.png differ diff --git a/terminal/jtag_debugging/pic/image-16.png b/terminal/jtag_debugging/pic/image-16.png new file mode 100644 index 0000000000000000000000000000000000000000..a8775770c213e2db34f34fcde5ff785fe94eb9d4 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-16.png differ diff --git a/terminal/jtag_debugging/pic/image-17.png b/terminal/jtag_debugging/pic/image-17.png new file mode 100644 index 0000000000000000000000000000000000000000..f6b06b68949d0e103256d42a7fac11c6c16d94c5 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-17.png differ diff --git a/terminal/jtag_debugging/pic/image-18.png b/terminal/jtag_debugging/pic/image-18.png new file mode 100644 index 0000000000000000000000000000000000000000..1692d591cade598a55373bc33d545f3da87d1c24 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-18.png differ diff --git a/terminal/jtag_debugging/pic/image-19.png b/terminal/jtag_debugging/pic/image-19.png new file mode 100644 index 0000000000000000000000000000000000000000..19e21487c602afdfbc0faed93c4f1ba166564ca1 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-19.png differ diff --git a/terminal/jtag_debugging/pic/image-2.png b/terminal/jtag_debugging/pic/image-2.png new file mode 100644 index 0000000000000000000000000000000000000000..da49c5693906e1a285c478b7fd58e72ba8f43a5a Binary files /dev/null and b/terminal/jtag_debugging/pic/image-2.png differ diff --git a/terminal/jtag_debugging/pic/image-20.png b/terminal/jtag_debugging/pic/image-20.png new file mode 100644 index 0000000000000000000000000000000000000000..a274a572df639c94e092b528bac528708539abbd Binary files /dev/null and b/terminal/jtag_debugging/pic/image-20.png differ diff --git a/terminal/jtag_debugging/pic/image-21.png b/terminal/jtag_debugging/pic/image-21.png new file mode 100644 index 0000000000000000000000000000000000000000..eb2bd0de90a96f2c60ed402e0c01009bdf36628a Binary files /dev/null and b/terminal/jtag_debugging/pic/image-21.png differ diff --git a/terminal/jtag_debugging/pic/image-22.png b/terminal/jtag_debugging/pic/image-22.png new file mode 100644 index 0000000000000000000000000000000000000000..af0c623d1902a0e2723c4d099fd64a2ee4e4ee7c Binary files /dev/null and b/terminal/jtag_debugging/pic/image-22.png differ diff --git a/terminal/jtag_debugging/pic/image-23.png b/terminal/jtag_debugging/pic/image-23.png new file mode 100644 index 0000000000000000000000000000000000000000..b8fff951f6e6696f6f9d274890b42cc37cbbf76a Binary files /dev/null and b/terminal/jtag_debugging/pic/image-23.png differ diff --git a/terminal/jtag_debugging/pic/image-24.png b/terminal/jtag_debugging/pic/image-24.png new file mode 100644 index 0000000000000000000000000000000000000000..75d96d6397eaafe653628d85c7b214ed5e53dfd2 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-24.png differ diff --git a/terminal/jtag_debugging/pic/image-25.png b/terminal/jtag_debugging/pic/image-25.png new file mode 100644 index 0000000000000000000000000000000000000000..cc3166add3ef53d9b8ade4019dda340713a1a402 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-25.png differ diff --git a/terminal/jtag_debugging/pic/image-26.png b/terminal/jtag_debugging/pic/image-26.png new file mode 100644 index 0000000000000000000000000000000000000000..fe55ac97aee5730b8e02cdfef4c50837c9af36e1 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-26.png differ diff --git a/terminal/jtag_debugging/pic/image-27.png b/terminal/jtag_debugging/pic/image-27.png new file mode 100644 index 0000000000000000000000000000000000000000..1863aa82354dc083c40c2781f8b868d7a751e42c Binary files /dev/null and b/terminal/jtag_debugging/pic/image-27.png differ diff --git a/terminal/jtag_debugging/pic/image-28.png b/terminal/jtag_debugging/pic/image-28.png new file mode 100644 index 0000000000000000000000000000000000000000..07aab6e59c0df346dc5f6021172de07a3f76f3e9 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-28.png differ diff --git a/terminal/jtag_debugging/pic/image-29.png b/terminal/jtag_debugging/pic/image-29.png new file mode 100644 index 0000000000000000000000000000000000000000..10af21f0171a8a5134ce01849f62ff0ba2bc8000 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-29.png differ diff --git a/terminal/jtag_debugging/pic/image-3.png b/terminal/jtag_debugging/pic/image-3.png new file mode 100644 index 0000000000000000000000000000000000000000..eeecbb4f5e7b0afd097ad036dba0b3a22c8f1199 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-3.png differ diff --git a/terminal/jtag_debugging/pic/image-30.png b/terminal/jtag_debugging/pic/image-30.png new file mode 100644 index 0000000000000000000000000000000000000000..d3b7cef906bba88084047ee80b2897e94fed657e Binary files /dev/null and b/terminal/jtag_debugging/pic/image-30.png differ diff --git a/terminal/jtag_debugging/pic/image-31.png b/terminal/jtag_debugging/pic/image-31.png new file mode 100644 index 0000000000000000000000000000000000000000..92ffd1ce7543388f26f2f11bffc2ed8f6b83f935 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-31.png differ diff --git a/terminal/jtag_debugging/pic/image-32.png b/terminal/jtag_debugging/pic/image-32.png new file mode 100644 index 0000000000000000000000000000000000000000..e13e0054f67e8314cfee6fd11bd8bc30535d6898 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-32.png differ diff --git a/terminal/jtag_debugging/pic/image-33.png b/terminal/jtag_debugging/pic/image-33.png new file mode 100644 index 0000000000000000000000000000000000000000..640e7a3b1ff4ec61f33594778d2c44b0fcc7f1b4 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-33.png differ diff --git a/terminal/jtag_debugging/pic/image-34.png b/terminal/jtag_debugging/pic/image-34.png new file mode 100644 index 0000000000000000000000000000000000000000..edf3875be17ab588fc93427788f896116acc16db Binary files /dev/null and b/terminal/jtag_debugging/pic/image-34.png differ diff --git a/terminal/jtag_debugging/pic/image-35.png b/terminal/jtag_debugging/pic/image-35.png new file mode 100644 index 0000000000000000000000000000000000000000..d2c6e9199c6c05aa9226424ff26b50e1f2ae5ba2 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-35.png differ diff --git a/terminal/jtag_debugging/pic/image-4.png b/terminal/jtag_debugging/pic/image-4.png new file mode 100644 index 0000000000000000000000000000000000000000..9ea815fd0924b1f8c44d1fa046fe46ea92698b04 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-4.png differ diff --git a/terminal/jtag_debugging/pic/image-5.png b/terminal/jtag_debugging/pic/image-5.png new file mode 100644 index 0000000000000000000000000000000000000000..df3b1a6bf8db3c82fba9ab233137afd8eca3584b Binary files /dev/null and b/terminal/jtag_debugging/pic/image-5.png differ diff --git a/terminal/jtag_debugging/pic/image-6.png b/terminal/jtag_debugging/pic/image-6.png new file mode 100644 index 0000000000000000000000000000000000000000..2f115d3125900f6c266082f804e65c09c24cb526 Binary files /dev/null and b/terminal/jtag_debugging/pic/image-6.png differ diff --git a/terminal/jtag_debugging/pic/image-7.png b/terminal/jtag_debugging/pic/image-7.png new file mode 100644 index 0000000000000000000000000000000000000000..231f67f0d1c391372be5a4d650b813b152f47cff Binary files /dev/null and b/terminal/jtag_debugging/pic/image-7.png differ diff --git a/terminal/jtag_debugging/pic/image-8.png b/terminal/jtag_debugging/pic/image-8.png new file mode 100644 index 0000000000000000000000000000000000000000..1e95794f875e9c50c478a1fb7748eb160726f63f Binary files /dev/null and b/terminal/jtag_debugging/pic/image-8.png differ diff --git a/terminal/jtag_debugging/pic/image-9.png b/terminal/jtag_debugging/pic/image-9.png new file mode 100644 index 0000000000000000000000000000000000000000..a765906b59bcf2c5e615a7de1acca4d28b51fedb Binary files /dev/null and b/terminal/jtag_debugging/pic/image-9.png differ diff --git a/terminal/jtag_debugging/pic/image.png b/terminal/jtag_debugging/pic/image.png new file mode 100644 index 0000000000000000000000000000000000000000..ba67294488750261f1e1f7ab0fee19d321af88c9 Binary files /dev/null and b/terminal/jtag_debugging/pic/image.png differ diff --git a/terminal/jtag_debugging/pic/image36.png b/terminal/jtag_debugging/pic/image36.png new file mode 100644 index 0000000000000000000000000000000000000000..ef4f4aad24955079a7e46bc2b96a08f7d7178e56 Binary files /dev/null and b/terminal/jtag_debugging/pic/image36.png differ diff --git a/terminal/jtag_debugging/pic/image37.png b/terminal/jtag_debugging/pic/image37.png new file mode 100644 index 0000000000000000000000000000000000000000..ee6db20fd487a9fb21d8bbf0f6a97788fa32a4f3 Binary files /dev/null and b/terminal/jtag_debugging/pic/image37.png differ diff --git a/terminal/jtag_debugging/pic/image38.png b/terminal/jtag_debugging/pic/image38.png new file mode 100644 index 0000000000000000000000000000000000000000..02cc5f469706a797c6d6703499c8b577af0751fc Binary files /dev/null and b/terminal/jtag_debugging/pic/image38.png differ diff --git a/terminal/jtag_debugging/pic/image39.png b/terminal/jtag_debugging/pic/image39.png new file mode 100644 index 0000000000000000000000000000000000000000..a03f3283286dcf03a4420e57151c7719fccafe9d Binary files /dev/null and b/terminal/jtag_debugging/pic/image39.png differ diff --git a/terminal/linux_x64/figs/ubuntu_cc.png b/terminal/linux_x64/figs/ubuntu_cc.png new file mode 100644 index 0000000000000000000000000000000000000000..7567587fcdee8539baaf23f6f3c816b9054d1246 Binary files /dev/null and b/terminal/linux_x64/figs/ubuntu_cc.png differ diff --git a/terminal/linux_x64/figs/ubuntu_env.png b/terminal/linux_x64/figs/ubuntu_env.png new file mode 100644 index 0000000000000000000000000000000000000000..aef2d186223c4d10b9742d7111429dfd2fb31083 Binary files /dev/null and b/terminal/linux_x64/figs/ubuntu_env.png differ diff --git a/terminal/linux_x64/terminal_ubuntu_x64.md b/terminal/linux_x64/terminal_ubuntu_x64.md new file mode 100644 index 0000000000000000000000000000000000000000..44a1b7a140592f459e916ef8285b811cc54aa5f6 --- /dev/null +++ b/terminal/linux_x64/terminal_ubuntu_x64.md @@ -0,0 +1,60 @@ +# Linux 平台命令行开发环境 (Ubuntu x64) + +- Ubuntu 平台的命令行开发环境集成了, +- 1. `setup_dev.py`, 用于更新开发环境路径到环境变量 +- 2. `xpack-arm-none-eabi-gcc-12.2.1-1.2-linux-x64`,xpack 发布的[32位交叉编译链](https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack),用于 Windows 环境交叉编译 ARM32 目标码 +- 3. `xpack-aarch64-none-elf-gcc-12.2.1-1.2-linux-x64`,xpack 发布的[64位交叉编译链](https://github.com/xpack-dev-tools/aarch64-none-elf-gcc-xpack),用于 Windows 环境交叉编译 ARM64 目标码 +- 4. `openocd`, OpenOCD 是一种开源的片上编程和调试软件(https://github.com/openocd-org/openocd),本环境中的 openocd 基于开源软件修改后编译,如果需要修改后的源码,可以联系 `opensource_embedded@phytium.com.cn` 获取 + +## 获取和安装开发环境 + +- (1) 从下面的链接中下载开发环境安装包 + +- [env_ubuntu_x64.tar.gz](https://pan.baidu.com/s/1UIiYRHWjx15fHjj8nJX0Zw) +> 提取码: PHYT + + +- (2) 下载完成后,在 Linux 控制台中输入下列命令进行解压 +``` +tar zxvf env_ubuntu_x64.tar.gz +``` + +- (3) 解压安装完成后,进入解压目录,运行下列命令更新开发环境路径到环境变量中 + +``` +python3 ./setup_dev.py +``` + +- (4) 更新完成后,重启系统或者运行下列命令在当前控制台生效环境变量 + +``` +source /etc/profile.d/phytium_dev.sh +``` +> 注意上述命令更新环境变量只对当前控制台生效,之前打开的控制台不会自动生效,建议重启系统全局生效 + +- (5) 安装完成后,可以测试一下各组件是否能够使用 + +![](./figs/ubuntu_env.png) + +## 下载 SDK 源码进行编译 + +- (6) 在 Linux 控制台,通过 git 拉取 Phytium Standalone SDK 的代码 + +``` +git clone https://gitee.com/phytium_embedded/phytium-standalone-sdk.git ./phytium-standalone-sdk +``` + +- (7) 进入 SDK 源码路径下的工程开始编译 + +``` +cd ./phytium-standalone-sdk/example/system/letter_shell_test/ +make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_shell +make clean +make -j +``` + +![](./figs/ubuntu_cc.png) + +## 通过 OpenOCD 和 GDB 进行调试 + +- (8) 编译生成镜像后,可以使用开发环境中的 OpenOCD 和 GDB 进行调试,调试方法可以[参考](../jtag_debugging/jtag_debugging.md) \ No newline at end of file diff --git a/terminal/windows_x64/figs/msys2_env.png b/terminal/windows_x64/figs/msys2_env.png new file mode 100644 index 0000000000000000000000000000000000000000..f6e220a9966fc728b2179d4679f0137f02338935 Binary files /dev/null and b/terminal/windows_x64/figs/msys2_env.png differ diff --git a/terminal/windows_x64/figs/sdk_cc.png b/terminal/windows_x64/figs/sdk_cc.png new file mode 100644 index 0000000000000000000000000000000000000000..c2e7b586c50cacb8ec2977c4f949e776d6cc0add Binary files /dev/null and b/terminal/windows_x64/figs/sdk_cc.png differ diff --git a/terminal/windows_x64/terminal_msys64.md b/terminal/windows_x64/terminal_msys64.md new file mode 100644 index 0000000000000000000000000000000000000000..105c74269997844b1973c2337fead3b595bd14bf --- /dev/null +++ b/terminal/windows_x64/terminal_msys64.md @@ -0,0 +1,44 @@ +# Windows 平台命令行开发环境 (Msys2) + +- Windows 平台的命令行开发环境基于 Msys2 开发,集成了, +- 1. `msys2` 命令行环境,主要提供 Windows 上的 shell 命令行开发环境,[Msys2](https://repo.msys2.org/distrib/x86_64/) 包括了Cygwin (POSIX 兼容性层)和 MinGW-w64(从"MinGW-生成") +- 2. `run_msys2.cmd`,用于打开和配置msys2 shell的脚本 +- 3. `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 目标码 +- 4. `xpack-aarch64-none-elf-gcc-12.2.1-1.2-win32-x64` ,xpack 发布的[64位交叉编译链](https://github.com/xpack-dev-tools/aarch64-none-elf-gcc-xpack),用于 Windows 环境交叉编译 ARM64 目标码 +- 5. `openocd`, OpenOCD 是一种开源的片上编程和调试软件(https://github.com/openocd-org/openocd),本环境中的 openocd.exe 基于开源软件修改后编译,如果需要修改后的源码,可以联系 `opensource_embedded@phytium.com.cn` 获取 + +## 获取和安装开发环境 + +- (1) 从下面的链接中下载开发环境安装包 + +- [env_msys64.exe](https://pan.baidu.com/s/1UIiYRHWjx15fHjj8nJX0Zw) +> 提取码: PHYT + +- (2) 下载完成后,在 Windows 环境下双击自解压安装到指定目录,注意安装路径使用全英文和数字,不要使用带中文字符的路径 +- (3) 解压安装完成后,双击脚本`run_msys2.cmd`, 进入 msys2 控制台,之后可以直接使用,使用前可以测试相关组件是否可以使用 + +![](./figs/msys2_env.png) + +## 下载 SDK 源码进行编译 + +- (4) 在 msys2 控制台,通过 git 拉取 Phytium Standalone SDK 的代码 + +``` +cd ~ +git clone https://gitee.com/phytium_embedded/phytium-standalone-sdk.git ./phytium-standalone-sdk +``` + +- (5) 进入 SDK 源码路径下的工程开始编译 + +``` +cd ./phytium-standalone-sdk/example/system/letter_shell_test/ +make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_shell +make clean +make -j +``` + +![](./figs/sdk_cc.png) + +## 通过 OpenOCD 和 GDB 进行调试 + +- (6) 编译生成镜像后,可以使用开发环境中的 OpenOCD 和 GDB 进行调试,调试方法可以[参考](../jtag_debugging/jtag_debugging.md) \ No newline at end of file