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.

RTOS/AM5728: Data transfer with NDK

Part Number: AM5728
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi All,

  I tried to build RTOS based NIMU basic example for M4 core and able to build and run over AM572x_EVM.  

  I just want to transfer some data from M4 core to host PC using any NDK service. Can I know which NDK service should I use to transfer data towards PC.

  Am using TI RTOS SDK over Am572x_EVM. Able to ping my target board from host PC

Regards,

Geek13

  • Hi,

    There are existing CCS example projects like helloworld and TFTP you can use for EVM and PC communication. http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_Foundational_Components.html#ndk

    Regards, Eric 

  • Hi Eric,

      Thanks for your reply. My application required to send ADC sample data from DSP core to PC side. Is that TFTP is helpful in that case.

    Regards,

    Geek13

  • Hi,

    I thought use helloworld with TCP or UDP is better.

    Regards, Eric

  • Hi Eric,

      I tried to run NIMU basic example that using TCP for communication. Following issues am facing while using it.

      1. I able to build NIMU basic example for M4 core and successfully execute its task.

      2. Am able to run this example with debugger only. Not able to run with remoteproc. it giving an error of resource table not found.

          Although I follow below provided link by TI. to create Custom resource table. Still am not able to run using remoteproc.

       http://processors.wiki.ti.com/index.php/IPC_Resource_customTable

      http://wiki.tiprocessors.com/index.php/IPC_Resource_customTable

     3. How to use this example to send data from target to host & where I could configure host IP. 

         Am able ping between both host and target.

    4. As of now to location are used in example to configure static IP :   nimu_evm_pem4.c and nimu_evm.cfg 

    5. I don't want to send any thing from host to target side. Main aim is to send data from target  to host side.

    What application is used to see capture data at host side.?

    As of now am using wireshark to sniff data on host side but not getting any data. 

    Tried EMAC_Send and NIMU_send api to send some data over network but able to do that.

    Regards,

    Geek13

  • Hi,

    In the task application, you can see some local server setup, like:

    // Create our local servers
    hEcho = DaemonNew( SOCK_STREAMNC, 0, 7, dtask_tcp_echo,
    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );
    hEchoUdp = DaemonNew( SOCK_DGRAM, 0, 7, dtask_udp_echo,
    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 1 );
    hData = DaemonNew( SOCK_STREAM, 0, 1000, dtask_tcp_datasrv,
    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );
    hNull = DaemonNew( SOCK_STREAMNC, 0, 1001, dtask_tcp_nullsrv,
    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );
    hOob = DaemonNew( SOCK_STREAMNC, 0, 999, dtask_tcp_oobsrv,
    OS_TASKPRINORM, OS_TASKSTKNORM, 0, 3 );

    Those functions are implemented inside the NDK package, You can replace those functions with your owns to send packets to host. 

    Regards, Eric

  • Hi Eric,

      I tried your above suggestion but still am not able to send data towards host PC. Also not able to run application using remoteproc giving below error:

      

    root@am57xx-evm:~# echo 'stop' > /sys/class/remoteproc/remoteproc1/state
    [ 2219.844571] remoteproc remoteproc1: stopped remote processor 55020000.ipu
    root@am57xx-evm:~# echo 'start' > /sys/class/remoteproc/remoteproc1/state
    [ 2222.951044] remoteproc remoteproc1: powering up 55020000.ipu
    [ 2222.963114] remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4, size 4807164
    [ 2222.971029] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    [ 2223.004378] omap-iommu 55082000.mmu: iommu fault: da 0x90019200 flags 0x0
    [ 2223.011197] remoteproc remoteproc1: crash detected in 55020000.ipu: type mmufault
    [ 2223.018718] omap-iommu 55082000.mmu: 55082000.mmu: errs:0x00000002 da:0x90019200 pgd:0xec4d2400 *pgd:pxba300002
    [ 2223.029364] virtio_rpmsg_bus virtio0: rpmsg host is online
    [ 2223.035036] remoteproc remoteproc1: registered virtio0 (type 7)
    [ 2223.041736] remoteproc remoteproc1: remote processor 55020000.ipu is now up
    [ 2223.049193] remoteproc remoteproc1: handling crash #3 in 55020000.ipu
    root@am57xx-evm:~# [ 2223.057443] remoteproc remoteproc1: recovering 55020000.ipu
    [ 2223.073097] remoteproc remoteproc1: stopped remote processor 55020000.ipu
    [ 2223.079917] remoteproc remoteproc1: powering up 55020000.ipu
    [ 2223.092314] remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4, size 4807164
    [ 2223.100154] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    [ 2223.134775] omap-iommu 55082000.mmu: iommu fault: da 0x90019200 flags 0x0
    [ 2223.141597] remoteproc remoteproc1: crash detected in 55020000.ipu: type mmufault
    [ 2223.149111] omap-iommu 55082000.mmu: 55082000.mmu: errs:0x00000002 da:0x90019200 pgd:0xec4d6400 *pgd:pxba300002
    [ 2223.159887] virtio_rpmsg_bus virtio0: rpmsg host is online
    [ 2223.165465] remoteproc remoteproc1: registered virtio0 (type 7)
    [ 2223.171534] remoteproc remoteproc1: remote processor 55020000.ipu is now up

    Also find below log on terminal when I run this application using debugger:

    App start
    SetPhyMode:000021e1 Auto:1, FD10:64, HD10:32, FD100:256, HD100:128, FD1000:8192 LPBK:0

    SYS/BIOS Ethernet/IP (CPSW) Sample application
    SetPhyMode:000021e1 Auto:1, FD10:64, HD10:32, FD100:256, HD100:128, FD1000:8192 LPBK:0

    TCP/IP Stack 'Hello World!' Application

    StackTest: using localIp
    Network Removed: If-1:192.168.2.1
    StackTest: exiting

    Regards,

    Geek13

  • Hi,

    Those NDK examples should work standalone (SYSBIOS without Linux), we tested everyday. You issue may come with integration with Linux and use remoteproc. I added expert for help in the thread.

    Regards, Eric

  • Hello,

    An MMU fault indicates the DSP is trying to access an address space that is not mapped, or in other words, not in the resource table.

    Please refer to the following guide for guidance on this.

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/How_to_Guides.html#create-dsp-and-ipu-firmware-using-pdk-drivers-and-ipc-to-load-from-arm-linux-on-am57xx-devices

    And please refer to the following guide for guidance on debugging an MMU fault.

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/How_to_Guides.html#ipc-debugging-tools-and-techniques-on-am57xx

    Best,
    Sahin

  • Hi Sahin,

       I follow the provided link as you mention above and trying to build  NIMU_BasicExample_evmAM572x_m4Exampleproject for M4 core.

       Still am getting an error after take care of all steps mention in below link for IPU. 

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/How_to_Guides.html#create-dsp-and-ipu-firmware-using-pdk-drivers-and-ipc-to-load-from-arm-linux-on-am57xx-devices

    Still am getting an error while building project like:

    "configPkg/linker.cmd", line 287: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".data" size 0x1010ca9 . Available memory ranges:
    EXT_DATA size: 0x600000 unused: 0x5ef573 max hole: 0x5ef56c
    error #10010: errors encountered during linking; "NIMU_BasicExample_evmAM572x_m4Exampleproject.out" not built

    already added config.bld for EXT_DATA. 

    Am building this application  for IPU2.

    Regards,

    Geek13

  • Hi Sahin,

    Can I  know which Config.bld is used in case of IPU2.

    Currently am using Config.bld from /ti/ipc_3_50_02_02/examples/DRA7XX_linux_elf/ex02_messageq/shared.


    I configure NIMU basic example as define in above provided link., but getting memory range related error.

    Regards,

    Geek13

  • Hello,

    The project dependencies may have gotten larger since this project was created. Can you try turning on optimization and rebuilding?

    The config.bld in the shared folder is the correct one to use (this is used by all cores).

  • Hi Sahin,

    I tried with different optimization level, but not able to run application using Remotproc.

    MMU fault error gone when I append  content from IpuAmmu.cfg & Ipu2.cfg from ti/ipc_3_50_02_02/examples/DRA7XX_linux_elf/ex02_messageq/ipu2  in  nimu_evm.cfg file.

    Remoteproc able to load my application with dra7-ipu2-fw.xem4, But application not start as it start while using debugger.

    Is there any single M4 example available  in SDK, that  can be run through remoteproc. 

    So that I can take that example reference to create my project with NIMU support.

     Regards,

    Geek13

  • Hi Sahin,

      Tried with UART example for IPU with remoteproc & IPC support mention in below link:

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/How_to_Guides.html#create-dsp-and-ipu-firmware-using-pdk-drivers-and-ipc-to-load-from-arm-linux-on-am57xx-devices

    But problem is same  giving following error:

    root@am57xx-evm:~# echo 'start' > /sys/class/remoteproc/remoteproc1/state
    [ 807.101060] remoteproc remoteproc1: powering up 55020000.ipu
    [ 807.112492] remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4, size 4393720
    [ 807.120347] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    [ 807.146625] omap-iommu 55082000.mmu: iommu fault: da 0x80059600 flags 0x0
    [ 807.153445] remoteproc remoteproc1: crash detected in 55020000.ipu: type mmufault
    [ 807.160969] omap-iommu 55082000.mmu: 55082000.mmu: errs:0x00000002 da:0x80059600 pgd:0xdfc06000 *pgd:px95f00002
    [ 807.172538] virtio_rpmsg_bus virtio0: rpmsg host is online
    [ 807.178184] remoteproc remoteproc1: registered virtio0 (type 7)
    [ 807.184365] remoteproc remoteproc1: remote processor 55020000.ipu is now up
    [ 807.192111] remoteproc remoteproc1: handling crash #3 in 55020000.ipu
    root@am57xx-evm:~# [ 807.198780] remoteproc remoteproc1: recovering 55020000.ipu
    [ 807.216322] remoteproc remoteproc1: stopped remote processor 55020000.ipu
    [ 807.223166] remoteproc remoteproc1: powering up 55020000.ipu
    [ 807.234234] remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4, size 4393720
    [ 807.242124] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    [ 807.265566] omap-iommu 55082000.mmu: iommu fault: da 0x18ba8 flags 0x0
    [ 807.272125] remoteproc remoteproc1: crash detected in 55020000.ipu: type mmufault
    [ 807.279640] omap-iommu 55082000.mmu: 55082000.mmu: errs:0x00000002 da:0x00018ba8 pgd:0xdfc00000 *pgd:px95900002
    [ 807.290996] virtio_rpmsg_bus virtio0: rpmsg host is online
    [ 807.296622] remoteproc remoteproc1: registered virtio0 (type 7)
    [ 807.302735] remoteproc remoteproc1: remote processor 55020000.ipu is now up

    Even not able to run example by following steps mention on provided link. 

    Kindly help me in this regards, so that I can move further.

    Regards,

    Geek13

  • Hello,

    Did you include the resource table in the ipu project?

    Can you please try with the project attached below?

    6281.UART_BasicExample_evmAM572x_m4ExampleProject_with_ipc.zip

    Regards,
    Sahin

  • HI Sahin,

    Yeah I include resource table in IPU project, that I tried out with ethernet as well as for USB application on M4 core.

    But am able to run my both applications using debugger, not with remoteproc.

    kindly find files am using in the attachment  that am using in case of USB bulk generic device mode on M4 core.

    Also am attaching an log what am getting while loading my USB application on IPU2 core 

    4861.rsc_table_vayu_ipu.h

    /**********************Linker.cmd************************************/
    /*
     * Do not modify this file; it is automatically generated from the template
     * linkcmd.xdt in the ti.targets.elf package and will be overwritten.
     */
    
    /*
     * put '"'s around paths because, without this, the linker
     * considers '-' as minus operator, not a file name character.
     */
    
    
    -l"/home/stryker/workspace_v8/USB_DevBulkM4_evmAM572x/Debug__TI/configPkg/package/cfg/usb_dra7xx_pem4.oem4"
    -l"/home/stryker/workspace_v8/USB_DevBulkM4_evmAM572x/src/ipc/ipc.aem4"
    -l"/home/stryker/ti/ipc_3_50_02_02/packages/ti/pm/lib/debug/ti.pm_null.aem4"
    -l"/home/stryker/workspace_v8/USB_DevBulkM4_evmAM572x/src/utils/utils.aem4"
    -l"/home/stryker/ti/ipc_3_50_02_02/packages/ti/deh/lib/debug/ti.deh_vayu_smp.aem4"
    -l"/home/stryker/workspace_v8/USB_DevBulkM4_evmAM572x/src/sysbios/sysbios.aem4"
    -l"/home/stryker/ti/pdk_am57xx_1_0_12/packages/ti/fs/fatfs/lib/m4/release/ti.fs.fatfs.aem4"
    -l"/home/stryker/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/lib/am572x/m4/release/ti.drv.usb.aem4"
    -l"/home/stryker/ti/pdk_am57xx_1_0_12/packages/ti/board/lib/evmAM572x/m4/release/ti.board.aem4"
    -l"/home/stryker/ti/pdk_am57xx_1_0_12/packages/ti/drv/i2c/lib/m4/release/ti.drv.i2c.aem4"
    -l"/home/stryker/ti/pdk_am57xx_1_0_12/packages/ti/osal/lib/tirtos/m4/release/ti.osal.aem4"
    -l"/home/stryker/ti/pdk_am57xx_1_0_12/packages/ti/drv/uart/lib/m4/release/ti.drv.uart.aem4"
    -l"/home/stryker/ti/pdk_am57xx_1_0_12/packages/ti/csl/lib/am572x/m4/release/ti.csl.aem4"
    -l"/home/stryker/ti/bios_6_73_00_12/packages/ti/targets/arm/rtsarm/lib/ti.targets.arm.rtsarm.aem4"
    -l"/home/stryker/ti/bios_6_73_00_12/packages/ti/targets/arm/rtsarm/lib/boot.aem4"
    -l"/home/stryker/ti/bios_6_73_00_12/packages/ti/targets/arm/rtsarm/lib/auto_init.aem4"
    
    --retain="*(xdc.meta)"
    
    /* C6x Elf symbols */
    --symbol_map __TI_STACK_SIZE=__STACK_SIZE
    --symbol_map __TI_STACK_BASE=__stack
    --symbol_map _stack=__stack
    
    
    
    --args 0x64
    -heap  0x0
    -stack 0x8000
    
    MEMORY
    {
        L2_ROM : org = 0x0, len = 0x4000
        L2_RAM : org = 0x20000000, len = 0x10000
        OCMC_RAM1 : org = 0x40300000, len = 0x80000
        OCMC_RAM2 : org = 0x40400000, len = 0x100000
        OCMC_RAM3 : org = 0x40500000, len = 0x100000
        EXT_CODE (RWX) : org = 0x4000, len = 0x5fc000
        EXT_DATA (RW) : org = 0x80000000, len = 0x600000
        EXT_HEAP (RW) : org = 0x80600000, len = 0x1400000
        TRACE_BUF (RW) : org = 0x9f000000, len = 0x60000
        EXC_DATA (RW) : org = 0x9f060000, len = 0x10000
        PM_DATA (RWX) : org = 0x9f070000, len = 0x20000
    }
    
    /*
     * Linker command file contributions from all loaded packages:
     */
    
    /* Content from xdc.services.global (null): */
    
    /* Content from xdc (null): */
    
    /* Content from xdc.corevers (null): */
    
    /* Content from xdc.shelf (null): */
    
    /* Content from xdc.services.spec (null): */
    
    /* Content from xdc.services.intern.xsr (null): */
    
    /* Content from xdc.services.intern.gen (null): */
    
    /* Content from xdc.services.intern.cmd (null): */
    
    /* Content from xdc.bld (null): */
    
    /* Content from ti.targets (null): */
    
    /* Content from ti.targets.arm.elf (null): */
    
    /* Content from xdc.rov (null): */
    
    /* Content from xdc.runtime (null): */
    
    /* Content from ti.targets.arm.rtsarm (null): */
    
    /* Content from ti.sysbios.interfaces (null): */
    
    /* Content from ti.sysbios.family (null): */
    
    /* Content from ti.sysbios.family.arm (ti/sysbios/family/arm/linkcmd.xdt): */
    --retain "*(.vecs)"
    
    /* Content from xdc.services.getset (null): */
    
    /* Content from ti.csl (null): */
    
    /* Content from ti.drv.uart (null): */
    
    /* Content from ti.osal (null): */
    
    /* Content from ti.drv.i2c (null): */
    
    /* Content from ti.board (null): */
    
    /* Content from ti.drv.usb (null): */
    
    /* Content from ti.fs.fatfs (null): */
    
    /* Content from ti.sysbios.hal.ammu (ti/sysbios/hal/ammu/linkcmd.xdt): */
    ti_sysbios_hal_ammu_AMMU_mmu = 1073743872;
    
    /* Content from xdc.runtime.knl (null): */
    
    /* Content from ti.sdo.ipc.interfaces (null): */
    
    /* Content from ti.sdo.ipc.family (null): */
    
    /* Content from ti.sysbios.rts (ti/sysbios/rts/linkcmd.xdt): */
    
    /* Content from ti.catalog (null): */
    
    /* Content from ti.catalog.arm.cortexm4 (null): */
    
    /* Content from ti.catalog.peripherals.hdvicp2 (null): */
    
    /* Content from xdc.platform (null): */
    
    /* Content from xdc.cfg (null): */
    
    /* Content from ti.catalog.arp32 (null): */
    
    /* Content from ti.catalog.c6000 (null): */
    
    /* Content from ti.catalog.arm.cortexa15 (null): */
    
    /* Content from ti.platforms.evmDRA7XX (null): */
    
    /* Content from ti.sysbios.hal (null): */
    
    /* Content from ti.sysbios (null): */
    
    /* Content from ti.sysbios.knl (null): */
    
    /* Content from ti.sysbios.family.arm.ducati (ti/sysbios/family/arm/ducati/linkcmd.xdt): */
    --diag_suppress=10063
    --entry_point=ti_sysbios_family_arm_ducati_Core_reset
    ti_sysbios_family_arm_ducati_CTM_ctm = 0x40000400;
    
    /* Content from ti.sysbios.family.arm.m3 (ti/sysbios/family/arm/m3/linkcmd.xdt): */
    -u _c_int00
    ti_sysbios_family_arm_m3_Hwi_nvic = 0xe000e000;
    
    /* Content from ti.sysbios.timers.dmtimer (null): */
    
    /* Content from ti.sysbios.family.shared.vayu (null): */
    
    /* Content from ti.sysbios.gates (null): */
    
    /* Content from ti.sysbios.heaps (null): */
    
    /* Content from ti.deh (null): */
    
    /* Content from ti.sysbios.hal.unicache (ti/sysbios/hal/unicache/linkcmd.xdt): */
    ti_sysbios_hal_unicache_Cache_cache = 1073741824;
    
    /* Content from ti.sdo.utils (null): */
    
    /* Content from ti.sysbios.syncs (null): */
    
    /* Content from ti.sysbios.family.arm.ducati.smp (null): */
    
    /* Content from ti.sysbios.xdcruntime (null): */
    
    /* Content from ti.pm (null): */
    
    /* Content from ti.sysbios.utils (null): */
    
    /* Content from ti.ipc.remoteproc (ti/ipc/remoteproc/linkcmd.xdt): */
    
    
    
    /* Content from ti.sdo.ipc (ti/sdo/ipc/linkcmd.xdt): */
    
    SECTIONS
    {
    
        ti_sdo_ipc_init: load > EXT_DATA, type = NOINIT
    }
    
    /* Content from ti.ipc.ipcmgr (null): */
    
    /* Content from ti.ipc.rpmsg (null): */
    
    /* Content from ti.ipc.family.vayu (null): */
    
    /* Content from ti.sdo.ipc.family.vayu (null): */
    
    /* Content from ti.sdo.ipc.notifyDrivers (null): */
    
    /* Content from configPkg (null): */
    
    /* Content from xdc.services.io (null): */
    
    /* Content from ti.sdo.ipc.family.ti81xx (null): */
    
    
    /*
     * symbolic aliases for static instance objects
     */
    xdc_runtime_Startup__EXECFXN__C = 1;
    xdc_runtime_Startup__RESETFXN__C = 1;
    
    SECTIONS
    {
        .text: load >> EXT_CODE
        .stack: load > EXT_DATA
        GROUP: load > EXT_DATA
        {
            .bss:
            .neardata:
            .rodata:
        }
        .binit: load > EXT_CODE
        .cinit: load > EXT_CODE
        .init_array: load > EXT_CODE
        .const: load >> EXT_CODE
        .data: load >> EXT_DATA
        .fardata: load >> EXT_DATA
        .switch: load >> EXT_DATA
        .sysmem: load > EXT_DATA
        .far: load >> EXT_DATA
        .args: load > EXT_DATA align = 0x4, fill = 0 {_argsize = 0x64; }
        .cio: load >> EXT_DATA
        .ARM.exidx: load > EXT_DATA
        .ARM.extab: load >> EXT_DATA
        .tracebuf: load > TRACE_BUF
        .errorbuf: load > EXC_DATA
        .bootVecs:  type = DSECT
        .resetVecs: load > 0x400
        .vecs: load > 0x400, type = DSECT
        .resource_table: load > 0x3000, type = NOINIT
        .ducatiBoot: load > 0x0
        xdc.meta: load > EXT_CODE, type = COPY
    
    }

    3463.mapfile.txt

    usb_dra7xx.cfg

    Can you please check where am doing wrong by seeing above settings am using

    Regards

    Geek13

  • Hello,

    Thanks for the update. Could you please confirm that you were able to run the project attached in my previous post?

    I will look through your attachments for any discrepancies, but for thread readability, could you please do me a favor and edit your post and attach these files instead of copy/pasting?

    Regards,
    Sahin

  • Hi Sahin,

     Yeah am able to run above attached code, but problem is once I load that application using remoteproc am not able to stop/ exit from it. Is there any way to stop that running application. Meanwhile I prepared one another sd card to check my USB application.

    Am trying to replicate same configuration that you have shared in above attached code with my USB application let you know once I succeed . 

    There will be no option to attach c files. 

    Regards,

    Geek13

  • Hi Sahin,

      I found some Memory sections configuration in case of  A15. Should we required similar configuration in case of IPU also??

    /* ================ Cache and MMU configuration ================ */
    
    var Cache1  = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
    var Mmu    = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
    
    /* Enable cache */
    Cache1.enableCache = true;
    
    /* Enable the MMU (Required for L1 data caching) */
    Mmu.enableMMU = true;
    
    var attrs = new Mmu.DescriptorAttrs();
    Mmu.initDescAttrsMeta(attrs);
    attrs.type = Mmu.DescriptorType_BLOCK;
    attrs.noExecute = true;
    attrs.accPerm = 0;       // R/W at PL1
    attrs.attrIndx = 7;      // Use MAIR0 Byte7
    Mmu.setMAIRMeta(7, 0x04);
    
    Mmu.setSecondLevelDescMeta(0x43200000, 0x43200000, attrs);
    Mmu.setSecondLevelDescMeta(0xA0000000, 0xA0000000, attrs); /* APP_UNCACHED_DATA_BLK3_MEM */
    
    /* Set IO Delay configuration areas as non-cache */
    attrs.attrIndx = 1;
    Mmu.setSecondLevelDescMeta(0x4844a000, 0x4844a000, attrs); /* IODELAYCONFIG */
    Mmu.setSecondLevelDescMeta(0x4ae07d00, 0x4ae07d00, attrs); /* ? */
    
    Mmu.setSecondLevelDescMeta(0x48880000, 0x48880000, attrs); /* USB1 */
    Mmu.setSecondLevelDescMeta(0x488C0000, 0x488C0000, attrs); /* USB2 */
    
    
    
    /* ================ Memory sections configuration ================ */
    Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
    Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
    Program.sectMap[".bss:extMemNonCache:usbXhci"]              = "APP_UNCACHED_DATA_BLK3_MEM";
    Program.sectMap[".bss:extMemCache:ramdisk"]                 = new Program.SectionSpec();
    Program.sectMap[".bss:extMemCache:ramdisk"].loadSegment     = "APP_CACHED_DATA_BLK2_MEM";
    Program.sectMap[".bss:extMemCache:ramdisk"].type            = "NOLOAD";
    

    I tried with same configuration like in shared UART example, but not able to run USB application on remoteproc.

    Regards,

    Geek13

  • Hello Sahin,

    Any further update on this. Actually I tried couple of things like use same resource table and cfg file used for UART application on  M4 core, with that application not giving any error while loading via remoteproc but application not start. 

    USB not able to detect neither on windows nor on Linux.

    Below is my log am getting on terminal.

    [ 175.738790] remoteproc remoteproc1: powering up 55020000.ipu
    [ 175.949371] remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4, size 4476304
    [ 175.957259] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    [ 175.991533] virtio_rpmsg_bus virtio0: rpmsg host is online
    [ 175.997217] remoteproc remoteproc1: registered virtio0 (type 7)
    [ 176.003399] remoteproc remoteproc1: remote processor 55020000.ipu is now up

     When I run this application using debugger the am getting USB message on terminal, application run successfully.

    Regards,

    Geek13

  • Hello,

    I take it you are now trying to apply the same method used for the UART application for your USB application - is my understanding correct?

    When you run the application via debugger, is Linux running on the A15?

    You may need to disable the USB instance in the Linux device tree. Similar to what was done for UART in the guide:

    There are some other careabouts that need to be taken care of for the USB application to play nicely with Linux. For example, you will need to disable board_init() in the USB application since this is handled by Linux.

    Additionally, Linux expects the IPU application at a certain address so make sure this matches the location specified in the resource table and CMA carveout in the Linux dts (you can place the USB application in the same location as the UART application if you've already verified it works)

    Furthermore, standalone IPU applications use addresses (0x4X000000) to peripheral registers and use following MMU settings:

    • L2 MMU uses default 1:1 Mapping
    • AMMU configuration translates physical 0x4X000000 access to logical 0x4X000000

    When integrating IPC/RemoteProc + IPU application, IPC requires that the IPU application uses the logical address instead. This is due to the bit-banding feature of the M4 core (I've attached slides below for more explanation on this). Therefore, the L2 MMU is configured such that MMU translates 0x6X000000 access to addresss 0x4X000000. The consequence of this is that you will need to append 0x20000000 to peripheral addresses, for example:

    (CSL_IPU_UART3_REGS + 0x20000000),    //Base Addr = 0x48000000 + 0x20000000 = 0x68000000

    https://training.ti.com/sites/default/files/docs/Running_RTOS_on_Cortex_M4_SLIDES.pdf

    This is explained in the section titled "Update Linux Kernel device tree to remove UART that will be controlled by M4" in the following guide.

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/How_to_Guides.html#create-dsp-and-ipu-firmware-using-pdk-drivers-and-ipc-to-load-from-arm-linux-on-am57xx-devices

    I'm looping in our Linux expert to take a look at this as well - there may be something additional requirement on the Linux side that I'm not aware of. 

    Regards,
    Sahin

  • Hello Sahin, 

    Thanks for your reply, Kindly find my findings below: 

    1. Yeah am applying similar process to run my USB application as describe in shared link for UART. 

    2. When I run my application through debugger, target EVM is under u-boot mode. 

    3. Current status of my UART3 on device tree file am57xx-beagle-x15-common.dtsi is     

       &uart3 {

       status = "okay";

       interrupts-extended = <&crossbar_mpu GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,<&dra7_pmx_core 0x3f8>; 

       I never change status of UART3 as described in provided link. 

    4. For USB disable under Linux device tree, I need to check once then I let you know. 

    5. Board_init() I already disabled. 

    6. CMA carveout in dts are properly aligned.

    7. L2MMU config need to check as per M4 bit banding.

    8. One important observation in UART application for M4 there is one file with name IpuAmmu.cfg.

         My UART application is perfectly working without using that file/ its content.

         That is not as per described in provided link. 

    9. While debug USB application following error am getting on trace0

    root@am57xx-evm:~# cat /sys/kernel/debug/remoteproc/remoteproc1/trace0

    [0][     0.000] 18 Resource entries at 0x3000

    [0][     0.000] [t=0x00090b57] ti.sysbios.timers.dmtimer.Timer: ERROR: line 394: E_notAvailable: Timer not available 1

    [0][     0.000] ti.sysbios.timers.dmtimer.Timer: line 394: E_notAvailable: Timer not available 1

    [0][     0.000] [t=0x000b9611] xdc.runtime.Main: ERROR: "src/tirtos/SemaphoreP_tirtos.c", line 212: assertion failure

    [0][     0.001] xdc.runtime.Main: "src/tirtos/SemaphoreP_tirtos.c", line 212: assertion failure

    [0][     0.001] xdc.runtime.Error.raise: terminating execution

     

    But am not using dmtimer and Semaphore properties. Already disable these from my cfg file. Tried with both using/disable these properties, error is same on trace0 for IPU2. 

    Regards,

    Geek13

  • Hello,

    Geek13 said:

    [0][     0.000] [t=0x00090b57] ti.sysbios.timers.dmtimer.Timer: ERROR: line 394: E_notAvailable: Timer not available 1

    [0][     0.000] ti.sysbios.timers.dmtimer.Timer: line 394: E_notAvailable: Timer not available 1

    If timer 1 is being used by the IPU you may need to disable it in the Linux dts (if it's not already being used by some Linux subsystem)

  • Hello,

    I see you have created a new thread here: https://e2e.ti.com/support/processors/f/791/t/841574

    Let us continue the discussion in that thread. I will close this one.

    Regards,
    Sahin