adafruit / Adafruit_nRF52_Bootloader

USB-enabled bootloaders for the nRF52 BLE SoC chips

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Entering on OTA for nRF52840 Express is not easily accessible

christophepersoz opened this issue · comments

Describe the bug
After reading the code and the readme.md, entering in OTA required DFU = LOW and FRST=LOW.
In/src/boards/feather_nRF52840_express/board.h there is this description,

/*------------------------------------------------------------------*/
/* BUTTON
 *------------------------------------------------------------------*/
#define BUTTONS_NUMBER        2
#define BUTTON_1              _PINNUM(1, 02)
#define BUTTON_2              _PINNUM(0, 10)
#define BUTTON_PULL           NRF_GPIO_PIN_PULLUP

this defined are then included into /src/board.h as follow,

#include "board.h"

#ifndef BUTTON_DFU
#define BUTTON_DFU      BUTTON_1
#endif

#ifndef BUTTON_FRESET
#define BUTTON_FRESET   BUTTON_2
#endif

But, BUTTON_2 have no button correspondance on the schematic found there : nRF52840 Schematic but it is linked to D2 / P(0.10) / NFC2 and find its place at the bottom-left of the board, under TX
Only BUTTON_1 match to _PINNUM(1,02) as SWITCH on schematic.

Set up (please complete the following information)

  • Board : Adafruit nRF52840 Express
  • Mac OS 10.14.6

To Reproduce

  1. Just try to enable OTA with BUTTON_1 and BUTTON_2, it won't work
  2. Need to connect D2 to GND, then keep pressed BUTTON_2 and a brief click on BUTTON_1 will reset the board and enter in OTA

Expected behavior
Have the OTA enabled as expected by pressing BUTTON_1 and BUTTON_2 or any other pattern on one of the two that will activate OTA in an easier way. Could that be when activate the UF2 mode too if that's possible? or change BUTTON_1 and BUTTON_2 as follow, and it will require to reset the board by unplugged it.

Additional context
To solve this, simply replace in /src/boards/feather_nRF52840_express/board.h

#define BUTTON_1              _PINNUM(1, 02)

by

#define BUTTON_1              _PINNUM(0, 18)

@christophepersoz We added triple reset to enter OTA on our fork if you want to take a look #91

Thanks a lot for your fork link @JoeBakalor, I'm gonna have a look at it!

Yeah, it is not so easy now requiring GND 2 pins. I will discuss with others to see what is the best way to enter OTA. However, to be honest I don't really like the triple reset method.

Agree too @hathach, for the moment I changed the bootloader to have the following sequence to enter OTA DFU, User BT down on power-up.
The best could be, this User Switch hold for a second after a RESET or a power-up cycle to enter in, but I haven’t explored this way yet.

There seems to be the same issue for the Adafruit nRF52840 Feather Sense.
For me even connecting D2 to ground won't work
I am currently powering through USB. Could this be the causing the problem?

@hathach What is actually wrong with christophepersoz suggestion

#define BUTTON_1 _PINNUM(0, 18)

Does it brake anything or why is it not fixed in this way?

I can confirm the process described by @christophepersoz as working.
I was on Bootloader 0.2.9 with the sense. After upgrading to 0.3.1 it was working ( also tested on 0.4.1).

I am currently focusing on other work. I will try to look at this later on when working back with bootloader later on.