adafruit / Adafruit_nRF52_Bootloader

USB-enabled bootloaders for the nRF52 BLE SoC chips
MIT License
461 stars 415 forks source link

Add support for SparkFun Pro nRF52840 Mini #62

Closed charlesportwoodii closed 4 years ago

charlesportwoodii commented 5 years ago

Adds support for the SparkFun Pro nRF52840 Mini.

SparkFun's documentation says this chip uses a bootloader "heavily based upon" this one. I wasn't able to find the actual bootloader hex they used or the changes they made though, so after spending around a week trying to fix a bad flash from the factory I wanted see if we could get this "officially" supported.

I've tried to keep the setup in-line with what SparkFun has in their documentation.

The board has only a single blue LED and primarily can be reset via the double-reset trigger. SparkFun's documentation also states that you can reset it via PIN13 + RST and by grounding PIN 2. I've verified all 3 reset methods.

Please let me know if you'd like to see any changes before merging this in. Thanks!

tannewt commented 5 years ago

@jimblom worked on this for SparkFun I believe.

ladyada commented 5 years ago

tagging also @santised @edspark

judepereira commented 5 years ago

@charlesportwoodii I'm gonna give this a shot, since I need to build a boot loader for an S340 SoftDevice profile.

charlesportwoodii commented 5 years ago

@judepereira Ok. As an FYI if you need something that supports nordic secure bootloader I have a separate fork over at https://github.com/charlesportwoodii/kaidyth_nrf52_bootloader that handles that.

judepereira commented 5 years ago

Thanks, not looking for the secure boot right now.

judepereira commented 5 years ago

@charlesportwoodii quick one - going over the Makefile, looks like the SoftDevice can only be flashed via nrfjprog, for which I need the J-Link programmer?

judepereira commented 5 years ago

Is there no way to use the dfu to flash the SoftDevice hex as well? adafruit-nrfutil does have a --softdevice option. Is it possible to use that?

charlesportwoodii commented 5 years ago

The flashing instructions do not differ from the ones outlined in the project readme: https://github.com/adafruit/Adafruit_nRF52_Bootloader#how-to-compile-and-build

judepereira commented 5 years ago

Nevermind, I just found the targets in Makefile:

## Create pkg file for bootloader+SD combo to use with DFU
genpkg: $(BUILD)/$(MERGED_FNAME).zip
judepereira commented 5 years ago

Got it, trying it out.

judepereira commented 5 years ago

@charlesportwoodii Any chance you know how to derive the linker script for the S340?

cannot open linker script file src/linker/s340_v6.ld: No such file or directory

Diffing the linker scripts for S140 and S132, I see the following differences:

  1. RAM + FLASH values change - this is okay, I can assume sane enough values, since these are just safe offsets
  2. BOOTLOADER_SETTINGS
  3. MBR_PARAMS_PAGE

I'm not quite sure how to derive the values for 2 & 3. Any ideas?

charlesportwoodii commented 5 years ago

I don't, and this MR is probably the wrong place to open this discussion at.

This MR is to add support for Sparkfun Pro nRF52840 Mini. If you want to support ANT/s340 SD within the Adafruit bootloader I recommend you open a issue with the project maintainers to see if support for that can be added.

judepereira commented 5 years ago

@charlesportwoodii got it, will do.

judepereira commented 5 years ago

I can confirm that this works on the SparkFun nRF52840 board. Just flashed the s340 soft device, and the BSC (bicycle speed and cadence) example works.

hathach commented 4 years ago

closed due to lack of activities