PROCESSOR-SDK-AM62X: AM62x: Failed to run the UART Echo in M4F core

Part Number: PROCESSOR-SDK-AM62X

Hi,

I am trying to run the UART Echo example.

https://software-dl.ti.com/mcu-plus-sdk/esd/AM62X/09_02_00_38/exports/docs/api_guide_am62x/EXAMPLES_DRIVERS_UART_ECHO.html


I believe I have built the UART Echo application successfully.

I have tried both "uart_echo_am62x-sk_m4fss0-0_nortos_ti-arm-clang.out" and "uart_echo.mcu-m4f0_0.strip.out". Both also failed.


root@p550:/lib/firmware# ls
am62-mcu-m4f0_0-fw  regulatory.db  regulatory.db.p7s
root@p550:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state
[514484.624850] remoteproc remoteproc0: powering up 5000000.m4fss
[514484.631666] remoteproc remoteproc0: Booting fw image am62-mcu-m4f0_0-fw, size 273848
[514484.643169] remoteproc remoteproc0: Boot failed: -22
-sh: echo: write error: Invalid argument
root@p550:/lib/firmware#

Do I miss anything here ?

But, I can run IPC RP Message Linux Echo application successfully.

root@p550:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state
[515958.535521] remoteproc remoteproc0: powering up 5000000.m4fss
[515958.541903] remoteproc remoteproc0: Booting fw image am62-mcu-m4f0_0-fw, size 124408
[515958.552541] rproc-virtio rproc-virtio.2.auto: assigned reserved memory node m4f-dma-memory@9cb00000
[515958.571380] virtio_rpmsg_bus virtio0: rpmsg host is online
[515958.577250] virtio_rpmsg_bus virtio0: creating channel ti.ipc4.ping-pong addr 0xd
[515958.588724] rproc-virtio rproc-virtio.2.auto: registered virtio0 (type 7)
[515958.597023] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0xe
[515958.606231] remoteproc remoteproc0: remote processor 5000000.m4fss is now up
root@p550:/lib/firmware#

rgds,

kc Wong

  • Hi Kiung,

    Thanks for your question. I have noted your concerns.


    I am going to run the UART echo example for M4f and let you know about the results. I am assuming you have not made any changes and working on the latest MCU PLUS SDK release.

    Regards,

    Vaibhav

  • I am using mcu_plus_sdk_am62x_09_02_00_38.

  • Hi Kiung,

    Thanks for mentioning the MCU PLUS SDK version.

    I am going to run this example and check if it works at my setup. I will update you in sometime.

    Regards,

    Vaibhav

  • Hi Vaibhav,

    Figured out that a resource table is needed in the UART Echo example in order for Linux remoteproc driver to launch the example application successfully.

    The linker.cmd file must also be updated to place the resource table in DDR.

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


    With that, I am able to run the  UART Echo example

    But, the trace log does not work, so there is no way to tell if the example application run successfully.

    root@p550:~#
    root@p550:~# cat /sys/class/remoteproc/remoteproc0/state
    running
    root@p550:~# cat /sys/kernel/debug/remoteproc/remoteproc0/trace0
    root@p550:~#
    root@p550:~#
    

    rgds,

    kc Wong

  • Hello Kiung,

    Can you please list down all the steps to run this UART echo example?

    I think you are booting via SD Card boot mode and following SPL instead of SBL.

    Can you please list the steps for me to try it on my setup? Starting from the way you initialized the SoC to how to running the application.

    Regards,

    Vaibhav

  • 1. build the UART echo example using CCS

    2. copy the .out file to the target HW that running Linux at /lib/firmware

    3. rename the .out file to am62-mcu-m4f0_0-fw 

    4. start the application as follow at the Linux target terminal

    root@p550:/lib/firmware# ls
    am62-mcu-m4f0_0-fw  regulatory.db  regulatory.db.p7s
    root@p550:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state
    [514484.624850] remoteproc remoteproc0: powering up 5000000.m4fss
    [514484.631666] remoteproc remoteproc0: Booting fw image am62-mcu-m4f0_0-fw, size 273848
    [514484.643169] remoteproc remoteproc0: Boot failed: -22
    -sh: echo: write error: Invalid argument
    root@p550:/lib/firmware#



    You may refer to the below for more detailed steps.

    (a) https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1344067/processor-sdk-am62x-setup-the-development-environment-for-m4f-core

    (b) e2e.ti.com/.../re-processor-sdk-am62x-how-to-run-an-m4f-example-that-communicates-with-linux


    A
    nd of course you need to enable the M4F core in device tree as below.

    &mcu_m4fss {
    	status = "okay";
    	mboxes = <&mailbox0_cluster0 &mbox_m4_0>;
    	memory-region = <&mcu_m4fss_dma_memory_region>,
    			<&mcu_m4fss_memory_region>;
    };

  • Hi Kiung,

    Thanks for the steps.

    Please expect responses in sometime.

    Regards,

    Vaibhav

  • Hi Kiung,

    I am currently in full day trainings and you can expect responses by early next week.

    Regards,

    Vaibhav

  • Hi Kiung,

    Thanks for your patience.

    I would like to continue my debug on this and as a part of action item, I would like to replicate your setup.

    1. build the UART echo example using CCS

    2. copy the .out file to the target HW that running Linux at /lib/firmware

    3. rename the .out file to am62-mcu-m4f0_0-fw 

    4. start the application as follow at the Linux target terminal

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    root@p550:/lib/firmware# ls
    am62-mcu-m4f0_0-fw regulatory.db regulatory.db.p7s
    root@p550:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state
    [514484.624850] remoteproc remoteproc0: powering up 5000000.m4fss
    [514484.631666] remoteproc remoteproc0: Booting fw image am62-mcu-m4f0_0-fw, size 273848
    [514484.643169] remoteproc remoteproc0: Boot failed: -22
    -sh: echo: write error: Invalid argument
    root@p550:/lib/firmware#
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    You may refer to the below for more detailed steps.

    I have noted your steps.

    Apart from this I wanted to know one more thing, in which exact file did you make the following change?

    &mcu_m4fss {
    status = "okay";
    mboxes = <&mailbox0_cluster0 &mbox_m4_0>;
    memory-region = <&mcu_m4fss_dma_memory_region>,
    <&mcu_m4fss_memory_region>;
    };

    After you made the change, did you run the following command? make linux-dtbs

    If there were any additional commands you ran you can let me know as well.

    Looking forward to your response.

    Regards,

    Vaibhav

  • Hi Vaibhav,

    I am using our company custom board, and not the TI development board.

    I think you need to identify the device tree for the HW that you are using. I made that change in our custom board device tree.

    Then you shall just run your normal bitbake build.

    We are using kas now instead of running bitbake directly, thus we just run "kas build" for our project.

    User Guide — kas 4.4 documentation

    Or may be you can force to bitbake your kernel with below command.

    bitbake -c compile -f linux-ti-staging

    rgds,

    kc Wong

  • Hi Kiung,

    Thanks for pointing out your steps.

    Allow me sometime to replicate this issue.

    Regards,

    Vaibhav

  • Hi Kiung,

    A little update from my end, so I have found the section where mcu_m4fss node is declared.

    I think I would just need to put status = "okay" in order to make sure the kernel knows about it.

    I will keep you updated with any progress on this.

    Regards,

    Vaibhav

  • Hello Kiung,

    Thank you for your patience.

    Due to other high priority threads, I have not been able to catch up with this thread.

    Just a heads up, I am going to resume working on this tomorrow and update you with the results.

    Regards,

    Vaibhav

  • Greetings Kiung,

    I have been able to recreate the issue you were facing.

    I took the file named uart_echo.release.out and renamed it to am62-mcu-m4f0_0-fw.

    I am going to check if this is expected or not.

    Regards,

    Vaibhav