I took a look into the upload script ambiq_bin2board.py. The script sends a AM_SECBOOT_WIRED_MSGTYPE_HELLO command to the board and expects a response of length 88 bytes.
A sample response looks like this:
[‘0x6f’, ‘0x72’, ‘0xd’, ‘0xa’, ‘0x49’, ‘0x32’, ‘0x43’, ‘0x20’, ‘0x45’, ‘0x72’, ‘0x72’, ‘0x6f’, ‘0x72’, ‘0xd’, ‘0xa’, ‘0x49’, ‘0x32’, ‘0x43’, ‘0x20’, ‘0x45’, ‘0x72’, ‘0x72’, ‘0x6f’, ‘0x72’, ‘0xd’, ‘0xa’, ‘0x49’, ‘0x32’, ‘0x43’, ‘0x20’, ‘0x45’, ‘0x72’, ‘0x72’, ‘0x6f’, ‘0x72’, ‘0xd’, ‘0xa’, ‘0x49’, ‘0x32’, ‘0x43’, ‘0x20’, ‘0x45’, ‘0x72’, ‘0x72’, ‘0x6f’, ‘0x72’, ‘0xd’, ‘0xa’, ‘0x49’, ‘0x32’, ‘0x43’, ‘0x20’, ‘0x45’, ‘0x72’, ‘0x72’, ‘0x6f’, ‘0x72’, ‘0xd’, ‘0xa’, ‘0x49’, ‘0x32’, ‘0x43’, ‘0x20’, ‘0x45’, ‘0x72’, ‘0x72’, ‘0x6f’, ‘0x72’, ‘0xd’, ‘0xa’, ‘0x49’, ‘0x32’, ‘0x43’, ‘0x20’, ‘0x45’, ‘0x72’, ‘0x72’, ‘0x6f’, ‘0x72’, ‘0xd’, ‘0xa’, ‘0x49’, ‘0x32’, ‘0x43’, ‘0x20’, ‘0x45’, ‘0x72’, ‘0x72’]
In ASCII characters it looks like this:
orI2C ErrorI2C ErrorI2C ErrorI2C ErrorI2C ErrorI2C ErrorI2C ErrorI2C Err
The script continues with a check if the response is of type AM_SECBOOT_WIRED_MSGTYPE_STATUS and this fails of course.
So it looks like the output from the code that runs on the board is the problem.
I’m not happy with this shaky upload procedure, for my take this might be good enough for a hobby project but not for a commercial product 8-(
Is there any way to fix this from the software side? I thought about making the response buffer much larger and than search for the response, something like this?