AI-64 Running code from R5F cores

So I have been trying to figure this out and have finally manged to find an example that compiles and will boot on the core without an error.

This is for the R5 cores in the MAIN domain, not the MCU domain as I think that probably needs to be setup at boot.

This is all on a Linux host. If using Windows, it will be slightly different.

I have downloaded the PROCESSOR-SDK-RTOS-J721E (1.7G) from the TI website
Extract the file.

By investigating the firmware files on the Beaglebone I narrowed down a couple of possible examples.

switch to

ti-processor-sdk-rtos-j721e-evm-08_02_00_05/pdk_jacinto_08_02_00_21/packages/ti/build

make ipc_echo_test_freertos CORE=mcu2_0

built binary is in

ti-processor-sdk-rtos-j721e-evm-08_02_00_05/pdk_jacinto_08_02_00_21/packages/ti/binary/ipc_echo_test_freertos/bin/j721e_evm/

copy ipc_echo_test_freertos_mcu2_0_release_strip.xer5f to the beaglebone /lib/firmware

then

echo ipc_echo_test_freertos_mcu2_0_release_strip.xer5f > /dev/remoteproc/j7-main-r5f0_0/firmware
echo start > /dev/remoteproc/j7-main-r5f0_0/state

I have not yet delved into any detail of what this actually does, but it will load and run.

There are also a lot of other examples, however most so far come back with a boot failed: -22 error when loading the firmware. I think some/many are designed to be run from boot, with no OS.

Perhaps they do actually work, but because they don’t setup rpmsg the kernel thinks they have failed ? No idea what error 22 is.

There is quite a bit of documentation, however not so much to get a bare-bones project up and running.

The -22 I think is a bit of a catchall, I think it may well be to do with how it was linked, memory access, DMA who knows. I thought it was maybe something to do with how the kernel was set up with memory for each core, I have not investigated this yet.

I have taken a similar approach but used the vision apps examples from the same RTOS package, trying to run something built for one core on another can give you that -22, or totally hang everything!

To be honest the vision apps make stuff is a behemoth I’m guessing they have some tool to generate it, so have not got much further than enabling the extra cores and running them on the AI-64, so it is great you have found a better example to use, I will take a look at that one.