Where's "XMEGA Simple-Serial" script located?

Can’t find this script in git repo.
Want to run the Example project for CW308T-S6LX9 here https://wiki.newae.com/CW308T-S6LX9
It refers to “XMEGA Simple-Serial”. Where’s that script in the git repo?

Hi, the instructions are a bit out-of-date, they’re referring to the CW4 GUI. If that’s what you’re using, you’ll find them under the “Python Console” tab: connect_cwlite_simpleserial.py, setup_cwlite_xmega.py.

If you’ve already moved to Jupyter and CW5, you can follow any of the AES attack notebooks (e.g. this one), just skip over the parts which program the target FW (instead program the FPGA bitfile using your FPGA programmer).

Jean-Pierre

For each “capture_trace()” command, I get this error “root: Target did not ack”.
Any changes needed to get the FPGA Target to send ack?

No changes are required, it should run out of the box with the example bitfile.
Are you certain that you’ve successfully program the target with the Xilinx tools?

Jean-Pierre

I successfully programmed the target. I get “target program successful” each time I program it.
I’m using CW5 if that could help.
Here’s what I’ve tried so far to no avail:

  • added delay in the while loop in write, read and flush functions in simple.py. The values I tried are 0.001, 0.0001, 0.000001.
  • Also changed the baudrate of the target (target.baudrate) to 9600, 19200 and 115200.
    Neither of these helped. With the baudrate change, the connection with the scope can’t be established.
    Will changing the baudrate in the SW help? Don’t know how to perform this.
    Anything else you can think off that I can try?

Ah, I think I’ve found the issue. I don’t have an S6LX9 target with me at the moment so I can’t verify this, but if I remember correctly the example bitfile does not return ACKs, it only returns the encrypted result. A quick read of the Verilog code seems to confirm this.

The band-aid solution then is to change this line in software/chipwhisperer/__init__.py:

target.set_key(key)

for:

target. set_key(key, ack=False)

Report back if this works so we can fix it in the repo.
Thanks,
Jean-Pierre

Nope. I get the same errors in the loop: “ERROR:root:Target did not ack”
There are several init.py files in various directories. Some empty, but a few are not. Can you confirm the one I’m modifying?

<root of chipwhisperer install directory>/software/chipwhisperer/__init__.py
That’s the only one where you’ll find a target.set_key(key) call :slight_smile:

If you’re running Jupyter, make sure you restart the kernel after you make the change. Otherwise you’re still running the old code. (Which version of ChipWhisperer are you running and how did you install it?)

Again I’m doing this a bit blindly since I don’t have the target to try it myself, but it should be impossible to get the “did not ack” message if you apply the change correctly.

Jean-Pierre

I restarted the VM, reopened the notebook, but still getting the error.
I changed the right file as below. I went through all the init files and confirmed that only one has that command.
I’m using CW5 with Jupyther installed in Oracle VM

… versionadded:: 5.1
_ Added to simplify trace capture.​_
_ “”"​_
_ if key:​_
_ #target.set_key(key)​_
_ #ATM​_
_ target.set_key(key,ack=False)_

Ah sorry, I missed that simpleserial_read() also does an ack check.
Add an ack=False argument to the simpleserial_read() call in the same __init__.py file and, fingers crossed, now it will work :slight_smile:
Jean-Pierre

OK. This works. I can capture the power with this target.
Another question though: The CPA based side channel attack example does not uncover the secret keys like with other targets. Any idea why?