Windows 10, ERROR:ChipWhisperer Target:Target did not ack

Hi
I have a problem with the errors and warnings that appear:

  • “ERROR:ChipWhisperer Target:Target did not ack”
  • “Warning: Device failed to ack”

I use software:
I tried ChipWhisperer 5.5.2 versions: Windows Installer and Virtual Machine (VirtualBox). The error shows up in both.

I use hardware from the Level 2 Starter Kit (SCAPACK-L2):

  • CW308 UFO Board
  • ChipWhisperer-Lite (Model: CW1173)
  • STM32F board (sticker F303) - STM32F303RDT6

The USB cable is directly connected to the PC. I tried several USB cables, different USB inputs (3.2, 2.0).

The error appears when executing the code in Jupyter Notebook, e.g .:

  • SOLN_Lab 3_1 - Large Hamming Weight Swings
  • SOLN_Lab 3_3 - DPA on Firmware Implementation of AES

+--------------------------------------------------------
+ Built for platform CW308T: STM32F3 Target with:
+ CRYPTO_TARGET = TINYAES128C
+ CRYPTO_OPTIONS = AES128C
+--------------------------------------------------------
Detected unknown STM32F ID: 0x446
Extended erase (0x44), this can take ten seconds or more
Attempting to program 6383 bytes at 0x8000000
STM32F Programming flash...
STM32F Reading flash...
ERROR:ChipWhisperer Target:Target did not ack
Verified flash OK, 6383 bytes
---------------------------------------------------------------------------
Warning                                   Traceback (most recent call last)
~/work/projects/chipwhisperer/jupyter/courses/sca101/Lab 3_3 - DPA on Firmware Implementation of AES (HARDWARE).ipynb in <module>
      9 key, text = ktp.next()
     10 
---> 11 target.set_key(key)
     12 
     13 N = 2500

~/work/projects/chipwhisperer/software/chipwhisperer/capture/targets/SimpleSerial.py in set_key(self, key, ack, timeout)
    533             if ack:
    534                 if self.simpleserial_wait_ack(timeout) is None:
--> 535                     raise Warning("Device failed to ack")
    536         else:
    537             target_logger.debug("Key unchanged, skipping send")

Warning: Device failed to ack

---------------------------------------------------------------------------
Warning                                   Traceback (most recent call last)
<ipython-input-2-3902592a4978> in <module>
      1 if VERSION == 'HARDWARE':
----> 2     get_ipython().run_line_magic('run', '"Lab 3_3 - DPA on Firmware Implementation of AES (HARDWARE).ipynb"')
      3 elif VERSION == 'SIMULATED':
      4     get_ipython().run_line_magic('run', '"Lab 3_3 - DPA on Firmware Implementation of AES (SIMULATED).ipynb"')

~/.pyenv/versions/3.7.7/envs/cw/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
   2342                 kwargs['local_ns'] = self.get_local_scope(stack_depth)
   2343             with self.builtin_trap:
-> 2344                 result = fn(*args, **kwargs)
   2345             return result
   2346 

~/.pyenv/versions/3.7.7/envs/cw/lib/python3.7/site-packages/decorator.py in fun(*args, **kw)
    230             if not kwsyntax:
    231                 args, kw = fix(args, kw, sig)
--> 232             return caller(func, *(extras + args), **kw)
    233     fun.__name__ = func.__name__
    234     fun.__doc__ = func.__doc__

~/.pyenv/versions/3.7.7/envs/cw/lib/python3.7/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
    185     # but it's overkill for just that one bit of state.
    186     def magic_deco(arg):
--> 187         call = lambda f, *a, **k: f(*a, **k)
    188 
    189         if callable(arg):

~/.pyenv/versions/3.7.7/envs/cw/lib/python3.7/site-packages/IPython/core/magics/execution.py in run(self, parameter_s, runner, file_finder)
    722             with preserve_keys(self.shell.user_ns, '__file__'):
    723                 self.shell.user_ns['__file__'] = filename
--> 724                 self.shell.safe_execfile_ipy(filename, raise_exceptions=True)
    725             return
    726 

~/.pyenv/versions/3.7.7/envs/cw/lib/python3.7/site-packages/IPython/core/interactiveshell.py in safe_execfile_ipy(self, fname, shell_futures, raise_exceptions)
   2829                     result = self.run_cell(cell, silent=True, shell_futures=shell_futures)
   2830                     if raise_exceptions:
-> 2831                         result.raise_error()
   2832                     elif not result.success:
   2833                         break

~/.pyenv/versions/3.7.7/envs/cw/lib/python3.7/site-packages/IPython/core/interactiveshell.py in raise_error(self)
    329             raise self.error_before_exec
    330         if self.error_in_exec is not None:
--> 331             raise self.error_in_exec
    332 
    333     def __repr__(self):

    [... skipping hidden 1 frame]

<ipython-input-2-cd2a822a193f> in <module>
      9 key, text = ktp.next()
     10 
---> 11 target.set_key(key)
     12 
     13 N = 2500

~/work/projects/chipwhisperer/software/chipwhisperer/capture/targets/SimpleSerial.py in set_key(self, key, ack, timeout)
    533             if ack:
    534                 if self.simpleserial_wait_ack(timeout) is None:
--> 535                     raise Warning("Device failed to ack")
    536         else:
    537             target_logger.debug("Key unchanged, skipping send")

Warning: Device failed to ack

Hi,

The device should acknowledge each serial message we send to it. Typically, if this doesn’t happen, it means serial isn’t working for some reason.

Can you try uncommenting the

putch('h');
putch('e');
putch('l');
putch('l');
putch('o');

line in chipwhisperer/hardware/victims/firmware/simpleserial-aes/simpleserial-aes.c. Then rebuild the firmware, reprogram the STM32F3, and run the following code:

print(target.read())

This just causes the target to print a “hello” message after boot so we can confirm that the device is starting up, serial is working, the baud rate is correct, etc.

Alex

Thanks for your reply.
I uncommented lines from putch (). Then I rebuilt the firmware, reprogram STM32F3 and print.
Unfortunately, the “hello” text did not appear.

Hi,

Can you verify that J3 is jumpered on HS2/OUT and that the VCC3.3 LED is on? Also, if you try building with PLATFORM=CWLITEARM, do any of LED1-3 turn on?

Alex

Thanks for your reply.

yes, J3 was jumpered on HS2/OUT.
3.3V LED is on - (LED 5 is on, LED8 is on).
LED2 and LED3 are on when the program prints ‘hello’.
LED2 and LED3 are turned off when the program does not print ‘hello’.

I tried again today and it printed hello.
“<ihello”
… I did not change the jumpers, USB.

The problem with the error (Target did not ack) and not writing ‘hello’ sometimes occurs.

To get rid of the error I did:

  • disconnect the USB cable from Chipwhisperer Lite
  • close the current tab in the browser
  • In Jupyter, the Running tab, click “Shutdown” of the active Notebook
  • open target file
  • click ‘Kernel -> Restart and Clear Output’
  • plug the USB cable to Chipwhisperer Lite
  • executes the necessary instructions and cw.program_target ().
    The text “hello” appears

Now when I click ‘Cell-> All Output-> Clear’ or ‘Kernel-> Restart & Clear Output’ and execute the code again (cw.program_target ()) the error sometimes reappears. Something gets stuck somewhere, I don’t know if it’s in Jupyter or on the PCB.

One last thing to try: can you try replacing cwlite.py at chipwhisperer/software/chipwhisperer/hardware/firmware with the one at this link? https://raw.githubusercontent.com/newaetech/chipwhisperer/5.1.3/software/chipwhisperer/hardware/firmware/cwlite.py.

Alternatively, you can run this block in one of the notebooks in the jupyter folder:

%%bash
cd ../software/chipwhisperer/hardware/firmware
git checkout 5.1.3 cwlite.py

Then try rerunning the capture. This replaces the current FPGA bitstream with an older one that handles clocking more reliably.

EDIT: Also, we can just do a replacement if easier. Let me know

Thanks,

Alex