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.

TDA4VM: udma_memcpy_test does not work on QNX(SDK8.0)

Part Number: TDA4VM

Hi Experts,

I have tested the udma_memcpy_test application developed by TI(psdkqa/qnx/examples/udma/udma_memcpy_test_qnx), and found out that it does not work also. The program just hangs and looks like the following thread,

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1055124/tda4vm-spi-dma-does-not-work-qnx-rtos-sdk8-0

The following is the output of the program,

J7EVM@QNX:/# udma_memcpy_testapp -v
Using 'ram' for allocating memory
main: Opened typed memory 'ram' fd/3
main: posix_tmi_length/1962934272 posix_tmi_total/4294967296
App_alloc: Alloc successful; Virt: 0x1569248000, Phy: 0x8fc565000 Contig_len: 1024
App_alloc: Alloc successful; Virt: 0x1569249000, Phy: 0x8fc566000 Contig_len: 1024
App_alloc: Alloc successful; Virt: 0x156924a000, Phy: 0x8fc567000 Contig_len: 2704
App_alloc: Alloc successful; Virt: 0x156924b000, Phy: 0x8fc568000 Contig_len: 800
App_alloc: Alloc successful; Virt: 0x156924c000, Phy: 0x8fc569000 Contig_len: 192
App_alloc: Alloc successful; Virt: 0x156924d000, Phy: 0x8fc56a000 Contig_len: 192
App_alloc: Alloc successful; Virt: 0x156924e000, Phy: 0x8fc56b000 Contig_len: 128
App_alloc: Alloc successful; Virt: 0x156924f000, Phy: 0x8fc56c000 Contig_len: 128
App_alloc: Alloc successful; Virt: 0x1569250000, Phy: 0x8fc56d000 Contig_len: 128
App_alloc: Alloc successful; Virt: 0x1569251000, Phy: 0x8fc56e000 Contig_len: 256
Udma_qnxVirtToPhyFxn: virt/156924e000 phy/0x8fc56b000
Udma_qnxVirtToPhyFxn: virt/156924e000 phy/0x8fc56b000
Udma_qnxVirtToPhyFxn: virt/156924f000 phy/0x8fc56c000
Udma_qnxVirtToPhyFxn: virt/156924f000 phy/0x8fc56c000
Udma_qnxVirtToPhyFxn: virt/1569250000 phy/0x8fc56d000
Udma_qnxVirtToPhyFxn: virt/1569250000 phy/0x8fc56d000
App_memcpyTest: Setting Src/0x1569248000 and Dest/0x1569249000 to 0
Udma_qnxVirtToPhyFxn: virt/1569248000 phy/0x8fc565000
Udma_qnxVirtToPhyFxn: virt/1569249000 phy/0x8fc566000
udma_dump_bufs: printing 10 bytes of 1000 byte transfer
Source Buffer virtual=0x1569248000(phys=0x8fc565000):
src[0] = 0x00
src[1] = 0x01
src[2] = 0x02
src[3] = 0x03
src[4] = 0x04
src[5] = 0x05
src[6] = 0x06
src[7] = 0x07
src[8] = 0x08
src[9] = 0x09
Destination Buffer virtual=0x1569249000(phys=0x8fc566000):
dst[0] = 0x00
dst[1] = 0x00
dst[2] = 0x00
dst[3] = 0x00
dst[4] = 0x00
dst[5] = 0x00
dst[6] = 0x00
dst[7] = 0x00
dst[8] = 0x00
dst[9] = 0x00
Udma_qnxVirtToPhyFxn: virt/1569248000 phy/0x8fc565000
Udma_qnxVirtToPhyFxn: virt/1569249000 phy/0x8fc566000
App_udmaMemcpy: TR Packet descriptor updated
Udma_qnxVirtToPhyFxn: virt/1569251000 phy/0x8fc56e000
App_udmaMemcpy: TRPD submitted to channel
App_udmaMemcpy: Waiting on semaphore for return descriptor in completion ring

****** THEN, IT HANGS HERE for waiting the completion event! ******

Please help to fix this issue.

Thanks,

Best Regards,

Jianqiang

  • Hi Jianqiang,

    The "udma_memcpy_testapp -v" is expected to function, if it is being run for the first time after boot.   Can you please provide logs for the below.   

    <Reboot board>

    pidin ar

    udma_memcpy_testapp -v

    slog2info

    Below are logs from local setup on SDK QNX 8.0.

    sdk80_bootlog_udma_memcpy.txt
    U-Boot SPL 2021.01-g53e79d0e89 (Aug 04 2021 - 23:32:00 +0000)
    Model: Texas Instruments K3 J721E SoC
    Board: J721EX-PM2-SOM rev E6
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
    Trying to boot from MMC2
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.5(release):08.00.00.004-dirty
    NOTICE:  BL31: Built : 22:30:09, Aug  4 2021
    
    U-Boot SPL 2021.01-g53e79d0e89 (Aug 04 2021 - 22:33:28 +0000)
    Model: Texas Instruments K3 J721E SoC
    Board: J721EX-PM2-SOM rev E6
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
    Detected: J7X-BASE-CPB rev E3
    Detected: J7X-VSC8514-ETH rev E2
    Trying to boot from MMC2
    
    
    U-Boot 2021.01-g53e79d0e89 (Aug 04 2021 - 22:33:28 +0000)
    
    SoC:   J721E SR1.0
    Model: Texas Instruments K3 J721E SoC
    Board: J721EX-PM2-SOM rev E6
    DRAM:  4 GiB
    Flash: 0 Bytes
    MMC:   sdhci@4f80000: 0, sdhci@4fb0000: 1
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Detected: J7X-BASE-CPB rev E3
    Detected: J7X-VSC8514-ETH rev E2
    Net:   am65_cpsw_nuss_slave ethernet@46000000: K3 CPSW: nuss_ver: 0x6BA00101 cpsw_ver: 0x6BA80100 ale_ver: 0x00293904 Ports:1 mdio_freq:1000000
    eth0: ethernet@46000000
    Hit any key to stop autoboot:  0
    Timed out in wait_for_bb: status=1000
    Timed out in wait_for_bb: status=1000
    Timed out in wait_for_bb: status=1000
    pca953x gpio@22: Error reading output register
    switch to partitions #0, OK
    mmc1 is current device
    Timed out in wait_for_bb: status=1000
    pca953x gpio@22: Error reading output register
    SD/MMC found on device 1
    Failed to load 'boot.scr'
    526 bytes read in 9 ms (56.6 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    Running uenvcmd ...
    k3_r5f_rproc r5f@41000000: Core 1 is already in use. No rproc commands work
    k3_r5f_rproc r5f@41400000: Core 2 is already in use. No rproc commands work
    2550940 bytes read in 116 ms (21 MiB/s)
    Load Remote Processor 2 with data@addr=0x82000000 2550940 bytes: Success!
    506744 bytes read in 31 ms (15.6 MiB/s)
    Load Remote Processor 3 with data@addr=0x82000000 506744 bytes: Success!
    Failed to load '/lib/firmware/j7-main-r5f1_0-fw'
    Failed to load '/lib/firmware/j7-main-r5f1_1-fw'
    1579088 bytes read in 72 ms (20.9 MiB/s)
    Load Remote Processor 6 with data@addr=0x82000000 1579088 bytes: Success!
    1579088 bytes read in 72 ms (20.9 MiB/s)
    Load Remote Processor 7 with data@addr=0x82000000 1579088 bytes: Success!
    10399616 bytes read in 183 ms (54.2 MiB/s)
    Load Remote Processor 8 with data@addr=0x82000000 10399616 bytes: Success!
    8144540 bytes read in 350 ms (22.2 MiB/s)
    ## Starting application at 0x80080000 ...
    MMU: 16-bit ASID 44-bit PA TCR_EL1=b5183519
    cpu0: MPIDR=80000000
    cpu0: MIDR=411fd080 Cortex-A72 r1p0
    cpu0: CWG=4 ERG=4 Dminline=4 Iminline=4 PIPT
    cpu0: CLIDR=a200023 LoUU=1 LoC=2 LoUIS=1
    cpu0: L1 Icache 48K linesz=64 set/way=256/3
    cpu0: L1 Dcache 32K linesz=64 set/way=256/2
    cpu0: L2 Unified 1024K linesz=64 set/way=1024/16
    Display set to R5
    Loading IFS...decompressing...done
    cpu1: MPIDR=80000001
    cpu1: MIDR=411fd080 Cortex-A72 r1p0
    cpu1: CWG=4 ERG=4 Dminline=4 Iminline=4 PIPT
    cpu1: CLIDR=a200023 LoUU=1 LoC=2 LoUIS=1
    cpu1: L1 Icache 48K linesz=64 set/way=256/3
    cpu1: L1 Dcache 32K linesz=64 set/way=256/2
    cpu1: L2 Unified 1024K linesz=64 set/way=1024/16
    
    System page at phys:0000000080011000 user:ffffff8040254000 kern:ffffff8040251000
    Starting next program at vffffff8060086e10
    All ClockCycles offsets within tolerance
    Welcome to QNX Neutrino 7.1.0 on the TI J721E EVM Board!!
    Starting random service ...
    start serial driver
    Unable to access "/dev/i2c0" (2)
    Starting MMC/SD memory card driver... eMMC
    Starting MMC/SD memory card driver... SD
    Starting XHCI driver on USB3SS0 and USB3SS1
    Path=0 - am65x
     target=0 lun=0     Direct-Access(0) - SDMMC: S0J56X Rev: 1.0
    Setting environment variables...
    done..
    Mounting the sd ..
    Looking for user script to run: /ti_fs/scripts/user.sh
    Running user script...
    user.sh called...
    Setting additional environment variables...
    Starting tisci-mgr..
    Starting shmemallocator..
    Starting tiipc-mgr..
    Starting TI IPC Resmgr
    Starting tiudma-mgr..
    Start screen..
    screen started with dss_on_r5 configuration..
    done...
    J7EVM@QNX:/#
    J7EVM@QNX:/#
    J7EVM@QNX:/# udma_memcpy_testapp -v
    Using 'ram' for allocating memory
    main: Opened typed memory 'ram' fd/3
    main: posix_tmi_length/1979711488 posix_tmi_total/4294967296
    App_alloc: Alloc successful; Virt: 0x3543369000, Phy: 0x8fc290000 Contig_len: 1024
    App_alloc: Alloc successful; Virt: 0x354336a000, Phy: 0x8fc291000 Contig_len: 1024
    App_alloc: Alloc successful; Virt: 0x354336b000, Phy: 0x8fc292000 Contig_len: 2704
    App_alloc: Alloc successful; Virt: 0x354336c000, Phy: 0x8fc293000 Contig_len: 800
    App_alloc: Alloc successful; Virt: 0x354336d000, Phy: 0x8fc294000 Contig_len: 192
    App_alloc: Alloc successful; Virt: 0x354336e000, Phy: 0x8fc295000 Contig_len: 192
    App_alloc: Alloc successful; Virt: 0x354336f000, Phy: 0x8fc296000 Contig_len: 128
    App_alloc: Alloc successful; Virt: 0x3543370000, Phy: 0x8fc297000 Contig_len: 128
    App_alloc: Alloc successful; Virt: 0x3543371000, Phy: 0x8fc298000 Contig_len: 128
    App_alloc: Alloc successful; Virt: 0x3543372000, Phy: 0x8fc299000 Contig_len: 256
    Udma_qnxVirtToPhyFxn: virt/354336f000 phy/0x8fc296000
    Udma_qnxVirtToPhyFxn: virt/354336f000 phy/0x8fc296000
    Udma_qnxVirtToPhyFxn: virt/3543370000 phy/0x8fc297000
    Udma_qnxVirtToPhyFxn: virt/3543370000 phy/0x8fc297000
    Udma_qnxVirtToPhyFxn: virt/3543371000 phy/0x8fc298000
    Udma_qnxVirtToPhyFxn: virt/3543371000 phy/0x8fc298000
    App_memcpyTest: Setting Src/0x3543369000 and Dest/0x354336a000 to 0
    Udma_qnxVirtToPhyFxn: virt/3543369000 phy/0x8fc290000
    Udma_qnxVirtToPhyFxn: virt/354336a000 phy/0x8fc291000
    udma_dump_bufs: printing 10 bytes of 1000 byte transfer
    Source Buffer virtual=0x3543369000(phys=0x8fc290000):
    src[0] = 0x00
    src[1] = 0x01
    src[2] = 0x02
    src[3] = 0x03
    src[4] = 0x04
    src[5] = 0x05
    src[6] = 0x06
    src[7] = 0x07
    src[8] = 0x08
    src[9] = 0x09
    Destination Buffer virtual=0x354336a000(phys=0x8fc291000):
    dst[0] = 0x00
    dst[1] = 0x00
    dst[2] = 0x00
    dst[3] = 0x00
    dst[4] = 0x00
    dst[5] = 0x00
    dst[6] = 0x00
    dst[7] = 0x00
    dst[8] = 0x00
    dst[9] = 0x00
    Udma_qnxVirtToPhyFxn: virt/3543369000 phy/0x8fc290000
    Udma_qnxVirtToPhyFxn: virt/354336a000 phy/0x8fc291000
    App_udmaMemcpy: TR Packet descriptor updated
    Udma_qnxVirtToPhyFxn: virt/3543372000 phy/0x8fc299000
    App_udmaMemcpy: TRPD submitted to channel
    App_udmaMemcpy: Waiting on semaphore for return descriptor in completion ring
    Udma_qnxVirtToPhyFxn: virt/3543369000 phy/0x8fc290000
    Udma_qnxVirtToPhyFxn: virt/354336a000 phy/0x8fc291000
    udma_dump_bufs: printing 10 bytes of 1000 byte transfer
    Source Buffer virtual=0x3543369000(phys=0x8fc290000):
    src[0] = 0x00
    src[1] = 0x01
    src[2] = 0x02
    src[3] = 0x03
    src[4] = 0x04
    src[5] = 0x05
    src[6] = 0x06
    src[7] = 0x07
    src[8] = 0x08
    src[9] = 0x09
    Destination Buffer virtual=0x354336a000(phys=0x8fc291000):
    dst[0] = 0x00
    dst[1] = 0x01
    dst[2] = 0x02
    dst[3] = 0x03
    dst[4] = 0x04
    dst[5] = 0x05
    dst[6] = 0x06
    dst[7] = 0x07
    dst[8] = 0x08
    dst[9] = 0x09
    Udma_qnxVirtToPhyFxn: virt/3543372000 phy/0x8fc299000
    App_memcpyTest: Memory check complete
    UDMA memcpy using TR15 block copy Passed!!
    All tests have passed!!
    

    Regards,

    kb

  • Hi KB,

    I tested it as you suggested.

    It's great, the udma_memcpy_testapp works fine if it is being run for the first time after boot.

    If I run udma_memcpy_testapp after my ported spi driver being accessed,  the udma_memcpy_testapp will hangs.

    The fault comes from my spi driver!

    Thanks,

    Regards,

    Jianqiang