Unable to follow simpleserial AES tutorial


#1

Hello there, I’m having some challenges getting started with the ChipwhispererLite HW and software. I downloaded the VM image to reduce the number of initial problems so I could dive into learning. Right now when I go to start the simpleserialAES xmega script I get the following:

INFO - OpenADC Found, Connecting
WARNING - Response length from target shorter than expected (0<34): “”.
WARNING - Timeout in OpenADC capture(), trigger FORCED
WARNING - Timeout in OpenADC capture(), trigger FORCED
WARNING - Response length from target shorter than expected (0<34): “”.
WARNING - Timeout in OpenADC capture(), trigger FORCED
WARNING - Timeout in OpenADC capture(), trigger FORCED
INFO - Finished Script: ChipWhisperer-Lite: AES SimpleSerial on XMEGA

Which leads me to think the simpleserial-aes firmware isn’t currently loaded. I go about compiling the firmware in the vitcim directory and when I go to flash it I get:

Starting FLASH program process at 15:54:21
File /home/cwuser/chipwhisperer/hardware/victims/firmware/simpleserial-aes/simeplserial-aes-xmega.hex last changed on Wed Sep 7 15:02:52 2016
Entering Programming Mode
FAILED: XMEGA Command 20 failed: err=1, timeout=1
FLASH Program FAILED at 15:54:22

Any ideas of where I should start to get myself back on track to start the tutorials?

TIA


#2

Hi GCA,

Did you solve this problem? All this should work “out of the box”, if you have such issues also feel free to contact us directly (the forum is used for support, but sometimes slower as you can see as it’s often answering more general questions).

The XMEGA programming failing is suspicious, I’d retry with a fresh clone/install (maybe on your hardware and not VM?). You can email us your serial number of the board to double-check the self-test results (NB: they would match what comes in the printout with the ChipWHisperer-Lite).

Thanks,

-Colin


#3

I am facing same problem, it gives same issues,
can anyone please resolve this issues?


#4

i am using chipwhisperer light 2 part and version is CW1173.


#5

Try running the automated test script:
python chipwhisperer/software/chipwhisperer/tests/aescpaeattackscript.py

It should automatically flash the target, capture the traces, and analyse it to extract the key. If it is not working for you than you have an installation problem for sure.

Come back later to tell if it worked for you.


#6

I just did but gives error

Traceback (most recent call last):
File “/home/cwuser/chipwhisperer/software/chipwhisperer/common/api/CWCoreAPI.py”, line 395, in runScriptClass
eval(‘m.%s()’ % funcName)
File “”, line 1, in
File “aescpaeattackscript.py”, line 40, in run
xmega.find()
File “/home/cwuser/chipwhisperer/software/chipwhisperer/capture/api/programmers.py”, line 144, in find
self.xmega.enablePDI(True)
File “/home/cwuser/chipwhisperer/software/chipwhisperer/hardware/naeusb/programmer_xmega.py”, line 187, in enablePDI
self._xmegaDoWrite(self.XPROG_CMD_ENTER_PROGMODE)
File “/home/cwuser/chipwhisperer/software/chipwhisperer/hardware/naeusb/programmer_xmega.py”, line 156, in _xmegaDoWrite
raise IOError(“XMEGA Command %x failed: err=%x, timeout=%d” % (status[0], status[1], status[2]))
Warning: Could not execute method run in script class Capture: ‘IOError: XMEGA Command 20 failed: err=1, timeout=1:XMEGA Command 20 failed: err=1, timeout=1’

still having problem.


#7

Can you test in another computer / OS and if possible with another USB cable? The test scripts should work out of the box. If not, it can be a driver problem (more often) or a hardware problem (cable or board).
If it still not work, I would suggest you to contact NewAE directly.


#8

Hi All,
I’m a new howner on this tool and I’m having the same problem related to the programming of XMEGA board supplied with my ChipWhispererLite.

I’ve installed manually on 2 different windows 10 PC and got the same behaviour.

Any suggestion?
Is there a tool to check in the target board is working and can be programmed?

Any help is wellcome.
Thank you


#9

Hi all again,

I’m sorry but I’ve not realized this was a 3 years old post.
I’m worknig with ChipWhisperer 5.0 on python 3.7 so probably a different environment.

Can someone tell me how to move my post to an appropriate position?

Regards


#10

Hi, what exactly is the error message that you get?
Also make sure you’re using a known good USB cable.

Jean-Pierre


#11

Hi Jean-Pierre,

Yes I’ve tried with some other USB cable that works fine for other targets (STLINKV2, Diligent Analog Discovery 2 etc.) with same results.

I’ve run one simple intor in Notebook to have a clean situation: in the following the results:

Jupyter Notebook: PA_Intro_1-Firmware_Build_Setup

I’ve selected the platform modifing the first variable assignements:
SCOPETYPE = ‘OPENADC’
PLATFORM = ‘CWLITEXMEGA’ #‘CWLITEARM’

Everithing works fine until the target program where I’ve got this error:

In [18]: cw.program_target(scope, prog, fw_path)

OSError Traceback (most recent call last)
in
----> 1 cw.program_target(scope, prog, fw_path)

c:\chipwhisperer\chipwhisperer\software\chipwhisperer_init_.py in program_target(scope, prog_type, fw_path, **kwargs)
51 prog._logging = None
52 prog.open()
—> 53 prog.find()
54 prog.erase()
55 prog.program(fw_path, memtype=“flash”, verify=True)

c:\chipwhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py in func_wrapper(self, *args, **kwargs)
68 self.scope.io.nrst = ‘high_z’
69 try:
—> 70 val = func(self, *args, **kwargs)
71 finally:
72 logging.debug(‘Restoring pdic, pdid, and nrst pin configuration’)

c:\chipwhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py in find(self, xmega)
223 def find(self, xmega=None):
224 xmega = self.xmegaprog()
–> 225 sig, chip = xmega.find()
226
227 # Print signature of unknown device

c:\chipwhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\programmer_xmega.py in find(self)
173 def find(self):
174 self.setParamTimeout(100)
–> 175 self.enablePDI(True)
176
177 # Read signature bytes

c:\chipwhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\programmer_xmega.py in enablePDI(self, status)
307 if status:
308 # self._xmegaDoWrite(self.XPROG_CMD_LEAVE_PROGMODE)
–> 309 self._xmegaDoWrite(self.XPROG_CMD_ENTER_PROGMODE)
310 self._pdienabled = True
311 else:

c:\chipwhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\programmer_xmega.py in _xmegaDoWrite(self, cmd, data, checkStatus)
502 status = self._xmegaDoRead(cmd=0x0020, dlen=3)
503 if status[1] != 0x00:
–> 504 raise IOError(“XMEGA Command %x failed: err=%x, timeout=%d” % (status[0], status[1], status[2]))
505
506 def _xmegaDoRead(self, cmd, dlen=1):

OSError: XMEGA Command 20 failed: err=1, timeout=1

Thank you again
Maurizio


#12

Hmm… are you using the CW308 UFO target, or just the CW1173 basic board?
I haven’t come across this problem before, and the only way I can reproduce it is if I try to program an ARM target with the XMEGA programmer. That gives me the exact same error you get. Are you sure you have an XMEGA target?

Jean-Pierre


#13

I’m using a ChipWhisperer Lite 2-Part Version which inclute a 8-bit ATXMEGA128D4 target; I think it should be equivalent to an cw1173 basic board.

I’ve attached the photo of the processor (hope you can see it)

I’ve connected the target via the flat cable and both the coax cables, then I’ve tried again with only measure coax connectd (removing glitch) with the same results.

I’ve selected the platform CWLITEXMEGA, is it correct?

On the ChipWhisperer board I have a blue led blinking at about 1 Hz and a green led blinking at higher speed (maybe the double) while on the targer board there are two leds (green and red) fixed on.

Maurizio


#14

Having a look at the windows driver i saw that even if the driver seems to work correctly something went wrong:

"La migrazione del dispositivo USB\VID_2B3E&PID_ACE2\50203120324136503030342033313032 non è stata eseguita a causa di una corrispondenza parziale o ambigua.

ID ultima istanza dispositivo: USB\VID_059F&PID_1010\ST3500830A____________9QG7K1Y2
GUID classe: {36fc9e60-c465-11cf-8056-444553540000}
Percorso: PCIROOT(0)#PCI(1A07)#USBROOT(0)#USB(5)
Classificazione migrazione: 0xF000FFFFFFFF0123
Presente: false
Stato: 0xC0000719
"

Sorry it is in italian due to the windows installation language. basically it says that “the USB device migration was not was not performed due to a partial or ambiguous correspondence …”

Anyway cw.scope seems to work.

Do you think it could be tha cause?
Do you know if there is a way to fix it?

Maurizio


#15

Main board LEDs are behaving as expected, while on the target board normally the LEDs should be off however they are driven directly by the target firmware.

Did you install the CW Windows drivers successfully? What do you see in Device Manager?


#16

This is the display driver window:

The same of yours except fpr the language settings…

About the events I listed above: it was the first event (before drive installation). Last two events show that everithing went well…

Is there am application to test it whitout use python? (Maybe some exe)

As far as I read it seems that the ChipWhisperer firmware should be upgraded automatically, is there something I can check to see if I’m using the latest revisions?


#17

No, I don’t think we have any other application to test it. If you haven’t tried it yet, do you mind trying the VM install? It would eliminate a few variables.

Jean-Pierre


#18

Hi Jean-Pierre,

Finally I didi it and the results are the same.

I had some problem in having jupyter workning. I had to install the gnome environment on the virtual machine to be able to run Firefox and work with it.

I’m not an expert of VirtualBox and linux so I can’t have window Chome opening the localhost:8888 to see the Jupyter server runnin on debian in VirtualBox…

Don’t know how to go on…

Is there some signal I can check with an external scope? (maybe on the target connector)


#19

Ah, I think you misunderstood how the VM is meant to be used.There is no need to install anything in the VM; you browse to localhost:8888 on your host machine, not in the VM.
So, after following all the VM installation instructions, all you do with the VM is start it. Don’t even log in. Then in Windows go to localhost:8888.

Jean-Pierre


#20

Yes, I’ve followed the installing instructions but:

  • on laptop PC noway to have the USB passed to the VM; anyway the localhost:8888 on host PC chrome works and allow me to get into Jupyter (but no chipwhisperer connected :frowning: ).
  • on desktop PC: USB is working fine but noway to have the host Chrome connected to VM with localhost:8888. This is the reason why I’ve installed here the gnome and so on.

Later on i will try to disconnect the DeskTop PC from LAN network to see if it will works an will let you know.

Trying Python in debug I saw that the problem seems to be in the answer from the target.
If you are interested in these details I can send you some screenshot later today.

Thank you and best regards.

PS: I saw in some old posts (on github) someone had a similar problem and the suggestion was to verify the voltage level on some pins because of possible voltage missmatch. Do you think it could be also my case or it was an old issue already fixed?


Fisrt test: I succeed in having the original VM working in VirtualBox as expected and with the USB enabled.
So tested as suggested with the same result:

cw.program_target(scope, prog, fw_path) -->

OSError Traceback (most recent call last)
in
----> 1 cw.program_target(scope, prog, fw_path)

~/work/projects/chipwhisperer/software/chipwhisperer/init.py in program_target(scope, prog_type, fw_path, **kwargs)
51 prog._logging = None
52 prog.open()
—> 53 prog.find()
54 prog.erase()
55 prog.program(fw_path, memtype=“flash”, verify=True)

~/work/projects/chipwhisperer/software/chipwhisperer/capture/api/programmers.py in func_wrapper(self, *args, **kwargs)
68 self.scope.io.nrst = ‘high_z’
69 try:
—> 70 val = func(self, *args, **kwargs)
71 finally:
72 logging.debug(‘Restoring pdic, pdid, and nrst pin configuration’)

~/work/projects/chipwhisperer/software/chipwhisperer/capture/api/programmers.py in find(self, xmega)
223 def find(self, xmega=None):
224 xmega = self.xmegaprog()
–> 225 sig, chip = xmega.find()
226
227 # Print signature of unknown device

~/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/programmer_xmega.py in find(self)
173 def find(self):
174 self.setParamTimeout(100)
–> 175 self.enablePDI(True)
176
177 # Read signature bytes

~/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/programmer_xmega.py in enablePDI(self, status)
307 if status:
308 # self._xmegaDoWrite(self.XPROG_CMD_LEAVE_PROGMODE)
–> 309 self._xmegaDoWrite(self.XPROG_CMD_ENTER_PROGMODE)
310 self._pdienabled = True
311 else:

~/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/programmer_xmega.py in _xmegaDoWrite(self, cmd, data, checkStatus)
502 status = self._xmegaDoRead(cmd=0x0020, dlen=3)
503 if status[1] != 0x00:
–> 504 raise IOError(“XMEGA Command %x failed: err=%x, timeout=%d” % (status[0], status[1], status[2]))
505
506 def _xmegaDoRead(self, cmd, dlen=1):

OSError: XMEGA Command 20 failed: err=1, timeout=1