From ae5f878d6acadabaa671a7a30b87e16eb1d718a7 Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Wed, 30 Nov 2016 10:55:18 -0800 Subject: Bump Everything to Match new Freedom Repo (#8) * Bump tool versions * Use version of OpenOCD which can load programs into flash * Bump OpenOCD to Handle ISSI Flash Programming * Update Header files * add initial support for hifive1 * add dhrystone * add clock helper functions * add openocd cfg file * Demo_GPIO checkpoint -- compiles and runs but no blinky LEDs * Remove riscv-tests submodule * Remove FPGA files, as they are no longer relevant to this Repository * Add openocd_upload script * Add Pinmux Mappings Adding the pinmux mappings to the Platform Header * Add IOF Mappings to platform header * Re-order the IOF Mapping declarations * Add more useful things to platform headers * Get GPIO Demo working again (except interrupts aren't working) * Update README with more OS packages needed A bare ubuntu-16.04.1-server installation could not run `make tools` without these packages. * bump openocd to get SCKDIV fix * Remove duplicated help text for run_debug target * Add package to README that is needed for openocd build Without this package I was seeing two different failures like below when running `make tools`. /home/scottj/freedom-e-sdk/openocd/configure: line 4533: syntax error near unexpected token `0.23' /home/scottj/freedom-e-sdk/openocd/configure: line 4533: `PKG_PROG_PKG_CONFIG(0.23)' Makefile:70: recipe for target '/home/scottj/freedom-e-sdk/toolchain/bin/openocd' failed make: *** [/home/scottj/freedom-e-sdk/toolchain/bin/openocd] Error 2 ... or ... + autoconf configure.ac:12: error: possibly undefined macro: AC_MSG_WARN If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:240: error: possibly undefined macro: AC_MSG_NOTICE configure.ac:342: error: possibly undefined macro: AC_DEFINE Makefile:70: recipe for target '/home/scottj/freedom-e-sdk/toolchain/bin/openocd' failed make: *** [/home/scottj/freedom-e-sdk/toolchain/bin/openocd] Error 1 * Bump OpenOCD to not overwrite SCKDIV when flashing * Roll back CoreMark --- Makefile | 73 +++++++++++++++++++++++++++------------------------------------- 1 file changed, 31 insertions(+), 42 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a9f9122..41d01c0 100644 --- a/Makefile +++ b/Makefile @@ -17,23 +17,22 @@ help : @echo " tools:" @echo " Install compilation & debugging tools" @echo "" - @echo " software [PROGRAM=demo_gpio PLATFORM=freedom-e300]:" + @echo " software [PROGRAM=demo_gpio BOARD=freedom-e300-arty]:" @echo " Build a software program to load with the" @echo " debugger." @echo "" - @echo " run_debug [PROGRAM=demo_gpio PLATFORM=freedom-e300]:" + @echo " run_debug [PROGRAM=demo_gpio BOARD=freedom-e300-arty]:" @echo " Launch OpenOCD & GDB to load or debug " @echo " running programs." + @echo "" + @echo " upload [PROGRAM=demo_gpio BOARD=freedom-e300-arty]:" + @echo " Launch OpenOCD to flash your program to the" + @echo " on-board Flash" @echo "" - @echo " run_openocd [PLATFORM=freedom-e300]:" - @echo " run_gdb [PROGRAM=demo_gpio PLATFORM=freedom-e300]:" - @echo " Launch OpenOCD & GDB seperately" - @echo "" - @echo " fpga [BOOTROM=demo]:" - @echo " Rebuild the image (including Boot SW) to" - @echo " reprogram the FPGA image for Arty Board. " - @echo "" - + @echo " run_openocd [BOARD=freedom-e300-arty]:" + @echo " run_gdb [PROGRAM=demo_gpio BOARD=freedom-e300-arty]:" + @echo " Launch OpenOCD or GDB seperately" + @echo "" @echo " For more information, visit dev.sifive.com" @@ -43,14 +42,12 @@ help : toolchain_srcdir := $(srcdir)/riscv-gnu-toolchain toolchain32_wrkdir := $(wrkdir)/riscv32-gnu-toolchain -toolchain64_wrkdir := $(wrkdir)/riscv64-gnu-toolchain toolchain_dest := $(CURDIR)/toolchain openocd_srcdir := $(srcdir)/openocd openocd_wrkdir := $(wrkdir)/openocd openocd_dest := $(CURDIR)/toolchain -target64 := riscv64-unknown-linux-gnu target32 := riscv32-unknown-linux-gnu @@ -58,18 +55,12 @@ target32 := riscv32-unknown-linux-gnu all: tools @echo All done. -tools: tools64 tools32 openocd +tools: tools32 openocd @echo All Tools Installed -tools64: $(toolchain_dest)/bin/$(target64)-gcc tools32: $(toolchain_dest)/bin/$(target32)-gcc openocd: $(openocd_dest)/bin/openocd -$(toolchain_dest)/bin/$(target64)-gcc: $(toolchain_srcdir) - mkdir -p $(toolchain64_wrkdir) - cd $(toolchain64_wrkdir); $(toolchain_srcdir)/configure --prefix=$(toolchain_dest) - $(MAKE) -C $(toolchain64_wrkdir) - $(toolchain_dest)/bin/$(target32)-gcc: $(toolchain_srcdir) mkdir -p $(toolchain32_wrkdir) cd $(toolchain32_wrkdir); $(toolchain_srcdir)/configure --prefix=$(toolchain_dest) --with-arch=RV32IMA @@ -89,27 +80,12 @@ uninstall: rm -rf -- $(toolchain_dest) ############################################################# -# This Section is for MCS File Generation ( -############################################################# - -BOOTROM ?= demo -BOOTROM_DIR = $(srcdir)/bootrom/$(BOOTROM)/ - -.PHONY: -fpga: - cd $(BOOTROM_DIR);\ - make mcs - -fpga_clean: - cd $(BOOTROM_DIR);\ - make clean - -############################################################# -# This Section is for Software (non-boot) compilation +# This Section is for Software Compilation ############################################################# - -PROGRAM ?= demo_gpio +BOARD ?= freedom-e300-arty +PROGRAM ?= demo_gpio PROGRAM_DIR = $(srcdir)/software/$(PROGRAM) +PROGRAM_ELF = $(srcdir)/software/$(PROGRAM)/$(PROGRAM) .PHONY: software software: @@ -120,14 +96,27 @@ software_clean: cd $(PROGRAM_DIR);\ make clean +dasm: software + cd $(PROGRAM_DIR); \ + $(toolchain_dest)/bin/riscv32-unknown-elf-objdump -D $(PROGRAM_ELF) + +############################################################# +# This Section is for uploading a program to SPI Flash +############################################################# +OPENOCD_UPLOAD = $(srcdir)/bsp/tools/openocd_upload.sh +OPENOCDCFG ?= $(srcdir)/bsp/env/$(BOARD)/openocd.cfg + +upload: + $(OPENOCD_UPLOAD) $(PROGRAM_ELF) $(OPENOCDCFG) + ############################################################# # This Section is for launching the debugger ############################################################# + OPENOCD = $(toolchain_dest)/bin/openocd -PLATFORM ?= freedom-e300 -OPENOCDARGS += -f $(srcdir)/riscv-tests/debug/targets/$(PLATFORM)/openocd.cfg +OPENOCDARGS += -f $(OPENOCDCFG) -GDB = $(toolchain_dest)/bin/riscv64-unknown-elf-gdb +GDB = $(toolchain_dest)/bin/riscv32-unknown-elf-gdb GDBCMDS += -ex "target extended-remote localhost:3333" GDBARGS = -- cgit v1.2.1-18-gbd029