I have been able to load/start/run/stop a PRU core from 4.4.30-ti-r64 using 
just the uio_pruss (& uio) drivers, without any of the prussdrv code. Big 
milestone in my project.

A long time ago I asked a question about the examples in the pru here: 
https://groups.google.com/d/topic/beagleboard/Kv03QMsgOmo/discussion

as did someone else 
here: https://groups.google.com/d/topic/beagleboard/vnZ9eSzoo6Y/discussion

but I found no answer to help me. From a thorough review of the examples in 
the am335x_pru_package (using the prussdrv uio-based pru driver) 
here: 
https://github.com/beagleboard/am335x_pru_package/blob/master/pru_sw/example_apps/PRU_PRUtoPRU_Interrupt/PRU_PRUtoPRU_Interrupt.c

it *appears* to me that this example (to teach/illustrate proper use of pru 
in the BB family) works only by luck - or taking advantage of some bit of 
information that is undocumented (from my research).

Specifically, when using the L3 DDR (main) memory to share data between the 
A8 and PRU, it seems that rather than using the 256KiB size region starting 
at 0x9c94_0000 (on my BBB rev C) it seems to simply hardcode 0x8000_0000 
and write away. See here:

static int LOCAL_exampleInit () {
 void *DDR_regaddr;
 /* open the device */
 mem_fd = open("/dev/mem", O_RDWR);
 if (mem_fd < 0) {
  printf("Failed to open /dev/mem (%s)\n", strerror(errno));
  return -1;
 }
 /* map the memory */
 ddrMem = mmap(0, 0x0FFFFFFF, PROT_WRITE | PROT_READ, MAP_SHARED, mem_fd, 
DDR_BASEADDR);
 if (ddrMem == NULL) {
  printf("Failed to map the device (%s)\n", strerror(errno));
  close(mem_fd);
  return -1;
 }
 //FLush the flag locations of PRU0 and PRU1
 DDR_regaddr = ddrMem;
 *(unsigned long*) DDR_regaddr = 0x00;
 DDR_regaddr = ddrMem + 0x000000004;
 *(unsigned long*) DDR_regaddr = 0x00;
 return(0);
}
I can understand how this might work "by accident" if these first eight 
bytes in DDR are not used. But that's not a good example. Questions: 1) Is 
there some "magic" to this physical memory location that I'm missing out 
on? Or am I mis-reading the code, and it is *not* just writing to physical 
memory 0x0-0x7? 2) Is it correct that the actual DDR physical memory region 
that is allocated by the uio driver is properly determined by examining 
/sys/class/uio/uio<n>/maps/map1/{addr,size}? If not, how? I think this is 
useful information that would be helpful to others if provided. Perhaps 
even an update to the example, if my assertions are correct.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/54e7aca4-5dc6-405a-a2ab-d6ea3718a562%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to