Programming firmware for XMEGA target fails

Hi.

ChipWhisperer Lite 2 XMEGA

Working on Part 2, Topic 1, Lab A: Instruction Power Differences (MAIN).
Didn’t get very far.

program_target() doesn’t work.

>>> print(cw.__version__)
>>> print(scope.fw_version)
>>> print(prog)
>>> cw.program_target(scope, prog, "../../../firmware/mcu/simpleserial-base-lab2/simpleserial-base-{}.hex".format(PLATFORM))
>>> #cw.program_target(scope, cw.programmers.SAM4SProgrammer, "~/work/projects/chipwhisperer/firmware/mcu/simpleserial-base-lab2/simpleserial-base-CW308_SAM4S.hex")

5.7.0
{'major': 0, 'minor': 65, 'debug': 0}
<class 'chipwhisperer.capture.api.programmers.SAM4SProgrammer'>

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Input In [53], in <cell line: 2>()
      1 print(prog)
----> 2 cw.program_target(scope, prog, "../../../firmware/mcu/simpleserial-base-lab2/simpleserial-base-{}.hex".format(PLATFORM))

File ~/work/projects/chipwhisperer/software/chipwhisperer/__init__.py:179, in program_target(scope, prog_type, fw_path, **kwargs)
    177 prog._logging = None
    178 prog.open()
--> 179 prog.find()
    180 prog.erase()
    181 prog.program(fw_path, memtype="flash", verify=True)

...

File ~/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/bootloader_sam3u.py:333, in Samba.read_word(self, addr)
    331 if len(resp) < 4:
    332     target_logger.debug("Timeout on read from {:04X}".format(addr))
--> 333     raise IOError("timeout")
    335 value = (resp[3] << 24 | resp[2] << 16 | resp[1] << 8 | resp[0] << 0)
    336 target_logger.debug("Read {:04X} from {:02X}".format(value, addr))

OSError: timeout
$ ls -l ~/work/projects/chipwhisperer/firmware/mcu/simpleserial-base-lab2/simpleserial-base-CW308_SAM4S.hex
-rw-r--r-- 1 vagrant vagrant 8381 Nov 21 16:29 /home/vagrant/work/projects/chipwhisperer/firmware/mcu/simpleserial-base-lab2/simpleserial-base-CW308_SAM4S.hex

Why does find() fail?

Hi,

It appears that you’ve got your PLATFORM set as CWHUSKY or CW308_SAM4S. You’ll need to change that to CWLITEXMEGA and rerun the lab.

Alex

1 Like

That did the job !!!
(completely missed that one - newbie)
Many thanks.