You could have the ARM side write a unique number at a known offset into into
the PRU's DRAM area.
Then have the firmware read it from 0x0000+offset.
Each PRU's DRAM is mapped into 0x0000 (as seen from the PRU).
The ARM sees PRU0's DRAM at PRUBASE + 0x0000 and PRU's DRAM at PRUBASE +
0x2000.
For eample:
So before loading, write 0x10 to PRUBASE + 0x0004 and 0x20 to PRUBASE +
0x2004. 0x10 and 0x20 are just 2 unique values.
Then the PRU firmware can do something like (psuedo code):
If (*(0x0004) == 0x10) {
/* On PRU 0 */
} else {
/* On PRU 1 */
}
On Friday, January 20, 2017 23:42:12 Ken Shirriff wrote:
> Is it possible for a PRU to know if it is PRU0 or PRU1? I want to run the
> same code on both PRUs but have it do slightly different things [*]. I
> guess I could write a "0" to PRU0's RAM and a "1" to PRU1's RAM and the PRU
> code could test this. But is there a more direct way, such as reading a
> config register? I looked over the Technical Reference Manual but couldn't
> find anything.
>
> [*] Specifically, I want the PRU code to send an event to the ARM,
> with PRU_EVTOUT0 from PRU0 and PRU_EVTOUT1 from PRU1, so the ARM code knows
> which PRU sent the event. But I can't see how to do that without the PRU
> knowing if it is PRU0 or PRU1.
>
> Thanks,
> Ken
--
Hunyue Yau
http://www.hy-research.com/
--
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/15316540.OZV5ip5eiX%40acer0.
For more options, visit https://groups.google.com/d/optout.