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.

AM335x fails loading PRU firmware

Hi,

I'm following the PRU training. In the Lab 4 is described how load and run the firmwares of the PRUs directly by the linux driver, after a modification of the uboot trees.

I tried to do this but it doesn't work. In other words the PRU firmware seems to be stopped.

I done these tests:

1) load and run the firmware.out files by Jtag, and I'm sure that both are ok

2) run the following commands by terminal:

                                                                                      
root@am335x-evm:~# rmmod -f /lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/remoteproc/pru_rproc.ko                    
[   71.627118] Disabling lock debugging due to kernel taint                                                           
[   71.632870] pru-rproc 4a338000.pru1: pru_rproc_remove: removing rproc 4a338000.pru1                                
[   71.640594] pru-rproc 4a338000.pru1: stopping the manually booted PRU core                                         
[   71.652259] ti-pruss 4a300000.pruss: unconfigured system_events = 0xffffffffffffffff host_intr = 0x00000001        
[   71.674335]  remoteproc2: stopped remote processor 4a338000.pru1                                                   
[   71.680586]  remoteproc2: releasing 4a338000.pru1                                                                  
[   71.698560] pru-rproc 4a334000.pru0: pru_rproc_remove: removing rproc 4a334000.pru0                                
[   71.706461] pru-rproc 4a334000.pru0: stopping the manually booted PRU core                                         
[   71.718518] ti-pruss 4a300000.pruss: unconfigured system_events = 0x0000000000010000 host_intr = 0x00000002        
[   71.733626]  remoteproc1: stopped remote processor 4a334000.pru0                                                   
[   71.740037]  remoteproc1: releasing 4a334000.pru0      

                                                            
root@am335x-evm:~# insmod /lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/remoteproc/pru_rproc.ko                      
[  131.397191]  remoteproc1: 4a334000.pru0 is available                                                               
[  131.408740]  remoteproc1: Note: remoteproc is still under development and considered experimental.                 
[  131.436706]  remoteproc1: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[  131.448485] pru-rproc 4a334000.pru0: booting the PRU core manually                                                 
[  131.459565]  remoteproc1: powering up 4a334000.pru0                                                                
[  131.472814]  remoteproc1: Booting fw image am335x-pru0-fw, size 52236                                              
[  131.479577] ti-pruss 4a300000.pruss: configured system_events = 0x0000000000010000 intr_channels = 0x00000002 host2
[  131.505304]  remoteproc1: remote processor 4a334000.pru0 is now up                                                 
[  131.511636] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss@4a300000/pru0@4a334000 probed successfully          
[  131.526605]  remoteproc2: 4a338000.pru1 is available                                                               
[  131.531645]  remoteproc2: Note: remoteproc is still under development and considered experimental.                 
[  131.555599]  remoteproc2: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[  131.567381] pru-rproc 4a338000.pru1: booting the PRU core manually                                                 
[  131.578115]  remoteproc2: powering up 4a338000.pru1                                                                
[  131.591138]  remoteproc2: Booting fw image am335x-pru1-fw, size 50792                                              
[  131.605613]  remoteproc2: remote processor 4a338000.pru1 is now up                                                 
[  131.612238] pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss@4a300000/pru1@4a338000 probed successfully          
                                                                                             
root@am335x-evm:~# echo 4a334000.pru0 > /sys/bus/platform/drivers/pru-rproc/unbind                                    
[  182.813730] pru-rproc 4a334000.pru0: pru_rproc_remove: removing rproc 4a334000.pru0                                
[  182.821488] pru-rproc 4a334000.pru0: stopping the manually booted PRU core                                         
[  182.841574] ti-pruss 4a300000.pruss: unconfigured system_events = 0x0000000000010000 host_intr = 0x00000002        
[  182.851683]  remoteproc1: stopped remote processor 4a334000.pru0                                                   
[  182.862339]  remoteproc1: releasing 4a334000.pru0    

                                                            
root@am335x-evm:~# echo 4a334000.pru0 > /sys/bus/platform/drivers/pru-rproc/bind                                      
[  211.784313]  remoteproc1: 4a334000.pru0 is available                                                               
[  211.789359]  remoteproc1: Note: remoteproc is still under development and considered experimental.                 
[  211.804692]  remoteproc1: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[  211.819313] pru-rproc 4a334000.pru0: booting the PRU core manually                                                 
[  211.829933]  remoteproc1: powering up 4a334000.pru0                                                                
[  211.842742]  remoteproc1: Booting fw image am335x-pru0-fw, size 52236                                              
[  211.849507] ti-pruss 4a300000.pruss: configured system_events = 0x0000000000010000 intr_channels = 0x00000002 host2
[  211.875610]  remoteproc1: remote processor 4a334000.pru0 is now up                                                 
[  211.882389] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss@4a300000/pru0@4a334000 probed successfully 

What can I do in order to go on with the debug? Up to now I can't understand where find the issue. I repeated more times the steps indicated in the training lab, but the result is always the same.

Thanks in advance for your help.

Matteo     
                                                                                           

  • Hi,

    The PRU experts have been notified. They will respond here.
  • Matteo,

    From the console output it appears like the PRUs are being loaded and run correctly. Can you tell me why you think that the PRUs are not running?

    Can you post the output of the following command:

    ls -la /lib/firmware/


    Which example are you attempting to run?

    Jason Reeder

  • Jason,
    the firmware should turn on and off and on the blue led when I press the button S1. But in my case nothing happen..

    the result of ls -la command is this:

    matteo@matteo-Compaq-Presario-CQ61-Notebook-PC:/media/matteo/rootfs/lib/firmware$ ls -la
    totale 364
    drwxr-xr-x 5 root root 4096 nov 13 10:58 .
    drwxr-xr-x 9 root root 4096 ott 3 23:37 ..
    -rw-r--r-- 1 root root 72 ott 3 23:14 am335x-bone-scale-data.bin
    -rw-r--r-- 1 root root 16 ott 3 23:14 am335x-evm-scale-data.bin
    -rw-r--r-- 1 root root 217148 ott 3 23:14 am335x-pm-firmware.elf
    lrwxrwxrwx 1 root root 16 nov 13 10:58 am335x-pru0-fw -> button_led_0.out
    lrwxrwxrwx 1 root root 16 nov 13 10:58 am335x-pru1-fw -> button_led_1.out
    -rw-r--r-- 1 root root 40 ott 3 23:14 am43x-evm-scale-data.bin
    -rw-rw-r-- 1 root root 52236 nov 13 10:32 button_led_0.out
    -rw-rw-r-- 1 root root 50792 nov 13 10:34 button_led_1.out
    drwxr-xr-x 2 root root 4096 ott 4 01:58 pru
    drwxr-xr-x 2 root root 4096 ott 4 01:58 ti-connectivity
    drwxr-xr-x 2 root root 4096 ott 3 23:29 ti-pruss
    matteo@matteo-Compaq-Presario-CQ61-Notebook-PC:/media/matteo/rootfs/lib/firmware$

    thanks
  • Matteo,

    This feels like a dts/pin mux issue. I think I know what is going on. Can you post the output of the following:

    dmesg | grep pinctrl


    I think there is a pin conflict with I2C2 that we are running into that is stopping our PRU cape pin muxing from being applied. I'm testing it on my setup and I'll let you know what I come up with.

    Jason Reeder

  • Jason,
    this is the output:

    root@am335x-evm:~# dmesg | grep pinctrl
    [ 0.171706] pinctrl core: initialized pinctrl subsystem
    [ 0.307147] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
    [ 9.027350] pinctrl-single 44e10800.pinmux: pin 44e108ac.0 already requested by 0-0070; cannot claim for 4a300000.ps
    [ 9.186454] pinctrl-single 44e10800.pinmux: pin-43 (4a300000.pruss) status -22
    [ 9.317524] pinctrl-single 44e10800.pinmux: could not request pin 43 (44e108ac.0) from group pru_cape_bone_pins one
    root@am335x-evm:~#

    I add also this info:
    root@am335x-evm:/boot# ls -ls
    0 lrwxrwxrwx 1 root root 33 Oct 3 2016 am335x-bone.dtb -> devicetree-zImage-am335x-bone.dtb
    40 -rw-rw-r-- 1 root root 37376 Nov 11 2016 am335x-boneblack-prucape.dtb
    0 lrwxrwxrwx 1 root root 28 Nov 13 2016 am335x-boneblack.dtb -> am335x-boneblack-prucape.dtb
    0 lrwxrwxrwx 1 root root 38 Oct 3 2016 am335x-bonegreen.dtb -> devicetree-zImage-am335x-bonegb
    0 lrwxrwxrwx 1 root root 32 Oct 3 2016 am335x-evm.dtb -> devicetree-zImage-am335x-evm.dtb
    0 lrwxrwxrwx 1 root root 34 Oct 3 2016 am335x-evmsk.dtb -> devicetree-zImage-am335x-evmsk.dtb
    0 lrwxrwxrwx 1 root root 34 Oct 3 2016 am335x-icev2.dtb -> devicetree-zImage-am335x-icev2.dtb
    36 -rw-r--r-- 1 root root 35156 Oct 3 2016 devicetree-zImage-am335x-bone.dtb
    40 -rw-r--r-- 1 root root 37004 Oct 3 2016 devicetree-zImage-am335x-boneblack.dtb
    36 -rw-r--r-- 1 root root 35412 Oct 3 2016 devicetree-zImage-am335x-bonegreen.dtb
    44 -rw-r--r-- 1 root root 41876 Oct 3 2016 devicetree-zImage-am335x-evm.dtb
    40 -rw-r--r-- 1 root root 40598 Oct 3 2016 devicetree-zImage-am335x-evmsk.dtb
    40 -rw-r--r-- 1 root root 38696 Oct 3 2016 devicetree-zImage-am335x-icev2.dtb
    13056 -rw-r--r-- 1 root root 13346120 Oct 3 2016 vmlinux-4.4.19-gdb0b54cdad
    0 lrwxrwxrwx 1 root root 25 Oct 3 2016 zImage -> zImage-4.4.19-gdb0b54cdad
    3376 -rw-r--r-- 1 root root 3451352 Oct 3 2016 zImage-4.4.19-gdb0b54cdad
    root@am335x-evm:/boot#

    thanks again
  • Matteo,

    This looks like a pin mux conflict.

    Please try to rebuild your dtb file using the new am335x-boneblack-prucape.dtsi file that I have just pushed to the pru-software-support-package git repository: git.ti.com/.../am335x-boneblack-prucape.dtsi

    Let me know if this doesn't fix it.

    Thanks for reporting this,

    Jason Reeder
  • Jason,
    when I compile the new files the compiler returns this error:

    matteo@matteo-Compaq-Presario-CQ61-Notebook-PC:~/ti-processor-sdk-linux-am335x-evm-03.01.00.06/board-support/linux-4.4.19+gitAUTOINC+db0b54cdad-gdb0b54cdad$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x-boneblack.dtb
    DTC arch/arm/boot/dts/am335x-boneblack.dtb
    Error: arch/arm/boot/dts/am335x-boneblack-prucape.dtsi:2.1-2 syntax error
    FATAL ERROR: Unable to parse input tree
    scripts/Makefile.lib:293: set di istruzioni per l'obiettivo "arch/arm/boot/dts/am335x-boneblack.dtb" non riuscito
    make[1]: *** [arch/arm/boot/dts/am335x-boneblack.dtb] Errore 1
    arch/arm/Makefile:333: set di istruzioni per l'obiettivo "am335x-boneblack.dtb" non riuscito
    make: *** [am335x-boneblack.dtb] Errore 2

    If I go back to the old file the compiler is able to generate the output file:
    matteo@matteo-Compaq-Presario-CQ61-Notebook-PC:~/ti-processor-sdk-linux-am335x-evm-03.01.00.06/board-support/linux-4.4.19+gitAUTOINC+db0b54cdad-gdb0b54cdad$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x-boneblack.dtb
    make[1]: "arch/arm/boot/dts/am335x-boneblack.dtb" è aggiornato.

    thanks
  • Matteo,

    I just tested again and the am335x-boneblack.dtb device tree built successfully for me using the updated dtsi file linked above.

    Can you post the contents of your .dtsi file as well as the include line from the am335x-boneblack.dts file? Is it possible that there was a copy/paster error?

    Jason Reeder
  • Jason,
    I had an error in the downloaded file. Now it works fine!
    Could you give me more information about the pin configuration? How do you modify the .dtsi file? there is a tool? Have you some documentation?

    Many thanks
    Matteo