aboutsummaryrefslogtreecommitdiff
path: root/contrib/loaders
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2015-11-29 03:09:46 +0100
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>2016-02-29 19:42:21 +0000
commit7cf68a0f16e265996143056754774481eb9df7eb (patch)
treef104a71d4bb0a893077362dd445ae7b716456233 /contrib/loaders
parent43ff5acd45017fd9828cc56f54b929e600956c3b (diff)
downloadriscv-openocd-7cf68a0f16e265996143056754774481eb9df7eb.zip
riscv-openocd-7cf68a0f16e265996143056754774481eb9df7eb.tar.gz
riscv-openocd-7cf68a0f16e265996143056754774481eb9df7eb.tar.bz2
xmc4xxx: Integrate build of erase check code
Instead of pointing to the assembler sources in a comment and inline-commenting the THUMB bytecode, place the hex array alongside the assembler sources and include it via preprocessor. Originally inspired by a typo in the file path during driver development, but it also facilitates making changes to the assembler sources. A Makefile is provided to help automate updating the bytecode. It is not integrated with the automake system to avoid forcing an ARM cross-compiler onto every user, i.e. after modifying the sources they need to be rebuilt in that directory before building the usual way. ARM_CROSS_COMPILE= can be passed on the make command line to deal with native ARM toolchains or with varying prefixes of cross-toolchains. Change-Id: I00ceb980a68c8554a180dd13719ac77b677a8bcd Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-on: http://openocd.zylin.com/3133 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Diffstat (limited to 'contrib/loaders')
-rw-r--r--contrib/loaders/erase_check/Makefile19
-rw-r--r--contrib/loaders/erase_check/armv7m_0_erase_check.inc2
2 files changed, 21 insertions, 0 deletions
diff --git a/contrib/loaders/erase_check/Makefile b/contrib/loaders/erase_check/Makefile
new file mode 100644
index 0000000..32b7517
--- /dev/null
+++ b/contrib/loaders/erase_check/Makefile
@@ -0,0 +1,19 @@
+BIN2C = ../../../src/helper/bin2char.sh
+
+ARM_CROSS_COMPILE ?= arm-none-eabi-
+ARM_AS ?= $(ARM_CROSS_COMPILE)as
+ARM_OBJCOPY ?= $(ARM_CROSS_COMPILE)objcopy
+
+arm: armv7m_erase_check.inc armv7m_0_erase_check.inc
+
+armv7m_%.elf: armv7m_%.s
+ $(ARM_AS) $< -o $@
+
+armv7m_%.bin: armv7m_%.elf
+ $(ARM_OBJCOPY) -Obinary $< $@
+
+armv7m_%.inc: armv7m_%.bin
+ $(BIN2C) < $< > $@
+
+clean:
+ -rm -f *.elf *.bin *.inc
diff --git a/contrib/loaders/erase_check/armv7m_0_erase_check.inc b/contrib/loaders/erase_check/armv7m_0_erase_check.inc
new file mode 100644
index 0000000..76115ec
--- /dev/null
+++ b/contrib/loaders/erase_check/armv7m_0_erase_check.inc
@@ -0,0 +1,2 @@
+/* Autogenerated with ../../../src/helper/bin2char.sh */
+0x03,0x78,0x01,0x30,0x1a,0x43,0x01,0x39,0xfa,0xd1,0x00,0xbe,