1、RTOS SDK 环境搭建
1.1 下载RTOS SDK
下载链接:PROCESSOR-SDK-J721E 软件开发套件 (SDK) | TI.com.cn
下载压缩包ti-processor-sdk-rtos-j721e-evm-08_06_01_03.tar
到PSDKR_PATH
目录中,可以为home/user
目录或者/opt
目录
解压:
tar -xvf ti-processor-sdk-rtos-j721e-evm-08_06_01_03.tar
1.2 环境设置:
1.2.1 链接linux sdk
中的rootfs
和boot
文件到:
cd ${PSDKR_PATH} ln -s /home/zynq/tda4/ti-processor-sdk-linux-j7-evm-08_06_01_02/board-support/prebuilt-images/boot-j7-evm.tar.gz boot-j7-evm.tar.gz ln -s /home/zynq/tda4/ti-processor-sdk-linux-j7-evm-08_06_01_02/filesystem/tisdk-edgeai-image-j7-evm.tar.xz tisdk-edgeai-image-j7-evm.tar.xz
1.2.2 如果已下载工具链,可以链接到PSDKR_PATH
目录中
cd ${PSDKR_PATH} ln -s /home/zynq/tools/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf ln -s /home/zynq/tools/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu ln -s /home/zynq/tools/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf
1.2.3 运行RTOS 环境setup脚本
setup脚本会安装系统所需软件包,并下载源代码包和工具链包(PSDKR_PATH
目录下没有的情况下)。
cd ${PSDKR_PATH} ./psdk_rtos/scripts/setup_psdk_rtos.sh
2、RTOS SDK 组件介绍
软件包列表:
mcusw | 包含用于 AutoSAR的MCU demos, MCAL(Microcontroller abstraction layer) |
---|---|
pdk_jacinto | The PDK( Platform Development Kit ) comes with pre-built libraries for running the demos/examples and everything you need to start writing an application (Note: This is part of the binary package and not available with source only package). However, one may want to customize and rebuild the source. |
ethfw | 以太网固件是基于FreeRTOS的应用,用于配置SOC内核的以太网switch,运行在Main域的Cortex R5F 0 core 0上。 以太网固件包含用于处理本地和远程API调用和演示的远程配置服务器、源管理库、交换驻留协议、代理层. 交换机软件使用PDK中的网路和其它驱动用于各自的IP配置。 |
tidl_j721e | 用于j721e的深度学习库 |
glm | 用于图形软件的c++数学库,全部为hpp头文件形式 |
dsplib_c66x | C66x DSP 通用运算库,有预编译版本,也可以用CCS v5编译或者makefile编译,工程位于packages/ti/dsplib |
dsplib | C71 DSP 通用运算库,有预编译版本,也可以重新编译 |
mathlib_c66x | C66x DSP 浮点运算库,有预编译版本,位于ti/mathlib/lib/目录下 |
mathlib | C71 DSP 浮点运算库,有预编译版本,位于lib/目录下 |
fftlib | C7X/MMA FFT 计算库 |
remote_device | 用于核间通讯的C/S架构的软件库,可以用于核间共享物理设备数据。 |
SYSFW | https://git.ti.com/git/processor-firmware/ti-linux-firmware.git。用于管理clock, power and resource 。这些服务可以通过PDK包中的 “sciclient” 进行访问 |
xdais | XDAIS DSP 算法接口 |
3、编译PDK
PDK支持两种编译方式,区别如下:
makefile at PDK_INSTALL_DIR/packages/ti/build supports granular build targets like specific library and examples. makefile at PDK_INSTALL_DIR/packages supports build of all possible boards and cores based on PDK_SOC variable.
编译产物位于${PSDKR_PATH}/pdk_jacinto_08_06_01_03/packages/ti/binary/。
3.1 编译所有Plaform Development Kit (PDK)
包,包括 libraries 和examples
cd ${PSDKR_PATH}/pdk_jacinto_08_06_01_03/packages make all PDK_SOC=j721e
3.2 只编译Plaform Development Kit (PDK)
中的 libraries
cd ${PSDKR_PATH}/pdk_jacinto_08_06_01_03/packages make all_libs PDK_SOC=j721e
3.3 只编译Plaform Development Kit (PDK)
中的 examples
cd ${PSDKR_PATH}/pdk_jacinto_08_06_01_03/packages make all_examples PDK_SOC=j721e
3.4 分core编译
下面是支持的board和core列表
Jacinto Family of Devices BOARD = j721e_evm CORE = < mpu1_0, mcu1_0, mcu1_1, mcu2_0, mcu2_1, mcu3_0, mcu3_1, c66xdsp_1, c66xdsp_2, c7x_1 >
cd PDK_INSTALL_DIR/packages/ti/build Build all PDK libraries for all cores: make -s pdk_libs_allcores BOARD=<board> Build all PDK applications and libraries for all cores: make -s allcores BOARD=<board> Build all PDK libraries for a given cores: make -s pdk_libs BOARD=<board> CORE=<core> Build all PDK applications and libraries for a given cores: make -s all BOARD=<board> CORE=<core> Build individual targets (use help menu to see all targets): make -s <target> BOARD=<board> CORE=<core> Clean everything (all cores and all platforms/boards): make -s allclean Clean all targets for a given board: make -s allcores_clean BOARD=<board> Clean individual targets: make -s <target>_clean BOARD=<board> CORE=<core> To know more build options: make -s help BOARD=<board> e.g. make help BOARD = j721e_evm The above command could be used to list the application supported for a given platform/SoC
3.5、编译产物
3.5.1 编译lib产物后缀
The full library name consists of its name and extension shown as <LIBNAME>.<LIBEXT> where LIBEXT is constructed as a<FORMAT_EXT><ISA_EXT><ENDIAN_EXT> as described at the following table
Variable | Description |
---|---|
<LIBMAME> | Library name will be the module name or the <mod name>_LIBNAME if it is specified at the makefile. Examples: csl_LIBNAME = ti.csl ==> ti.csl.ae66, MODULE_NAME = esm ==> esm.aer5f |
<FORMAT_EXT> | Format extension. For example, ELF file is indicated as “e” |
<ISA_EXT> | ISA extension. For example, a8, a9, a15, a53, a72, m4, r5f, 66, 71 |
<ENDIAN_EXT> | ENDIAN extension which is core-specific. For example, “e” is usually used to indicate big endianness and “fg” indicates little endianness for MPU A8, A9, A15, A53 and A72 |
下面是一些示例,文件位于目录 “PDK_INSTALL_DIR/packages”:
ti/drv/udma/lib/j721e/mcu1_0/release/udma.aer5f ti/osal/lib/freertos/j721e/r5f/release/ti.osal.aer5f ti/drv/i2c/ib/j721e/a72/debug/ti.drv.i2c.aa53fg ti/board/lib/j721e_evm/c66/release/ti.board.ae66
4、编译ethfw
4.1 编译所有包
总体编译规则如下:
make <target> PSDK_PATH=<Processor SDK installation path> ETHFW_PATH=<EthFw installation path>
可以使用make help
查看支持的编译选项
For J721E:
make ethfw_all BUILD_SOC_LIST=J721E
可以使用SHOW_COMMANDS 设置输出编译过程信息:
make ethfw_all BUILD_SOC_LIST=<SOC> SHOW_COMMANDS=1
清除编译结果
make ethfw_all_clean BUILD_SOC_LIST=<SOC>
4.2 编译 SafeRTOS
The location of the SafeRTOS package can be changed through the SAFERTOS_KERNEL_INSTALL_r5f_<SOC> variable in ethfw_tools_path.mak. The SafeRTOS version validated for each SoC can also be found in ethfw_tools_path.mak.
只编译基于SafeRTOS,不编译基于FreeRTOS的包:
make ethfw_all BUILD_SOC_LIST=<SOC> BUILD_APP_FREERTOS=no BUILD_APP_SAFERTOS=yes
编译基于SafeRTOS和FreeRTOS的包:
make ethfw_all BUILD_SOC_LIST=<SOC> BUILD_APP_FREERTOS=yes BUILD_APP_SAFERTOS=yes
4.3 Profiles选项
debug版本
make ethfw_all BUILD_SOC_LIST=<SOC> PROFILE=debug
release版本
make ethfw_all BUILD_SOC_LIST=<SOC> PROFILE=release
4.4 编译产物
cp <SDK_INSTALL_PATH>/ethfw/out/J721E/R5Ft/FREERTOS/debug/app_remoteswitchcfg_server_strip.xer5f <MOUNT>/rootfs/lib/firmware/ethfw/
If needed, update the soft-link j7-main-r5f0_0-fw or j7200-main-r5f0_0-fw to point to the demo application copied to SD card in the previous step.
cd <MOUNT>/rootfs/lib/firmware/ ln -sf ethfw/app_remoteswitchcfg_server_strip.xer5f j7-main-r5f0_0-fw
4、编译错误
4.1 mono: command not found
出现
/bin/sh: mono: command not found
解决方法:
sudo apt install mono-complete