I am now using CW-Lite and CW308-STM32F3 board to do a new project. In my project, I want to read from the fireware using target.simpleserial_read().When I doing the first simpleserial reading command target.simpleserial_read('r', 32), I can get the information from the firmware well. However, the second one return a error:
WARNING:ChipWhisperer Target:Read timed out
and with no responses. I add some time.sleep()here but still don’t work.
Does the target ever become responsive after the 'e' command? Can you retry the 's' command after waiting a while and have it work? If not, I’d guess your target is probably becoming unresponsive after the 'e' command.
I tried two ‘s’ command after 5s using time.sleep(5) and found it working well. I can get what I want with 32 bytes seed from target. However, as I changing the firmware with simpleserial_put('r',128, pk), i.e. more bytes for reading, the PC can read the first response and return the information, and the second one return:
Because the pk contains 800 bytes in total, so I am guessing maybe I have to read all 800 bytes before the second's' command? It may take a long time for reading?
Also I tried two simpleserial_put() in firmware for reading the more pk but still return:
I find that it only get 61 byte not 128 bytes from the second simpleserial_put(), So I am guessing is the buffer can only hold not more than 192 bytes no matter how many simpleserial_put() I used? If I want to read the whole 800 bytes, how can I deal with that?
This happens because you’re not reading the ack packet from the 's' command. SimpleSerial commands always send back an ack packet to let you know that the command has finished and to report any errors (https://chipwhisperer.readthedocs.io/en/latest/simpleserial.html#simpleserial-v2-1). Try doing a target.simpleserial_wait_ack() after time.sleep(5). It looks like you’re getting an invalid command error, which indicates that the command you’re trying to call hasn’t been added via simpleserial_addcmd().
I trid adding a target.simpleserial_wait_ack() after time.sleep(5) and return a error of read time out and device did not ack. I then tried the 'hello' and print(target.read()) but failed to print after the boot. I really don’t know what’s wrong here.
I learned a lot from your answers.But I ran into problems when I operated on my own.
If i want to separate transmission for each 128 bytes in simpleserial V1 and 1632 bytes in total.
The callback function did not have scmd parameter.
Please tell me what should I do.