Chipwhisperer target error using CW1200 ChipWhisperer-Pro

I am trying in( Connecting to Hardware.ipynb ) using CW1200 ChipWhisperer-Pro , but i have the following error

Any body have any idea about this error?

The target isn’t responding because the ‘p’ command is expected to have a 16-byte payload; the target firmware is such that it only responds to properly formatted commands. It ignores commands with an incorrect payload size. Try, for example, target.simpleserial_write('p', bytearray(range(16))) instead.

Thank you for your response,i tried but i have the same error:

Were you successful in compiling and programming the target firmware?

Thank you for your reply, i can’t see the list of platform after this command:
cd …/hardware/victims/firmware/simpleserial-base/

Detected known STMF32: STM32F302xB(C)/303xB(C)
Extended erase (0x44), this can take ten seconds or more

FileNotFoundError Traceback (most recent call last)
Cell In[14], line 2
1 #cw.program_target(scope, cw.programmers.XMEGAProgrammer, “path/to/firmware.hex”)
----> 2 cw.program_target(scope, cw.programmers.STM32FProgrammer, “path/to/firmware.hex”)
3 #cw.program_target(scope, cw.programmers.AVRProgrammer, “path/to/firmware.hex”)

File c:\users\user\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\, in program_target(scope, prog_type, fw_path, **kwargs)
176 prog.find()
177 prog.erase()
→ 178 prog.program(fw_path, memtype=“flash”, verify=True)
179 prog.close()
180 except:

File c:\users\user\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\api\, in save_and_restore_pins..func_wrapper(self, *args, **kwargs)
125 target_logger.debug(‘Changing {} pin configuration’.format(pin_setup))
127 try:
→ 128 val = func(self, *args, **kwargs)
129 finally:
130 target_logger.debug(‘Restoring {} pin configuration’.format(pin_setup))

File c:\users\user\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\api\, in STM32FProgrammer.program(self, filename, memtype, verify)
404 stm32f = self.stm32prog()
405 stm32f.scope = self.scope
→ 406 stm32f.program(filename, memtype, verify)

File c:\users\user\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\, in close_on_fail..func_wrapper(self, *args, **kwargs)
35 @wraps(func)
36 def func_wrapper(self, *args, **kwargs):
37 try:
—> 38 return func(self, *args, **kwargs)
39 except:
40 self.close_port()

File c:\users\user\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\, in STM32FSerial.program(self, filename, memtype, verify, logfunc, waitfunc)
195 “”“Programs memory type, dealing with opening filename as either .hex or .bin file”“”
196 self.lastFlashedFile = filename
→ 198 f = IntelHex(filename)
200 fsize = f.maxaddr() - f.minaddr()
201 fdata = f.tobinarray(start=f.minaddr())

File c:\users\user\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\utils\, in IntelHex.init(self, source)
96 if source is not None:
97 if isinstance(source, StrType) or getattr(source, “read”, None):
98 # load hex file
—> 99 self.loadhex(source)
100 elif isinstance(source, dict):
101 self.fromdict(source)

File c:\users\user\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\utils\, in IntelHex.loadhex(self, fobj)
201 “”“Load hex file into internal buffer. This is not necessary
202 if object was initialized with source set. This will overwrite
203 addresses if object was already initialized.
205 @param fobj file name or file-like object
206 “””
207 if getattr(fobj, “read”, None) is None:
→ 208 fobj = open(fobj, “r”)
209 fclose = fobj.close
210 else:

FileNotFoundError: [Errno 2] No such file or directory: ‘path/to/firmware.hex’

First, you need to build the firmware.

As the notebook explains, you need to set PLATFORM to one of the platforms you see when you run the unmodified make PLATFORM= CRYPTO_TARGET=NONE command.

For example, if your target is the STM32F3, you would choose CW308_STM32F3:

Then, when you cal cw.program_target(), as the error indicates, you need to replace ‘path/to/firmware.hex’ with the path to the .hex file that you compiled. (hint: it will be in the ../hardware/victims/firmware/simpleserial-base/ directory).

Thank you a lots, it is work properly. :smiley: