analogdevicesinc / msdk

Software Development Kit for Analog Device's MAX-series microcontrollers
Apache License 2.0
61 stars 82 forks source link

MAX78000FTHR Board Can't Flash #883

Closed nyasar-code closed 7 months ago

nyasar-code commented 8 months ago

Hi,

I have a MAX78000FTHR board with a Adafruit 2.4" 320x240 TFT display attached to it. I was running facial_recognition example on it and everything was working well. But something happened and I can't flash my board anymore, it is giving the error:

Remote communication error. Target disconnected.: Connection reset by peer.

If I erase the flash it gives the error:

Open On-Chip Debugger 0.11.0+dev-g56a818e4c (2023-10-09-16:10) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html DEPRECATED! use 'adapter driver' not 'interface' Info : CMSIS-DAP: SWD supported Info : CMSIS-DAP: Atomic commands supported Info : CMSIS-DAP: Test domain timer supported Info : CMSIS-DAP: FW Version = 0256 Info : CMSIS-DAP: Serial# = 0444170199e18a7600000000000000000000000097969906 Info : CMSIS-DAP: Interface Initialised (SWD) Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 2000 kHz Error: Error connecting DP: cannot read IDR

After searching through other user's issues, I realized others had the similar error and the solution was to "unlock the board" to make it programmable again. I followed all the steps and everything went smoothly. I updated the debugger and put the erase.act file into the drive and there was no fail.txt generated.

But my issue still persists, I still get the same error as before. Could there be something additional I have to do because of the TFT display? What else can cause this issue? Thanks in advance.

Copy of my Details.txt file:

DAPLink Firmware - see https://mbed.com/daplink

Unique ID: 0444170199e18a7600000000000000000000000097969906 HIC ID: 97969906 Auto Reset: 1 Automation allowed: 1 Overflow detection: 1 Page erasing: 1 Daplink Mode: Interface Interface Version: 0256 Git SHA: a209a92c65513989f86ac7ff32c1bec27082eee0 Local Mods: 0 USB Interfaces: MSD, CDC, HID, WebUSB Interface CRC: 0xb61afbb5 Remount count: 0 URL: http://www.maximintegrated.com/max78000fthr

Jake-Carter commented 8 months ago

Hi @nyasar-code, sorry for the delay.

This has the same symptoms as low-power lockout. Since the software method didn't work, I would suggest trying to time a hardware reset.

  1. Hold SW4 on the MAX78000FTHR (this is the reset button) 20240122_192723

  2. Release SW4 and immediately run the VS Code "erase flash" build task after you release the button.

I flashed the same project to my board and couldn't re-create the same error message, but the erase flash task worked for me without any issues. On yours, I suspect that you should be able to time the connection after the hardware reset with a few tries. Let me know if it succeeds.

nyasar-code commented 8 months ago

Hi Jake,

I have seen you suggest this to other users experiencing the same issue but unfortunately it hasnt worked for me.

Using the board was a part of a college project. I have returned the board back to university and they have given me a new one that is working without any issues. Thanks for your help nonetheless.

Jake-Carter commented 8 months ago

Hi @nyasar-code, since we have had enough similar issues I spent some time digging into this further.

For anyone else having this issue -

I found that there is a bug in the default factory DAPLINK firmware (Git SHA a209a92c65513989f86ac7ff32c1bec27082eee0). That version of the firmware does not drive the RSTN pin at all... It attempts to reset only with the software command. Therefore it will be unable to reset the device at all from any of the low-power modes.

The latest version (Git SHA 34fe95d79afeba62ef097774ecc609ef8c2b74ea) does drive the RSTN pin correctly and should be able to recover from the lockouts (download here). I replicated a lockout and where SHA a209 failed, SHA 34fe succeeded. The known working version has the following DETAILS.TXT:

# DAPLink Firmware - see https://mbed.com/daplink
Unique ID: 042317021452035100000000000000000000000097969906
HIC ID: 97969906
Auto Reset: 1
Automation allowed: 1
Overflow detection: 1
Incompatible image detection: 0
Page erasing: 1
Daplink Mode: Interface
Interface Version: 0256
Git SHA: 34fe95d79afeba62ef097774ecc609ef8c2b74ea
Local Mods: 1
USB Interfaces: MSD, CDC, HID, WebUSB
Interface CRC: 0x0bea58c5
Remount count: 0
URL: http://www.maximintegrated.com/max78000fthr

See the Debuggers section of the UG for update instructions. The relevant pushbutton to put the MAX78000FTHR in MAINTENANCE mode is SW3.

Jake-Carter commented 8 months ago

Re-opening for visibility. I will submit a request to the factory to update the default PICO firmware.

Jake-Carter commented 7 months ago

The default firmware has been updated to 34fe95 and our existing stock being updated as well. Closing out, thanks for reporting.

yuval5295 commented 5 months ago

Hey, @Jake-Carter

I have the same problem but I am using Max32660EVSYS. I am using VS (Eclipse made me too much troubles) and unfortunately I had never succeed to flash it. I did all the instructions step by step - updated the firmware adapter firmware and erase but still no success.

this is my details on DAPALINK:

DAPLink Firmware - see https://mbed.com/daplink

Unique ID: 04211702bfb8038600000000000000000000000097969906 HIC ID: 97969906 Auto Reset: 0 Automation allowed: 1 Overflow detection: 0 Incompatible image detection: 0 Page erasing: 1 Daplink Mode: Interface Interface Version: 0256 Git SHA: 34fe95d79afeba62ef097774ecc609ef8c2b74ea Local Mods: 1 USB Interfaces: MSD, CDC, HID, WebUSB Interface CRC: 0xd7617efe Remount count: 0 URL: http://www.maximintegrated.com/max32660

this is what written on terminal:

Remote communication Error

looking forward for any help :)