PRU data ram access from uio_pruss interrupt handler

I’d like to modify the pruss_handler routine in uio_pruss.c to write some information into the PRU data memory when an interrupt occurs. What is the simplest way the correct pointers? Maybe they are already in the code somewhere, but I can’t figure it out. Thanks for any suggestions.

Chris

Hi Chris,

You will want to use

           char * pointer;
           prussdrv_map_prumem(PRUSS0_PRU0_DATARAM, (void **) &pointer);

This will give you a memory pointer to the PRU 0 data memory.
You can use the pointer to read or write memory.
Be sure to declare the memory are volatile in the PRU C code, or the compiler will optimize reads and not read the new values.
You can get more details on the TI web site:

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