Skip to content

Commit

Permalink
Independent flashing of openocd and bootloader (#229)
Browse files Browse the repository at this point in the history
* flashing srecs means bootloader isn't overwritten by opendps

* remove note on bootloader overwrite
  • Loading branch information
frederikvs authored Feb 14, 2021
1 parent ed4e00e commit d651514
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ make -C opendps flash
make -C dpsboot flash
```

*Please note that you currently MUST flash the bootloader last as OpenOCD overwrites the bootloader when flashing the firmware. Currently no idea why :-/ *

Check [the blog](https://johan.kanflo.com/upgrading-your-dps5005/) for instructions on how to unlock and flash your DPS5005.

Second, build and flash the ESP8266 firmware. First you need to create the file `esp8266-proxy/esp-open-rtos/include/private_ssid_config.h` with the following content:
Expand Down
24 changes: 12 additions & 12 deletions libopencm3.rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -234,36 +234,36 @@ styleclean: $(STYLECHECKFILES:=.styleclean)
ifeq ($(STLINK_PORT),)
ifeq ($(BMP_PORT),)
ifeq ($(OOCD_FILE),)
%.flash: %.elf
%.flash: %.srec
@printf " FLASH $<\n"
(echo "halt; program $(realpath $(*).elf) verify reset" | nc -4 localhost 4444 2>/dev/null) || \
(echo "halt; program $(realpath $(*).srec) verify reset" | nc -4 localhost 4444 2>/dev/null) || \
$(OOCD) -f interface/$(OOCD_INTERFACE).cfg \
-f target/$(OOCD_TARGET).cfg \
-c "program $(*).elf verify reset exit" \
-c "program $(*).srec verify reset exit" \
$(NULL)
else
%.flash: %.elf
%.flash: %.srec
@printf " FLASH $<\n"
(echo "halt; program $(realpath $(*).elf) verify reset" | nc -4 localhost 4444 2>/dev/null) || \
(echo "halt; program $(realpath $(*).srec) verify reset" | nc -4 localhost 4444 2>/dev/null) || \
$(OOCD) -f $(OOCD_FILE) \
-c "program $(*).elf verify reset exit" \
-c "program $(*).srec verify reset exit" \
$(NULL)
endif
else
%.flash: %.elf
@printf " GDB $(*).elf (flash)\n"
%.flash: %.srec
@printf " GDB $(*).srec (flash)\n"
$(GDB) --batch \
-ex 'target extended-remote $(BMP_PORT)' \
-x $(SCRIPT_DIR)/black_magic_probe_flash.scr \
$(*).elf
$(*).srec
endif
else
%.flash: %.elf
@printf " GDB $(*).elf (flash)\n"
%.flash: %.srec
@printf " GDB $(*).srec (flash)\n"
$(GDB) --batch \
-ex 'target extended-remote $(STLINK_PORT)' \
-x $(SCRIPT_DIR)/stlink_flash.scr \
$(*).elf
$(*).srec
endif

.PHONY: images clean stylecheck styleclean elf bin hex srec list
Expand Down

0 comments on commit d651514

Please sign in to comment.