remove combinehex and erase target
update Readme
This commit is contained in:
parent
1db3ffe968
commit
f097cae0cd
10
Makefile
10
Makefile
@ -305,7 +305,7 @@ $(info ASFLAGS $(ASFLAGS))
|
|||||||
$(info )
|
$(info )
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: all clean flash dfu-flash sd erase gdbflash gdb
|
.PHONY: all clean flash dfu-flash sd gdbflash gdb
|
||||||
|
|
||||||
# default target to build
|
# default target to build
|
||||||
all: $(BUILD)/$(OUT_FILE)-nosd.out $(BUILD)/$(MERGED_FILE).hex
|
all: $(BUILD)/$(OUT_FILE)-nosd.out $(BUILD)/$(MERGED_FILE).hex
|
||||||
@ -332,10 +332,6 @@ sd:
|
|||||||
@echo Flashing: $(SD_HEX)
|
@echo Flashing: $(SD_HEX)
|
||||||
$(NRFJPROG) --program $(SD_HEX) -f nrf52 --chiperase --reset
|
$(NRFJPROG) --program $(SD_HEX) -f nrf52 --chiperase --reset
|
||||||
|
|
||||||
erase:
|
|
||||||
@echo Erasing chip
|
|
||||||
$(NRFJPROG) --eraseall -f nrf52
|
|
||||||
|
|
||||||
gdbflash: $(BUILD)/$(MERGED_FILE).hex
|
gdbflash: $(BUILD)/$(MERGED_FILE).hex
|
||||||
@echo Flashing: $<
|
@echo Flashing: $<
|
||||||
@$(GDB_BMP) -nx --batch -ex 'load $<' -ex 'compare-sections' -ex 'kill'
|
@$(GDB_BMP) -nx --batch -ex 'load $<' -ex 'compare-sections' -ex 'kill'
|
||||||
@ -369,7 +365,7 @@ $(BUILD)/$(OUT_FILE)-nosd.out: $(BUILD) $(OBJECTS)
|
|||||||
@$(SIZE) $@
|
@$(SIZE) $@
|
||||||
|
|
||||||
#------------------- Binary generator -------------------
|
#------------------- Binary generator -------------------
|
||||||
.PHONY: genhex genpkg combinehex
|
.PHONY: genhex genpkg
|
||||||
|
|
||||||
## Create binary .hex file from the .out file
|
## Create binary .hex file from the .out file
|
||||||
genhex: $(BUILD)/$(OUT_FILE)-nosd.hex
|
genhex: $(BUILD)/$(OUT_FILE)-nosd.hex
|
||||||
@ -379,8 +375,6 @@ $(BUILD)/$(OUT_FILE)-nosd.hex: $(BUILD)/$(OUT_FILE)-nosd.out
|
|||||||
@$(OBJCOPY) -O ihex $< $@
|
@$(OBJCOPY) -O ihex $< $@
|
||||||
|
|
||||||
# merge bootloader and sd hex together
|
# merge bootloader and sd hex together
|
||||||
combinehex: $(BUILD)/$(MERGED_FILE).hex
|
|
||||||
|
|
||||||
$(BUILD)/$(MERGED_FILE).hex: $(BUILD)/$(OUT_FILE)-nosd.hex
|
$(BUILD)/$(MERGED_FILE).hex: $(BUILD)/$(OUT_FILE)-nosd.hex
|
||||||
@echo CR $(MERGED_FILE).hex
|
@echo CR $(MERGED_FILE).hex
|
||||||
@mergehex -q -m $< $(SD_HEX) -o $@
|
@mergehex -q -m $< $(SD_HEX) -o $@
|
||||||
|
35
README.md
35
README.md
@ -107,8 +107,6 @@ both bootloader and the Nordic SoftDevice, you can freely upgrade/downgrade to a
|
|||||||
You should only continue if you are looking to develop bootloader for your own.
|
You should only continue if you are looking to develop bootloader for your own.
|
||||||
You must have have a J-Link available to "unbrick" your device.
|
You must have have a J-Link available to "unbrick" your device.
|
||||||
|
|
||||||
### Option 1: Build with Makefile
|
|
||||||
|
|
||||||
Prerequisites
|
Prerequisites
|
||||||
|
|
||||||
- ARM GCC
|
- ARM GCC
|
||||||
@ -117,7 +115,7 @@ Prerequisites
|
|||||||
To build:
|
To build:
|
||||||
|
|
||||||
```
|
```
|
||||||
make BOARD=feather_nrf52840_express all combinehex
|
make BOARD=feather_nrf52840_express all
|
||||||
```
|
```
|
||||||
|
|
||||||
To flash the bootloader with JLink:
|
To flash the bootloader with JLink:
|
||||||
@ -138,12 +136,6 @@ To flash SoftDevice (and chip erase):
|
|||||||
make BOARD=feather_nrf52840_express sd
|
make BOARD=feather_nrf52840_express sd
|
||||||
```
|
```
|
||||||
|
|
||||||
To erase all of flash:
|
|
||||||
|
|
||||||
```
|
|
||||||
make BOARD=feather_nrf52840_express erase
|
|
||||||
```
|
|
||||||
|
|
||||||
For the list of supported boards, run `make` without `BOARD=` :
|
For the list of supported boards, run `make` without `BOARD=` :
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -167,13 +159,11 @@ make: *** [_build/main.o] Error 127
|
|||||||
```
|
```
|
||||||
|
|
||||||
... you may need to pass the location of the GCC ARM toolchain binaries to `make` using
|
... you may need to pass the location of the GCC ARM toolchain binaries to `make` using
|
||||||
the variable `GNU_INSTALL_ROOT` as below:
|
the variable `CROSS_COMPILE` as below:
|
||||||
```
|
```
|
||||||
$ make GNU_INSTALL_ROOT=/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/ BOARD=feather_nrf52832 all
|
$ make CROSS_COMPILE=/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi- BOARD=feather_nrf52832 all
|
||||||
```
|
```
|
||||||
|
|
||||||
_Please note that the path needs a trailing path separator (a `/`)_
|
|
||||||
|
|
||||||
#### 2. `mergehex: No such file or directory`
|
#### 2. `mergehex: No such file or directory`
|
||||||
|
|
||||||
Make sure that `mergehex` is available from the command-line. This binary is
|
Make sure that `mergehex` is available from the command-line. This binary is
|
||||||
@ -184,22 +174,3 @@ part of Nordic's nRF5x Command Line Tools.
|
|||||||
Make sure that `nrfjprog` is available from the command-line. This binary is
|
Make sure that `nrfjprog` is available from the command-line. This binary is
|
||||||
part of Nordic's nRF5x Command Line Tools.
|
part 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:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ export PATH=$PATH:/location/of/nRF5x-Command-Line-Tools_9_7_2_OSX/nrfjprog
|
|
||||||
```
|
|
||||||
|
|
||||||
### Option 2: Build using Segger Embedded Studio
|
|
||||||
|
|
||||||
For easier debugging you can also use [SES](https://www.segger.com/products/development-tools/embedded-studio/).
|
|
||||||
The project file is located at `src/segger/Adafruit_nRF52_Bootloader.emProject`.
|
|
||||||
|
|
||||||
> **Note**: SES only flashes the bootloader when you click download, not the SoftDevice.
|
|
||||||
You need to flash the SoftDevice beforehand if you haven't already done so.
|
|
||||||
As mentioned above do something like:
|
|
||||||
|
|
||||||
```
|
|
||||||
make BOARD=feather_nrf52840_express sd
|
|
||||||
```
|
|
||||||
|
@ -34,7 +34,7 @@ for board in all_boards:
|
|||||||
os.makedirs(bin_directory, exist_ok=True)
|
os.makedirs(bin_directory, exist_ok=True)
|
||||||
|
|
||||||
start_time = time.monotonic()
|
start_time = time.monotonic()
|
||||||
make_result = subprocess.run("make -j 4 BOARD={} combinehex genpkg".format(board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
make_result = subprocess.run("make -j 4 BOARD={} all genpkg".format(board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
build_duration = time.monotonic() - start_time
|
build_duration = time.monotonic() - start_time
|
||||||
|
|
||||||
flash_size = "-"
|
flash_size = "-"
|
||||||
|
Loading…
Reference in New Issue
Block a user