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.

AM62A7: running ipc test applications on am62a

Part Number: AM62A7
Other Parts Discussed in Thread: PROCESSOR-SDK-AM62A,

Tool/software:

Hi,

I am trying to test IPC on am62a, so I chose the vision_apps/apps/utilities/app_ipc shipped within PROCESSOR-SDK-J7XXX to do this.

I was building my rtos with the k3-am62a7-sk bsp against PROCESSOR-SDK-J7XXX and getting some binaries of the test applications.

then I was running the binary (app_arm_ipc) but getting the following errors:

APP: Init ... !!!
MEM: Init SHM ... !!!
MEM: Initialized SHM (fd=7) !!!
MEM: get SHM heap id (0) !!!
MEM: Init SHM ... Done !!!
IPC: Init ... !!!
IPC: ERROR: Unable to create TX channels for CPU [mcu1_0] !!!
IPC: ERROR: Unable to create TX channels for CPU [c7x_1] !!!
IPC: Init ... Done !!!
APP: ERROR: IPC init failed !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
   461.300612 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
   461.305887 s:  VX_ZONE_INIT:Enabled
   461.306044 s:  VX_ZONE_ERROR:Enabled
   461.311157 s:  VX_ZONE_WARNING:Enabled
   461.317021 s:  VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-0
   461.317573 s:  VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-1
   461.327221 s:  VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-2
   461.332543 s:  VX_ZONE_INIT:[tivxPlatformCreateTargetId:116] Added target MPU-3
   461.342846 s:  VX_ZONE_INIT:[tivxInitLocal:136] Initialization Done !!!
   461.348286 s:  VX_ZONE_INIT:[tivxHostInitLocal:101] Initialization Done for HOST !!!
APP IPC: ERROR: Send msg 1 to CPU [mcu1_0] failed !!!
APP IPC: ERROR: Send msg 1 to CPU [c7x_1] failed !!!
APP IPC: ERROR: Send msg 1 to CPU [mcu1_0] failed !!!
APP IPC: ERROR: Send msg 1 to CPU [c7x_1] failed !!!
APP IPC: ERROR: Send msg 1 to CPU [mcu1_0] failed !!!
APP IPC: ERROR: Send msg 1 to CPU [c7x_1] failed !!!
APP IPC: ERROR: Send msg 1 to CPU [mcu1_0] failed !!!
APP IPC: ERROR: Send msg 1 to CPU [c7x_1] failed !!!
APP IPC: Waiting for all messages to get echoed from remote core...
APP IPC: Waiting for all messages to get echoed ... Done.
APP IPC: Running remote service test ...
   471.423271 s: REMOTE_SERVICE_TEST: Running test for CPU mcu1_0 !!!
REMOTE_SERVICE: TX: FAILED: mpu1_0 -> mcu1_0 (port 21) cmd = 0x00001234, prm_size = 4 bytes
   471.423857 s: REMOTE_SERVICE_TEST: Test failed @ iteration 0 !!!
   471.424328 s: REMOTE_SERVICE_TEST: Running test @ 0xa3000000 of 1024 bytes size for CPU mcu1_0 !!!
REMOTE_SERVICE: TX: FAILED: mpu1_0 -> mcu1_0 (port 21) cmd = 0x00005678, prm_size = 8 bytes
   471.433340 s: REMOTE_SERVICE_TEST: Test failed @ iteration 0 !!!
   471.443803 s: REMOTE_SERVICE_TEST: Running test for timer of 10000 msecs for CPU mcu1_0 !!!
REMOTE_SERVICE: TX: FAILED: mpu1_0 -> mcu1_0 (port 21) cmd = 0x00000002, prm_size = 4 bytes
   471.459628 s: REMOTE_SERVICE_TEST: Timer test of 10000 msecs for CPU mcu1_0 ... DONE !!!
   471.464971 s: REMOTE_SERVICE_TEST: ERROR: Timer test !!!
   471.475493 s: REMOTE_SERVICE_TEST: Running test for CPU c7x_1 !!!
REMOTE_SERVICE: TX: FAILED: mpu1_0 -> c7x_1 (port 21) cmd = 0x00001234, prm_size = 4 bytes
   471.486083 s: REMOTE_SERVICE_TEST: Test failed @ iteration 0 !!!
   471.491538 s: REMOTE_SERVICE_TEST: Running test @ 0xa3000000 of 1024 bytes size for CPU c7x_1 !!!
REMOTE_SERVICE: TX: FAILED: mpu1_0 -> c7x_1 (port 21) cmd = 0x00005678, prm_size = 8 bytes
   471.507305 s: REMOTE_SERVICE_TEST: Test failed @ iteration 0 !!!
   471.517783 s: REMOTE_SERVICE_TEST: Running test for timer of 10000 msecs for CPU c7x_1 !!!
REMOTE_SERVICE: TX: FAILED: mpu1_0 -> c7x_1 (port 21) cmd = 0x00000002, prm_size = 4 bytes
   471.528433 s: REMOTE_SERVICE_TEST: Timer test of 10000 msecs for CPU c7x_1 ... DONE !!!
   471.538949 s: REMOTE_SERVICE_TEST: ERROR: Timer test !!!
APP IPC: Running remote service test ... Done.
   471.549602 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:115] De-Initialization Done for HOST !!!
   471.673185 s:  VX_ZONE_INIT:[tivxDeInitLocal:204] De-Initialization Done !!!
APP: Deinit ... !!!
REMOTE_SERVICE: Deinit ... !!!
REMOTE_SERVICE: Deinit ... Done !!!
IPC: Deinit ... !!!
IPC: DeInit ... Done !!!
MEM: Deinit SHM ... !!!
MEM: Alloc's: 2 alloc's of 2048 bytes
MEM: Free's : 2 free's  of 2048 bytes
MEM: Open's : 0 allocs  of 0 bytes
MEM: Deinit SHM ... Done !!!
APP: Deinit ... Done !!!
APP IPC: Done !!!

I did some investigations on the initial failures for creating TX channels and found the testing code is trying to open the following devices:

/rpmsg_ctrl-1-13
/rpmsg_ctrl-2-13

while I see in my rtos with device show command, the same are not showed but having entries in other identifiers:

drv refs name
  2 [ 3] /dev/video0
  6 [ 3] /devm
 19 [ 3] /dma_heap/edgeai_shared-memories
  3 [ 3] /eeprom/0
 13 [ 3] /fifos
 17 [ 3] /host.host
  8 [ 3] /mmc0a
  9 [ 3] /mmc0b
  0 [ 5] /null
 12 [ 3] /romfs
 15 [ 3] /rpmsg_ctrl-3-14
 18 [ 3] /rpmsg_ctrl-4-13
  8 [ 3] /sd1a
  9 [ 3] /sd1b
  8 [ 3] /sd1c
  5 [ 3] /shm
  1 [ 5] /ttyS0
  1 [ 3] /ttyUSB0
  4 [ 3] /vxbus
value = 2 = 0x2

I then turned on the debug for the rpmsg component and got this:

this may explain how the port numbers are created.

arget Name: vxTarget
rpmsg_create_ept:ns
rpmsg_create_ept:ns->53
rpmsg_register_device: Added one Rpmsg @ 0x245e140
rpmsg_ns_cb: NS message: flag:0, ti.ipc4.ping-pong, addr:13
rpmsg_ns_cb: NS message: flag:0, rpmsg_chrdev, addr:14
rpmsg_create_ept:ns
rpmsg_create_ept:ns->53
rpmsg_register_device: Added one Rpmsg @ 0x245e280
rpmsg_ns_cb: NS message: flag:0, rpmsg_chrdev, addr:13

I understand the first number is for remote processor id and the second number is for remote port, the dts shows the processor id for r5 core and c7x core are 3 and 4 respectively:

r5f@79000000 {
compatible = "ti,am62-r5f";
reg = <0x79000000 0x00008000 0x79020000 0x00008000>;
reg-names = "atcm" "btcm";
ti,sci = <0x00000005>;
ti,sci-dev-id = <0x00000009>;
ti,sci-proc-ids = <0x00000003 0x000000ff>;

dsp@7e000000 {
compatible = "ti,am62a-c7xv-dsp";
reg = <0x00000000 0x7e000000 0x00000000 0x00100000>;
reg-names = "l2sram";
ti,sci = <0x00000005>;
ti,sci-dev-id = <0x000000d0>;
ti,sci-proc-ids = <0x00000004 0x000000ff>;
resets = <0x00000007 0x000000d0 0x00000001>;

 

So the confusing part is why the testing code is trying invalid processor ids? 

 

Please help!

Thank you very much!

Regards,

Hailong

  • The code uses the cpu id in the enabled_cpu_id_list to construct the rpmsg_ctrl device name. so by this code the id for the remote processor should be 1 and 2:

     

    So looks like the rpmsg_ctrl-3-14 and rpmsg_ctrl-4-13 are mal formatted?

    What's more, where the port numbers (13 and 14) come from? and why the test code only uses the 13? 

  • Hello Hailong,

    What are you trying to test?

    Are you trying to test general-purpose RPMsg IPC? Or are you specifically trying to test a Vision application or EdgeAI application?

    Use the correct code base

    I would suggest running AM62Ax code on AM62Ax, instead of J7 code (i.e., use the AM62Ax SDKs https://www.ti.com/tool/PROCESSOR-SDK-AM62A )

    If you are trying to test RPMsg IPC 

    Please refer to the AM62Ax academy. You can find steps to evaluate the IPC example here:
    https://dev.ti.com/tirex/explore/node?node=A__AYEyuCg.JDdHqpTk3sF27g__AM62A-ACADEMY__WeZ9SsL__LATEST

    And then you can find a ton of additional information about IPC in the Multicore academy module:
    https://dev.ti.com/tirex/explore/node?node=A__AQycfKMsR-1yeBcryJ2abg__AM62A-ACADEMY__WeZ9SsL__LATEST

    Regards,

    Nick

  • Hi Nick,

    Thanks for the quick reply!

    My goal is to verify the TIOVX/TIDL features on AM62a with my RTOS running on A core. 

    I've done this on TDA4AEN by running the vision apps supplied in the PROCESSOR-SDK-RTOS-J722S.

    I am not able to do the same since TI does not provide any SDK like PROCESSOR-SDK-RTOS-AM62a containing the vision apps.

    TI only provides PSDK SDK RTOS for R core.

    Therefore, I am trying to build my RTOS with k3-am62a7-sk bsp against PROCESSOR-SDK-RTOS-J722S and hope the build products can be run on AM62a evm as well. but as you see, the first one (ipc test) is running into errors all the time.

    In general do you know any alternative that I can use to achieve the goal?

    Also I have some questions regarding what I am doing:

    1) I find there is am62a directory under vision_apps/platform in all J7 PROCESSOR-SDK-RTOS, here it is for J722S

    test-machine:ti-processor-sdk-rtos-j722s-evm-09_02_00_05/vision_apps/platform$ ls am62a/
    linux qnx rtos

    what's this for? that makes me think all J7 RTOS SDK can be sort of built for am62a or can be used for am62a?

    2) there is a memory mapping dtsi file under platform/j7xxx/rtos, I understand this is required to be included/updated in the main dts file when running the vision apps.  however, there is no similar one under platform/am62a/rtos, there is k3-am62a7-sk.dts, but the content of it is almost the same as the dts in the PROCESSOR-SDK-AM62A. does it mean no memory mapping updates needed for am62a when running the vision apps?

    3)  by examining the k3-am62a7-sk.dts, I don't quite understand what's the difference between wkup_r5fss0_core0 and mcu_r5fss0_core0? do they refer to the same R core? after all, the configuration file only defines MCU1_0 for am62a. 

    #if defined (SOC_AM62A)
    #if !defined (MCU_PLUS_SDK)
    static uint32_t g_app_to_ipc_cpu_id[APP_IPC_CPU_MAX] =
    {
    IPC_MPU1_0,
    IPC_MCU1_0,
    IPC_C7X_1
    };
    
    static uint32_t g_ipc_to_app_cpu_id[IPC_MAX_PROCS] =
    {
    APP_IPC_CPU_MPU1_0,
    APP_IPC_CPU_MCU1_0,
    APP_IPC_CPU_C7x_1
    };
    #else

    Regards,

    Hailong

  • Hello Hailong,

    AM62Ax has multiple cores:
    A53 cluster
    DM (Device manager) R5F <-- this is "wkup_r5fss0_core0" in the Linux devicetree
    MCU domain R5F
    C7

    For the other questions, I need to send your thread to another team member. We might need to reassign the thread a couple of times to get it to the right person. Feel free to ping the thread if you do not have another response by Friday.

    Regards,

    Nick

  • Hello Hailong,

    We offer limited support on vision_apps components for AM62A currently. I may not have the answers to all your questions, but allow me to point you towards the proper tools. 

    1) I find there is am62a directory under vision_apps/platform in all J7 PROCESSOR-SDK-RTOS, here it is for J722S

    test-machine:ti-processor-sdk-rtos-j722s-evm-09_02_00_05/vision_apps/platform$ ls am62a/
    linux qnx rtos

    what's this for? that makes me think all J7 RTOS SDK can be sort of built for am62a or can be used for am62a?

    Our linux SDK does not include vision_apps, as you've found. PSDK RTOS for J7 / TDA4x devices includes this. For AM62A, the proper code is within the firmware-builder. This is available on request -- please find the link here: https://www.ti.com/drr/opn/FIRMWARE-BUILDER-AM62A (it is also on the AM62A processor SDK page)

    The same vision_apps is provided in each of the packages. It may have some parts that refer to am62a, but the overall PSDK_RTOS for the device you've shown will likely not be sufficient to build similar code for AM62A.

    2) there is a memory mapping dtsi file under platform/j7xxx/rtos, I understand this is required to be included/updated in the main dts file when running the vision apps.  however, there is no similar one under platform/am62a/rtos, there is k3-am62a7-sk.dts, but the content of it is almost the same as the dts in the PROCESSOR-SDK-AM62A. does it mean no memory mapping updates needed for am62a when running the vision apps?

    There is memory mapping info under am62a portion of vision_apps/platform/am62a/rtos. That will exist in vision_apps within the AM62A firmware builder. This package is open source: https://git.ti.com/cgit/processor-sdk/vision_apps/tree/platform/am62a/rtos?h=main 

    However, I do not anticipate you need to change the memory map to use IPC or TIOVX. The existing memory map will be sufficient. If you are trying to use standalone vision_apps tests,

    And looks like Nick covered Q3. Just to add additional note:

    We do not support additional application code on WKUP/DM R5 core. This is tasked with critical system functions. With firmware builder, that source can be changed, but may conflict with system performance. 

    The MCU R5 is meant for application code / safety monitor. Vision_apps / firmware builder does not have explicitly use this core for any predefined purpose. 

    BR,
    Reese

  • Hi Reese,

    Thanks for the reply!

    Please let me know if I should proceed with the below approach anyway,

    "build my RTOS with k3-am62a7-sk bsp against PROCESSOR-SDK-RTOS-J722S and to run the vision apps within it"

    I am looking for a guideline about how to build/run vision apps in RTOS for AM62a.

    I once asked for this here and you TI guys all pointed me to https://software-dl.ti.com/processor-sdk-linux/esd/AM62AX/10_00_00/exports/edgeai-docs/common/sample_apps.html, but this is for edgeai apps, NOT for vision apps.

    Regards,

    Hailong  

  • Hello Hailong, 

    "build my RTOS with k3-am62a7-sk bsp against PROCESSOR-SDK-RTOS-J722S and to run the vision apps within it"

    I would not suggest using PSDK_RTOS for J722S here. Please use the AM62A firmware builder instead. Firmware builder should have the (mostly) same packages as PSDK RTOS.

    I once asked for this here and you TI guys all pointed me to https://software-dl.ti.com/processor-sdk-linux/esd/AM62AX/10_00_00/exports/edgeai-docs/common/sample_apps.html, but this is for edgeai apps, NOT for vision apps.

    This is because support for vision_apps is limited. 

    Depending on your use-case, edgeai-tiovx-apps may be of interest. This is showing applications that use TIOVX more directly -- vision_apps does this as well. tiovx-apps has QNX support, which cannot use edgeai-apps / linux tools like gstreamer

    BR,
    Reese

  • Hi Reese,

    The reason we are not using edgeai apps is we have no software stack supported yet for gstreamer in our RTOS. 

    As for the AM62A firmware builder, actually I have been requesting for it 3 times in 2 months lately, no single response or feedback received.

    Can this be even used for RTOS? Is there any step-by-step document that I can reference?

    Thanks,

    Hailong 

  • Hi,

    Can you help on the following issue?

    Entries in dts:

                   ti,sci-proc-ids = <0x00000001 0x000000ff>;
                   firmware-name = "am62-wkup-r5f0_0-fw";
    
                   ti,sci-proc-ids = <0x00000003 0x000000ff>;
                   firmware-name = "am62a-mcu-r5f0_0-fw";			 
    
                   ti,sci-proc-ids = <0x00000004 0x000000ff>;
                   firmware-name = "am62a-c71_0-fw";

    Note: processor id:1 for wkup-r5,  processor id:3 for mcu-r5 and processor id:4 for dsp

    Firmwares used to boot up the target:

    am62a-c71_0-fw -> /lib/firmware/vision_apps_eaik/vx_app_rtos_linux_c7x_1.out
    am62a-mcu-r5f0_0-fw -> /lib/firmware/ti-ipc/am62axx/ipc_echo_test_mcu2_0_release_strip.xer5f
    am62-wkup-r5f0_0-fw -> /lib/firmware/ti-dm/am62axx/ipc_echo_testb_mcu1_0_release_strip.xer5f

    RPMSG_PORT_ID definitions in app_utils/utils/ipc/include/app_ipc.h:

    /** \brief RPMsg Port used for TIOVX IPC */
    #define APP_IPC_TIOVX_RPMSG_PORT_ID      (13u)
    
    /** \brief RPMsg Port used for Remote service */
    #define APP_IPC_REMOTE_SERVICE_RPMSG_PORT_ID      (21u)
    
    /** \brief RPMsg Port used for echo test */
    #define APP_IPC_ECHO_TEST_RPMSG_PORT_ID  (14u)

    Issue goes here ------------------->

    The rpmsg device tree looks suspicious on my am62a7 evm target:

     17 [ 3] /rpmsg_ctrl-1-13
     21 [ 3] /rpmsg_ctrl-1-21
     15 [ 3] /rpmsg_ctrl-3-14
     19 [ 3] /rpmsg_ctrl-4-13
     20 [ 3] /rpmsg_ctrl-4-21

    Normally the rpmsg device for a core should be created in pairs, e.g. we have rpmsg_ctrl-1-13 and rpmsg_ctrl-1-21 for core wkup-r5.

    Is this an issue that there is only one rpmsg device rpmsg_ctrl-3-14 created for core mcu-r5? especially its port is neither 13 nor 21?

    With the little knowledge that the port number is carried in the message that sent from the remote processors (r5 or dsp), is it possible that I am not running the correct firmwares?

    Please help!

    Thanks,

    Hailong

  • Hello Hailong, 

    Yes, I understand the stipulation with edgeai-apps is that is it linux centric due to GST dependency. edgeai-tiovx-apps relaxes this to some degree.

    RE fw-builder access: I see, let me see if I can push that access through on our side. 

    Can this be even used for RTOS? Is there any step-by-step document that I can reference?

    Do you mean rpmsg examples in RTOS? Yes that's supported in MCU+ SDK. As Nick mentioned, there is plenty of information in the Multicore academy on this topic. Source for MCU+ is included within firmware builder and is used for RPMsg drivers on MCU-core side.

    And then you can find a ton of additional information about IPC in the Multicore academy module:
    https://dev.ti.com/tirex/explore/node?node=A__AQycfKMsR-1yeBcryJ2abg__AM62A-ACADEMY__WeZ9SsL__LATEST

    This includes examples for the MCU-side of RPMsg

    Firmwares used to boot up the target:

    >am62-wkup-r5f0_0-fw -> /lib/firmware/ti-dm/am62axx/ipc_echo_testb_mcu1_0_release_strip.xer5f

    Hmm, I'm not certain that firmware would have loaded correctly. The WKUP/DM R5 plays a role in the boot process, so the firmware loaded at runtime is actually loaded during U-boot before Linux boots. It is packaged into the R5 bootloader, and the process in updating that firmware is included in the firmware-builder documentation + "Build U-boot" section of PSDK Linux documentation

  • Hi,

    Can you please forward my question to the author of the firmwares and get the feedback to me?

    In short, I may want to know why the wkup-r5-fw uses port 13 and port 21 for the rpmsg exchanges while the mcu-r5-fw uses port 14 instead? I am expecting both would use port 13 and port 21.

    again the firwares I am using in my setup:

    am62a-c71_0-fw -> /lib/firmware/vision_apps_eaik/vx_app_rtos_linux_c7x_1.out
    am62a-mcu-r5f0_0-fw -> /lib/firmware/ti-ipc/am62axx/ipc_echo_test_mcu2_0_release_strip.xer5f
    am62-wkup-r5f0_0-fw -> /lib/firmware/ti-dm/am62axx/ipc_echo_testb_mcu1_0_release_strip.xer5f

    Looking back to the port definition -> #define APP_IPC_TIOVX_RPMSG_PORT_ID      (13u)

    It looks like the port 13 is used for TIOVX, then why does the am62a-mcu-r5f0_0-fw -> /lib/firmware/ti-ipc/am62axx/ipc_echo_test_mcu2_0_release_strip.xer5f not support TIOVX? I am using the firmwares from within the ti-processor-sdk-linux-edgeai-am62axx-evm-09_02_00_05-Linux-x86/filesystem/tisdk-edgeai-image-am62axx-evm.tar.xz

    Please let me if I am using the wrong firmwares to support the vision apps and where to get the correct ones?

    Regards,

    Hailong

  • Hello Hailong,

    I can check with those developers, but it may take a few days to get a response as I recall they are out of office right now. 

    I believe cores using TIOVX should be mapping to the (13, 21) RPMSG ID's -- this would be true for WKUP R5 and C7

    MCU R5 is not being used within TIOVX. In our software stack, this is not given a specific purpose that TIOVX is needed for. This MCU R5 core is typically designated as a safety monitor, so it does not actively participate in the application itself -- as such, no TIOVX. The default firmware is a basic echo test (within SDK, safety monitor is not implemented). 

    My understanding of the ports is as such: 13 and 21 are for TIOVX IPC. Channel for basic echo test / development is 14, and this is what's used in the default example within linux / MCU+ SDK. These channels intentionally do not conflict so the client side of the RPMsg channel doesn't need to distinguish between TIOVX and non-TIOVX

  • Thanks Reese! This explained and resolved my issue.