Using Adafruit’s Bluefruit nRF52 Feather bootloader on a cheap chinese board.

I have one of these E73-TBB Test Board for an nRF52832 module. The board is only U$S10 and Ebay was handing out U$S5 off coupons, so it ended costing me the same as the bare bluetooth module. The board comes with a USB-to-serial converter, a couple of leds and a couple of switches, nothing too fancy. I don’t have a programmer for this board but I bought it anyways thinking that it could be possible to use with the Arduino environment.

E73 TBB Board with main components highlighted

The module itself is a E73-2G4M04S1B (for which there is a manual available) but there isn’t much information about the board. As a first step I had to figure it out how everything is connected, from that I got this schematic:

E73-TBB Test Board For nRF52832 schematic

The layout is quite similar to other boards like SparkFun’s nRF52832 Breakout or Adafruit’s Bluefruit nRF52 Feather. There is even a board whit the same module with the leds, switches and UART wired as a Bluefruit nRF52, this allows them to use Adafruit’s bootloader without any modifications. What I’m lacking is a switch on the reset line but that is not such a big isuue.

I started with Sparkfun bootloader whitout much luck, not sure what the problem was, and then with Adafruit’s bootloader. Thankfully the people at Adafruit have make it really easy to use it and modify it with a superb documentation.

E73 board coneected to a J-Link EDU through an adapter board we made at work.

The only files I had to modify is the Makefile (just to correct path to some tools) and the board.h file for the nrf52832 feather. In this last file you’ll find the definition of the pins used for the leds, switches and UART. So, It was just a matter of changing the values to match the wiring on my board.

Original and modified

Now, I can’t say the rest of the process went smoothly. I could flash the bootloader in the board (using a J-Link from work 😉 ) but the Arduino software didn’t recognize it whenever I tried to flash something on it.

I was trying different things until I found a sequence of events that make it work. You have the possibility to update the bootloader in Adafruit’s board in Arduino using a J-Link.

I tried that and worked great , but now I had the wrong bootloader in the board. I immediately flash the modified bootloader directly with the J-link

And that somehow made the trick. Not sure why this is, if somebody have any idea please comment.

Blinkyyy!!!!

Now I have a board “Bluefruit nRF52 Feather compatible”. To enter bootloader mode I’m currentely shorting the RST pin to GND with a cable while holding the DFU button. There are a couple of modifications that I migth make in the future to make things easier:

  • I’m using one of the buttons as DFU and the other one as FRST. This last one isn’t used that much, you don’t even have a dedicated button in the Bluefruit nRF52 Feather, so I might modify the PCB in order to use it as a RST button.
  • The Bluefruit nRF52 Feather also has the DTR line from the USB-to-serial converter wired thorugh a capacitor to the RST line, this way you can normally enter bootloader mode and flash new firmware whit out haveing to press buttons.

UPDATE 1

As massimiliano mentioned on the messages section there is a mistake in the image showing both board.h files, it should be 13 and 14 instead of 28 and 29 in the switch pins definitions.

UPDATE 2

I lost the files and repo so I repeated the process again. This time (as I mentioned to Norbert on the messages section) I used nRF Connect Programmer. Here is the updated bootloader, I interchanged the definitions for the pins, now SW1 is DFU, press it while connecting RST to ground and the device will enter bootloader mode (LED 1 with a slow “breath” pattern)

 

8 thoughts on “Using Adafruit’s Bluefruit nRF52 Feather bootloader on a cheap chinese board.

  1. Thank you for your beautiful and interesting article. I want to flash this bootloader on my E73 TBB. Unfortunately I can not understad why you put the number 28 and 29 for BUTTON_1 and BUTTON_2. From the schematic button 1 is on pin P0.14 and button2 on pin P0.13. Should you have put the number 14 and 13 instead ? I’ve no idea on the correspondance from P0 pin and these numbers. Can you help me ? Can I have a precompiled hex file to test ?
    Thank you !!

    • Hi there!
      You are right. All the coding was done in Ubuntu, all the blogging in Windows. I made the captures from memory and obviously wrong… I’ll update the post, in the meantime here is the file

  2. I just got my bare ebyte module, and I found that these modules came with flash protection enabled. I had to remove them, following these instructions: https://medium.com/@ly.lee/coding-nrf52-with-rust-and-apache-mynewt-on-visual-studio-code-9521bcba6004#1285

    I’m guessing that with flashing the Adafruit Bootloader via the jlink, it removed the flash protection (in order to write itself) and then left the flash protection off, thus allowing you to flash your modified bootloader.

  3. Can not find the Makefile and board.h in my arduino 1.8.13. What is exactly ‘different things until I found a sequence of events’ ? Can I also use ST-Link V2 instead ? But Congratulations for your success.

    • Hi!
      Can’t quite remember, was a while back. Those file I mentioned I had to edit are in Adafruit’s repository. The ST-link v2 should work, I use it with PlatformIO in Visual Studio.

  4. Hi I know this is a bit outdated, but still. As far I understand this it should work if I burn your bootloader hex file with j-link then burn arduino bootloader and than again your bootloader. I tried it in these sequence with DFU button pressed while reset and it does not upload. I am quite fresh with these things so I apologize if I missed something obvious.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s