On 8/28/2017 3:38 AM, Babak akbari wrote:
> I'm an absolute beginner in the field of pru. I was wondering what actually 
> takes place when a bin file is loaded into the instruction memory of a pru. I 
> looked through the prussdrv.c in am335x_pru_package file where application 
> loader api functions are located.
> https://github.com/beagleboard/am335x_pru_package/blob/master/pru_sw/app_loader/interface/prussdrv.c
> 
> My question is in 
> int prussdrv_pru_write_memory (unsigned int pru_ram_id, unsigned int 
> wordoffset, unsigned int *memarea,  unsigned int bytelength); 
> function scope
> 
> 
> wordlength = (bytelength + 3) >> 2; //Adjust length as multiple of 4 bytes
> 
> for (i = 0; i < wordlength; i++) {
> *(pruramarea + i + wordoffset) = *(memarea + i);
>     }
>     return wordlength;
> 
> why wordoffset is added to pruramarea which holds the the address of the 
> instruction memory.but according to this guide
> 
> http://processors.wiki.ti.com/index.php/PRU_Linux_Application_Loader_API_Guide
> 
> wordoffset is the offset from *memarea and I think wordoffset is to be added 
> to memarea instead , otherwise we are missing some parts of the instruction 
> memory.

It looks like the documentation is unclear (or wrong).  The offset is
the offset into the mapped memory region (pruramarea, selected by what
you pass as the pru_ram_id parameter) where the memory buffer
specified by memarea & bytelength will be copied.

When in doubt, trust the code!  :)

> My other question is why pru instruction memory is said to be 8kB But 
> according to the trm pru global memory section the instruction memory is just 
> 4k

Which TRM?  The TRMs I have for the AM335x refer to 8KB instruction
memory for each PRU core, but there are several versions of the PRU
floating around in different SoC's.

-- 
Charles Steinkuehler
char...@steinkuehler.net

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/bc13310e-4c4d-460c-357c-65178c5447bc%40steinkuehler.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to