Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single Button Press into Bootloader #38

Closed
brendanvanbreda opened this issue Mar 20, 2018 · 4 comments
Closed

Single Button Press into Bootloader #38

brendanvanbreda opened this issue Mar 20, 2018 · 4 comments

Comments

@brendanvanbreda
Copy link
Contributor

I am attempting to build a custom binary release for a custom board, with reference about the reset procedure.

When looking through uf2.h

// If enabled, bootloader will start on power-on and every reset. A second reset
// will start the app. This only happens if the app says it wants that (see SINGLE_RESET() below).
// If disabled here or by the app, the bootloader will only start with double-click of the reset
// button.
#define USE_SINGLE_RESET 1

If this value is set to 0, should the expected result be that the bootloader will become active on a single reset ?

As when working in maker.makecode with the Arduino Zero it makes use of a single reset to enable the bootloader. In comparison to when converting a .bin file from Arduino to a .UF2 it would still require a second reset. This occures between uploads of the UF2 file from the different sources.

@mmoskal
Copy link
Member

mmoskal commented Mar 20, 2018

To get single-reset behavior on Arduino-generated binaries you will need to set USE_SINGLE_RESET to 1, and also modify:

#define SINGLE_RESET() (*((uint32_t *)0x20B4) == 0x87eeb07c)

to

#define SINGLE_RESET() 1

Let me know if it didn't work!

@mmoskal mmoskal closed this as completed Mar 20, 2018
@brendanvanbreda
Copy link
Contributor Author

Awesome thanx @mmoskal worked as expected.

@TamojitSaha
Copy link

Is it possible to have a key combination to enter into bootloader mode?

@mmoskal
Copy link
Member

mmoskal commented Jan 4, 2019

You could probably quite easily modify the bootloader to support that - just configure the pin as input with a pull up (or pulldown, depending on how your button is wired) and return at the beginning of check_start_application() when your button is pressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants