Hi, wondering if there is a recommended way to more quickly test CPU usage besides loading it into the SD card and reloading MM - it’s a bit hard to iterate on changes. Is there something I’m missing with Simulator?
A JTAG debugger helps, but that’s a bigger setup.
A logic analyzer, even a cheap USB scope or cheap standalone scope will work to measure the pulsewidth of debug pins that you setup:
Basically you set one of the pins to go high when you want to start measuring a block of code, then go low when you’re done. Use the scope to measure the pulse width and that tells you how long it took to execute that block of code.
The pins in the photo of the PCB in the link above are mis-numbered (I changed them). The one labelled Pin0 is no longer available, and Pin1, Pin2, and Pin3 are now called Pin0, Pin1, and Pin2.
There’s a “debug_raw.h” header in the SDK you can include which is easier to integrate into a plugin since the SDK doesn’t expose access to the GPIO driver. Take a look inside that. Depending on which branch you’re on, it might have the older Pin0-3 numbering or the newer. Just try toggling the pins and see which ones flip and it’ll be easy to figure out.
I need to update the docs on this!