I modified the "PRU_memAccessPRUDataRam.p" with the interrupt code and without the HALT command and now the code (and C program) exits successfully.
But how do I send an interrupt the other way? Say I want the PRU to run a loop until the C code reads a key input? Or should I just do that using shared mem? Thanks /Jacob 2014-07-29 0:44 GMT+02:00 John Stampfl <[email protected]>: > Looks like to me you just halted the PRU. > > 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. > > > > > > > On Tue, Jul 29, 2014 at 1:00 AM, Jacob Ole Juul Kolding <[email protected]> > wrote: >> >> Hi >> >> 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. >> >> #define GPIO0 0x44e07000 >> #define GPIO1 0x4804c000 >> #define GPIO2 0x481ac000 >> #define GPIO_OE 0x134 >> #define GPIO_DATAIN 0x138 >> >> MOV r3, GPIO1 | GPIO_OE >> >> LBBO r2, r3, 0, 4 >> >> SET r2, 12 // set bit 12 >> >> SBBO r2, r3, 0, 4 >> >> MOV r3, GPIO1 | GPIO_DATAIN >> >> LBBO r2, r3, 0, 4 // Store register contents into r2 >> >> // r2 contains of all GPIO1, so now you can inspect the value of >> bit 12 as desired >> >> HALT >> >> can anyone tell what’s wrong or another way of doing this? >> /Jacob >> >> -- >> "In acting as if life has meaning, we will find, thank God, that it does" >> - John Cottingham >> >> -- >> 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]. >> For more options, visit https://groups.google.com/d/optout. > > > > > -- > John Stampfl > > -- > 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]. > For more options, visit https://groups.google.com/d/optout. -- "In acting as if life has meaning, we will find, thank God, that it does" - John Cottingham -- 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]. For more options, visit https://groups.google.com/d/optout.
