CW1200 Pro Erasing STM32F4 error

I have last version (5.1.1) of chipwhisperer software, I’m on Windows 10 64bit, and I use the ChipWhisperer-Pro (CW1200).
I manage with no problems to erase, flash and use the STM32F3 ufo board, but when I try to flash the STM32F4 ufo board I’m not able to erase the flash, having the following errors:

Detected known STMF32: STM32F40xxx/41xxx
Extended erase (0x44), this can take ten seconds or more
IndexError                                Traceback (most recent call last)
c:\chipwhisperer\software\chipwhisperer\hardware\naeusb\ in _wait_for_ask(self, info)
    286         try:
--> 287             ask =[0]
    288         except:

IndexError: list index out of range

During handling of the above exception, another exception occurred:

CmdException                              Traceback (most recent call last)
<ipython-input-2-9a4a378942c6> in <module>
----> 3 cw.program_target(scope, prog, fw_path, slow_prog=True)
      4 #cw.program_target(scope, prog, fw_path)

c:\chipwhisperer\software\chipwhisperer\ in program_target(scope, prog_type, fw_path, **kwargs)
     53     prog.find()
---> 54     prog.erase()
     55     prog.program(fw_path, memtype="flash", verify=True)
     56     prog.close()

c:\chipwhisperer\software\chipwhisperer\capture\api\ in func_wrapper(self, *args, **kwargs)
     68    = 'high_z'
     69         try:
---> 70             val = func(self, *args, **kwargs)
     71         finally:
     72             logging.debug('Restoring pdic, pdid, and nrst pin configuration')

c:\chipwhisperer\software\chipwhisperer\capture\api\ in erase(self)
    322         self.log("Erasing Chip")
    323         stm32f = self.stm32prog()
--> 324         stm32f.cmdEraseMemory()
    326     @save_and_restore_pins

c:\chipwhisperer\software\chipwhisperer\hardware\naeusb\ in cmdEraseMemory(self, sectors)
    425     def cmdEraseMemory(self, sectors=None):
    426         if self.extended_erase:
--> 427             return self.cmdExtendedEraseMemory()
    429         if self.cmdGeneric(0x43):

c:\chipwhisperer\software\chipwhisperer\hardware\naeusb\ in cmdExtendedEraseMemory(self)
    457             self.sp.timeout = 30000
    458             print("Extended erase (0x44), this can take ten seconds or more")
--> 459             self._wait_for_ask("0x44 erasing failed")
    460             self.sp.timeout = tmp
    461   "    Extended Erase memory done")

c:\chipwhisperer\software\chipwhisperer\hardware\naeusb\ in _wait_for_ask(self, info)
    287             ask =[0]
    288         except:
--> 289             raise CmdException("Can't read port or timeout (%s). Target didn't respond when an ack was expected." % traceback.format_exc())
    290         else:
    291             if ask == 0x79:

CmdException: Can't read port or timeout (Traceback (most recent call last):
  File "c:\chipwhisperer\software\chipwhisperer\hardware\naeusb\", line 287, in _wait_for_ask
    ask =[0]
IndexError: list index out of range
). Target didn't respond when an ack was expected.

I tried several fixes, with no success:

  1. Following this page, where they have the same problem (in the Nano, and not Pro) but in a later step (flashing and not erasing).
    I tried to call the program_target with several parameters like slow_prog=True and or baud=XXX, trying several XXX
  2. trying the solution proposed in this thread and post
  3. trying on a Ubuntu 16.04 machine with the same ChipWhisperer sw (5.1.1)

EDIT: I tried to upgrade the CW software, from the last release to the develop branch: same results.

Do you have some hint to solve the problem?
Thanks in advance


Hmm… First checking the obvious: are all cables properly connected?
What if you increase the timeout in cmdExtendedEraseMemory?

Hi, thanks for the prompt reply.
All cables are ok, indeed with the F3 I’m able to do everything.

I already tried to increase it, but without any success.

Thanks again

Then this is most likely related to this Github issue. Subscribe to notifications so you know when it’s fixed.