-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile.quickfeather
45 lines (31 loc) · 1.24 KB
/
Makefile.quickfeather
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
litex_platform = quicklogic_quickfeather
export QORC_SDK = $(realpath ./lib/qorc-sdk)
soc_dir = build/$(litex_platform)
soc = poetry run python lib/litex-boards/litex_boards/targets/$(litex_platform).py
bitstream_bin = $(soc_dir)/gateware/$(litex_platform).bin
firmware_bin = $(soc_dir)/software/bios/bios.bin
firmware_elf = $(soc_dir)/software/bios/bios.elf
.DEFAULT_GOAL := $(firmware_bin)
.PHONY: prepare clean gateware flash
.venv:
poetry install
clean:
rm -rf build
prepare:
poetry install
# note: this is only to download/install tools, we don't need these environment modifications
cd lib/qorc-sdk && bash -c "source envsetup.sh"
$(firmware_bin): .venv
$(soc)
$(firmware_elf): $(firmware_bin)
$(bitstream_bin): .venv
PATH=$(QORC_SDK)/fpga_toolchain_install/v1.3.1/quicklogic-arch-defs/bin:$(QORC_SDK)/fpga_toolchain_install/v1.3.1/conda/bin:$(PATH) $(soc) --build
gateware: $(bitstream_bin)
firmware: $(firmware_bin)
flash: | $(bitstream_bin) $(firmware_bin)
poetry run python $(QORC_SDK)/TinyFPGA-Programmer-Application/tinyfpga-programmer-gui.py \
--mode fpga-m4 --m4app $(firmware_bin) --appfpga $(bitstream_bin)
openocd:
openocd -f scripts/s3_jlink_swd.cfg
gdb: $(firmware_elf)
arm-none-eabi-gdb -ex 'target extended-remote :3333' $^