update readme

This commit is contained in:
hathach 2018-08-07 21:21:12 +07:00
parent c1baf25c69
commit bcd3431d26
3 changed files with 56 additions and 23 deletions

View File

@ -86,8 +86,7 @@ remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-ou
#*********************************
ifeq ($(BOARD),)
$(info You must provide a BOARD parameter with 'BOARD=')
$(info Possible values are:)
$(info $(sort $(subst .h,,$(subst src/boards/,,$(wildcard src/boards/*)))))
$(info Supported boards are: $(sort $(subst .h,,$(subst src/boards/,,$(wildcard src/boards/*)))))
$(error BOARD not defined)
else
ifeq ($(wildcard src/boards/$(BOARD).h),)

View File

@ -1,25 +1,61 @@
# Adafruit nRF52840 Bootloader
# Adafruit Bluefruit nRF52 Bootloader
This repository contains the USB bootloader for Adafruit nRF52840 boards (1MB
flash, 256KB SRAM). This repository depend on [tinyusb](https://github.com/hathach/tinyusb/tree/develop) as submodule. After
cloning this repo you need to run the following command:
This repository contains the bootloader for Adafruit nRF52 series board
- [Bluefruit Feather nRF52832](https://www.adafruit.com/product/3406)
- Bluefruit Feather nRF52840
## Features
### nRF52832
- DFU over Serial and OTA ( Application, Bootloader+SD )
- DFU auto start to work with Arduino DTR auto-reset
### nRF52840
- DFU over USB CDC and OTA ( Application, Bootloader+SD )
- DFU using USB Flashing Format a.k.a [UF2](https://github.com/Microsoft/uf2) (Applicatoin only)
## Compile
This repository depend on following submodule
- [tinyusb](https://github.com/hathach/tinyusb/tree/develop)
- [nrfx](https://github.com/NordicSemiconductor/nrfx)
Get the code with following command:
git clone <URL>.git Adafruit_nRF52_Bootloader
cd Adafruit_nRF52_Bootloader
git submodule update --init
## Option 1: Build with makefile
### Option 1: Build with makefile
Navigate to `src/singlebank` (recommended) or `src/dualbank` (work in progress),
and use feather52840 target for building bootloader.
Prerequisite
make feather52840
- ARM GCC
- Nordic's [nRF5x Command Line Tools](http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.tools%2Fdita%2Ftools%2Fnrf5x_command_line_tools%2Fnrf5x_installation.html)
To flash bootloader + S140
To build
make flash_feather52840
$ make BOARD=feather52840 all
To only flash S140
To flash bootloader
make flash_sd
$ make BOARD=feather52840 flash
To flash SoftDevice (with full chip erase)
$ make BOARD=feather52840 sd
For the list of supported boards, try to type make without `BOARD=`
$ make
You must provide a BOARD parameter with 'BOARD='
Supported boards are: feather52832 feather52840 pca10056
Makefile:90: *** BOARD not defined. Stop
### Common makefile problems
@ -27,24 +63,22 @@ To only flash S140
If you get the following error ...
$ make feather52840
Compiling file: dfu_single_bank.c
$ make BOARD=feather52840 all
Compiling file: main.c
/bin/sh: /usr/bin/arm-none-eabi-gcc: No such file or directory
make: *** [_build/dfu_single_bank.o] Error 127
make: *** [_build/main.o] Error 127
... you may need to edit the `Makefile` (for example `src/singlebank/Makefile`),
and update the `GNU_INSTALL_ROOT` to point to the root path of your GCC ARM
toolchain.
... you may need to edit the `Makefile` and update the `GNU_INSTALL_ROOT` to point to the root path of your GCC ARM toolchain.
#### 2. `mergehex: No such file or directory`
Make sure that `mergehex` is available from the command-line. This binary is
part of of Nordic's [nRF5x Command Line Tools](http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.tools%2Fdita%2Ftools%2Fnrf5x_command_line_tools%2Fnrf5x_installation.html).
part of of Nordic's nRF5x Command Line Tools
#### 3. `make: nrfjprog: No such file or directory`
Make sure that `nrfjprog` is available from the command-line. This binary is
part of of Nordic's [nRF5x Command Line Tools](http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.tools%2Fdita%2Ftools%2Fnrf5x_command_line_tools%2Fnrf5x_installation.html).
part of of Nordic's nRF5x Command Line Tools.
On POSIX-type systems you can temporarily add the path to `nrfjprog` via a
variation on the following command:

View File

@ -18,7 +18,7 @@
arm_target_debug_interface_type="ADIv5"
arm_target_device_name="nRF52840_xxAA"
arm_target_interface_type="SWD"
c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;BOARD_PCA10056;BOOTLOADER_VERSION=0x06000001;MK_DIS_FIRMWARE=&quot;S140 6.0.0, 6.0.0&quot;;S140;CONFIG_GPIO_AS_PINRESET;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD"
c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;BOARD_PCA10056;MK_BOOTLOADER_VERSION=0x06000001;MK_DIS_FIRMWARE=&quot;S140 6.0.0, 6.0.0&quot;;S140;CONFIG_GPIO_AS_PINRESET;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD"
c_user_include_directories="../;../usb;$(TusbDir);$(SdDir)/s140/headers;$(SdDir)/s140/headers/nrf52;$(Sdk11Dir)/drivers_nrf/pstorage;$(Sdk11Dir)/ble/common/;$(Sdk11Dir)/ble/ble_services/ble_dfu;$(Sdk11Dir)/ble/ble_services/ble_dis;$(Sdk11Dir)/libraries/bootloader_dfu;$(Sdk11Dir)/libraries/bootloader_dfu/hci_transport;$(Sdk11Dir)/libraries/util;$(SdkDir)/toolchain/cmsis/include;$(SdkDir)/device;$(SdkDir)/toolchain;$(SdkDir)/drivers_nrf/hal;$(SdkDir)/drivers_nrf/systick;$(SdkDir)/drivers_nrf/uart;$(SdkDir)/drivers_nrf/usbd;$(SdkDir)/drivers_nrf/common;$(SdkDir)/drivers_nrf/delay;$(SdkDir)/drivers_nrf/power;$(SdkDir)/drivers_nrf/clock;$(SdkDir)/libraries/util;$(SdkDir)/libraries/timer;$(SdkDir)/libraries/scheduler;$(SdkDir)/libraries/crc16;$(SdkDir)/libraries/util;$(SdkDir)/libraries/hci/config;$(SdkDir)/libraries/uart;$(SdkDir)/libraries/hci;$(SdkDir)/external/fprintf;$(SdkDir)/libraries/strerror;$(SdkDir)/libraries/atomic;$(SdkDir)/libraries/balloc;$(SdkDir)/libraries/experimental_log/src;$(SdkDir)/libraries/experimental_log;$(SdkDir)/libraries/experimental_section_vars;$(SdkDir)/libraries/experimental_memobj"
debug_register_definition_file="$(ProjectDir)/nrf52840_Registers.xml"
debug_target_connection="J-Link"