Project

General

Profile

Using PRU

TI provided examples for the L138
http://processors.wiki.ti.com/index.php/PRU_Linux_Application_Loader

References

PRU Datasheet

The 335x has a similar PRU and some of its documentation should be usable with minor tweaks.

http://elinux.org/Ti_AM33XX_PRUSSv2

http://processors.wiki.ti.com/index.php/PRU-ICSS_FAQ

PRU FAQ

http://processors.wiki.ti.com/index.php/PRU_Projects

Examples Setup:

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.
Note If asked for password, leave blank

svn co --username anonymous 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

Copy all files in created bin folder to L138 /home/root/bin_pru

Running examples

Running through all the examples.

Note: Several of the examples directly access the DDR memory and can cause a system segfault if an application or linux itself is using that memory. A safe design that wanted to use shared DDR would probably have to either reserve some memory similar to how the DSP does by using mem= in bootargs. Or the application could malloc some memory and pass the physical memory address to the PRU to use. Unsure if userspace can determine the physical address of malloc'd memory so might need to be done within the driver.

root@mityomapl138:~/bin_pru# 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# ./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# ./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# ./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# ./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_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.
root@mityomapl138:~/bin_pru# ./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# ./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

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# ./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# ./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# ./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# ./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# ./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# ./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.

Go to top
Add picture from clipboard (Maximum size: 600 MB)