Designing a side channel target board for the STM32

When reading through the side-channel literature everybody seems to have their own preferred setup for taking side-channel measurements. The most straightforward approach when targeting a new IC is to purchase the IC’s development board if available. The development board can then be modified to accommodate the desired measurement method or can be used as is.

These development boards however are designed by the manufacturer to show off all the cool features their IC has such as sensors, display and communication interfaces. All these features make it more difficult to measure the target IC and can potentially introduce noise into our measurements. The PCB of the development board is designed to guarantee a very stable behaviour  of the IC. To guarantee stability it will have a power regulator circuit with plenty of decoupling capacitors and in order to keep PCB area to a minimum the routing of these PCBs will be rather dense. All these features make it more difficult to properly measure the desired side-channel.

Although the quick and dirty approach for measuring an IC is appealing, it is often worth it to take the time to design your own target. In this blogpost we will have a look at designing a target board for the popular STM32 ARM family of microcontrollers (MCU).

For our PCB we used the LQFP100 package because due to the pin compatibility of the STM32s our target board will then support almost all possible STM32 variants without requiring changes to the PCB. In order to get our microcontroller up and running we need to add four main components: a power supply, a clock, a programming interface and some GPIO pins. For the power supply we would like it to be as stable as possible but still have the option to increase and lower the VDD when needed. Thus we opted to have no on board power regulator but rely on an external lab power supply. The board does contain decoupling capacitors to ensure a stable operation of the MCU. For the clock we provide a connector for both the low speed and high speed external clock. Using an external clock will give measurements which will require less alignment compared to measurements taken with the internal oscillator. We also noticed there is significantly less coupling between the clock signal and our measurements when using a clock signal with a low slew rate and a low peak to peak voltage. In an attempt to minimize coupling between the clock signal and the rest of the board we shielded the clock traces using via stitching. This technique is also applied to the different measurement points. A complete hardware design guide for the STM32F4 can be found in application note AN4488.

For our target board we would like to have several side-channel measurement points available. We allow measurements in VDD with a current probe or one can also opt to take measurements in the ground line over a shunt resistor. The shunt resistor is impedance matched to the 50 ohm measurement equipment. STM32s usually require external capacitors to stabilize the output of the internal voltage regulator. These also make for an interesting measurement point and therefore we also allow for a current probe to be placed on the regulator pins.

The main goal of this board is to ease side-channel analysis but since we are at it we might as well add some features to accommodate fault attacks. We therefore leave an opening at the backside of the PCB to allow for backside laser fault injection. All the pins and connectors which need to be accessible by the user are placed on the side such that even when the PCB is flipped we can still access them. With EM-fault injection in mind we left an opening in the ground plane in an attempt to minimize eddy currents in the ground plane. Whether or not this has an impact still needs to be investigated.

Special thanks to Lucca Roofthooft for designing and testing the PCB.