From ddcc350a8b4c3a53b5bf55db09b6d7f0652b0bba Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Sun, 29 May 2016 03:25:52 -0700 Subject: [PATCH] nrf52: Auto generate Intel Hex kernel image Generate kernel image in Intel Hex format when building for the nRF52. Remove the additional step from the board doc file. Change-Id: I619496f64037c2a0ac459ae05e549e01458e0f71 Signed-off-by: Carles Cufi --- arch/arm/soc/nordic_nrf5/nrf52/Makefile | 14 ++++++++++++++ doc/board/nrf52_pca10040.rst | 10 ---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/arch/arm/soc/nordic_nrf5/nrf52/Makefile b/arch/arm/soc/nordic_nrf5/nrf52/Makefile index 52341f86c0b..ffc1fe39b79 100644 --- a/arch/arm/soc/nordic_nrf5/nrf52/Makefile +++ b/arch/arm/soc/nordic_nrf5/nrf52/Makefile @@ -1 +1,15 @@ obj-y += soc.o + +KERNEL_HEX_NAME = $(KERNEL_NAME).hex + +quiet_cmd_gen_hex = HEX $@ + cmd_gen_hex = \ +( \ + $(OBJCOPY) -S -O ihex -R .note -R .comment -R COMMON -R .eh_frame $< $@; \ +) + +$(KERNEL_HEX_NAME): $(KERNEL_ELF_NAME) + $(call cmd,gen_hex) + +zephyr: $(KERNEL_HEX_NAME) +all: $(KERNEL_HEX_NAME) diff --git a/doc/board/nrf52_pca10040.rst b/doc/board/nrf52_pca10040.rst index bdf94e3cfc7..0895706838a 100644 --- a/doc/board/nrf52_pca10040.rst +++ b/doc/board/nrf52_pca10040.rst @@ -377,16 +377,6 @@ shell :file:`$ZEPHYR_BASE/samples/shell`. #. Connect the micro-USB cable to the nRF52 DK and to your computer. -#. Convert the Zephyr kernel image to Intel Hex: - - .. code-block:: console - - $ cd samples/shell - $ objcopy -O ihex outdir/zephyr.elf outdir/zephyr.hex - - The :code:`objcopy` binary must be the one included with the - toolchain you used to build the Zephyr kernel - #. Erase the flash memory in the nRF52832: .. code-block:: console