The code below is written in assembly.
.origin 0 .entrypoint START START: // set all PRU GPIOs channels to HIGH MOV R30, 0xffffffff // wait several cycles MOV R1, 3 LOOP1: SUB R1, R1, 1 QBNE LOOP1, R1, 0 // set all PRU GPIOs channels to LOW MOV R30, 0 // wait several cycles MOV R1, 3 LOOP2: SUB R1, R1, 1 QBNE LOOP2, R1, 0 // go back from the beginning QBA START
First, load the above assembly code, (to build it you can refer build_pru.sh)
To run the prudebugger, execute the command
sudo ./prudebug -m
After this, you will enter the following shell-looking interface.
Now type in
PRU 1 This select PRU 1 core 1 on the BBAI.
sswhich means it will single step through each instruction in the asm code on the PRU and you should see your LED blink as you do.