Beginner Problem Tutorial B1 Empty Response length


#1

Hi,
my first time with ChipWhisperer-Lite 2-Part Version.
When I follow the tutorial “B1 Building a SimpleSerial Project” I get this error on the Debug_Logging of the Capture-SW.
I am running on Windows Pro 8.1 with Python 2.7 and the newest CW-Version 3.4.1:
The error in question is " Response length from target shorter than expected (0<34): “”.
As a result, the “Encryption Status Monitor” is always showing ‘?’ in “Test Out” and “Expected”
The CWLite has a continous blinking blue light (USB?) and a blinking green light and is connected with the flat broad wirecable and the golden “measure” cable.

Any Idea?
Output in DEBUG_LOGGING:
INFO - Found ChipWhisperer-Lite, Serial Number = 53313120313436373230372033…
INFO - SAM3U Firmware version = 0.11 b0
INFO - Detected ChipWhisperer with USB ID ace2 - switching firmware loader
INFO - FPGA programmed
INFO - OpenADC Found, Connecting
INFO - Target and Scope Connected
INFO - SimpleSerial: protocol V1.0 detected
WARNING - Response length from target shorter than expected (0<34): “”.
INFO - Capture completed

thanx Holger


#2

Hi there,

Hope you’re enjoying your ChipWhisperer so far!

What this means is that the CWLite is sending serial data to the target XMEGA, but the target isn’t answering. It sounds like your hardware setup (the SMA and ribbon cables) is right, so there’s probably something wrong with your setup. This is usually one of the following problems:

  • The target doesn’t have the right firmware programmed onto it
  • The CWLite clock output is disabled (Target HS IO-Out isn’t set to CLKGEN)
  • The CLKGEN speed is wrong (the XMEGA target expects CLKGEN to be 7.37 MHz)
  • The CLKGEN speed is set right but the DCMs aren’t locked - press the DCM Reset buttons in the software (if this happens, the red LED on the board should be on)
  • The Serial TX/RX lines are flipped
    Try these and let me know if it’s still not working.

#3

Hi gdeon,
thanks for your help.
I followed your instruction (I lost the CLKGEN Setting while trying)
Now it is a z30 sync error: (I tried to re-programmed the Firmware as well)

WARNING - FPGA mode switched to ‘builtin’ from invalid setting of ‘None’
WARNING - FPGA mode switched to ‘builtin’ from invalid setting of ‘None’
INFO - FPGA Configuration skipped - detected already programmed
INFO - FPGA programmed
INFO - SimpleSerial: protocol V1.0 detected
Sync Error: z30
rCA38249460E073FC001F1D83C4795
Hex Version: 7a 33 30 0a 72 43 41 33 38 32 34 39 34 36 30 45 30 37 33 46 43 30 30 31 46 31 44 38 33 43 34 37 39 35
INFO - Capture completed.

If I try to work in the Terminal Window, I see a
D2E
z60

but no reaction to any of my manual Inputs,. When I send an x I’ll get a z30 in return

Thanks Holger


#4

This is completely my fault! We recently improved our firmware to use SimpleSerial V1.1, but I forgot to fix the simpleserial-base firmware.

We’ll push out ChipWhisperer v3.4.2 with a fix ASAP. Until then, you can use the following code for simpleserial-base.c:

#include "hal.h"
#include <stdint.h>
#include <stdlib.h>

#include "simpleserial.h"

uint8_t get_key(uint8_t* k)
{
	// Load key here
	return 0x00;
}

uint8_t get_pt(uint8_t* pt)
{
	/**********************************
	* Start user-specific code here. */
	trigger_high();
	
	for(int i = 0; i < 16; i++)
		pt[i]++;
	
	//16 hex bytes held in 'pt' were sent
	//from the computer. Store your response
	//back into 'pt', which will send 16 bytes
	//back to computer. Can ignore of course if
	//not needed
	
	trigger_low();
	/* End user-specific code here. *
	********************************/
	simpleserial_put('r', 16, pt);
	return 0x00;
}

uint8_t reset(uint8_t* x)
{
	// Reset key here if needed
	return 0x00;
}

int main(void)
{
    platform_init();
	init_uart();	
	trigger_setup();
	
 	/* Uncomment this to get a HELLO message for debug */
	/*
	putch('h');
	putch('e');
	putch('l');
	putch('l');
	putch('o');
	putch('\n');
	*/
		
	simpleserial_init();		
	simpleserial_addcmd('k', 16, get_key);
	simpleserial_addcmd('p', 16, get_pt);
	simpleserial_addcmd('x', 0, reset);
	while(1)
		simpleserial_get();
}

#5

This is now online in v3.4.2 - you can run git pull to get the fixes.


#6

Hi gdeon,
thanks for the quick fix - Errors give you a better understanding of the topic than a tutorial that runs through - no worries.
I recompiled it and we are somewhat there:
Now, I can see the response but the “Expected” field still shows a ‘?’. And the count in the encryption Status Monitor shows "xx Total Ops 0 OK xx failed " after xx attempts.

The Debug Windows says:
INFO - SimpleSerial: protocol V1.1 detected
DEBUG - PlainText: 2cdc041ffc7031716223e6d6ba1fa1b4
DEBUG - CipherText: 2ddd0520fd7132726324e7d7bb20a2b5
DEBUG - Reading data fromm OpenADC…
DEBUG - Processed data, ended up with 24430 samples total
INFO - Capture completed.


#7

Yes, the Expected field is broken too - I wouldn’t worry about it too much. It’s just meant to show you the expected output of an AES encryption. It’s definitely on our to-do list! Maybe you can fix it and send us a pull request on Github :slight_smile:


#8

Hi gdeon,
thanks for clarifying. Once I understand what I am doing, I start with this homework :slight_smile:


#10

Hello, I have almost the same problem, the first steps of the tutorial goes well without any error but when I try to do the final step i get no text out and these warning in the debug logging:
WARNING - Response length shorter than expected (0<34): “”.
WARNING - Timeout in OpenADC capture(), trigger FORCED
WARNING - Timeout in OpenADC capture(), trigger FORCED


#11

Hi,

Can you let me know what scope you’re using (CW-Lite, CW-Pro, etc) and what target you’re attacking? If you’re attacking an Arm target (i.e. any of the STM32 targets including the CWLite Arm board), certain version of the arm-gcc compiler don’t produce working binaries (Windows build 2018-q2 and Linux 15:6.3.1+svn253039-1build1 6.3.1 20170620 should work).

Alex


#12

Hello, thanks you very much for your answer,
i’m using CW-lite on an Arm target(stm32f + cortex M0).
I’ll try with theses version of the compiler thanks