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

Simplify buttons usage #121

Open
hathach opened this issue Apr 24, 2020 · 9 comments
Open

Simplify buttons usage #121

hathach opened this issue Apr 24, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@hathach
Copy link
Member

hathach commented Apr 24, 2020

Is your feature request related to a problem? Please describe.
Currently usage of bootloader is confusing and require 2 GPIOs which is quite a lot.

Describe the solution you'd like
FRST seems to be not needed since enter bootlaoder is easy enough, and user can just flash a known good firmware should their application corrupt. Therefore

  • 832: Button1 to enter bootloader, button2 to enter OTA. No more combination of both
  • 840: button to enter OTA. bootloader mode can be easily enter by double reset trick.

Describe alternatives you've considered
A better button-less for 840 is start both USB and OTA mode whenever enter bootloader. That would be optimal if we could that off.

@dhalbert @tannewt @PaintYourDragon for comments.

@hathach hathach added the enhancement New feature or request label Apr 24, 2020
@jpconstantineau
Copy link
Contributor

jpconstantineau commented Jul 27, 2020

For the 832 boards with no automatic reset circuitry and off-board serial, would it be possible to enable double-reset to enter DFU mode?
Perhaps as an optional define option to set in the board.h file. In previous releases, we could just press reset just in time when we were uploading to the board. However, recently, the success rate of catching the 1000ms DFU window is pretty small.

@hathach
Copy link
Member Author

hathach commented Jul 27, 2020

double reset is not possible with 832, Nordic did very hard job spending extra logic gates to make sure every bit of SRAM cleared upon reset.

@jpconstantineau
Copy link
Contributor

Humm. Do you mean that a pin reset clears the GPREGRET register? That would indeed be problematic.

Could we leverage the RESETREAS register and detect if the reset reason was from the reset pin being triggered?
Depending on the reason, we could use different timing between DFU mode on bootup and DFU mode on pin reset. Take for example, extend DFU_SERIAL_STARTUP_INTERVAL to 10 seconds on a pin reset and keep it short for other reasons. This would also allow to completely bypass DFU (or making it 10ms) on restart when waking up from sleep (making keyboards more responsive)

We may consider doing this as a non-feather/generic nrf52832 board so that it doesn't break the feathers of most people... (just in case I guess...)

@hathach
Copy link
Member Author

hathach commented Jul 28, 2020

Humm. Do you mean that a pin reset clears the GPREGRET register? That would indeed be problematic.

Yes?

For reset reason, you can try it out to see what fit your need. For more questions that is not related to the button usage, please post it in our forum support.

@jpconstantineau
Copy link
Contributor

jpconstantineau commented Jul 28, 2020 via email

@jpconstantineau
Copy link
Contributor

I just configured a new 832 board that doesn't have reset circuitry and having a button to enter DFU is very useful before flashing from the Arduino IDE. It's a simple as pressing "BUTTON_1", Pressing and releasing "Reset" followed by releasing "BUTTON_1". This leaves the nrf52832 chip in DFU mode and the Arduino IDE is happy to flash a new sketch.

(I might be stating the obvious but this highlights the importance of "BUTTON_1" for boards that don't have serial normally installed or that don't have the reset circuitry.)

@hathach
Copy link
Member Author

hathach commented May 30, 2021

832 will always have hold-button1 to DFU mode. Double reset is only possible with 840. Anyway, these should be configured via specific board header.

@tannewt
Copy link
Member

tannewt commented Aug 2, 2021

Double tap into USB + BLE would be awesome

@markbirss
Copy link
Contributor

@hathach

Is the "clear user firmware and remain in bootloader mode" function defined in

/* Pin below is in the bottom left of PCB, and can be shorted to GND

actually implemented and working ?

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

No branches or pull requests

4 participants