Chipwhisperer Software running C++ code

Hi everyone,

I am doing a research where I’m using chipwhisperer nano and I wanted to know if there’s any reference I can use to run C++ on Chipwhisperer nano, such as on Arduino IDE, Microchip Atmel Studio, etc. Thanks.

Hi,

Are you looking to run C++ on the capture or target side of the board? Either way, everything’s written in C, so I don’t imagine it’ll be too much work to port it over.

Alex

I wanted to run on the capture side of the board because I want to run side channel power analysis and voltage glitching so I can do the same on Arduino Zero. I have tried to run a sample code in Microchip Atmel Studio, but the board doesn’t recognize Atmel on device manager. Only shows it’s from NEWAE company. Is there anything that you can point to the right direction to where I can run a code for side channel power analysis and voltage glitching?

If you haven’t found it yet, the source code for the Nano is at chipwhisperer/hardware/capture/chipwhisperer-nano/firmware at develop · newaetech/chipwhisperer · GitHub. There’s no additional onboard debug chip, so you won’t be able to program it via Atmel Studio without an external debugger like the Atmel ICE. Otherwise you’ll either need to program it via its built in bootloader (python code to talk to bootloader), but you won’t have any debug capabilities.

Honestly, the Nano and that Arduino are very different hardware wise, so I’d recommend ignoring the Nano entirely and just focusing on the Arduino. To replicate capture, you’re going to want to setup a DMA to read from the onboard ADC based on an IO pin, then find a way to send it back to a PC. To replicate voltage glitching, you’ll need to buy a MOSFET and use the Arduino to drive it based off an IO interrupt.

int incomingByte = 0;
char b[5];

int powerPin = 2;
int glitchDelay = 0;

void setup() {
Serial.begin(19200);
Serial.println(“Arduino is ready”);

pinMode(powerPin, OUTPUT);

digitalWrite(powerPin, HIGH);
delay(5000);

Serial.println(“Gliching is ready”);
}

void glitch(){
int waste = 0;

digitalWrite(powerPin, LOW);
for (int i = 0; i<glitchDelay; i++){ waste++; }
digitalWrite(powerPin, HIGH);

glitchDelay +=10;
Serial.println();
Serial.print("Glich Delay set to: ");
Serial.print(glitchDelay);
Serial.println();
}

void loop() {

for (int i = 0; i<200;i++){
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
Serial.print(char(incomingByte));
}
}

delay(1000);
glitch();

}

if you want to know more about this DM