Cannot upload a CWHUSKY firmware

hello,

I recently followed chipwhisperer jupyter notebook tutorials,but I faced a problem in 1 - Connecting to Hardware.

I tried to upload a firmware to target, but failed.

Here is the error messages.

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[6], line 5
      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")
      4 #cw.program_target(scope, cw.programmers.SAM4SProgrammer, "path/to/firmware.hex")
----> 5 cw.program_target(scope, cw.programmers.SAM4SProgrammer, "~/ChipWhisperer/chipwhisperer/firmware/mcu/simpleserial-base/simpleserial-base-CWHUSKY.hex")

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

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py:129, in save_and_restore_pins.<locals>.func_wrapper(self, *args, **kwargs)
    126 target_logger.debug('Changing {} pin configuration'.format(pin_setup))
    128 try:
--> 129     val = func(self, *args, **kwargs)
    130 finally:
    131     target_logger.debug('Restoring {} pin configuration'.format(pin_setup))

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py:185, in SAM4SProgrammer.find(self, power_cycle)
    183 prog = self.get_prog()
    184 target_logger.info("Connecting to SAMBA")
--> 185 prog.con(self.scope)
    186 target_logger.info("Done!")

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\bootloader_sam3u.py:250, in Samba.con(self, port, usbmode)
    247 res = ser.read(2)
    248 # print(res)
--> 250 cid = self.chip_id()
    252 target_logger.info('FWUP: CID = %04x' % cid)
    254 #Originally this was used to limit to SAM3U
    255 #eproc = (cid >> 5) & 0x7
    256 #arch = (cid >> 20) & 0xff
    257 #if eproc == 3 and ((0x80 <= arch <= 0x8a) or (0x93 <= arch <= 0x9a)):
    258 #    target_logger.info('FWUP: Detected SAM3')

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\bootloader_sam3u.py:308, in Samba.chip_id(self)
    305 def chip_id(self):
    306     """ Read chip-id """
--> 308     vector = self.read_word(0x00)
    310     # If the vector is a ARM7TDMI branch, then assume Atmel SAM7 registers
    311     if ((vector & 0xff000000) == 0xea000000):

File ~\ChipWhisperer\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

I used ChipWhisperer Husky, ChipWhisperer CW313, SAM4S Target Board.

How do I solve it?

Have you connected the SAM4S target to Husky, and the 20-pin cable between the two correctly? Check your Husky user manual: there is a picture.

If it’s still not working, post a picture of your setup.

hello jpthibault

My reply was late because I had work to do.

This picture is my hardware setup.

I think I connected it correctly, but it still doesn’t work.

Thank you for your reply.

I can’t tell for sure from the picture: are any of the CW313 LEDs on?

In particular the green +3.3V LED near the bottom of the 20-pin connector.

d2, d4, d5 leds are on.

d2 is green, d4 and d5 are red.

Can you set cw.target_logger.setLevel(cw.logging.DEBUG)before running the cw_program_target() command, and share the output?

image

Here is a output.

Did CW not recognize it?

You need to import chipwhisperer as cw first.

In the notebook where programming the target is failing, insert cw.target_logger.setLevel(cw.logging.DEBUG)after the import, but before cw.program_target().

I did it that but the return is None.

Sorry, there is a misunderstanding. cw.target_logger.setLevel(cw.logging.DEBUG) is not meant to return anything; it sets the logging level for everything that follows. Once it is set, cw.program_target() will produce additional logging that will help us understand why programming the target is failing. That’s the output I want.

Sorry for the late reply.

The log is here.

(ChipWhisperer Target DEBUG|File programmers.py:112) Saving ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target DEBUG|File programmers.py:121) pdic was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) pdid was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) nrst was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) tio3 was high_z
(ChipWhisperer Target DEBUG|File programmers.py:126) Changing ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target INFO|File programmers.py:165) Toggling erase(pdic)/nrst pins
(ChipWhisperer Target INFO|File programmers.py:184) Connecting to SAMBA
(ChipWhisperer Target INFO|File serial.py:121) Serial baud rate = 115200
(ChipWhisperer Target DEBUG|File bootloader_sam3u.py:326) Read word from 00
(ChipWhisperer Target DEBUG|File bootloader_sam3u.py:332) Timeout on read from 0000
(ChipWhisperer Target DEBUG|File programmers.py:131) Restoring ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target DEBUG|File programmers.py:133) pdic setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) pdid setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) nrst setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) tio3 setting to high_z

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[6], line 5
      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")
      4 #cw.program_target(scope, cw.programmers.SAM4SProgrammer, "path/to/firmware.hex")
----> 5 cw.program_target(scope, cw.programmers.SAM4SProgrammer, "~/ChipWhisperer/chipwhisperer/firmware/mcu/simpleserial-base/simpleserial-base-CWHUSKY.hex")

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

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py:129, in save_and_restore_pins.<locals>.func_wrapper(self, *args, **kwargs)
    126 target_logger.debug('Changing {} pin configuration'.format(pin_setup))
    128 try:
--> 129     val = func(self, *args, **kwargs)
    130 finally:
    131     target_logger.debug('Restoring {} pin configuration'.format(pin_setup))

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py:185, in SAM4SProgrammer.find(self, power_cycle)
    183 prog = self.get_prog()
    184 target_logger.info("Connecting to SAMBA")
--> 185 prog.con(self.scope)
    186 target_logger.info("Done!")

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\bootloader_sam3u.py:250, in Samba.con(self, port, usbmode)
    247 res = ser.read(2)
    248 # print(res)
--> 250 cid = self.chip_id()
    252 target_logger.info('FWUP: CID = %04x' % cid)
    254 #Originally this was used to limit to SAM3U
    255 #eproc = (cid >> 5) & 0x7
    256 #arch = (cid >> 20) & 0xff
    257 #if eproc == 3 and ((0x80 <= arch <= 0x8a) or (0x93 <= arch <= 0x9a)):
    258 #    target_logger.info('FWUP: Detected SAM3')

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\bootloader_sam3u.py:308, in Samba.chip_id(self)
    305 def chip_id(self):
    306     """ Read chip-id """
--> 308     vector = self.read_word(0x00)
    310     # If the vector is a ARM7TDMI branch, then assume Atmel SAM7 registers
    311     if ((vector & 0xff000000) == 0xea000000):

File ~\ChipWhisperer\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

Can you try changing the following line:

        ser.write("N#".encode("ascii"))
        res = ser.read(2)

to

        ser.write("N#".encode("ascii"))
        ser.flush()
        res = ser.read(2)

in chipwhisperer/hardware/naeusb/bootloader_sam3u.py? It should be around line 247.

Then, share the output with cw.target_logger.setLevel(cw.logging.DEBUG) as before.

I modified the bootloader_sam3u.py and here is the log.

(ChipWhisperer Target DEBUG|File programmers.py:112) Saving ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target DEBUG|File programmers.py:121) pdic was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) pdid was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) nrst was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) tio3 was high_z
(ChipWhisperer Target DEBUG|File programmers.py:126) Changing ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target INFO|File programmers.py:165) Toggling erase(pdic)/nrst pins
(ChipWhisperer Target INFO|File programmers.py:184) Connecting to SAMBA
(ChipWhisperer Target INFO|File serial.py:121) Serial baud rate = 115200
(ChipWhisperer Target DEBUG|File bootloader_sam3u.py:327) Read word from 00
(ChipWhisperer Target DEBUG|File bootloader_sam3u.py:333) Timeout on read from 0000
(ChipWhisperer Target DEBUG|File programmers.py:131) Restoring ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target DEBUG|File programmers.py:133) pdic setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) pdid setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) nrst setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) tio3 setting to high_z

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[6], line 5
      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")
      4 #cw.program_target(scope, cw.programmers.SAM4SProgrammer, "path/to/firmware.hex")
----> 5 cw.program_target(scope, cw.programmers.SAM4SProgrammer, "~/ChipWhisperer/chipwhisperer/firmware/mcu/simpleserial-base/simpleserial-base-CWHUSKY.hex")

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

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py:129, in save_and_restore_pins.<locals>.func_wrapper(self, *args, **kwargs)
    126 target_logger.debug('Changing {} pin configuration'.format(pin_setup))
    128 try:
--> 129     val = func(self, *args, **kwargs)
    130 finally:
    131     target_logger.debug('Restoring {} pin configuration'.format(pin_setup))

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py:185, in SAM4SProgrammer.find(self, power_cycle)
    183 prog = self.get_prog()
    184 target_logger.info("Connecting to SAMBA")
--> 185 prog.con(self.scope)
    186 target_logger.info("Done!")

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\bootloader_sam3u.py:251, in Samba.con(self, port, usbmode)
    248 res = ser.read(2)
    249 # print(res)
--> 251 cid = self.chip_id()
    253 target_logger.info('FWUP: CID = %04x' % cid)
    255 #Originally this was used to limit to SAM3U
    256 #eproc = (cid >> 5) & 0x7
    257 #arch = (cid >> 20) & 0xff
    258 #if eproc == 3 and ((0x80 <= arch <= 0x8a) or (0x93 <= arch <= 0x9a)):
    259 #    target_logger.info('FWUP: Detected SAM3')

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\bootloader_sam3u.py:309, in Samba.chip_id(self)
    306 def chip_id(self):
    307     """ Read chip-id """
--> 309     vector = self.read_word(0x00)
    311     # If the vector is a ARM7TDMI branch, then assume Atmel SAM7 registers
    312     if ((vector & 0xff000000) == 0xea000000):

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

OSError: timeout

Hi,

Can you try modifying the reset time in software/chipwhisperer/api/programmers.py, line 172 through 179 to be 1 second instead of 0.5 seconds:

        setattr(self.scope.io, self.erase_pin, 1)
        time.sleep(0.5) # change to 1 second
        setattr(self.scope.io, self.erase_pin, None)
        time.sleep(0.5) # change to 1 second

        self.scope.io.nrst = 0
        time.sleep(0.5) # change to 1 second
        self.scope.io.nrst = None
        time.sleep(0.5) # change to 1 second

Alex

I apologize for the delay, this slipped through the cracks.

One last thing to try: in the same bootloader_sam3u.py file, near where you made the other edit, can you add time.sleep(0.1)right after the ser.write(“N#”.encode(“ascii”)) line and see if that resolves the issue?

Hi Alex,

I modified the programmers.py file but the error log doesn’t seem to have changed.

(ChipWhisperer Target DEBUG|File programmers.py:112) Saving ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target DEBUG|File programmers.py:121) pdic was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) pdid was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) nrst was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) tio3 was high_z
(ChipWhisperer Target DEBUG|File programmers.py:126) Changing ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target INFO|File programmers.py:165) Toggling erase(pdic)/nrst pins
(ChipWhisperer Target INFO|File programmers.py:188) Connecting to SAMBA
(ChipWhisperer Target INFO|File serial.py:121) Serial baud rate = 115200
(ChipWhisperer Target DEBUG|File bootloader_sam3u.py:327) Read word from 00
(ChipWhisperer Target DEBUG|File bootloader_sam3u.py:333) Timeout on read from 0000
(ChipWhisperer Target DEBUG|File programmers.py:131) Restoring ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target DEBUG|File programmers.py:133) pdic setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) pdid setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) nrst setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) tio3 setting to high_z

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[6], line 5
      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")
      4 #cw.program_target(scope, cw.programmers.SAM4SProgrammer, "path/to/firmware.hex")
----> 5 cw.program_target(scope, cw.programmers.SAM4SProgrammer, "~/ChipWhisperer/chipwhisperer/firmware/mcu/simpleserial-base/simpleserial-base-CWHUSKY.hex")

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

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py:129, in save_and_restore_pins.<locals>.func_wrapper(self, *args, **kwargs)
    126 target_logger.debug('Changing {} pin configuration'.format(pin_setup))
    128 try:
--> 129     val = func(self, *args, **kwargs)
    130 finally:
    131     target_logger.debug('Restoring {} pin configuration'.format(pin_setup))

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py:189, in SAM4SProgrammer.find(self, power_cycle)
    187 prog = self.get_prog()
    188 target_logger.info("Connecting to SAMBA")
--> 189 prog.con(self.scope)
    190 target_logger.info("Done!")

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\bootloader_sam3u.py:251, in Samba.con(self, port, usbmode)
    248 res = ser.read(2)
    249 # print(res)
--> 251 cid = self.chip_id()
    253 target_logger.info('FWUP: CID = %04x' % cid)
    255 #Originally this was used to limit to SAM3U
    256 #eproc = (cid >> 5) & 0x7
    257 #arch = (cid >> 20) & 0xff
    258 #if eproc == 3 and ((0x80 <= arch <= 0x8a) or (0x93 <= arch <= 0x9a)):
    259 #    target_logger.info('FWUP: Detected SAM3')

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\bootloader_sam3u.py:309, in Samba.chip_id(self)
    306 def chip_id(self):
    307     """ Read chip-id """
--> 309     vector = self.read_word(0x00)
    311     # If the vector is a ARM7TDMI branch, then assume Atmel SAM7 registers
    312     if ((vector & 0xff000000) == 0xea000000):

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

OSError: timeout

I changed the code:

    ser.write("N#".encode("ascii"))
    res = ser.read(2)

to

    ser.write("N#".encode("ascii"))

    res = ser.read(2)
    ser.write("N#".encode("ascii"))
    time.sleep(0.1)
    ser.flush()
    res = ser.read(2)

but the issue wasn’t resolved.

(ChipWhisperer Target DEBUG|File programmers.py:112) Saving ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target DEBUG|File programmers.py:121) pdic was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) pdid was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) nrst was high_z
(ChipWhisperer Target DEBUG|File programmers.py:121) tio3 was high_z
(ChipWhisperer Target DEBUG|File programmers.py:126) Changing ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target INFO|File programmers.py:165) Toggling erase(pdic)/nrst pins
(ChipWhisperer Target INFO|File programmers.py:184) Connecting to SAMBA
(ChipWhisperer Target INFO|File serial.py:121) Serial baud rate = 115200
(ChipWhisperer Target DEBUG|File bootloader_sam3u.py:328) Read word from 00
(ChipWhisperer Target DEBUG|File bootloader_sam3u.py:334) Timeout on read from 0000
(ChipWhisperer Target DEBUG|File programmers.py:131) Restoring ['pdic', 'pdid', 'nrst', 'tio3'] pin configuration
(ChipWhisperer Target DEBUG|File programmers.py:133) pdic setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) pdid setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) nrst setting to high_z
(ChipWhisperer Target DEBUG|File programmers.py:133) tio3 setting to high_z

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[6], line 5
      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")
      4 #cw.program_target(scope, cw.programmers.SAM4SProgrammer, "path/to/firmware.hex")
----> 5 cw.program_target(scope, cw.programmers.SAM4SProgrammer, "~/ChipWhisperer/chipwhisperer/firmware/mcu/simpleserial-base/simpleserial-base-CWHUSKY.hex")

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

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py:129, in save_and_restore_pins.<locals>.func_wrapper(self, *args, **kwargs)
    126 target_logger.debug('Changing {} pin configuration'.format(pin_setup))
    128 try:
--> 129     val = func(self, *args, **kwargs)
    130 finally:
    131     target_logger.debug('Restoring {} pin configuration'.format(pin_setup))

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\capture\api\programmers.py:185, in SAM4SProgrammer.find(self, power_cycle)
    183 prog = self.get_prog()
    184 target_logger.info("Connecting to SAMBA")
--> 185 prog.con(self.scope)
    186 target_logger.info("Done!")

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\bootloader_sam3u.py:252, in Samba.con(self, port, usbmode)
    249 res = ser.read(2)
    250 # print(res)
--> 252 cid = self.chip_id()
    254 target_logger.info('FWUP: CID = %04x' % cid)
    256 #Originally this was used to limit to SAM3U
    257 #eproc = (cid >> 5) & 0x7
    258 #arch = (cid >> 20) & 0xff
    259 #if eproc == 3 and ((0x80 <= arch <= 0x8a) or (0x93 <= arch <= 0x9a)):
    260 #    target_logger.info('FWUP: Detected SAM3')

File ~\ChipWhisperer\chipwhisperer\software\chipwhisperer\hardware\naeusb\bootloader_sam3u.py:310, in Samba.chip_id(self)
    307 def chip_id(self):
    308     """ Read chip-id """
--> 310     vector = self.read_word(0x00)
    312     # If the vector is a ARM7TDMI branch, then assume Atmel SAM7 registers
    313     if ((vector & 0xff000000) == 0xea000000):

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

OSError: timeout

In that case there may be a problem with your target board.

Email support@newae.com, with a reference to this thread, and we will send you a replacement target board.

I really appreciate your help.

Thank you so much for your help so far :slight_smile:

The solution is removing SMA calbes in my case.

1 Like