-
Notifications
You must be signed in to change notification settings - Fork 472
Add dualstack softdevice support #151
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
base: master
Are you sure you want to change the base?
Changes from all commits
28c4b3f
c9dab78
82fbf55
57c4848
7b597a7
0c95fd1
ab66710
f14592e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ For other boards, please check the board definition for details. | |
|
||
### Making your own UF2 | ||
|
||
To create your own UF2 DFU update image, simply use the [Python conversion script](https://github.com/Microsoft/uf2/blob/master/utils/uf2conv.py) on a .bin file or .hex file, specifying the family as **0xADA52840**. If using a .bin file with the conversion script you must specify application address with the -b switch, this address depend on the SoftDevice size/version e.g S140 v6 is 0x26000 | ||
To create your own UF2 DFU update image, simply use the [Python conversion script](https://github.com/Microsoft/uf2/blob/master/utils/uf2conv.py) on a .bin file or .hex file, specifying the family as **0xADA52840**. If using a .bin file with the conversion script you must specify application address with the -b switch, this address depend on the SoftDevice size/version e.g S140 v6 is 0x26000 | ||
|
||
To create a UF2 image from a .bin file: | ||
``` | ||
|
@@ -111,25 +111,25 @@ Prerequisites | |
To build: | ||
|
||
``` | ||
make BOARD=feather_nrf52840_express all | ||
make BOARD=feather_nrf52840_express SD=s140 all | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove those
|
||
``` | ||
|
||
To flash the bootloader with JLink: | ||
|
||
``` | ||
make BOARD=feather_nrf52840_express flash | ||
make BOARD=feather_nrf52840_express SD=s140 flash | ||
``` | ||
|
||
To upgrade the bootloader using DFU Serial via port /dev/ttyACM0 | ||
|
||
``` | ||
make BOARD=feather_nrf52840_express SERIAL=/dev/ttyACM0 dfu-flash | ||
make BOARD=feather_nrf52840_express SERIAL=/dev/ttyACM0 SD=s140 dfu-flash | ||
``` | ||
|
||
To flash SoftDevice (and chip erase): | ||
|
||
``` | ||
make BOARD=feather_nrf52840_express sd | ||
make BOARD=feather_nrf52840_express SD=s140 sd | ||
``` | ||
|
||
For the list of supported boards, run `make` without `BOARD=` : | ||
|
@@ -141,14 +141,34 @@ Supported boards are: feather_nrf52840_express feather_nrf52840_express pca10056 | |
Makefile:90: *** BOARD not defined. Stop | ||
``` | ||
|
||
The supported protocols are currently BLE and BOTH (ANT + BLE). | ||
|
||
### Building with an ANT softdevice | ||
|
||
Currently, the bootloader can be built against the dualstack softdevice headers for | ||
use of both ANT and BLE simultaneously. To do this: | ||
|
||
1. Download either s332 or s340 from thisisant.com. Note that this softdevice is | ||
freely available for evaluation use only. Garmin Canada must be contacted to obtain | ||
ANT licenses for commercial use. | ||
2. Place the contents of the softdevice package in the appropriate lib/softdevice folder. | ||
3. Rename the API folder to <SD name>_nrf52_6.1.1_API. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you tell me what is the default name of the s332 and s340 name, I would prefer to have the makefile to use their default name from the extracted instead. |
||
4. Rename the softdevice hex to <SD name>_nrf52_6.1.1_softdevice.hex. | ||
5. When building make sure to set SD=s340 or SD=s332 | ||
|
||
All bootloader features available in the single-stack BLE softdevice are also available in the | ||
dualstack softdevice, including OTA-DFU updates using BLE. | ||
|
||
Note that single stack ANT softdevices are not currently supported (s2xx series softdevices). | ||
|
||
### Common makefile problems | ||
|
||
#### 1. `arm-none-eabi-gcc`: No such file or directory | ||
|
||
If you get the following error ... | ||
|
||
``` | ||
$ make BOARD=feather_nrf52840_express all | ||
$ make BOARD=feather_nrf52840_express all | ||
Compiling file: main.c | ||
/bin/sh: /usr/bin/arm-none-eabi-gcc: No such file or directory | ||
make: *** [_build/main.o] Error 127 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Obtain the 6.1.1 s332 softdevice from thisisant.com and place the API folder and softdevice hex here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Obtain the 6.1.1 s340 softdevice from thisisant.com and place the API folder and softdevice hex here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,7 +155,7 @@ void softdev_mbr_init(void) | |
//--------------------------------------------------------------------+ | ||
int main(void) | ||
{ | ||
PRINTF("Bootlaoder Start\r\n"); | ||
PRINTF("Bootloader Start\r\n"); | ||
|
||
// Populate Boot Address and MBR Param into MBR if not already | ||
// MBR_BOOTLOADER_ADDR/MBR_PARAM_PAGE_ADDR are used if available, else UICR registers are used | ||
|
@@ -328,7 +328,13 @@ static uint32_t softdev_init(bool init_softdevice) | |
.accuracy = NRF_CLOCK_LF_ACCURACY_250_PPM | ||
}; | ||
|
||
#ifdef BLE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like to have an extra macro for this, please use the ANT_LICENSE_KEY for this as well. These macro should be removed from the makefile as well.
|
||
APP_ERROR_CHECK( sd_softdevice_enable(&clock_cfg, app_error_fault_handler) ); | ||
#elif defined(BOTH) | ||
APP_ERROR_CHECK( sd_softdevice_enable(&clock_cfg, app_error_fault_handler, ANT_LICENSE_KEY ) ); | ||
hathach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#else | ||
#error "No valid protocol was selected" | ||
#endif // BLE | ||
sd_nvic_EnableIRQ(SD_EVT_IRQn); | ||
|
||
/*------------- Configure BLE params -------------*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many duplication here, this should be checked before the whole if, and SD should get the default only to S132/S140 only. Then the ifeq() sequence take care of all the CFLAGS.