[riot-notifications] [RIOT-OS/RIOT] boards/frdm-kw41z: add riotboot (#11562)

Gaƫtan Harter notifications at github.com
Wed May 22 17:44:52 CEST 2019


cladmi commented on this pull request.



> @@ -31,8 +31,11 @@ endif
 # Configuration for OpenOCD v0.10.0 and newer
 export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/openocd-$(CPU_FAMILY).cfg
 
-# Check the flash configuration field before flashing
+ifneq (,$(filter riotboot/%, $(MAKECMDGOALS)))
+export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-bin.sh

By doing the following,  that use '-bin.sh' if it as .bin file, '-hex.sh' if it is a '.hex' file and the '-elf.sh' by default, you can do `make -C tests/riotboot flash` directly.

```diff
diff --git a/boards/common/frdm/Makefile.include b/boards/common/frdm/Makefile.include
index 81898ef3c..510934ce2 100644
--- a/boards/common/frdm/Makefile.include
+++ b/boards/common/frdm/Makefile.include
@@ -31,11 +31,12 @@ endif
 # Configuration for OpenOCD v0.10.0 and newer
 export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/openocd-$(CPU_FAMILY).cfg
 
-ifneq (,$(filter riotboot/%, $(MAKECMDGOALS)))
-export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-bin.sh
-else
-export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh
-endif
+# Use the '.bin/.hex' files if a '.bin/.hex' extension is found or the .elf as
+# sane default if not any special case.
+CHECK_FC_FIELD_.bin = $(RIOTCPU)/$(CPU)/dist/check-fcfield-bin.sh
+CHECK_FC_FIELD_.hex = $(RIOTCPU)/$(CPU)/dist/check-fcfield-hex.sh
+CHECK_FC_FIELD_default = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh
+export PRE_FLASH_CHECK_SCRIPT = $(or $(CHECK_FC_FIELD_$(suffix $(FLASHFILE))),$(CHECK_FC_FIELD_default))
 
 # setup serial terminal
 include $(RIOTMAKE)/tools/serial.inc.mk
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11562#discussion_r286560656
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190522/de221d83/attachment-0001.html>


More information about the notifications mailing list