Could'nt write programs on SAM4S from HuskyPlus

I have purchased the Pro set of HuskyPlus and am trying it out, but when I try to write to the target (SAM4S) in the first step “1-Connecting to Hardware”, the following warning is displayed and the writing fails, and I can’t solve it.
If you have a solution, please let me know.

cw.program_target(scope, cw.programmers.SAM4SProgrammer, “…/firmware/mcu/simpleserial-base/simpleserial-base-CW308_SAM4S.hex”)
(ChipWhisperer Target WARNING|File programmers.py:214) Boot flash not set, target may require power cycle

  • For other targets (XMEGA and STM32F3), the AES response was strange, but there were no warnings or errors during the writing itself.
  • I uninstalled chipwhisperer and installed the latest “develop” version repository, but there was no change.

Info about the environment:
The ChipWhisperer software was installed on a PC(Windows 10 Pro 22H2) using the latest installer. Even though HuskyPlus could be recognized from chipwhisperer installed from Python on Windows, HuskyPlus could not be recognized from the installed MINGW64(error occurred in cw.scope()). To solve this, I upgraded the pip of MINGW64 and then used pip-review to update all packages in it.

Hi,

That message is referring to a bug in the BootROM for the SAM4S. IIRC, sometimes the internal flag that tells the SAM4S to boot into the program you just wrote into it doesn’t work, so you may need to do a full power cycle (scope.io.target_pwr = 0, wait a moment, then scope.io.target_pwr = 1).

Thanks for your reply.

Unforutunately I’ve inserted the code as below before the cw.program_target(), but the result doesn’t change.

import time
scope.io.target_pwr = 0
time.sleep(0.25)
scope.io.target_pwr = 1
time.sleep(0.25)

Are there any other way to fix this?

FYI, other target(STM32F3) is working fine with HuskyPlus and I’m able to trying out the SCA tutorials with this pairing.

You’ve got it backwards. You need to power cycle the target after programming, not before.