Bootloader - disable double tap

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Jimis
 
Posts: 7
Joined: Thu Sep 29, 2022 9:58 am

Bootloader - disable double tap

Post by Jimis »

Hi
I'm having a problem with Feather M0 entering sometimes bootloader mode while I connect the power. I need to disable the double tap of the RESET (button) feature because a HW fix is difficult at this point.
Is there a way to change the bootloader FW and upload a new one without this feature?

Thanks in advance

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Bootloader - disable double tap

Post by dastels »

The SAMD21 bootloader source is at https://github.com/adafruit/uf2-samdx1.

Question: how do you plan to get into the bootloader?

Dave

User avatar
Jimis
 
Posts: 7
Joined: Thu Sep 29, 2022 9:58 am

Re: Bootloader - disable double tap

Post by Jimis »

Thanks for the reply.
I'm not sure how to compile these files. I opened them with VS code and found the point where the double tap is. But I don't know how to compile them properly to get the uf2 or .bin file which is needed to upload the new bootloader.

If I have a .bin file I can produce the .uf2 with a Python conversion script according to adafruit (https://learn.adafruit.com/adafruit-fea ... er-2929771).

Any info on that?

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Bootloader - disable double tap

Post by dastels »

I haven't tried that myself, but I see a Makefile so I'd start with that.

Dave

User avatar
Jimis
 
Posts: 7
Joined: Thu Sep 29, 2022 9:58 am

Re: Bootloader - disable double tap

Post by Jimis »

I have no idea how to compile this thing. I tried downloading PlatformIO and Auto Build Marlin but no luck.
I can't build it.

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Bootloader - disable double tap

Post by dastels »

Back to your original post: how is connecting power and double tapping reset connected?

Dave

User avatar
Jimis
 
Posts: 7
Joined: Thu Sep 29, 2022 9:58 am

Re: Bootloader - disable double tap

Post by Jimis »

I will answer your question but I recommend not to focus on the HW cause I have gone over it and there is no viable solution. I must disable the bootloader double tap. I include the feather M0 schematic.

The problem is that Reset signal is pulled-up to 3.3V by an internal resistor in SAMD μC. When you unplug-plug the power the Reset signal drops a few times until it gets stable. The bootloader sometimes mistakenly considers these drops as double tap so it goes into bootloader mode. An RC on the reset line doesn't solve the problem and other HW solutions (555 latch) will be more complicated.

Solution is to disable the double tap in bootloader FW and upload the new one. If anyone has experience in Visual Code he would probably do it in a 5 minutes. I don't.

I'm trying to build the bootloader code in this link https://github.com/adafruit/uf2-samdx1
Attachments
feather_schem.png
feather_schem.png (62.85 KiB) Viewed 1486 times

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Bootloader - disable double tap

Post by dastels »

Weird. I have never encountered that. I'll ask around about building the bootloader.

My earlier question remains... how do you foresee getting into the bootloader if you remove the double-reset?

Dave

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: Bootloader - disable double tap

Post by adafruit2 »

what if you put a 1uF or larger cap between reset and ground? to compile we use msys2 (or cygwin) on windows and then compile packages in there
this guide is old but maybe relevant https://learn.adafruit.com/windows-tool ... r/overview

User avatar
Jimis
 
Posts: 7
Joined: Thu Sep 29, 2022 9:58 am

Re: Bootloader - disable double tap

Post by Jimis »

dastels wrote: Mon Oct 03, 2022 10:20 am Weird. I have never encountered that. I'll ask around about building the bootloader.

My earlier question remains... how do you foresee getting into the bootloader if you remove the double-reset?

Dave
For now I don't care about the bootloader. If I can't get in in the future I could use SWD to load it again. If I am able to compile maybe I can find another solution programmatically.
adafruit2 wrote: Mon Oct 03, 2022 11:05 am what if you put a 1uF or larger cap between reset and ground? to compile we use msys2 (or cygwin) on windows and then compile packages in there
this guide is old but maybe relevant https://learn.adafruit.com/windows-tool ... r/overview
Already tried using large caps. Gets better but the problem remains.
Compile method with msys2 looks a bit of a pain but will give it a try if I have nothing else to work with.

User avatar
Jimis
 
Posts: 7
Joined: Thu Sep 29, 2022 9:58 am

Re: Bootloader - disable double tap

Post by Jimis »

Which file to I select to run the "make" command in cmd ?


I tried also loading the files in Microchip Studio (ex Atmel Studio) but I can't build it cause there is a file missing uf2_version.h (!!!)
I couldn't even find this file on the internet anywhere !
Attachments
Screenshot_1.jpg
Screenshot_1.jpg (34.34 KiB) Viewed 1438 times

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: Bootloader - disable double tap

Post by adafruit2 »

how to compile the bootloader and use makefiles is outside our scope of tech support- the code is all there but one must have the knowhow of how to build ARM cross-compilation.
you may want to hire an electrical/firmware engineer to help you!

User avatar
Jimis
 
Posts: 7
Joined: Thu Sep 29, 2022 9:58 am

Re: Bootloader - disable double tap

Post by Jimis »

Well I only wanted someone to point me to the right direction. I figured it out after long read so I post it here for others. Like I said for someone who used VS code this was a piece of cake.

The key to build this is to run the "makefile" file inside the program folder. You need to open VS code and install an extension called "Makefile tools" (others could be available). Then you run the extension and it finds the file automatically.

Ofc I have other issues now I get an error: fatal: bad default revision 'HEAD'
but that's another issue, I wouldn't expect it to be that easy to work anyway.

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: Bootloader - disable double tap

Post by adafruit2 »

sounds like maybe somethign wierd with the git checkout process, HEAD is what git calls the latest version

Locked
Please be positive and constructive with your questions and comments.

Return to “CLUE Board”