SPA with external MCU

I have an MCU on a breadboard that I can communicate with over a UART from a raspberry pi. I want to just perform some simple power analysis of this MCU using a software controlled trigger on the rpi. Could someone explain the minimal amount of routing I’d need to do either directly via the CW1173 or using a CW308 UFO board in order to be able to do this? The MCU needs 3.3v. I’m currently powering the 3.3v supply with a relay controlled by one of the pi GPIOs so that I can do power on resets.

I’m presuming I’ll do something like this:

  1. power cycle the MCU directly from the CW1173 rather than use the relay
  2. send a trigger start to the CW lite via a GPIO
  3. send the password sequence over the uart (there is no response other than echoing the pw)
  4. maybe send some other command to test if password correct
  5. send the trigger low via the GPIO to the CW

In this scenario do I just need to route 3.3v via pin 3 on the 20pin connector and connect a rpi gpio to pin 16 for the trigger input?

Edit: that can’t be right as I’m missing access to the measure port. So perhaps I take the power from the CW308 board and then can attach the measure cable to it?

Hmm, not sure what to suggest here. Besides the measure port, the sequence of #2 and #3 should be inverted, and the trigger should be issued by the target, not by the Rpi. For example, when the target receives the password, it should issue the trigger. Otherwise the time between trigger and password processing will vary and you will have an additional problem to solve: realigning traces.

Can you explain why the Rpi needs to be there and why you can’t use the CW1173 / CW308 as intended?

Jean-Pierre

I can’t get the MCU to issue a trigger. It’s running code that I don’t control and there’s a password check that enables access to flash that must be performed after power on reset. I do have a virgin MCU that I can run code on for comparison, but really any code that I could run would be too late. I don’t know yet whether it does a check of the password one byte at a time while it’s being transmitted or all at once after it’s fully sent, or perhaps even later when I try to access flash. That’s why I want to do the trigger before I send the password.

I would like to do it all with the CW at some point, but first of all I just want to make as few changes as possible so that I can measure power usage. Also the UART is a bit weird as it is i/o on a single pin.

Oh, I see.
For measurement you can use an EM probe, or a differential probe.

For triggering it’s always best to have a constant time reference to avoid having to do trace alignment in software. How important that is will depend on your target, e.g. if it has a nice clear spike that can serve as a time reference then great, but if all you see looks like noise then it might be hard to progress.

You can try to derive the triggering from the UART too. If you have something like this in your toolkit and some FPGA knowledge then you can definitely do that.

Good luck!

Jean-Pierre

Thanks! I do have an ice stick FPGA which maybe might come in useful. At the moment I just want go learn how to use the CW one step at a time, hence just the power analysis with stuff mainly in software otherwise.

I have everything set up now, after a fashion anyway.

Are there some guidelines on choosing an appropriate shunt resistor value? The xmega uses 51 ohms and the STM32F has a 12 ohm shunt. My MCU uses about 4-5mA during normal running according to the datasheet.

The MCU recommended circuit includes a 0.1uF decoupling capacitor between Vdd and Gnd. Naively I tried removing it and it doesn’t work at all. Can I neuter this somewhat with a smaller value or something?

Thanks for any pointers!

Edit. figured out how to power cycle with scope.io.target_pwr = False

For the shunt resistor, generally you want the largest value you can get away with, with respect to the voltage drop that it will create and what your target can tolerate.

For capacitance, have a look at the many CW308 targets for guidance – sorry I don’t have any specific advice, this is outside my area of expertise.

Jean-Pierre