Project

General

Profile

How to enable PRU Subsystem on MityDSP-L138F SOM ???

Added by Ngoc Thanh Pham over 10 years ago

Hi everyone!

I'm using MityDSP-L138F SOM + IO Industrial Board and now trying to work with PRU subsystem of OMAP-L138 processor.
I've found some instructions from:
http://processors.wiki.ti.com/index.php/PRU_Linux_Application_Loader ()
and then rebuilt the kernel for SOM successfully (using MDK_2014-01-13 from Criticallink LLC )
However, after load the uImage (via tftp), boot up the board and load uio_pruss module, i can't run any PRU example from pru_sw project.
The error message are:

root@mityomapl138:~# ./PRU_gpioToggle

INFO: Starting PRU_gpioToggle example.
prussdrv_open open failed

I also try some command to verify uio_pruss driver, but my PRU module seem not configured correctly:

1 - I can't see ansy uio0 or uio1,... after "ls /dev" command.

2 - I was check in the file system, but i got a error message like this:

root@mityomapl138:~# cat /sys/class/uio/uio0/maps/map0/addr
cat: can't open '/sys/class/uio/uio0/maps/map0/addr': No such file or directory

Can anyone show me how to configure and run PRU example correctly?

Thanks in advance!

Regard,
Manh BT


Replies (11)

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Michael Williamson over 10 years ago

Hi,

I think we need to add the following patches (from linus tree) to the kernel to instantiate the PRUSS drivers for the L138.

2eb2478d471e45e1d0c8bb3defbf82bf7204e13d uio: uio_pruss: replace private SRAM API with genalloc
8e0d72d2c7a6955692ba0a21bbf5ca86e8061777 ARM: davinci: da8xx: add DA850 PRUSS support
ae41d17a76338ed4cb2ab2c7db2b5de9f9524609 ARM: davinci: da850 evm: register uio_pruss device
cb3771b049b3b554455094a3b06d8ceb07086e06 uio: uio_pruss: Fix potential NULL pointer dereference

We will need one additional patch similar to ae41d17a76338ed4cb2ab2c7db2b5de9f9524609 to register the device for the mitydsp-l138 board file.

I will try to get someone assigned to push the drivers in the MDK kernel. Sorry for the delay.

-Mike

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Ngoc Thanh Pham over 10 years ago

Hi Michael,

Thanks for your information, but where can I get above patches? Is it in Critical Link MDK ?

Regard,
Manh BT

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Bob Duke over 10 years ago

Hello Manh BT,

The patches Mike described are in the mainline Linux kernel (http://kernel.org/). You can search for those commit hashes via Google to see the required changes.

We are in the process of applying and testing these patches in our L138 kernel baseline and once they are ready you will see them on our support site: http://support.criticallink.com/gitweb/?p=linux-davinci.git;a=summary

Thanks,

-Bob

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Ngoc Thanh Pham over 10 years ago

Hi,

Thank you, I'm waiting for your patches. ^^

Regards,
Manh BT

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Jonathan Cormier over 10 years ago

Hi Ngoc,

I have been working on getting this to work. So far i've integrated the patches which i've posted to a test branch until we can confirm its working. Please checkout 'mitydsp-linux-v3.2_pruss_wip' branch. Currently it is creating the uio dev nodes but running some of the TI demos causes seg faults.

Heres my results so far:

Setting up examples, Note need the latest version of the svn repo. Revision 24 requested by the TI guide segfaults right away for the 3.2 kernel driver.

svn co https://gforge.ti.com/svn/pru_sw/trunk pru_sw
cd pru_sw
make CCTOOL_PREFIX=$TARGET_PREFIX libprussdrv
cd example_apps
make CCTOOLS=${TARGET_PREFIX}gcc

root@mityomapl138:~/bin_pru# ./PRU_gpioToggle

INFO: Starting PRU_gpioToggle example.
        INFO: Initializing example.
INFO: Executing pinmux configuration.
File ./pinmux.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
        INFO: Executing example.
File ./PRU_gpioToggle.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
INFO: Example failed.
        INFO: Executing pinmux reset.
File ./pinmux_reset.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.

Example failed..

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Jonathan Cormier over 10 years ago

Running through all the examples, atleast one of them seems to have caused a system segfault as not even reboot was able to run afterwards.

root@mityomapl138:~/bin_pru/bin# ls
PRU_ARMtoPRU_Interrupt        PRU_memAccessL3andDDR.bin
PRU_ARMtoPRU_Interrupt.bin    PRU_memAccessPRUDataRam
PRU_PRU0toPRU1_Interrupt.bin  PRU_memAccessPRUDataRam.bin
PRU_PRU1toPRU0_Interrupt.bin  PRU_memCopy
PRU_PRUtoARM_Interrupt        PRU_memCopy.bin
PRU_PRUtoARM_Interrupt.bin    PRU_miscOperations
PRU_PRUtoPRU_Interrupt        PRU_miscOperations.bin
PRU_access_const_table        PRU_multiply
PRU_access_const_table.bin    PRU_multiply.bin
PRU_edmaConfig.bin            PRU_pscConfig.bin
PRU_edmaInterrupt.bin         PRU_semaphore
PRU_gpioToggle                PRU_semaphore.bin
PRU_gpioToggle.bin            PRU_timer2Interrupt
PRU_mem1DTransfer             PRU_timer2Interrupt.bin
PRU_mem1DTransfer.bin         pinmux.bin
PRU_memAccessL3andDDR         pinmux_reset.bin
root@mityomapl138:~/bin_pru/bin# ./PRU_ARMtoPRU_Interrupt

INFO: Starting PRU_ARMtoPRU_Interrupt example.
        INFO: Initializing example.
File ./PRU_ARMtoPRU_Interrupt.bin open passed
        Generate interrupt
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example completed successfully.
root@mityomapl138:~/bin_pru/bin# ./PRU_PRUtoARM_Interrupt

INFO: Starting PRU_PRUtoARM_Interrupt example.
        INFO: Initializing example.
        INFO: Executing example.
File ./PRU_PRUtoARM_Interrupt.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example executed succesfully.

^C
root@mityomapl138:~/bin_pru/bin# ./PRU_PRUtoPRU_Interrupt

INFO: Starting PRU_PRUtoPRU_Interrupt example.
        INFO: Initializing example.
        INFO: Executing example on PRU0.
File ./PRU_PRU0toPRU1_Interrupt.bin open passed
                INFO: Executing example on PRU1.
File ./PRU_PRU1toPRU0_Interrupt.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU0 completed transfer.
                INFO: Waiting for HALT command.
                INFO: PRU1 completed transfer.
Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# ./PRU_access_const_table

INFO: Starting PRU_access_const_table example.
        INFO: Initializing example.
        INFO: Executing PSC configuration code .
File ./PRU_pscConfig.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
        INFO: Executing example.
File ./PRU_access_const_table.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# ./PRU_mem1DTransfer

INFO: Starting PRU_mem1DTransfer example.
        INFO: Initializing example.
        INFO: Executing example.
File ./PRU_mem1DTransfer.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# ./PRU_memAccessL3andDDR

INFO: Starting PRU_ARM_memAccessL3andDDR example.
        INFO: Initializing example.
        INFO: Executing example.
File ./PRU_memAccessL3andDDR.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# ./PRU_memAccessPRUDataRam
Segmentation fault
root@mityomapl138:~/bin_pru/bin# ./PRU_memCopy
Segmentation fault
root@mityomapl138:~/bin_pru/bin# ./PRU_multiply
Segmentation fault
root@mityomapl138:~/bin_pru/bin# ./PRU_semaphore
Segmentation fault
root@mityomapl138:~/bin_pru/bin# ./PRU_timer2Interrupt
Segmentation fault
root@mityomapl138:~/bin_pru/bin# ./PRU_ARMtoPRU_Interrupt
Segmentation fault
root@mityomapl138:~/bin_pru/bin# reboot
Segmentation fault

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Jonathan Cormier over 10 years ago

Reran some of the commands to see which fail. The ./PRU_memAccessL3andDDR can cause system segfaults as it appears to use a fixed part of ddr during its test and if a program or linux happens to be residing there then it will be overrided/corrupted.

root@mityomapl138:~/bin_pru/bin# ./PRU_memAccessL3andDDR

INFO: Starting PRU_ARM_memAccessL3andDDR example.
        INFO: Initializing example.
        INFO: Executing example.
File ./PRU_memAccessL3andDDR.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# ls
Segmentation fault

Rebooted

root@mityomapl138:~/bin_pru/bin# ./PRU_memAccessPRUDataRam

INFO: Starting PRU_memAccessPRUDataRam example.
        INFO: Initializing example.
        INFO: Executing example.
File ./PRU_memAccessPRUDataRam.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
INFO: Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# test
root@mityomapl138:~/bin_pru/bin#
root@mityomapl138:~/bin_pru/bin# ./PRU_memCopy

INFO: Starting PRU_memCopy example.
INFO: Initializing aligned example.
        INFO: Executing example.
File ./PRU_memCopy.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example executed succesfully.
INFO: Initializing same offset example.
        INFO: Executing example.
File ./PRU_memCopy.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example executed succesfully.
INFO: Initializing different offset example.
        INFO: Executing example.
File ./PRU_memCopy.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# test
root@mityomapl138:~/bin_pru/bin#
root@mityomapl138:~/bin_pru/bin# ./PRU_miscOperations

INFO: Starting PRU_miscOperations example.
        INFO: Initializing example.
        INFO: Executing example.
File ./PRU_miscOperations.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Masking and bit_shift operations were executed succesfully
Bubble sort was executed succesfully
Thresholding functionality was executed succesfully
Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# test
root@mityomapl138:~/bin_pru/bin# ./PRU_multiply

INFO: Starting PRU_multiply example.
        INFO: Initializing example.
        INFO: Executing example.
File ./PRU_multiply.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# test
root@mityomapl138:~/bin_pru/bin# ./PRU_semaphore

Starting PRU PRU_semaphore example.
        INFO: Initializing example.
        INFO: Current Transfer size = 4 bytes.
PRU has permission
        INFO: Loading and executing transfer in PRU.
File ./PRU_semaphore.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
        INFO: Current Transfer size = 14 bytes.
ARM has permission
Segmentation fault
root@mityomapl138:~/bin_pru/bin#
root@mityomapl138:~/bin_pru/bin# ./PRU_timer2Interrupt

INFO: Starting PRU_timer2Interrupt example.
        INFO: Initializing example.
        INFO: Executing example.
File ./PRU_timer2Interrupt.bin open passed
        Waiting for HALT command.
        PRU completed transfer.
Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# test
root@mityomapl138:~/bin_pru/bin#
root@mityomapl138:~/bin_pru/bin# ./PRU_memAccessL3andDDR

INFO: Starting PRU_ARM_memAccessL3andDDR example.
        INFO: Initializing example.
        INFO: Executing example.
File ./PRU_memAccessL3andDDR.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
Example executed succesfully.
root@mityomapl138:~/bin_pru/bin# test
root@mityomapl138:~/bin_pru/bin# ls
PRU_ARMtoPRU_Interrupt        PRU_memAccessL3andDDR.bin
PRU_ARMtoPRU_Interrupt.bin    PRU_memAccessPRUDataRam
PRU_PRU0toPRU1_Interrupt.bin  PRU_memAccessPRUDataRam.bin
PRU_PRU1toPRU0_Interrupt.bin  PRU_memCopy
PRU_PRUtoARM_Interrupt        PRU_memCopy.bin
PRU_PRUtoARM_Interrupt.bin    PRU_miscOperations
PRU_PRUtoPRU_Interrupt        PRU_miscOperations.bin
PRU_access_const_table        PRU_multiply
PRU_access_const_table.bin    PRU_multiply.bin
PRU_edmaConfig.bin            PRU_pscConfig.bin
PRU_edmaInterrupt.bin         PRU_semaphore
PRU_gpioToggle                PRU_semaphore.bin
PRU_gpioToggle.bin            PRU_timer2Interrupt
PRU_mem1DTransfer             PRU_timer2Interrupt.bin
PRU_mem1DTransfer.bin         pinmux.bin
PRU_memAccessL3andDDR         pinmux_reset.bin

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Jonathan Cormier over 10 years ago

gpioToggle test passed when i just ran it. Not sure why.

root@mityomapl138:~/bin_pru/bin# ./PRU_gpioToggle

INFO: Starting PRU_gpioToggle example.
        INFO: Initializing example.
INFO: Executing pinmux configuration.
File ./pinmux.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
        INFO: Executing example.
File ./PRU_gpioToggle.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.
INFO: Example executed succesfully.
        INFO: Executing pinmux reset.
File ./pinmux_reset.bin open passed
        INFO: Waiting for HALT command.
        INFO: PRU completed transfer.

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Jonathan Cormier over 10 years ago

Ngoc,

Can you confirm that this is working for you and i'll move the changes into our main kernel branch?

I also created a wiki page to help future projects Using PRU

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Ngoc Thanh Pham over 10 years ago

Hi Jonathan,

Thank you for your patches, it's working for me!
I have applied and successfully rebuilt my kernel.
And almost PRU example from TI can run on my board.

Thanks you very much! ^^

_Regard,
Manh BT

RE: How to enable PRU Subsystem on MityDSP-L138F SOM ??? - Added by Jonathan Cormier over 10 years ago

Patches have been merged into linux-mityarm-v3.2 branch.

    (1-11/11)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)