summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-03-06 21:41:15 +0000
committerGitHub <noreply@github.com>2019-03-06 21:41:15 +0000
commit87f176dfbbbf1a64bd3e034713434393a0f3518b (patch)
tree83596e3e6ed4d1fa832f6771cdee2ee35c070b95 /Makefile
parentc71689996d85011f3d493b8cbe75e1379bdbc932 (diff)
parent6aab6996dbd890c5788bf4e330454a3490268174 (diff)
Merge pull request #193 from sifive/hifive1-revb
Add support for Segger J-Link OB to HiFive1 Rev B
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 20a4a5d..4afdacf 100644
--- a/Makefile
+++ b/Makefile
@@ -216,20 +216,21 @@ endif
endif
#############################################################
-# MEE Software Compilation
+# CoreIP RTL Simulation Hex File Creation
#############################################################
-# Generation of $(PROGRAM_ELF) is handled by scripts/standalone.mk
-# In this top level Makefile, just describe how to turn the elf into
-# $(PROGRAM_HEX)
-
ifeq ($(BSP),metal)
+
+# Use elf2hex if we're not using Segger J-Link OB (i.e. for coreip-rtl targets)
+ifeq ($(SEGGER_JLINK_OB),)
$(PROGRAM_HEX): \
scripts/elf2hex/install/bin/$(CROSS_COMPILE)-elf2hex \
$(PROGRAM_ELF)
$< --output $@ --input $(PROGRAM_ELF) --bit-width $(COREIP_MEM_WIDTH)
endif
+endif
+
#############################################################
# Legacy Software Compilation
#############################################################
@@ -263,11 +264,21 @@ endif
ifeq ($(BSP),metal)
+ifneq ($(SEGGER_JLINK_OB),)
+upload: $(PROGRAM_HEX)
+ scripts/upload --hex $(PROGRAM_HEX) --jlink $(SEGGER_JLINK_EXE)
+else
upload: $(PROGRAM_ELF)
scripts/upload --elf $(PROGRAM_ELF) --openocd $(RISCV_OPENOCD) --gdb $(RISCV_GDB) --openocd-config bsp/$(TARGET)/openocd.cfg
+endif
+ifneq ($(SEGGER_JLINK_OB),)
+debug: $(PROGRAM_ELF)
+ scripts/debug --elf $(PROGRAM_ELF) --jlink $(SEGGER_JLINK_GDB_SERVER) --gdb $(RISCV_GDB)
+else
debug: $(PROGRAM_ELF)
scripts/debug --elf $(PROGRAM_ELF) --openocd $(RISCV_OPENOCD) --gdb $(RISCV_GDB) --openocd-config bsp/$(TARGET)/openocd.cfg
+endif
else # BSP != metal