Forums » Software Development »
Extending meta-toolchain-arago-tisdk to include pru-icss
Added by Nathan Wright 5 days ago
Hi guys,
We already have pru-icss on target by including it in our base image recipe.
ARAGO_BASE_IMAGE_EXTRA_INSTALL += "\
pru-icss \
...\
"
When we build meta-toolchain-arago-tisdk however, the SDK does not include all the needed support files. It has the compiler at sysroots/x86_64-arago-linux/usr/share/ti/cgt-pru, but the supporting files for compiling your own program (found in previous SDKs at .../example-applications/pru-icss-*.*.*) are not there. Searching all the sources, the only recipe that fetches from https://git.ti.com/cgit/pru-software-support-package is pru-icss.
After speaking with Bob, I think I need a recipes-core/meta/meta-toolchain-arago-tisdk.bbappend file. I am just not sure what to put in to it.
Do you guys have any experience extending this recipe?
Thanks,
Nathan
Replies (11)
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Jonathan Cormier 5 days ago
Nathan Wright wrote:
Hi guys,
We already have pru-icss on target by including it in our base image recipe.
[...]When we build meta-toolchain-arago-tisdk however, the SDK does not include all the needed support files. It has the compiler at sysroots/x86_64-arago-linux/usr/share/ti/cgt-pru, but the supporting files for compiling your own program (found in previous SDKs at .../example-applications/pru-icss-*.*.*) are not there. Searching all the sources, the only recipe that fetches from https://git.ti.com/cgit/pru-software-support-package is pru-icss.
Are you trying to build code for the PRU or code for the ARM to talk to the PRU?
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Nathan Wright 5 days ago
We are trying to build our own code for the PRU.
Our CMakeLists looks like this...
# variables for the pru build
set (PRU_CGT ${HOST_SYSROOT}/usr/share/ti/cgt-pru)
set (PRU_CGT_BIN ${PRU_CGT}/bin)
set (PRU_CGT_INC ${PRU_CGT}/include)
set (PRU_CGT_LIB ${PRU_CGT}/lib)
set (PRU_RPMSG ${SDK_PATH}/example-applications/pru-icss-5.6.0) <--- This is missing from the SDK
set (PRU_RPMSG_INC ${PRU_RPMSG}/include)
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pr1_pru0.o"
COMMAND "${PRU_CGT_BIN}/clpru"
"--include_path=${PRU_CGT_INC}"
"--include_path=${PRU_RPMSG_INC}"
"--include_path=${PRU_RPMSG_INC}/am572x_2_0"
"--include_path=../../include"
"-v3"
"-O4"
"-mf"
"--display_error_number"
"--endian=little"
"--hardware_mac=on"
"--obj_directory=${CMAKE_CURRENT_BINARY_DIR}"
"--pp_directory=${CMAKE_CURRENT_BINARY_DIR}"
"-ppd"
"-ppa"
"-fe"
"${CMAKE_CURRENT_BINARY_DIR}/pr1_pru0.o"
"pr1_pru0.c"
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/pr1_pru0.c
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
VERBATIM
COMMENT "Creating pr1_pru0.o"
)
It doesn't have to be 5.6.0. I think the layers use 6.3.0, which is probably fine. There are include files in there that are needed to compile.
I am simply looking for how to include the support package in to the sdk when I build it.
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Nathan Wright 5 days ago
I am currently trying this, but I am just blindly throwing things at the wall.
meta-toolchain-arago-tisdk.bbappend...
TOOLCHAIN_HOST_TASK:append += " pru-icss-dev"
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Jonathan Cormier 5 days ago
Ah so I think the way TI has their recipes setup, you need to build the tisdk-core-bundle recipe if you want the installer that TI produces that contains everything.
https://layers.openembedded.org/layerindex/recipe/405899/
Personally I'd recommend checking out the pru examples you need yourself and adding them to your code repo so your only external dependencies is the stuff included in the sdk toolchain build.
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Jonathan Cormier 5 days ago
These are the steps I took to figure that out but its all a bit convoluted...
$ ag example-applications meta-arago/meta-arago-extras/recipes-graphics/glsdk-example-apps/glsdk-example-apps.bb 14:SRC_URI = "git://git.ti.com/git/glsdk/example-applications.git;protocol=https;branch=master \ meta-tisdk/conf/distro/include/arago-source-ipk.inc 44:SRCIPK_INSTALL_DIR:pn-arm-benchmarks ?= "example-applications/${PN}-${PV}" 47:SRCIPK_INSTALL_DIR:pn-oprofile-example ?= "example-applications/${PN}" 50:SRCIPK_INSTALL_DIR:pn-pdm-anomaly-detection ?= "example-applications/${PN}-${PV}" 88:SRCIPK_INSTALL_DIR:pn-pru-icss ?= "example-applications/${PN}-${PV}" 91:SRCIPK_INSTALL_DIR:pn-mmwavegesture-hmi ?= "example-applications/${PN}-${PV}" 94:SRCIPK_INSTALL_DIR:pn-evse-hmi ?= "example-applications/${PN}-${PV}" 97:SRCIPK_INSTALL_DIR:pn-protection-relays-hmi ?= "example-applications/${PN}-${PV}" 100:SRCIPK_INSTALL_DIR_pn-omapconf ?= "example-applications/${PN}-${PV}" meta-tisdk/recipes-demos/pru-adc/pru-adc_git.bb 52:SRCIPK_INSTALL_DIR = "example-applications/${PN}-${PV}" <---------- ================================== $ ag SRCIPK_INSTALL_DIR meta-tisdk/classes/sourceipk.bbclass 12:# - SRCIPK_INSTALL_DIR = This variable indicates the directory to install 24:# By setting the SRCIPK_INSTALL_DIR this default can be changed to any 48:SRCIPK_INSTALL_DIR ?= "/usr/src/${PN}-src" 127: cd ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR} 140: rm -rf ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/.git 143: mv $gitshallowclone/.git ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/ 162: cd ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR} 244: mkdir -p ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR} 249: tar -C ${SRCIPK_SRC_DIR} -cO $excludes . | tar -C ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR} -xpf - 253: if [ -e ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/patches ] 255: mv ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/patches ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/patches-links 256: cp -rL ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/patches-links ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/patches 257: rm -rf ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/patches-links 262: sourceipk_create_readme ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/ 263: cp ${FILE} ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/ 296: d.setVar('FILES_%s-src' % (pn), '${SRCIPK_INSTALL_DIR}') 301: install -d ${PKGDEST}/${PN}-src/${SRCIPK_INSTALL_DIR} 303: ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/. \ 304: ${PKGDEST}/${PN}-src/${SRCIPK_INSTALL_DIR} meta-tisdk/conf/distro/include/arago-source-ipk.inc <------------- 26:# SRCIPK_INSTALL_DIR:pn-<pkg> = "<install dir>" 28:# SRCIPK_INSTALL_DIR:pn-u-boot = "board-support/u-boot-source" 44:SRCIPK_INSTALL_DIR:pn-arm-benchmarks ?= "example-applications/${PN}-${PV}" 47:SRCIPK_INSTALL_DIR:pn-oprofile-example ?= "example-applications/${PN}" 50:SRCIPK_INSTALL_DIR:pn-pdm-anomaly-detection ?= "example-applications/${PN}-${PV}" 53:SRCIPK_INSTALL_DIR:pn-u-boot-ti-staging ?= "${@oe.utils.conditional("TI_EXTRAS", "tie-jailhouse", "board-support/u-boot-extras-jailhouse-${PV}${UBOOT_LOCALVERSION}", "board-support/ti-u-boot-${PV}${UBOOT_LOCALVERSION}", d)}" 58:SRCIPK_INSTALL_DIR:pn-linux-ti-staging ?= "${@oe.utils.conditional("TI_EXTRAS", "tie-jailhouse", "board-support/linux-extras-${PV}${KERNEL_LOCALVERSION}", "board-support/ti-linux-kernel-${PV}${KERNEL_LOCALVERSION}", d)}" 63:SRCIPK_INSTALL_DIR:pn-linux-ti-staging-rt ?= "${@oe.utils.conditional("TI_EXTRAS", "tie-jailhouse", "board-support/linux-extras-${PV}${KERNEL_LOCALVERSION}", "board-support/ti-linux-kernel-${PV}${KERNEL_LOCALVERSION}", d)}" 68:SRCIPK_INSTALL_DIR:pn-cryptodev-module ?= "board-support/extra-drivers/cryptodev-module-${PV}" 72:SRCIPK_INSTALL_DIR:pn-ti-img-rogue-driver ?= "board-support/extra-drivers/${PN}-${PV}" 76:SRCIPK_INSTALL_DIR:pn-jailhouse ?= "board-support/extra-drivers/${PN}-${PV}" 80:SRCIPK_INSTALL_DIR:pn-optee-os ?= "board-support/${PN}-${PV}" 84:SRCIPK_INSTALL_DIR:pn-trusted-firmware-a ?= "board-support/${PN}-${PV}" 88:SRCIPK_INSTALL_DIR:pn-pru-icss ?= "example-applications/${PN}-${PV}" 91:SRCIPK_INSTALL_DIR:pn-mmwavegesture-hmi ?= "example-applications/${PN}-${PV}" 94:SRCIPK_INSTALL_DIR:pn-evse-hmi ?= "example-applications/${PN}-${PV}" 97:SRCIPK_INSTALL_DIR:pn-protection-relays-hmi ?= "example-applications/${PN}-${PV}" 100:SRCIPK_INSTALL_DIR_pn-omapconf ?= "example-applications/${PN}-${PV}" meta-tisdk/recipes-demos/opcua-server/opcua-server_git.bb 16:SRCIPK_INSTALL_DIR = "examples/opc-ua-server" meta-tisdk/recipes-demos/pru-adc/pru-adc_git.bb 52:SRCIPK_INSTALL_DIR = "example-applications/${PN}-${PV}" meta-edgeai/conf/distro/include/edgeai-source-ipk.inc 5:SRCIPK_INSTALL_DIR:pn-edgeai-apps-utils ?= "edgeai-app-stack/${PN}" 12:SRCIPK_INSTALL_DIR:pn-edgeai-dl-inferer ?= "edgeai-app-stack/${PN}" 19:SRCIPK_INSTALL_DIR:pn-edgeai-gst-apps ?= "edgeai-app-stack/${PN}" 26:SRCIPK_INSTALL_DIR:pn-edgeai-gst-plugins ?= "edgeai-app-stack/${PN}" 33:SRCIPK_INSTALL_DIR:pn-edgeai-tiovx-kernels ?= "edgeai-app-stack/${PN}" 40:SRCIPK_INSTALL_DIR:pn-edgeai-tiovx-modules ?= "edgeai-app-stack/${PN}" ============================== $ ag sourceipk.bbclass meta-tisdk/classes/sourceipk.bbclass 1:# sourceipk.bbclass enables the creation of an ipk file that contains the ============================ $ ag arago-source-ipk.inc meta-tisdk/conf/layer.conf 18:require conf/distro/include/arago-source-ipk.inc =================================== $ ag sourceipk meta-tisdk/conf/distro/include/arago-source-ipk.inc 37:INHERIT += "sourceipk" 39:# Disable including README and recipe files in sourceipks for SDK builds. meta-tisdk/classes/sourceipk.bbclass 1:# sourceipk.bbclass enables the creation of an ipk file that contains the 78:# the sourceipk 186: # sourceipk more than once. 217:sourceipk_create_readme() { 240:sourceipk_do_create_srcipk() { 262: sourceipk_create_readme ${SRCIPK_STAGING_DIR}/${SRCIPK_INSTALL_DIR}/ 288:# Do not perform any QA checks on sourceipk packages meta-tisdk/recipes-core/images/tisdk-core-bundle.bbappend <-------- 17: packagegroup-arago-tisdk-sourceipks-sdk-host \
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Nathan Wright 2 days ago
Hi Jon,
I guess I need more explicit instructions.
What exactly should I do with "tisdk-core-bundle"?
I have tried adding it a couple variables with seemingly no effect.
Thanks,
Nathan
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Jonathan Cormier 2 days ago
tisdk-core-bundle is another recipe of TI's which bundles a bunch of stuff into a single installer. You can build it via bitbake. Though I think its a bit overkill. It will likely trigger building of a lot of different recipes and images which you don't care about.
meta-arago/meta-arago-distro/recipes-core/images/tisdk-core-bundle.bb
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Nathan Wright 2 days ago
Ok, so that brings me back to my original question.
I see the files I need at...
pokyuser@b46b6b5ada2e:/work/am57xx-evm-ep00075/build$ ls -l ./arago-tmp-default-glibc/sysroots-components/am57xx_evm_ep00075/pru-icss/usr/
total 8
drwxr-xr-x 12 pokyuser pokyuser 4096 Feb 19 21:37 include
drwxr-xr-x 2 pokyuser pokyuser 4096 Feb 19 21:37 lib
What are the steps to include that tree in to the SDK installer?
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Nathan Wright 2 days ago
I figured it out...
nwright@nwright-ubuntu-24-lts:~/projects/oe-layersetup/sources/meta-adbsg$ cat recipes-core/meta/meta-toolchain-arago-tisdk.bbappend
TOOLCHAIN_TARGET_TASK:append = " \
pru-icss-dev \
pru-icss-staticdev \
"
Thanks
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Jonathan Cormier 1 day ago
Okay glad it works. Strange that they would put the include files in the -staticdev package. I wonder if that's a bug on TI's part.
RE: Extending meta-toolchain-arago-tisdk to include pru-icss - Added by Nathan Wright 1 day ago
I guess it is not that strange since the PRU code can't do stuff dynamically. I think it is all statically linked builds.
Hilariously though, it does not play well with the rest of the include space. The pru compiler starts acting all gnu-y if they co-habitate.
So I had to isolate them.
nwright@nwright-ubuntu-24-lts:~/projects/oe-layersetup/sources/meta-adbsg$ cat recipes-bsp/pru/pru-icss_%.bbappend
do_install:append() {
# The header files can't be mixed in with all the linux
# header files because the pru compiler gets confused and
# starts trying to include soft-stubs.h.
#
# So, we will move the headers in to their own folder
install -d ${D}${includedir}/pru
cd ${D}${includedir}
mv pru_* rsc_types.h am* pru/
}
# Add to package revision to indicate it has been changed
PR:append:mitysom-am62x-ep00119 = "_mitysom-am62x-ep00119_0"
PR:append:am57xx-evm-ep00075 = "_am57xx-evm-ep00075_0"