I found the following code and although it compiles the example app
never exits while waiting for HALT. And after that all other example
apps no longer work.
the comment: " // r2 contains of all GPIO1, so now you can inspect the value of
bit 12 as desired ", I think is a hint you need to do something (write some code) to look at the value of r2.
your say “I found the following code and although it compiles the example app
never exits while waiting for HALT” This sounds like you are referring to the program that loads and starts the Pru. Why don’t you show
all the code involved.
If you follow the examples in the am335x_pru_package, you will see the App-loader C program. The App-loader initializes a linux interrupt and the PRU INTC (interrupt controler) so the PRU can send an interrrupt to the linux program.
Are you doing something like this? if so, you are not sending the interrupt back to linix.
You can look at some PRU programs in the examples of the am335x_pru_package. For example, There is the “PRU_memAccessPRUDataRam” which shows the linux
program reading from the PRU data memory. Just put r2 from the example above into the PRU data memory and read in linux.
The example PRU_memAccessPRUDataRam should exit with the halt, it is sending the interrupt “mov r31.t30” that sends the interrupt to the linux program.
You can program the loops and exits anyway you want. In fact you can start the p prpgram and exit the c program leaving the p running.