commit
6dd4003da3
28
Makefile
28
Makefile
@ -48,7 +48,7 @@ NRFUTIL = adafruit-nrfutil
|
||||
ifneq ($(JLINK),)
|
||||
NRFJPROG = nrfjprog -s $(JLINK)
|
||||
else
|
||||
NRFJPROG = nrfjprog
|
||||
NRFJPROG = nrfjprog
|
||||
endif
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@ -62,7 +62,7 @@ MK := mkdir
|
||||
RM := rm -rf
|
||||
|
||||
ifeq ("$(V)","2")
|
||||
QUIET :=
|
||||
QUIET :=
|
||||
else
|
||||
QUIET := @
|
||||
endif
|
||||
@ -87,7 +87,7 @@ remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-ou
|
||||
#*********************************
|
||||
BOARD_LIST = $(sort $(subst .h,,$(subst src/boards/,,$(wildcard src/boards/*.h))))
|
||||
|
||||
NRF52840_BOARDLIST = pca10056 feather_nrf52840_express
|
||||
NRF52840_BOARDLIST = pca10056 pca10059 feather_nrf52840_express
|
||||
IS_NRF52840 = $(filter $(BOARD),$(NRF52840_BOARDLIST))
|
||||
|
||||
ifeq ($(filter $(MAKECMDGOALS),all-board all-release),)
|
||||
@ -250,7 +250,7 @@ CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
|
||||
# keep every function in separate section. This will allow linker to dump unused functions
|
||||
CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
|
||||
CFLAGS += -fno-builtin --short-enums
|
||||
CFLAGS += -fno-builtin --short-enums
|
||||
|
||||
# Defined Symbol (MACROS)
|
||||
CFLAGS += -DMK_BOOTLOADER_VERSION=0x0$(SD_VER1)0$(SD_VER2)0$(SD_VER3)0$(SD_VER4)UL
|
||||
@ -383,10 +383,10 @@ ifeq ($(VERSION),)
|
||||
flash: $(BUILD)/$(OUTPUT_FILENAME).hex
|
||||
@echo Flashing: $<
|
||||
$(NRFJPROG) --program $< --sectoranduicrerase -f nrf52 --reset
|
||||
|
||||
|
||||
dfu-flash: $(BUILD)/$(MERGED_FNAME).zip
|
||||
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
|
||||
$(NRFUTIL) --verbose dfu serial --package $< -p $(SERIAL) -b 115200 --singlebank
|
||||
$(NRFUTIL) --verbose dfu serial --package $< -p $(SERIAL) -b 115200 --singlebank
|
||||
|
||||
else
|
||||
|
||||
@ -400,16 +400,16 @@ endif
|
||||
flash:
|
||||
@echo Flashing: $(VERSION_FPATH).hex
|
||||
$(NRFJPROG) --program $(VERSION_FPATH).hex --chiperase -f nrf52 --reset
|
||||
|
||||
|
||||
dfu-flash:
|
||||
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
|
||||
$(NRFUTIL) --verbose dfu serial --package $(VERSION_FPATH).zip -p $(SERIAL) -b 115200 --singlebank
|
||||
|
||||
$(NRFUTIL) --verbose dfu serial --package $(VERSION_FPATH).zip -p $(SERIAL) -b 115200 --singlebank
|
||||
|
||||
endif
|
||||
|
||||
|
||||
sd:
|
||||
@echo Flashing: $(SD_HEX)
|
||||
$(NRFJPROG) --program $(SD_HEX) -f nrf52 --chiperase --reset
|
||||
$(NRFJPROG) --program $(SD_HEX) -f nrf52 --chiperase --reset
|
||||
|
||||
erase:
|
||||
@echo Erasing chip
|
||||
@ -423,7 +423,7 @@ $(BUILD):
|
||||
|
||||
clean:
|
||||
@$(RM) $(BUILD)
|
||||
|
||||
|
||||
# Create objects from C SRC files
|
||||
$(BUILD)/%.o: %.c
|
||||
@echo CC $(notdir $<)
|
||||
@ -433,7 +433,7 @@ $(BUILD)/%.o: %.c
|
||||
$(BUILD)/%.o: %.S
|
||||
@echo AS $(notdir $<)
|
||||
$(QUIET)$(CC) $(ASMFLAGS) $(INC_PATHS) -c -o $@ $<
|
||||
|
||||
|
||||
# Link
|
||||
$(BUILD)/$(OUTPUT_FILENAME).out: $(BUILD) $(OBJECTS)
|
||||
@echo LD $(OUTPUT_FILENAME).out
|
||||
@ -467,7 +467,7 @@ $(BUILD)/$(MERGED_FNAME).hex: $(BUILD)/$(OUTPUT_FILENAME).hex
|
||||
genpkg: $(BUILD)/$(MERGED_FNAME).zip
|
||||
|
||||
$(BUILD)/$(MERGED_FNAME).zip: $(BUILD)/$(OUTPUT_FILENAME).hex
|
||||
@$(NRFUTIL) dfu genpkg --dev-type 0x0052 --dev-revision $(DFU_DEV_REV) --bootloader $< --softdevice $(SD_HEX) $@
|
||||
@$(NRFUTIL) dfu genpkg --dev-type 0x0052 --dev-revision $(DFU_DEV_REV) --bootloader $< --softdevice $(SD_HEX) $@
|
||||
|
||||
# Create SD+bootloader combo with hex & dfu package at release folder
|
||||
release: combinehex genpkg
|
||||
|
10
README.md
10
README.md
@ -5,6 +5,7 @@ This is a CDC/DFU/UF2 bootloader for Adafruit nRF52 boards and Nordic developmen
|
||||
- [Adafruit Feather nRF52832](https://www.adafruit.com/product/3406)
|
||||
- Adafruit Feather nRF52840 Express
|
||||
- Nordic nRF52840DK PCA10056
|
||||
- Nordic nRF52840DK PCA10059 ("Dongle")
|
||||
|
||||
UF2 is an easy-to-use bootloader that appears as a flash drive. You can just copy `.uf2`-format
|
||||
application images to the flash drive to load new firmware.
|
||||
@ -57,7 +58,11 @@ There are two pins, `DFU` and `FRST` that bootloader will check upon reset/power
|
||||
|
||||
On the Nordic PCA10056 DK board, `DFU` is connected to **Button1**, and `FRST` is connected to **Button2**.
|
||||
So holding down **Button1** while clicking **RESET** will put the board into USB bootloader mode, with UF2 and CDC support.
|
||||
Holding down **Button2** while clicking **RESE**T will put the board into OTA (over-the-air) bootloader mode.
|
||||
Holding down **Button2** while clicking **RESET** will put the board into OTA (over-the-air) bootloader mode.
|
||||
|
||||
On the Nordic PCA10059 Dongle board, `DFU` is connected to the white button.
|
||||
`FRST` is connected to pin 1.10. Ground it to pull `FRST` low, as if you had pushed an `FRST` button.
|
||||
There is an adjacent ground pad.
|
||||
|
||||
For other boards, please check the board definition for details.
|
||||
|
||||
@ -92,6 +97,9 @@ bin/feather_nrf52840_express
|
||||
|
||||
bin/pca10056:
|
||||
6.1.0r0
|
||||
|
||||
bin/pca10059:
|
||||
6.1.0r0
|
||||
```
|
||||
|
||||
|
||||
|
1783
bin/pca10059/6.1.0r0/pca10059_bootloader_s140_6.1.0r0.hex
Normal file
1783
bin/pca10059/6.1.0r0/pca10059_bootloader_s140_6.1.0r0.hex
Normal file
File diff suppressed because it is too large
Load Diff
BIN
bin/pca10059/6.1.0r0/pca10059_bootloader_s140_6.1.0r0.zip
Normal file
BIN
bin/pca10059/6.1.0r0/pca10059_bootloader_s140_6.1.0r0.zip
Normal file
Binary file not shown.
@ -22,6 +22,8 @@
|
||||
#include "boards/feather_nrf52832.h"
|
||||
#elif defined BOARD_PCA10056
|
||||
#include "boards/pca10056.h"
|
||||
#elif defined BOARD_PCA10059
|
||||
#include "boards/pca10059.h"
|
||||
#else
|
||||
#error No boards defined
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@file feather52.h
|
||||
@file feather_nrf52832.h
|
||||
@author hathach
|
||||
|
||||
@section LICENSE
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@file feather52.h
|
||||
@file feather_nrf52840_express.h
|
||||
@author hathach
|
||||
|
||||
@section LICENSE
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@file metro52.h
|
||||
@file pca10056.h
|
||||
@author hathach
|
||||
|
||||
@section LICENSE
|
||||
|
72
src/boards/pca10059.h
Normal file
72
src/boards/pca10059.h
Normal file
@ -0,0 +1,72 @@
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@file pca10059.h
|
||||
@author hathach
|
||||
|
||||
@section LICENSE
|
||||
|
||||
Software License Agreement (BSD License)
|
||||
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef PCA10059_H
|
||||
#define PCA10059_H
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* LED
|
||||
*------------------------------------------------------------------*/
|
||||
#define LEDS_NUMBER 2
|
||||
// LED_RED
|
||||
#define LED_1 6
|
||||
// LED_BLUE
|
||||
#define LED_2 12
|
||||
#define LED_STATE_ON 0
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* BUTTON
|
||||
*------------------------------------------------------------------*/
|
||||
#define BUTTONS_NUMBER 2
|
||||
|
||||
#define BUTTON_1 (1 << 5 | 6)
|
||||
#define BUTTON_2 (1 << 5 | 10)
|
||||
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* UART
|
||||
*------------------------------------------------------------------*/
|
||||
#define RX_PIN_NUMBER 20
|
||||
#define TX_PIN_NUMBER 17
|
||||
#define CTS_PIN_NUMBER 15
|
||||
#define RTS_PIN_NUMBER 13
|
||||
#define HWFC false
|
||||
|
||||
// Used as model string in OTA mode
|
||||
#define DIS_MANUFACTURER "Nordic"
|
||||
#define DIS_MODEL "PCA10059"
|
||||
|
||||
#endif // PCA10059_H
|
Loading…
Reference in New Issue
Block a user