I am trying to learn how to load a bootloader. I took my adalogger M0, tested to make sure it works by loading "blink" in the arduino IDE and all worked ok. I then loaded the adafruit m0 bootloader using Microstudio. The feather shows up as a drive and I can see it in Arduino.
The problem:
Now, every time I try to load code (i'm using the blink sample) the code appears to load ok, but the instant the code finishes loading, the feather disappears (no longer shows up in Arduino IDE or as a drive) and doesn't come back. The blink code is also not working. If I double tap the reset the feather reappears, but I have the same issue where it loads the code, then disappears again.
I am thinking that I am either loading the wrong bootloader, not loading the bootloader correctly, or missing a step after I load the bootloader. I am doing all of this because I have built my own custom PCB with the same microcontroller and am having the same issue on my board. I have tried uploading the arduino zero bootloader, but when I do that I don't see the board at all. Any help is greatly appreciated. I am trying very hard to understand all of this. I'm definitely operating at the limits of my knowledge base.
Adalogger M0 bootloader
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_carter
- Posts: 29056
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Adalogger M0 bootloader
Are you doing something like this for loading the bootloader?
https://learn.adafruit.com/how-to-progr ... s/overview
https://learn.adafruit.com/how-to-progr ... s/overview
- waviation
- Posts: 21
- Joined: Tue Mar 28, 2023 11:09 pm
Re: Adalogger M0 bootloader
Yes, I am using the SAMD21G18 development board (https://www.microchipdirect.com/product ... p9EALw_wcB) . I have cut out the onboard chip and soldered in jumpers to connect to my board. I have also tried it through a Raspberry Pi running open OCD. I am able to program the chip with both (The Atmel development board and the Pi), but I can only get it to show up in bootloader mode (double click of the reset button). If I do a single reset it doesn't do anything (wont show up in the Arduino IDE and wont run the blink code).
- adafruit_support_carter
- Posts: 29056
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Adalogger M0 bootloader
That board appears to have a slightly different variant?
https://www.microchip.com/en-us/develop ... AMD21-XPRO
SAMD21J18A vs the SAMD21G18A on the Feather M0 Adalogger:
https://www.adafruit.com/product/2796
Is the Feather behaving as expected?
https://www.microchip.com/en-us/develop ... AMD21-XPRO
SAMD21J18A vs the SAMD21G18A on the Feather M0 Adalogger:
https://www.adafruit.com/product/2796
Is the Feather behaving as expected?
- waviation
- Posts: 21
- Joined: Tue Mar 28, 2023 11:09 pm
Re: Adalogger M0 bootloader
Good point. OK, so moving forward, I want to do this the right way, so what do you suggest for a programmer to load the bootloader on my SAMD21G18? Can I do it with the ATMEL ICE (https://www.farnell.com/datasheets/1835727.pdf) ? I see Adafruit has a Jlink programmer but that is $500. The cheaper EDU version seems out of stock everywhere.
I've also tried this with the Raspberry Pi and Open OCD but with the same results. I can take a working feather, program it with the M0 bootloader, and then the feather no longer works. I can double tap reset and get into bootloader mode, but If I try to upload a sketch, the feather locks up as soon as the sketch finishes loading and the feather reboots. I must be doing something wrong when I try to load the bootloader that is causing these working boards to fail? If it is as simple as "I need a proper programmer" I'll just order one.I just want to make sure I get the correct programmer.
Thanks.
I've also tried this with the Raspberry Pi and Open OCD but with the same results. I can take a working feather, program it with the M0 bootloader, and then the feather no longer works. I can double tap reset and get into bootloader mode, but If I try to upload a sketch, the feather locks up as soon as the sketch finishes loading and the feather reboots. I must be doing something wrong when I try to load the bootloader that is causing these working boards to fail? If it is as simple as "I need a proper programmer" I'll just order one.I just want to make sure I get the correct programmer.
Thanks.
- adafruit_support_carter
- Posts: 29056
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Adalogger M0 bootloader
The programmer isn't the issue - that will work for any of these variants, and for any SAMD MCU in general.
The issue would be firmware (software). Some bit of code expecting the one variant but loaded on a different one.
Should investigate the Feather behavior further. This:
The issue would be firmware (software). Some bit of code expecting the one variant but loaded on a different one.
Should investigate the Feather behavior further. This:
What is Microstudio? Is that something different than Atmel Studio?I can take a working feather, program it with the M0 bootloader, and then the feather no longer works.
- waviation
- Posts: 21
- Joined: Tue Mar 28, 2023 11:09 pm
Re: Adalogger M0 bootloader
Sorry, I meant Microchip Studio.
- adafruit_support_carter
- Posts: 29056
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Adalogger M0 bootloader
OK, sounds like you should be able to nominally follow the same procedure as shown here:
https://learn.adafruit.com/how-to-progr ... mel-studio
Is that process generally working as expected?
https://learn.adafruit.com/how-to-progr ... mel-studio
Is that process generally working as expected?
- waviation
- Posts: 21
- Joined: Tue Mar 28, 2023 11:09 pm
Re: Adalogger M0 bootloader
Yes, the process works as described in that tutorial. It is actually what I used to load the bootloader. The process seems to work. I see the program success message, and both the feather, and my custom board will show up as a drive.
- waviation
- Posts: 21
- Joined: Tue Mar 28, 2023 11:09 pm
Re: Adalogger M0 bootloader
- Attachments
-
- feather-bootloader.jpg (338.83 KiB) Viewed 159 times
- waviation
- Posts: 21
- Joined: Tue Mar 28, 2023 11:09 pm
Re: Adalogger M0 bootloader
- Attachments
-
- feather-arduino.jpg (214.52 KiB) Viewed 159 times
- waviation
- Posts: 21
- Joined: Tue Mar 28, 2023 11:09 pm
Re: Adalogger M0 bootloader
- Attachments
-
- feather-windows-explorer.jpg (119.54 KiB) Viewed 159 times
- waviation
- Posts: 21
- Joined: Tue Mar 28, 2023 11:09 pm
Re: Adalogger M0 bootloader
The three screenshots show the bootloader getting loaded in Microchip Studio, the feather showing up in the Arduino IDE, and the feather showing up as a drive if I place it into bootloader mode (double click the reset button). I then load the "blink code", and it loads successfully, but then does nothing and disappears from the Arduino IDE (I can't see it as an option under "tools-ports".
- waviation
- Posts: 21
- Joined: Tue Mar 28, 2023 11:09 pm
Re: Adalogger M0 bootloader
Is it possible to get the newest binary (or hex) for the Feather Adalogger M0? I found this link https://github.com/adafruit/uf2-samdx1 but it looks like these are not the hex and/or bin files, but files that need compiling? I'll admit, I find github confusing.
- adafruit_support_carter
- Posts: 29056
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Adalogger M0 bootloader
After the sketch uploads and the board goes away, can you still double press reset and get back into bootloader mode?
Please be positive and constructive with your questions and comments.