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.

SK-AM62: Reissuing: Load M4 firmware generate from MCU RTOS SDK

Part Number: SK-AM62
Other Parts Discussed in Thread: SYSCONFIG

HI,

I would like to pick up following archived thread:

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1114668/am6252-load-m4-firmware-generate-from-mcu-rtos-sdk

are there any updates to this issue?

I still encounter the same problems with newest SDK version 9 (https://www.ti.com/tool/download/MCU-PLUS-SDK-AM62X/09.00.00.19).

All standard SDK examples are failing to be loaded into M4 memory.

I am especially interested in NORTOS versions.

Is there an overall fix to this issue?

Best regards,
Clemens

  • Hello Clemens,

    Yes, we actually just published the first version of the AM62x Multicore academy last month. In particular, please take a look at page "Application Development on Remote Cores"

    https://dev.ti.com/tirex/explore/node?node=A__AVn3JGT9fqm0PbS.pegO-g__AM62-ACADEMY__uiYMDcq__LATEST 

    The section "How to create remote core firmware that can be initialized by Linux" was written partially based on that e2e thread you linked.

    Regards,

    Nick

  • Hello Nick,

    thank you for the quick response.

    I tried fix#1, since we are planning to use rpmsg anyway, but I got following errors while compiling:

    Building target: "hello_world_am62x-sk_m4fss0-0_nortos_ti-arm-clang.out"
    Invoking: Arm Linker
    "/home/grabner/ti/ti-cgt-armllvm_2.1.2.LTS/bin/tiarmclang" -mcpu=cortex-m4 -mfloat-abi=hard -mlittle-endian -mthumb -DSOC_AM62X -D_DEBUG_=1 -g -Wall -Wno-gnu-variable-sized-type-not-at-end -Wno-unused-function -Wl,-m"hello_world.Debug.map" -Wl,-i"/home/grabner/ti/mcu_plus_sdk_am62x_08_06_00_18/source/kernel/nortos/lib" -Wl,-i"/home/grabner/ti/mcu_plus_sdk_am62x_08_06_00_18/source/drivers/lib" -Wl,-i"/home/grabner/ti/mcu_plus_sdk_am62x_08_06_00_18/source/board/lib" -Wl,-i"/home/grabner/ti/ti-cgt-armllvm_2.1.2.LTS/lib" -Wl,--reread_libs -Wl,--diag_wrap=off -Wl,--display_error_number -Wl,--warn_sections -Wl,--xml_link_info="hello_world_am62x-sk_m4fss0-0_nortos_ti-arm-clang_linkInfo.xml" -Wl,--ram_model -o "hello_world_am62x-sk_m4fss0-0_nortos_ti-arm-clang.out" "./syscfg/ti_dpl_config.o" "./syscfg/ti_drivers_config.o" "./syscfg/ti_drivers_open_close.o" "./syscfg/ti_pinmux_config.o" "./syscfg/ti_power_clock_config.o" "./syscfg/ti_board_config.o" "./syscfg/ti_board_open_close.o" "./hello_world.o" "./main.o" "../linker.cmd" -Wl,-lnortos.am62x.m4f.ti-arm-clang.debug.lib -Wl,-ldrivers.am62x.m4f.ti-arm-clang.debug.lib -Wl,-lboard.am62x.m4f.ti-arm-clang.debug.lib -Wl,-llibc.a -Wl,-llibsysbm.a
    makefile:145: recipe for target 'hello_world_am62x-sk_m4fss0-0_nortos_ti-arm-clang.out' failed
    warning #10247-D: creating output section ".resource_table" without a SECTIONS specification
    "../linker.cmd", line 25: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. run placement with alignment fails for section ".bss" size 0x8235a. Available memory ranges:
    M4F_DRAM size: 0x10000 unused: 0xf020 max hole: 0xf020
    error #10010: errors encountered during linking; "hello_world_am62x-sk_m4fss0-0_nortos_ti-arm-clang.out" not built
    tiarmclang: error: tiarmlnk command failed with exit code 1 (use -v to see invocation)
    gmake[1]: *** [hello_world_am62x-sk_m4fss0-0_nortos_ti-arm-clang.out] Error 1
    gmake: *** [all] Error 2
    makefile:141: recipe for target 'all' failed

    **** Build Finished ****

    It looks like it ran out of space, but this is the plane "hello world" example from the SDK without any changes except including IPC.

    Thank you.

    Regards, Clemens

  • Hello Nick,

    I tried a few things and found something. Unfortunately it still doesn't work completely.

    If you add two additional lines to the linker.cmd file, that are not mentioned in the patch you showed me, coming from "ipc_rpmsg_echo_linux..." it compiles correctly:

    SECTIONS{

    /* this is used only when IPC RPMessage is enabled, else this is not used */
        .bss.ipc_vring_mem   (NOLOAD) : {} > IPC_VRING_MEM

    }

    MEMORY {

    IPC_VRING_MEM: ORIGIN = 0x9C800000, LENGTH = 0x00300000

    }

    Sadly after placing it in the /lib/firmware folder and booting up it returns:

    [ 7.231552] remoteproc remoteproc0: remote processor 5000000.m4fss is now up

    and

    root@verdin-am62-15133540:~# cat /sys/class/remoteproc/remoteproc0/state
    running

    but there are no outputs, neither on UART, nor in /sys/kernel/debug/remoteproc/remoteproc0/trace0

    Please let me know if you have any advice.

    Thank you and best Regards,
    Clemens

  • Hello Clemens,

    Did you follow the steps in the section "Update the linker.cmd file"?

    https://dev.ti.com/tirex/explore/node?node=A__AVn3JGT9fqm0PbS.pegO-g__AM62-ACADEMY__uiYMDcq__LATEST

    IPC_VRING_MEM is not actually used for RPMsg with Linux, it is only used for MCU+ to MCU+ core communication. So I would not expect that to help you. For more information about the memory section that is allocated for the VRINGS for Linux RPMsg, reference page "How to allocate memory"

    https://dev.ti.com/tirex/explore/node?node=A__AZgEw2fWxmvPzpRgXlGAMQ__AM62-ACADEMY__uiYMDcq__LATEST 

    Regards,

    Nick

  • Hi Nick,

    After a lot of testing I figured it out: There where some additional configuration changes mandatory in addition to the RPMsg settings within Sysconfig:

    - Change and copy all entries in "RAT" (now 8 at 256MB instead of 4 at 512MB, also change addresses)

    - Change and copy all entries in "MPU ARMv7" (now 3 instead of 2)

    When these settings are set in addition to the changes you mentioned it is possible to start and run MCU with UART, GPIO.

    I am now stuck on using SPI, but this will be part of another discussion.

    Thank you.

    Best Regards,
    Clemens

  • Thanks for responding back with your solution Clemens! Glad to hear you were able to make some progress.

    FYI for you and future readers, I have added documentation on using the RAT to the new AM62Ax MCU academy:
    https://dev.ti.com/tirex/explore/node?node=A__AXBsTEetU2hiTMZSzq4row__AM62A-ACADEMY__WeZ9SsL__LATEST

    We are still writing the AM62x MCU Academy, but it will have the same page. Let us know if you have any feedback for improving the next version of the docs!

    Regards,

    Nick