0

Adafruit Grand Central M4 bootloader no USB
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit Grand Central M4 bootloader no USB

by greymfm76 on Mon Sep 21, 2020 11:37 am

Hi,
We have purchased 50 pieces Adafruit Grand Central M4 boards (via Mouser Electronics) for our Ardumower project. We have bootloader issues with all of these boards using many different computers (all all different combinations of OS's, Windows, Linux etc.). We have tried out all available Grand Central M4 bootloader versions (v3.30, v3.7.0, v3.9.0, v3.10.0 ), different USB cables, USB-powered hubs, USB2 and USB3 etc.- Always the same bootloader issue.

Problem: The UF2 bootloader is 90% of the time not showing up any USB devices when loading via double-pressing RESET on the Adafruit Grand Central M4 board. The Neopixel LED stays red and the small LED is quickly pulsating.

grand_central_bootloader.jpg
grand_central_bootloader.jpg (382.19 KiB) Viewed 211 times


We have flashed a user program using Arduino IDE and the Arduino blink example code but it's difficult to flash when the bootloader does not show any USB devices 90% of the time.

We have captured several USB log dumps attached using 'usbmon' to be viewed with 'wireshark'.
The log files and further details are filed here:
https://github.com/adafruit/uf2-samdx1/issues/142

The crystals are soldered correctly (not upside down). Also, yes, we tried different USB cables.

What else could we do to help finding the cause for such a problem? :-)

Thanks,
Alexander

greymfm76
 
Posts: 6
Joined: Mon Sep 21, 2020 11:35 am

Re: Adafruit Grand Central M4 bootloader no USB

by adafruit2 on Mon Sep 21, 2020 4:05 pm

ok we can figure something out. first up please get one board that def works, please try the most recent UF2 updater so we can at least have the same setup
https://circuitpython.org/board/grandce ... 4_express/
also - so we have the same OS, please use windows 10 as the computer, and a 3 ft long USB cable

adafruit2
Site Admin
 
Posts: 20094
Joined: Fri Mar 11, 2005 7:36 pm

Re: Adafruit Grand Central M4 bootloader no USB

by greymfm76 on Tue Sep 22, 2020 5:32 pm

Thanks for your help, we appreciate it. I have to add that the affected boards have been reflashed a couple of times (using Arduino IDE) each day over a one week period until the bootloader issue appeared (and which could not be fixed by reflashing with the latest bootloader version). I will get a new board and work out an automated test and log the results for you so you can reproduce the issue easily...

One 'workaround' we found to get into the bootloader on these boards:
1. Press and hold RESET button.
2. Plug-in the board into the USB.
3. Release RESET button and immediately press RESET two times.
Then the boards go into bootloader, the Neopixel LED goes green and a USB device is shown. But this workaround does not work on Windows machines, only Linux machines. The typical double-tap RESET (at any time) does not work at all on those affected boards.

greymfm76
 
Posts: 6
Joined: Mon Sep 21, 2020 11:35 am

Re: Adafruit Grand Central M4 bootloader no USB

by adafruit2 on Wed Sep 23, 2020 12:27 am

its is quite weird but i think the fuses got damaged

do you have a programmer like jlink or avr ice? we could also use another grand central but its easiest if you hve a real programmer

adafruit2
Site Admin
 
Posts: 20094
Joined: Fri Mar 11, 2005 7:36 pm

Re: Adafruit Grand Central M4 bootloader no USB

by greymfm76 on Wed Sep 23, 2020 6:12 am

Thanks. Yes, I have an jlink mini (EDU). I wrote a tutorial how to use it to debug and flash the boards under Linux ( https://github.com/Ardumower/Sunray/tree/master/openocd ). Let me check the fuse bits and get back to you. Thanks.

greymfm76
 
Posts: 6
Joined: Mon Sep 21, 2020 11:35 am

Re: Adafruit Grand Central M4 bootloader no USB

by adafruit2 on Wed Sep 23, 2020 10:30 am

yeah - the person who knows this best is on holiday this week, i will try to help you the best possible but it may be a few days till they return and can assist!

adafruit2
Site Admin
 
Posts: 20094
Joined: Fri Mar 11, 2005 7:36 pm

Re: Adafruit Grand Central M4 bootloader no USB

by greymfm76 on Wed Sep 23, 2020 11:10 am

I checked the fuses with JLink.exe:
Code: Select all | TOGGLE FULL SIZE
J-Link> si 1
J-Link> speed 4000
J-Link> device ATSAMD51P20A
J-Link> mem8 0x00804000,0x2c

and it returns the same fuses data as on the boards that are working:
Code: Select all | TOGGLE FULL SIZE
00804000 = 39 92 9A F6 80 FF EC AE FF FF FF FF FF FF FF FF
00804010 = 10 40 80 00 FF FF FF FF FF FF FF FF FF FF FF FF
00804020 = FF FF FF FF FF FF FF FF FF FF FF FF

Also, the BOOTPROT bits (0x00804013) are all 0:
Code: Select all | TOGGLE FULL SIZE
J-Link> mem8 0x00804013,1
00804013 = 00

I tried writing a 0xF there to set BOOTPROT size to zero (according to SAMD5x datasheet):
Code: Select all | TOGGLE FULL SIZE
J-Link> w1 0x00804013,0xF

So, yes the fuses are ok ...

greymfm76
 
Posts: 6
Joined: Mon Sep 21, 2020 11:35 am

Re: Adafruit Grand Central M4 bootloader no USB

by adafruit2 on Wed Sep 23, 2020 12:05 pm

im quite mistified

can you try the uf2 updater attached? you'll need to get it into bootloader mode once
Attachments
update-bootloader-grandcentral_m4-v1.23.1-adafruit.1-329-gd2322a2.uf2
(37 KiB) Downloaded 9 times

adafruit2
Site Admin
 
Posts: 20094
Joined: Fri Mar 11, 2005 7:36 pm

Re: Adafruit Grand Central M4 bootloader no USB

by greymfm76 on Wed Sep 23, 2020 12:18 pm

Thanks. Partial success. After updating with your bootloader, on some USB ports it's already working without the workaround described above. Again, only Linux machines (Windows machines no success). I cannot see any pattern yet. I will test more boards in the next days, maybe the issue is too specific to certain boards only...

greymfm76
 
Posts: 6
Joined: Mon Sep 21, 2020 11:35 am

Re: Adafruit Grand Central M4 bootloader no USB

by adafruit2 on Wed Sep 23, 2020 12:50 pm

ok please try on other boards, we'll figure something out!

adafruit2
Site Admin
 
Posts: 20094
Joined: Fri Mar 11, 2005 7:36 pm

Re: Adafruit Grand Central M4 bootloader no USB

by danhalbert on Tue Sep 29, 2020 11:25 am

Hi, I have a bunch of comments and questions, so we can try to narrow this down:

1. You said that these boards seemed to be fine for a while, and then started acting up. Were they being used in your project, hooked up to other things, and then started acting peculiar?

2. The version of Arduino IDE shown in the screenshot in https://github.com/adafruit/uf2-samdx1/issues/142 is 1.8.9, which is fairly old. Have you tried newer versions, and are the Board Support Packages that support this board all up to date?

3. Thanks for the fuse check. The fuses look fine. I'll note that the BOOTPROT value is not at 0x00804013, it is in the top byte of the first fuse word, in bits 29:26. So you usually see the first word as 0xF6... when BOOTPROT is set to protect the first 16kB, and 0xFE... when it is not protecting anything.

(Another side comment: The JLink "w" commands do not actually write the flash until some other event happens, like doing a halt or exit or an "s" command. I was really confused by this for a while, and it took a ticket to Segger and several round of questions before I found out that the writes are queued up by the J-Link softwareand don't happen until some kind of "flushing" event, like a single-step "s" command.)

4. When you are testing the boards, is there anything else connected to the board, or is it just powered via USB to the host computer?

5. If you power a board via the barrel connector, do you see the same issues?

6. You mentioned that you see this problem on a wide variety of Linux and Windows machines. Are these machines scattered among homes, or are they maintained by the same organization? I am particularly interested in whether there are third-party disk monitoring, anti-virus, backup, or indexing programs that are in use. Has anyone tried these on a Mac and seen the same issues?

7. Do all these machines happen to have any special USB drivers installed for other reasons?

8. Are the Linux machines RPi and/or also x64? See this thread and the specific post for some (similar?) issues a few people have had with RPi: viewtopic.php?f=63&t=169773&p=831098

9. If you reboot the host machines between tries and/or switch USB ports, does it make any difference?
On Windows, the Device Cleanup Tool here: https://www.uwe-sieber.de/misc_tools_e.html can be quite helpful.

10. Are the boards with issues all from the same batch? Has anyone tried other Grand Central boards bought at a different time, perhaps from a different supplier? Are those board acting up similarly? I assume you bought just a few boards to begin with and then bought a larger batch. And is anyone having any similar difficulty with other SAMD51 or SAMD21 boards (not Grand Central) in the same environment.

11. You mentioned trying with hubs. Are these hubs with external power supplies? If not, could you try that?

12, The fast red flashing means that the bootloader has not successfully connected to USB. You'd see the same thing when connecting to a USB power supply instead of a host computer.

danhalbert
 
Posts: 2445
Joined: Tue Aug 08, 2017 12:37 pm

Re: Adafruit Grand Central M4 bootloader no USB

by greymfm76 on Thu Oct 01, 2020 7:03 am

Thanks for your suggestions. Further investigations show that the issue actually seem to be related to only a few boards that we worked with (and not the whole batch). To reduce further work, let's close this issue for now and concentrate on the remaining boards :-) (which seem to work fine) . I'm sorry that I (probably) made wrong assumptions in my first post (judging from some to all). Thanks for all your help!

greymfm76
 
Posts: 6
Joined: Mon Sep 21, 2020 11:35 am

Re: Adafruit Grand Central M4 bootloader no USB

by danhalbert on Thu Oct 01, 2020 7:18 am

Thanks for the follow up! You might check those particular boards for the upside down crystal we talked about in https://github.com/adafruit/uf2-samdx1/issues/142. I will close the GitHub issue for now.

danhalbert
 
Posts: 2445
Joined: Tue Aug 08, 2017 12:37 pm

Please be positive and constructive with your questions and comments.