ChipSHOUTER Users Manual: Simple EMFI Target (CW322)
31
For this experiment, you will need the ChipSHOUTER, the in-
cluded 19v power adapter, one of the included 4mm injection
tips, and the simple target board.
1. To start the simple target board, slide the PWR
switch up. The START light should briefly flash, fol-
lowed by a steady blink from the RUN light.
2. Place the simple target on a flat surface and plug
the ChipSHOUTER into the included 19v power adapter.
#define OUTER_LOOP_CNT 300
#define INNER_LOOP_CNT 300
void glitch_loop(void)
{
volatile uint32_t i, j;
volatile uint32_t cnt;
uint32_t blink_status = 1;
uint32_t run_cnt = 0;
uint32_t glitch_cnt = 0;
for(run_cnt = 0; run_cnt < RUN_CNT; run_cnt++){
//run led on
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, blink_status);
blink_status ^= 1;
cnt = 0;
for(i = 0; i < OUTER_LOOP_CNT; i++) {
for(j=0; j < INNER_LOOP_CNT; j++){
cnt++;
}
}
//look for glitch
if (i != OUTER_LOOP_CNT || j != INNER_LOOP_CNT ||
cnt != (OUTER_LOOP_CNT * INNER_LOOP_CNT) ) {
//if glitched, reset the run count and blink the fault LED
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, SET);
delay100ms(3);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, RESET);
run_cnt = 0;
}
}
Listing 1: EMFI Simple code example