This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6442: Remoteproc failed bad phdr da

Part Number: AM6442
Other Parts Discussed in Thread: TMDS64EVM, SYSCONFIG

Tool/software:

Hello,

I just created an application to blink a LED from R5F0 core with no RTOS. I replaced the firmware on /lib/firmware by my firmware. when I start the AM64-evm, in Linux I have this message for remoteproc

(I add a resource table in my R5F application) 

remoteproc remoteproc0: Booting fw image am64-main-r5f0_0-fw, size 310068

[ 12.464193] remoteproc remoteproc0: bad phdr da 0x70080000 mem 0xef00

[ 12.473257] remoteproc remoteproc0: Failed to load program segments: -22

what does it mean  ? I don't find where is the problem. Do you have an idea ? 

 

MY MEMORY CONFIGURATION on R5F 

name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
R5F_VECS 00000000 00000040 00000040 00000000 RWIX
R5F_TCMA 00000040 00007fc0 00000000 00007fc0 RWIX
R5F_TCMB0 41010000 00008000 00000000 00008000 RWIX
FLASH 60100000 00080000 00000000 00080000 RWIX
MSRAM 70080000 00040000 00016fd8 00029028 RWIX
DDR_0 a0100000 00100000 00001000 000ff000 RWIX
DDR_1 a0200000 00e00000 00000000 00e00000 RWIX
RTOS_NORTOS_IPC_SHM_M a5000000 00800000 00000000 00800000 RWIX
USER_SHM_MEM a5800000 00000080 00000000 00000080 RWIX
LOG_SHM_MEM a5800080 00003f80 00000000 00003f80 RWIX


SEGMENT ALLOCATION MAP

run origin load origin length init length attrs members
---------- ----------- ---------- ----------- ----- -------
00000000 00000000 00000040 00000040 r-x
00000000 00000000 00000040 00000040 r-x .vectors
70080000 70080000 0000ef00 00000000 rw-
70080000 70080000 00002f00 00000000 rw- .bss
70082f00 70082f00 00008000 00000000 rw- .sysmem
7008af00 7008af00 00004000 00000000 rw- .stack
7008ef00 7008ef00 00006940 00006940 r-x
7008ef00 7008ef00 00005160 00005160 r-x .text
70094060 70094060 00000898 00000898 r-- .rodata
700948f8 700948f8 00000760 00000760 r-x .text.hwi
70095058 70095058 00000430 00000430 r-x .text.cache
70095488 70095488 00000220 00000220 r-x .text.mpu
700956a8 700956a8 00000190 00000190 r-x .text.boot
70095838 70095838 00000008 00000008 r-x .text:abort
70095840 70095840 00000398 00000398 rw-
70095840 70095840 00000398 00000398 rw- .data
70095bd8 70095bd8 00001400 00000000 r--
70095bd8 70095bd8 00000100 00000000 r-- .irqstack
70095cd8 70095cd8 00000100 00000000 r-- .fiqstack
70095dd8 70095dd8 00001000 00000000 r-- .svcstack
70096dd8 70096dd8 00000100 00000000 r-- .abortstack
70096ed8 70096ed8 00000100 00000000 r-- .undefinedstack
a0100000 a0100000 00001000 00001000 r--
a0100000 a0100000 00001000 00001000 r-- .resource_table

Thank you 

  • Hello,

    What version of processor SDK are you using?

    Linux remoteproc is complaining about the SRAM memory allocation. Have you allocated a region for SRAM in your Linux devicetree, and then added that SRAM region to the R5F Linux devicetree node?

    Please refer to the AM64x Academy, multicore module.

    I would suggest going through the entire "Application Development on Remote Cores" section:
    https://dev.ti.com/tirex/explore/node?a=7qm9DIS__LATEST&node=A__AfSHr0vWbFdGCnmoPeMXzg__AM64-ACADEMY__WI1KRXP__LATEST

    But the specific page with the SRAM example code you are looking for is "modify the remote core application" > "Allocate memory":
    https://dev.ti.com/tirex/explore/node?a=7qm9DIS__LATEST&node=A__AXdlNVv-3hxEuToJ8O8ivg__AM64-ACADEMY__WI1KRXP__LATEST 

    Regards,

    Nick

  • Hello Nick,

    Thank you very much for your help. Now it's works. For future readers and beginners like me on this microcontroller, I've decided to make a summary. 

    Steps to reach gpio led blink on EVM TMDS64EVM from linux remoteproc LED 29

    1) Take mcu_plus_sdk_am64x_10_00_00_20 (for me the latest)

    2) Open with Code composer studio 12.7.0 GPIO LED blink project located at C:\ti\mcu_plus_sdk_am64x_10_00_00_20\examples\drivers\gpio\gpio_led_blink\am64x-evm\r5fss0-0_nortos

    3) In Project Explorer/double click on project gpio_led_blink_am64-evm_r5fss0-0_nortos_ti-arm-clang and file example.sysconfig

    3.1) configure IPC section like this

    3.2) GPIO section

    3.3) MEMORY REGION section

    3.4 SECTION OF MEMORY CONFIGURATOR

    Don't forget resource table like this

    see attached my example.sysconfig  sysconfig-DTS-memory map

    build project in debug ou release mode

    After build the .map file in your workspace project should look like this

    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    R5F_VECS 00000000 00000040 00000040 00000000 RWIX
    R5F_TCMA 00000040 00007fc0 00000000 00007fc0 RWIX
    R5F_TCMB0 41010000 00008000 00000000 00008000 RWIX
    FLASH 60100000 00080000 00000000 00080000 RWIX
    MSRAM 70080000 00040000 00016fd8 00029028 RWIX
    DDR_IPC_RESOURCE_TABL a0100000 00001000 00001000 00000000 RWIX
    RTOS_NORTOS_IPC_SHM_M a5000000 00800000 00000000 00800000 RWIX
    USER_SHM_MEM a5800000 00000080 00000000 00000080 RWIX
    LOG_SHM_MEM a5800080 00003f80 00000000 00003f80 RWIX

    -----------------------------------------------------------------------------------------------------------------------------------------------

    Modification of device tree

    On Linux SDK (Linux Machine) go to the directory ~/ti-processor-sdk-linux-am64xx-evm-10.00.07.04/board-support/ti-linux-kernel-6.6.32+git-ti/arch/arm64/boot/dts/ti$ 

    Modify the file k3-am64-main.dtsi by adding this line 

    and this file k3-am642-evm.dts

    and now to make a new dtb, go to the ~/ti-processor-sdk-linux-am64xx-evm-10.00.07.04 and type the command : make linux-dtbs (read this page 1.1.4. SDK Build using Makefile — Processor SDK AM64X Documentation

    a new dtb is available here : ~/ti-processor-sdk-linux-am64xx-evm-10.00.07.04/board-support/ti-linux-kernel-6.6.32+git-ti/arch/arm64/boot/dts/ti$/k3-am642-evm.dtb

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Copy this new dtb to your SD card on /boot/dtb/ti/

    In directory /lib/firmware,  unlink am64-main-r5f0_0-fw

    Copy the new firmware with the extension .out in /usr/lib/firmware/

    In directory /lib/firmware create a new link with :  ln -sf /gpio_led_blink_am64x-evm_r5fss0-0_nortos_ti-arm-clang.out /lib/firmware/am64-main-r5f0_0-fw

    reboot

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    To create a .out file signed (not mandatory for debug)

    $ git clone git.ti.com/.../core-secdev-k3.git -b master
    $ export TI_SECURE_DEV_PKG=`pwd`/core-secdev-k3
    Signing the firmware

    $ ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh $FIRMWARE.out $FIRMWARE.signed

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    My next step is to start the firmware directly to u-boot with a script file and the command

    rproc init
    load mmc 1:2 0x90000000 /lib/firmware/am64-main-r5f0_0-fw
    rproc load 1 0x90000000 0x${filesize}
    rproc start 1

    Coming soon

    Best regards

    Sebastien

     

  • Hello Sebastien,

    I am glad you were able to get things working! Thank you for confirming your solution, it definitely helps other people who find this thread in the future.

    If any other questions pop up, feel free to create a new thread.

    Using rproc to initialize cores in uboot 

    The AM64x Linux SDK docs are out-of-date. We added support for AM64x rproc in uboot starting in Linux SDK 9.1, but it is not documented as supported in SDK 9.1, 9.2, or 10.0. I filed a ticket to fix this a while ago, I'll ping the developers for an update.

    In the meantime, please refer to the AM62x SDK docs. The page is generic, so there are not any AM62x-specific details:
    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/10_00_07_04/exports/docs/linux/Foundational_Components/U-Boot/UG-RemoteProc.html

    Regards,

    Nick