PRU DEBUGGER for BBAI

Below is the entire ascii recording: asciicast

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

Prudebug

  1. First, load the above assembly code, (to build it you can refer build_pru.sh)

  2. To run the prudebugger, execute the command sudo ./prudebug -m

  3. After this, you will enter the following shell-looking interface.
    Now type in

PRU 1 This select PRU 1 core 1 on the BBAI.

  1. Now, keep on running ss which 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.

References: