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.

[K2G, ProcSDK Linux] mpmcl for PRU-ICSS

Hi,

I know CA15 side Linux can load/run DSP image(elf image) by using mpmcl, but can I understand it can also do the same for PRU-ICSS ? Here, I assume we use the latest ProcSDK Linux (03.01.00). Any suggestion ? PRUSS Driver is not still supported by the latest ProcSDK RTOS (version 03.01.00) so for now, there is no standard method to load the executable image from Application in K2G RTOS environment. I'm wondering if Linux might be able to do this.

Best Regards,
Naoki

  • Hi,

    I've notified the MPM experts. Feedback will be posted here.

    Best Regards,
    Yordan
  • Hi, Naoki,

    I don't believe mpmcl supports pru, but you can use remoteproc to download. RemoteProc process gets started during boot up time, and it downloads dsp and pru images when it finds the default file names exist in the /lib/firmware. Please see the partial K2G boot logs below:

    [   10.114206] ti-pruss 20a80000.pruss: creating PRU cores and other child platform devices

    [   10.238984] irq: no irq domain found for /soc/pruss@20a80000/intc@20aa0000 !

    [   10.246539] irq: no irq domain found for /soc/pruss@20a80000/intc@20aa0000 !

    [   10.338283] keystone-rproc 10800000.dsp0: assigned reserved memory node dsp_common_cma_pool

    [   10.414042]  remoteproc0: 10800000.dsp0 is available

    [ OK  ] Started udev Coldplug all Devices.

    [   10.478836]  remoteproc0: Note: remoteproc is still under development and considered experimental.

    [   10.487791]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.

    [   10.639465] davinci-wdt 2250000.wdt: heartbeat 60 sec

    [   10.689367] ti-pruss 20ac0000.pruss: creating PRU cores and other child platform devices

    [   10.698401] irq: no irq domain found for /soc/pruss@20ac0000/intc@20ae0000 !

    [   10.859236] irq: no irq domain found for /soc/pruss@20ac0000/intc@20ae0000 !

    [   10.917709]  remoteproc1: 20ab4000.pru0 is available

    [   11.005667]  remoteproc1: Note: remoteproc is still under development and considered experimental.

    [   11.111267] CAN device driver interface

    [   11.115146]  remoteproc1: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.

    [   11.211702] c_can_platform 260b200.can: c_can_platform device registered (regs=f221c200, irq=30)

    [   11.260049]  remoteproc1: powering up 20ab4000.pru0

    [   11.264935]  remoteproc1: Booting fw image k2g-pru0_0-fw, size 70220

    [   11.331754] c_can_platform 260b400.can: c_can_platform device registered (regs=f223e400, irq=31)

    [   11.358813] ti-pruss 20a80000.pruss: configured system_events = 0x0000000000030000 intr_channels = 0x00000005 host_intr = 0x00000005

    [ OK  ] Found device /dev/ttyS0.

    [   11.511006]  remoteproc1: remote processor 20ab4000.pru0 is now up

    [   11.555609] virtio_rpmsg_bus virtio0: rpmsg host is online

    [   11.561207] virtio_rpmsg_bus virtio0: creating channel rpmsg-pru addr 0x1e

             Starting Update UTMP about System Boot/Shutdown...

    [   11.628517]  remoteproc1: registered virtio0 (type 7)

    [   11.677232] pru-rproc 20ab4000.pru0: PRU rproc node /soc/pruss@20a80000/pru0@20ab4000 probed successfully

             Starting Network Time Synchronization...

    [   11.799125]  remoteproc2: 20ab8000.pru1 is available

    [   11.804090]  remoteproc2: Note: remoteproc is still under development and considered experimental.

    [   11.938648]  remoteproc2: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.

    [   12.090419]  remoteproc2: powering up 20ab8000.pru1

    [   12.095305]  remoteproc2: Booting fw image k2g-pru0_1-fw, size 70220

    [   12.192480] ti-pruss 20a80000.pruss: configured system_events = 0x00000000000c0000 intr_channels = 0x0000000a host_intr = 0x0000000a

    [ OK  ] Started Network Time Synchronization.

    [   12.345240]  remoteproc2: remote processor 20ab8000.pru1 is now up

    [   12.384868] virtio_rpmsg_bus virtio1: rpmsg host is online

    [   12.390439] virtio_rpmsg_bus virtio1: creating channel rpmsg-pru addr 0x1f

    [   12.439099]  remoteproc2: registered virtio1 (type 7)

    [   12.444223] pru-rproc 20ab8000.pru1: PRU rproc node /soc/pruss@20a80000/pru1@20ab8000 probed successfully

     

    Rex

     

  • Hi Rex,

    Thanks for your reply. So what is the file name for downloading ? k2g-pru0_0-fw.bin for PRU0-Core0 ?  What file format is expected by remoteproc ?  CCS can generate elf formatted execution file. so can I assume what i have to do is just renaming generated elf file to k2g-pru0_0-fw.bin and put it on /lib/firmware directory for downloading the binary from Linux ?

    Best Regards,
    Naoki

  • Hi, Naoki,

    Yes, each PRU SS has 2 cores, and the file names of pru0_0, pru0_1, pru1_0, and pru1_1 correspond to each of the core. I have not worked on PRU before, so I am not sure what format it is, nor how to build it. You can take a look at the TI PRU wiki for more info. In terms of download, it uses the remoteproc and is the same as DSP images. You can take a look at the linux kernel driver in drivers/remoteproc, and grep for "pru0_0-fw".

    Rex

  • Hi Rex,

    Thank you for your comment. Yes, I succeeded to download my PRU app (just a infinite loop in main()) to PRU0-Core0 and it looked working. I confirmed its program counter was looping correctly when I connect CCS to PRU0-Core0 after Linux was booted.

    k2g-pru0_0-fw is not actually file, but symbolic link. And in fact it is directed to my test app (test.out --- it is elf formatted out file generated by CCS) in my setup. 

    One important thing is that app is assumed to have a "resource table" by remoteproc otherwise remoteproc fails to load PRU executable during booting linux. I've just added empty resource table to my test app like this.

    #include <stdint.h>
    #include "resource_table_empty.h"
    
    
    /*
     * main.c
     */
    int main(void) {
    	
    	volatile int flag = 1;
    
    	while(flag) {
    		asm (" nop");
    	}
    
    	return 0;
    }

    You will find "resource_table_empty.h" in ​git://git.ti.com/pru-software-support-package/pru-software-support-package.git

    So I have a last question. It seems "ti-sci-firmware-k2g.bin" is required for remoteproc. Where is this lib delivered from ? I did make all of components at ProcSDK top directly, but it was not generated. So I'm temporary using pre-built version of ti-sci-firmware-k2g.bin at ti-processor-sdk-linux-k2g-evm-03.01.00.06/board-support/prebuilt-images. Also where is the document resources I should refer.

    Best Regards,
    Naoki

  • Hi, Naoki,

    Thanks for posting these useful info to help others who may have similar issue.

    ti-sci-firmware-k2g.bin is the power management firmware for the M4. It is TI IP and is delivered in binary form.

    If this answers your question, please close this thread. Thanks!

    Rex
  • Ok, understood. I close the thread now.

    Best Regards,
    Naoki
  • Hi,

    This is just input to you, but could you please consider putting PRU example applications/tool chain on ProcessorSDK Linux/RT-Linux in the future release ? 

    As for AM57x, there is example-applications\pru-icss-5.0.1 and related tool chain. My customer is considering using AM57x or K2G and they started to develop PRU application with AM57x ProcessorSDK just now. It is nice to have the same develop environment with K2G ProcessorSDK.

    Best Regards,
    Naoki

     

  • Hi, Naoki,

    Thanks for your suggestion. All TI compilers (C6x, PRU, MCU, etc) are included in CCS and use CCS as the delivery platform to resolve all licensing and packaging issues with the host OS. To be included in the ProcSDK will involve duplicate efforts which CCS has already covered and we don't plan that to be happend in the foreseeable future.

    There is a link in Processor SDK Software Developer's Guide to PRU ICSS wiki. The PRU examples are in PRU software support package.

    Rex

  • Hi Rex,

    Oh it's a shame, but I understand your policy for that. I'll share this information with our customer.

    Thanks.
    Naoki