How to see the error message of runtime?

Dear all, I am trying to put a small neural network model on the chipwhisperer. I have compiled all parts of code and their dependencies and there is no error. However, when I try to run the code on the device, I got “ERROR:root:Target did not ack” (As the screenshot shows). However, this message cannot really help me to figure out what bugs are in the runtime. Are there any way we can capture the exception and print it out in the notebook?

Hi,

You can see what serial data you’re getting back by calling target.read() instead of target.simpleserial_read(). Other than that, there’s not much in the way of builtin debugging on the firmware side of things. If you’re really stumped, the debug pins are broken out to header pins on all targets, except the CWNano target.

Alex

Hi, do you mean the message in printf will display when we call target.read ?

printf likely won’t, unless you have it setup to use UART as an output. Calling putch() can send individual characters across and you can create a puts() function utilizing putch() to send a whole string across uart.

target.read() just reads the raw serial, so if you call putch('h') in the firmware, target.read() will read h.

I see. Could you give me some sample ? The function for me is a bit confused.

For the puts? The following will work:

void my_puts(char *x)
{
   do {
       putch(*x++);
   } while (*x);
}