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.

AM5728: PRU access from DSP

Part Number: AM5728

We want to use the PRU driver pdk_am57xx_1_0_12/packages/ti/drv/pruss/ from DSP1 in order to route to DSP1 data
preprocessed by one of the PRU. After having been processed by DSP1 the data will be further routed to a Linux application
running on the A15 core.

To do this we have started with the IPC example ipc_3_50_02_02\examples\DRA7XX_linux_elf\ex02_messageq.

The DSP1 executable is launched from Linux in the way explained at

software-dl.ti.com/.../Foundational_Components_IPC.html

However, as explained by the on-line messages reported below, the DSP1 software crashes

[  107.635754] omap-rproc 40800000.dsp: assigned reserved memory node dsp1_cma@99000000
[  107.643718] remoteproc remoteproc2: 40800000.dsp is available
[  107.655344] remoteproc remoteproc2: powering up 40800000.dsp
...done
root@am5728-phycore-rdk:~# [  107.662331] remoteproc remoteproc2: Booting fw image dra7-dsp1-fw.xe66, size 4006044
[  107.679556] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
[  107.685455] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0
[  107.691400] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0
[  107.709538] virtio_rpmsg_bus virtio1: rpmsg host is online
[  107.715062] omap-iommu 40d01000.mmu: iommu fault: da 0x4b2a6000 flags 0x0
[  107.715070] remoteproc remoteproc2: crash detected in 40800000.dsp: type mmufault
[  107.715081] omap-iommu 40d01000.mmu: 40d01000.mmu: errs:0x00000002 da:0x4b2a6000 pgd:0xedaed2c8 *pgd:px00000000
[  107.739635] remoteproc remoteproc2: registered virtio1 (type 7)
[  107.745584] remoteproc remoteproc2: remote processor 40800000.dsp is now up

If we understand it correctly, it is while accessing PRUSS2_CFG PRUSS_REVID register at address 0x4b2a6000 in the

function PRUICSS_create.

We have tried to solve the problem in creating a custom IPC resource table including a new TYPE_DEVMEM entry for the
PRU peripheral as explained in
processors.wiki.ti.com/.../IPC_Resource_customTable
but this did not solve the problem. We suppose that there is also something to do on the Linux side but, up to now, we
did not find what.

Could somebody please help us to solve this problem ?

Best regards,
Gilbert

  • Hello Gilbert,

    1) What version of Linux are you running on ARM?

    2) Is this what you are trying to do? Or are you trying to do something else?: Use the Linux ARM to load RTOS onto a DSP. Then, use the RTOS DSP to load firmware into a PRU. Then set up data transfer between the PRU and the DSP, and data transfer between the DSP and the ARM.

    3) Do you have a known good state where you can get the ARM to successfully start the RTOS DSP? (e.g., running the example ex02_messageq with no modifications and without trying to do anything with the PRU)

    Regards,

    Nick

  • Hello Nick,

    Thank you very much for your prompt reply. Hereafter the answers to your questions :

    1) What version of Linux are you running on ARM?

    Linux 4.9.41-ga962b18-BSP-Yocto-TISDK-AM57xx-PD18.1.0 armv7l

    2) Is this what you are trying to do? Or are you trying to do something else?: Use the Linux ARM to load RTOS onto a DSP. Then, use the RTOS DSP to load firmware into a PRU. Then set up data transfer between the PRU and the DSP, and data transfer between the DSP and the ARM.

    As you say, we want 1) to load the RTOS DSP application from Linux running on the ARM by remoteproc, 2) the RTOS DSP application should load firmware into one PRU, as done in pdk_am57xx_1_0_12\packages\ti\drv\pruss\test\src\main.c, start the PRU, and read data from the PRU with the driver function PRUICSS_pruReadMemory 3) finally, data transfer should be established between DSP and ARM using IPC.

    3) Do you have a known good state where you can get the ARM to successfully start the RTOS DSP? (e.g., running the example ex02_messageq with no modifications and without trying to do anything with the PRU)

    Yes, running the ex02_messageq example is working perfectly. The problem arises when trying to read a PRU register from the DSP at address 0x4b2a6000.

    Best regards,
    Gilbert

  • State update :

    I discovered a mistake in my custom IPC resource table and improved it. Now, the DSP executable does not crash anymore. However,  following error message is still displayed at the Linux console:


    root@am5728-phycore-rdk:~# [ 7335.662303] remoteproc remoteproc2: powering up 40800000.dsp
    [ 7335.668681] remoteproc remoteproc2: Booting fw image dra7-dsp1-fw.xe66, size 4227152
    [ 7335.683584] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
    [ 7335.689481] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0
    [ 7335.695419] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0
    [ 7335.711847] virtio_rpmsg_bus virtio2: rpmsg host is online
    [ 7335.717373] ------------[ cut here ]------------
    [ 7335.717389] WARNING: CPU: 0 PID: 60 at /media/jenkins1/builddata1/yocto_ti_pd18.1.0/build_am5728/arago-tmp-external-linaro-toolchain/work-shared/am5728-phycore-rdk/kernel-source/drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x25c/0x36c
    [ 7335.717395] 44000000.ocp:L3 Standard Error: MASTER DSP1_MDMA TARGET PRUSS2 (Read Link): At Address: 0x00026000 : Data Access in User mode during Functional access
    [ 7335.717559] Modules linked in: bc_example(O) cbc xfrm_user xfrm4_tunnel ipcomp xfrm_ipcomp sd_mod esp4 ah4 af_key xfrm_algo usb_storage bluetooth xhci_plat_hcd xhci_hcd usbcore rpmsg_proto dwc3 udc_core usb_common rpmsg_rpc ecb sha512_generic snd_soc_simple_card snd_soc_simple_card_utils sha512_arm sha256_generic hmac md5 snd_soc_omap_hdmi_audio sha1_generic sha1_arm_neon sha1_arm ahci_platform pvrsrvkm(O) libahci_platform libahci omap_aes_driver omap_sham omap_wdt libata scsi_mod ti_vip ti_vpe ti_sc ti_csc ti_vpdma dwc3_omap rtc_omap c_can_platform c_can can_dev extcon_palmas extcon_core rtc_palmas snd_soc_tlv320aic3x edt_ft5x06 omap_des mt9m111 des_generic crypto_engine omap_rng rng_core omap_remoteproc virtio_rpmsg_bus rpmsg_core remoteproc virtio virtio_ring sch_fq_codel uio_module_drv(O) uio
    [ 7335.717568]  gdbserverproxy(O) cryptodev(O) cmemk(O)
    [ 7335.717576] CPU: 0 PID: 60 Comm: kworker/0:2 Tainted: G        W  O    4.9.41-ga962b18-BSP-Yocto-TISDK-AM57xx-PD18.1.0 #1
    [ 7335.717580] Hardware name: Generic DRA74X (Flattened Device Tree)
    [ 7335.717594] Workqueue: events request_firmware_work_func
    [ 7335.717599] Backtrace:
    [ 7335.717614] [<c020b208>] (dump_backtrace) from [<c020b4c4>] (show_stack+0x18/0x1c)
    [ 7335.717622]  r7:00000009 r6:600b0193 r5:00000000 r4:c102f8d0
    [ 7335.717637] [<c020b4ac>] (show_stack) from [<c04f4900>] (dump_stack+0x8c/0xa0)
    [ 7335.717651] [<c04f4874>] (dump_stack) from [<c022cfe8>] (__warn+0xec/0x104)
    [ 7335.717657]  r7:00000009 r6:c0bdcc20 r5:00000000 r4:ee3957f8
    [ 7335.717668] [<c022cefc>] (__warn) from [<c022d040>] (warn_slowpath_fmt+0x40/0x48)
    [ 7335.717676]  r9:0000001e r8:eea36110 r7:c0bdcfa0 r6:00000004 r5:c0bdcb40 r4:c0bdcbf0
    [ 7335.717686] [<c022d004>] (warn_slowpath_fmt) from [<c05244d0>] (l3_interrupt_handler+0x25c/0x36c)
    [ 7335.717690]  r3:eea30f80 r2:c0bdcbf0
    [ 7335.717694]  r4:80080001
    [ 7335.717702] [<c0524274>] (l3_interrupt_handler) from [<c027de38>] (__handle_irq_event_percpu+0xb4/0x138)
    [ 7335.717711]  r10:c101a36f r9:eea35000 r8:00000017 r7:ee39591c r6:00000000 r5:eea35000
    [ 7335.717716]  r4:eea36480
    [ 7335.717730] [<c027dd84>] (__handle_irq_event_percpu) from [<c027dee0>] (handle_irq_event_percpu+0x24/0x60)
    [ 7335.717736]  r10:00014840 r9:ee394000 r8:ee808000 r7:00000000 r6:c1008b74 r5:eea35000
    [ 7335.717739]  r4:eea35000
    [ 7335.717748] [<c027debc>] (handle_irq_event_percpu) from [<c027df5c>] (handle_irq_event+0x40/0x64)
    [ 7335.717755]  r5:eea35060 r4:eea35000
    [ 7335.717765] [<c027df1c>] (handle_irq_event) from [<c0281608>] (handle_fasteoi_irq+0xc0/0x190)
    [ 7335.717769]  r7:00000000 r6:c1008b74 r5:eea35060 r4:eea35000
    [ 7335.717779] [<c0281548>] (handle_fasteoi_irq) from [<c027d060>] (generic_handle_irq+0x2c/0x3c)
    [ 7335.717784]  r7:00000000 r6:00000000 r5:00000017 r4:c0e55da0
    [ 7335.717792] [<c027d034>] (generic_handle_irq) from [<c027d5e8>] (__handle_domain_irq+0x64/0xbc)
    [ 7335.717799] [<c027d584>] (__handle_domain_irq) from [<c02014a0>] (gic_handle_irq+0x40/0x7c)
    [ 7335.717806]  r9:ee394000 r8:fa213000 r7:fa212000 r6:ee3959d8 r5:fa21200c r4:c1003420
    [ 7335.717814] [<c0201460>] (gic_handle_irq) from [<c020c078>] (__irq_svc+0x58/0x8c)
    [ 7335.717818] Exception stack(0xee3959d8 to 0xee395a20)
    [ 7335.717823] 59c0:                                                       00000000 00000000
    [ 7335.717830] 59e0: 00000001 600b0013 c106f060 c1079e88 00000000 0000003e 00000000 00000385
    [ 7335.717836] 5a00: 00014840 ee395a94 ee395960 ee395a28 c05b9b3c c027b710 600b0013 ffffffff
    [ 7335.717842]  r9:ee394000 r8:00000000 r7:ee395a0c r6:ffffffff r5:600b0013 r4:c027b710
    [ 7335.717852] [<c027b420>] (console_unlock) from [<c027bcfc>] (vprintk_emit+0x2c0/0x480)
    [ 7335.717859]  r10:00000000 r9:c1059f08 r8:c1016e30 r7:00000006 r6:00000006 r5:00000000
    [ 7335.717862]  r4:0000002e
    [ 7335.717870] [<c027ba3c>] (vprintk_emit) from [<c0620578>] (dev_vprintk_emit+0xa8/0x1d0)
    [ 7335.717877]  r10:bf03dce8 r9:ee395bd4 r8:c0bfa8b8 r7:00000006 r6:ee395b08 r5:ed89ec38
    [ 7335.717879]  r4:00000011
    [ 7335.717886] [<c06204d0>] (dev_vprintk_emit) from [<c06206c8>] (dev_printk_emit+0x28/0x30)
    [ 7335.717892]  r10:00000000 r9:d9040000 r8:024000c0 r7:ed89ec28 r6:00000100 r5:ed99a0c0
    [ 7335.717895]  r4:00000001
    [ 7335.717901] [<c06206a4>] (dev_printk_emit) from [<c062077c>] (__dev_printk+0x54/0x94)
    [ 7335.717905]  r3:bf0588c8 r2:c0bfa8b8
    [ 7335.717917] [<c0620728>] (__dev_printk) from [<c0620a4c>] (_dev_info+0x40/0x48)
    [ 7335.717938] [<c0620a10>] (_dev_info) from [<bf057d70>] (rpmsg_probe+0x2b8/0x41c [virtio_rpmsg_bus])
    [ 7335.717943]  r3:00000000 r2:00000000 r1:bf0587ec
    [ 7335.717961] [<bf057ab8>] (rpmsg_probe [virtio_rpmsg_bus]) from [<bf03d85c>] (virtio_dev_probe+0x230/0x30c [virtio])
    [ 7335.717968]  r10:00000001 r9:00000000 r8:ffffffff r7:ed89ec38 r6:ed89ec28 r5:00000000
    [ 7335.717970]  r4:00000000
    [ 7335.717983] [<bf03d62c>] (virtio_dev_probe [virtio]) from [<c0624bf8>] (driver_probe_device+0x230/0x2d0)
    [ 7335.717990]  r10:00000000 r9:0000004b r8:bf0588f0 r7:00000000 r6:00000000 r5:c1093c14
    [ 7335.717993]  r4:ed89ec38
    [ 7335.718001] [<c06249c8>] (driver_probe_device) from [<c0624dfc>] (__device_attach_driver+0xa0/0xd4)
    [ 7335.718008]  r9:00000000 r8:c1093bf0 r7:00000001 r6:ed89ec38 r5:ee395d50 r4:bf0588f0
    [ 7335.718016] [<c0624d5c>] (__device_attach_driver) from [<c0622f90>] (bus_for_each_drv+0x68/0x9c)
    [ 7335.718021]  r7:00000001 r6:c0624d5c r5:ee395d50 r4:00000000
    [ 7335.718029] [<c0622f28>] (bus_for_each_drv) from [<c06248a4>] (__device_attach+0xb8/0x11c)
    [ 7335.718033]  r6:bf03dde4 r5:ed89ec6c r4:ed89ec38
    [ 7335.718042] [<c06247ec>] (__device_attach) from [<c0624e7c>] (device_initial_probe+0x14/0x18)
    [ 7335.718054]  r7:00000000 r6:bf03dde4 r5:ed89ec38 r4:ed89ec40
    [ 7335.718067] [<c0624e68>] (device_initial_probe) from [<c0623ea4>] (bus_probe_device+0x8c/0x94)
    [ 7335.718080] [<c0623e18>] (bus_probe_device) from [<c0622014>] (device_add+0x3fc/0x588)
    [ 7335.718091]  r7:00000000 r6:ed89ec38 r5:ed89cc20 r4:ed89ec40
    [ 7335.718099] [<c0621c18>] (device_add) from [<c06221bc>] (device_register+0x1c/0x20)
    [ 7335.718115]  r10:ed89ce1c r9:ed89ec04 r8:ed89cc20 r7:ed89ec28 r6:ed89ec38 r5:bf0459e8
    [ 7335.718120]  r4:ed89ec38
    [ 7335.718136] [<c06221a0>] (device_register) from [<bf03d494>] (register_virtio_device+0xb4/0xf4 [virtio])
    [ 7335.718143]  r5:bf0459e8 r4:ed89ec28
    [ 7335.718174] [<bf03d3e0>] (register_virtio_device [virtio]) from [<bf045f40>] (rproc_add_virtio_dev+0x78/0xfc [remoteproc])
    [ 7335.718182]  r7:ed89ec28 r6:00000007 r5:ed89cc20 r4:ed89ec00
    [ 7335.718218] [<bf045ec8>] (rproc_add_virtio_dev [remoteproc]) from [<bf0432f4>] (rproc_vdev_do_probe+0x18/0x1c [remoteproc])
    [ 7335.718223]  r7:00000000 r6:ed89cdcc r5:ed89cdc4 r4:ed89cc00
    [ 7335.718257] [<bf0432dc>] (rproc_vdev_do_probe [remoteproc]) from [<bf044fa4>] (__rproc_boot+0x4bc/0x5bc [remoteproc])
    [ 7335.718293] [<bf044ae8>] (__rproc_boot [remoteproc]) from [<bf0450d0>] (rproc_auto_boot_callback+0x18/0x24 [remoteproc])
    [ 7335.718300]  r10:ee375180 r9:00000000 r8:eed54c00 r7:00000000 r6:eed514c0 r5:ee375180
    [ 7335.718303]  r4:eda226c0
    [ 7335.718323] [<bf0450b8>] (rproc_auto_boot_callback [remoteproc]) from [<c063a9d0>] (request_firmware_work_func+0x44/0x6c)
    [ 7335.718328]  r5:ee375180 r4:eda22640
    [ 7335.718340] [<c063a98c>] (request_firmware_work_func) from [<c0243984>] (process_one_work+0x1dc/0x3f8)
    [ 7335.718342]  r4:eda22640
    [ 7335.718352] [<c02437a8>] (process_one_work) from [<c02445dc>] (worker_thread+0x58/0x574)
    [ 7335.718359]  r10:ee375180 r9:ee394000 r8:eed514d8 r7:c1002d00 r6:00000008 r5:ee375198
    [ 7335.718362]  r4:eed514c0
    [ 7335.718372] [<c0244584>] (worker_thread) from [<c0249914>] (kthread+0x100/0x118)
    [ 7335.718379]  r10:00000000 r9:00000000 r8:c0244584 r7:ee375180 r6:ee394000 r5:ee36fdc0
    [ 7335.718381]  r4:00000000
    [ 7335.718390] [<c0249814>] (kthread) from [<c0207c08>] (ret_from_fork+0x14/0x2c)
    [ 7335.718395]  r8:00000000 r7:00000000 r6:00000000 r5:c0249814 r4:ee36fdc0
    [ 7335.718399] ---[ end trace 05d91833d181e781 ]---
    [ 7336.471478] remoteproc remoteproc2: registered virtio2 (type 7)
    [ 7336.477426] remoteproc remoteproc2: remote processor 40800000.dsp is now up
    [ 7336.485040] virtio_rpmsg_bus virtio2: creating channel rpmsg-proto addr 0x3d

    and the PRU program seems not to run...

    Best regards,
    Gilbert

  • Status update:

    For running the RTOS program pdk_am57xx_1_0_12\packages\ti\drv\pruss\test\src\main.c, we had to enable the
    slave cores with a GEL command. We thought that enabling the PRU clock was missing in our DSP program
    launched with remoteproc. We added this part. This solved the issue.