Enable indications from C firmware ( STM32 - CW Lite)

Hi, I wrote c code for AES masking that makes better protection from CPA, but there is still point in time with high correlation to the power model. I need to find out where it happens.

Is there any way to see prints from firmware, or some indication for the different parts of the encrypting proccess? (maybe accessing STM32 directly with a debugger, and print the time at every stage?)


This is a perfect use case for TraceWhisperer!
You can run this on a PhyWhisperer-USB, or on CW-Husky.
Short of that, you could put multiple triggers at strategic spots in your code.
The problem with using a debugger is that it will alter the execution of your target code. The advantage of using Arm trace as we do with TraceWhisperer is that it doesn’t affect your code execution at all.

1 Like

Hi, thanks so much for your answer.
If I don’t have those products, can I debug using TraceWhisperer? It would be the best for visualing the data.
If it’s not possible, I just need to be able to print a message at each stage with start time.
Could I implement it with this: https://github.com/newaetech/chipwhisperer/blob/develop/hardware/victims/firmware/simpleserial-trace/simpleserial-trace.c

I mean, which console the data (traces) will be transfered to?


The Arm trace data comes out on the STM32’s SWD pin; TraceWhisperer hardware (in the form of a PhyWhisperer or CW-Husky) is required to record, timestamp, and parse this trace data.

Thanks. Assuming I don’t have this HW, could I use printf() inside c firmware to send UART messages? does it require additional setup?

Sure! You can print with putch().