ChipWhisperer Lite UFO-board XMEGA target communication issues

When running:
‘’’

msg = bytearray([0]*16) #simpleserial uses bytearrays
target.simpleserial_write('p', msg)
print(target.simpleserial_read('r', 16))

In

Jupyter 1 - Connecting to Hardware under the subsection “Communication with target”

I get the output:

CWbytearray(b’00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00’)

When I run:
‘’’

print(target.simpleserial_read('k', 16))

I get the following WARNING "

WARNING:ChipWhisperer Target:Unexpected start to command: "

Then the command “print(target.simpleserial_wait_ack()) #should return 0” is run.
which responds with the following ERROR "

ERROR:ChipWhisperer Target:Target did not ack

This is both for the CW308_XMEGA (CW303) firmware for the CW308 UFO Board, and for the CW308_SMT32F0 for the CORTEX M0 Board.

When running the

scope.arm()
target.simpleserial_write('p', msg)
scope.capture()
scope.get_last_trace()
fill in the rest..."

It returns

array([-0.02246094, -0.13867188, 0.04296875, …, -0.02441406, 0.10839844, 0.15429688])"

I do not know what is working and what is not, it seems like there are some communication issues, but not for all commands?

When running SCA101 (HARDWARE) reaching the following commands ‘’’

import chipwhisperer as cw
scope = cw.scope()
target = cw.target(scope, cw.targets.SimpleSerial) #cw.targets.SimpleSerial can be omitted
scope.default_setup()
cw.program_target(scope, prog, "/home/chippy/chipwhisperer/hardware/victims/firmware/simpleserial-base-lab2/simpleserial-base-CW308_STM32F0.hex")

Then I get

“ERROR:ChipWhisperer Scope:ChipWhisperer error state detected. Resetting and retrying connection…”.

The issue here is that the 'k' command is only valid when you send it to the target (target.simpleserial_write('k', msg)). Responses from the target always begin with an 'r'.

Basically, when you sent that 'p' command, it responsed with "r112233...\nz00\n". 'r' is the first letter
of the response, which is where the 'r' comes from in target.simpleserial_read().

When you send 'k', you’ll only get back 'z00\n', which is a status byte (it’s at the end of that other message too), which means you’ll need to do a simpleserial_wait_ack().

Alex