mirror of
https://github.com/keirf/greaseweazle-firmware.git
synced 2025-10-31 11:06:44 -07:00
Modify build system to place artefacts in separate out/ folder
This commit is contained in:
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@@ -27,10 +27,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
export P=greaseweazle-firmware
|
export P=greaseweazle-firmware
|
||||||
export V=${{ steps.vars.outputs.sha_short }}
|
export V=${{ steps.vars.outputs.sha_short }}
|
||||||
make dist
|
make -j4 dist
|
||||||
mkdir -p _cidist
|
mkdir -p _cidist
|
||||||
rm $P-v*.zip
|
rm out/$P-v*.zip
|
||||||
mv $P-v* $P-$V
|
mv out/$P-v* $P-$V
|
||||||
rm $P-$V/RELEASE_NOTES
|
rm $P-$V/RELEASE_NOTES
|
||||||
git rev-parse HEAD >$P-$V/COMMIT
|
git rev-parse HEAD >$P-$V/COMMIT
|
||||||
zip -r $P-$V.zip $P-$V
|
zip -r $P-$V.zip $P-$V
|
||||||
@@ -40,9 +40,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
export P=greaseweazle-firmware
|
export P=greaseweazle-firmware
|
||||||
export V=${{ steps.vars.outputs.sha_short }}-debug
|
export V=${{ steps.vars.outputs.sha_short }}-debug
|
||||||
env debug=y make dist
|
make -j4 dist level=debug
|
||||||
rm $P-v*.zip
|
rm out/$P-v*.zip
|
||||||
mv $P-v* $P-$V
|
mv out/$P-v* $P-$V
|
||||||
rm $P-$V/RELEASE_NOTES
|
rm $P-$V/RELEASE_NOTES
|
||||||
git rev-parse HEAD >$P-$V/COMMIT
|
git rev-parse HEAD >$P-$V/COMMIT
|
||||||
echo debug >>$P-$V/COMMIT
|
echo debug >>$P-$V/COMMIT
|
||||||
|
|||||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -27,7 +27,9 @@ jobs:
|
|||||||
run: python3 -m pip install --user crcmod
|
run: python3 -m pip install --user crcmod
|
||||||
|
|
||||||
- name: Build dist
|
- name: Build dist
|
||||||
run: make dist
|
run: |
|
||||||
|
make -j4 dist
|
||||||
|
mv out/*.zip .
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
|||||||
15
.gitignore
vendored
15
.gitignore
vendored
@@ -1,16 +1,5 @@
|
|||||||
*.[oa]
|
|
||||||
.*.d
|
|
||||||
*~
|
*~
|
||||||
*.ld
|
|
||||||
*.elf
|
|
||||||
*.bin
|
|
||||||
*.hex
|
|
||||||
*.orig
|
*.orig
|
||||||
*.rej
|
*.rej
|
||||||
*.upd
|
/out
|
||||||
*.adf
|
/ext
|
||||||
*.hfe
|
|
||||||
*.ipf
|
|
||||||
*.scp
|
|
||||||
*.pyc
|
|
||||||
greaseweazle-firmware-*
|
|
||||||
|
|||||||
125
Makefile
125
Makefile
@@ -2,85 +2,80 @@
|
|||||||
export FW_MAJOR := 1
|
export FW_MAJOR := 1
|
||||||
export FW_MINOR := 1
|
export FW_MINOR := 1
|
||||||
|
|
||||||
TARGETS := all blinky clean dist mrproper f1_ocd ocd flash start serial
|
|
||||||
.PHONY: $(TARGETS)
|
|
||||||
|
|
||||||
ifneq ($(RULES_MK),y)
|
|
||||||
|
|
||||||
export ROOT := $(CURDIR)
|
|
||||||
|
|
||||||
$(TARGETS):
|
|
||||||
$(MAKE) -f $(ROOT)/Rules.mk $@
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
PROJ = greaseweazle-firmware
|
PROJ = greaseweazle-firmware
|
||||||
VER := v$(FW_MAJOR).$(FW_MINOR)
|
VER := v$(FW_MAJOR).$(FW_MINOR)
|
||||||
|
|
||||||
SUBDIRS += src bootloader blinky_test
|
PYTHON := python3
|
||||||
|
|
||||||
all:
|
export ROOT := $(CURDIR)
|
||||||
$(MAKE) -C src -f $(ROOT)/Rules.mk \
|
|
||||||
greaseweazle.elf greaseweazle.bin greaseweazle.hex
|
|
||||||
$(MAKE) bootloader=y -C bootloader -f $(ROOT)/Rules.mk \
|
|
||||||
bootloader.elf bootloader.bin bootloader.hex
|
|
||||||
srec_cat bootloader/bootloader.hex -Intel src/greaseweazle.hex -Intel \
|
|
||||||
-o $(PROJ)-$(VER).hex -Intel
|
|
||||||
$(PYTHON) ./scripts/mk_update.py new $(PROJ)-$(VER).upd \
|
|
||||||
bootloader/bootloader.bin src/greaseweazle.bin $(mcu)
|
|
||||||
|
|
||||||
blinky:
|
.PHONY: FORCE
|
||||||
$(MAKE) debug=y mcu=stm32f1 -C blinky_test -f $(ROOT)/Rules.mk \
|
|
||||||
blinky.elf blinky.bin blinky.hex
|
|
||||||
|
|
||||||
clean::
|
.DEFAULT_GOAL := all
|
||||||
rm -f *.hex *.upd
|
|
||||||
find . -name __pycache__ | xargs rm -rf
|
|
||||||
|
|
||||||
dist:
|
prod-%: FORCE
|
||||||
rm -rf $(PROJ)-*
|
$(MAKE) target mcu=$* target=bootloader level=prod
|
||||||
mkdir -p $(PROJ)-$(VER)/hex/alt
|
$(MAKE) target mcu=$* target=greaseweazle level=prod
|
||||||
$(MAKE) clean
|
|
||||||
$(MAKE) mcu=stm32f1 all blinky
|
|
||||||
cp -a $(PROJ)-$(VER).hex $(PROJ)-$(VER)/hex/$(PROJ)-f1-$(VER).hex
|
|
||||||
cp -a $(PROJ)-$(VER).upd $(PROJ)-$(VER)/$(PROJ)-$(VER).upd
|
|
||||||
cp -a blinky_test/blinky.hex $(PROJ)-$(VER)/hex/alt/blinky-test-f1-$(VER).hex
|
|
||||||
cp -a COPYING $(PROJ)-$(VER)/
|
|
||||||
cp -a README $(PROJ)-$(VER)/
|
|
||||||
cp -a RELEASE_NOTES $(PROJ)-$(VER)/
|
|
||||||
$(MAKE) clean
|
|
||||||
$(MAKE) mcu=stm32f7 all
|
|
||||||
cp -a $(PROJ)-$(VER).hex $(PROJ)-$(VER)/hex/$(PROJ)-f7-$(VER).hex
|
|
||||||
$(PYTHON) ./scripts/mk_update.py cat $(PROJ)-$(VER)/$(PROJ)-$(VER).upd \
|
|
||||||
$(PROJ)-$(VER)/$(PROJ)-$(VER).upd $(PROJ)-$(VER).upd
|
|
||||||
$(MAKE) clean
|
|
||||||
$(MAKE) mcu=at32f4 all
|
|
||||||
cp -a $(PROJ)-$(VER).hex $(PROJ)-$(VER)/hex/$(PROJ)-at32f4-$(VER).hex
|
|
||||||
$(PYTHON) ./scripts/mk_update.py cat $(PROJ)-$(VER)/$(PROJ)-$(VER).upd \
|
|
||||||
$(PROJ)-$(VER)/$(PROJ)-$(VER).upd $(PROJ)-$(VER).upd
|
|
||||||
$(MAKE) clean
|
|
||||||
$(ZIP) $(PROJ)-$(VER).zip $(PROJ)-$(VER)
|
|
||||||
|
|
||||||
mrproper: clean
|
debug-%: FORCE
|
||||||
rm -rf $(PROJ)-*
|
$(MAKE) target mcu=$* target=bootloader level=debug
|
||||||
|
$(MAKE) target mcu=$* target=greaseweazle level=debug
|
||||||
|
|
||||||
|
all-%: FORCE prod-% debug-% ;
|
||||||
|
|
||||||
|
all: FORCE all-stm32f1 all-stm32f7 all-at32f4 ;
|
||||||
|
$(MAKE) target mcu=stm32f1 target=blinky level=debug
|
||||||
|
|
||||||
|
clean: FORCE
|
||||||
|
rm -rf out
|
||||||
|
|
||||||
|
out: FORCE
|
||||||
|
mkdir -p out/$(mcu)/$(level)/$(target)
|
||||||
|
rsync -a --include="*/" --exclude="*" src/ out/$(mcu)/$(level)/$(target)
|
||||||
|
|
||||||
|
target: FORCE out
|
||||||
|
$(MAKE) -C out/$(mcu)/$(level)/$(target) -f $(ROOT)/Rules.mk target.bin target.hex target.upd $(mcu)=y $(level)=y $(target)=y
|
||||||
|
|
||||||
|
dist: level := prod
|
||||||
|
dist: FORCE all
|
||||||
|
rm -rf out/$(PROJ)-*
|
||||||
|
$(eval t := out/$(PROJ)-$(VER))
|
||||||
|
mkdir -p out/$(PROJ)-$(VER)/hex/alt
|
||||||
|
$(eval s := out/stm32f1/$(level)/greaseweazle)
|
||||||
|
cp -a $(s)/target.hex $(t)/hex/$(PROJ)-f1-$(VER).hex
|
||||||
|
cp -a $(s)/target.upd $(t)/$(PROJ)-$(VER).upd
|
||||||
|
$(eval s := out/stm32f1/debug/blinky)
|
||||||
|
cp -a $(s)/target.hex $(t)/hex/alt/blinky-test-f1-$(VER).hex
|
||||||
|
$(eval s := out/stm32f7/$(level)/greaseweazle)
|
||||||
|
cp -a $(s)/target.hex $(t)/hex/$(PROJ)-f7-$(VER).hex
|
||||||
|
$(PYTHON) ./scripts/mk_update.py cat $(t)/$(PROJ)-$(VER).upd \
|
||||||
|
$(t)/$(PROJ)-$(VER).upd $(s)/target.upd
|
||||||
|
$(eval s := out/at32f4/$(level)/greaseweazle)
|
||||||
|
cp -a $(s)/target.hex $(t)/hex/$(PROJ)-at32f4-$(VER).hex
|
||||||
|
$(PYTHON) ./scripts/mk_update.py cat $(t)/$(PROJ)-$(VER).upd \
|
||||||
|
$(t)/$(PROJ)-$(VER).upd $(s)/target.upd
|
||||||
|
cp -a COPYING $(t)/
|
||||||
|
cp -a README $(t)/
|
||||||
|
cp -a RELEASE_NOTES $(t)/
|
||||||
|
(cd out && zip -r $(PROJ)-$(VER).zip $(PROJ)-$(VER))
|
||||||
|
|
||||||
BAUD=115200
|
BAUD=115200
|
||||||
DEV=/dev/ttyUSB0
|
DEV=/dev/ttyUSB0
|
||||||
|
SUDO=sudo
|
||||||
|
STM32FLASH=stm32flash
|
||||||
|
|
||||||
ocd: all
|
ocd: FORCE all
|
||||||
$(PYTHON) scripts/telnet.py localhost 4444 \
|
$(PYTHON) scripts/telnet.py localhost 4444 \
|
||||||
"reset init ; flash write_image erase `pwd`/$(PROJ)-$(VER).hex ; reset"
|
"reset init ; flash write_image erase `pwd`/$(target)/$(target).hex ; reset"
|
||||||
|
|
||||||
f1_ocd: all
|
f1_ocd: FORCE all
|
||||||
python3 scripts/openocd/flash.py `pwd`/$(PROJ)-$(VER).hex
|
$(PYTHON) scripts/openocd/flash.py `pwd`/$(target)/$(target).hex
|
||||||
|
|
||||||
flash: all
|
flash: FORCE all
|
||||||
sudo stm32flash -b $(BAUD) -w $(PROJ)-$(VER).hex $(DEV)
|
$(SUDO) $(STM32FLASH) -b $(BAUD) -w $(target)/$(target).hex $(DEV)
|
||||||
|
|
||||||
start:
|
start: FORCE
|
||||||
sudo stm32flash -b $(BAUD) -g 0 $(DEV)
|
$(SUDO) $(STM32FLASH) -b $(BAUD) -g 0 $(DEV)
|
||||||
|
|
||||||
serial:
|
serial: FORCE
|
||||||
sudo miniterm.py $(DEV) 3000000
|
$(SUDO) miniterm.py $(DEV) 3000000
|
||||||
|
|
||||||
endif
|
|
||||||
|
|||||||
33
Rules.mk
33
Rules.mk
@@ -46,9 +46,8 @@ CFLAGS += $(CFLAGS-y) $(FLAGS) -include decls.h
|
|||||||
AFLAGS += $(AFLAGS-y) $(FLAGS) -D__ASSEMBLY__
|
AFLAGS += $(AFLAGS-y) $(FLAGS) -D__ASSEMBLY__
|
||||||
LDFLAGS += $(LDFLAGS-y) $(FLAGS) -Wl,--gc-sections
|
LDFLAGS += $(LDFLAGS-y) $(FLAGS) -Wl,--gc-sections
|
||||||
|
|
||||||
RULES_MK := y
|
SRCDIR := $(shell $(PYTHON) $(ROOT)/scripts/srcdir.py $(CURDIR))
|
||||||
|
include $(SRCDIR)/Makefile
|
||||||
include Makefile
|
|
||||||
|
|
||||||
SUBDIRS += $(SUBDIRS-y)
|
SUBDIRS += $(SUBDIRS-y)
|
||||||
OBJS += $(OBJS-y) $(patsubst %,%/build.o,$(SUBDIRS))
|
OBJS += $(OBJS-y) $(patsubst %,%/build.o,$(SUBDIRS))
|
||||||
@@ -67,19 +66,11 @@ build.o: $(OBJS)
|
|||||||
%/build.o: FORCE
|
%/build.o: FORCE
|
||||||
$(MAKE) -f $(ROOT)/Rules.mk -C $* build.o
|
$(MAKE) -f $(ROOT)/Rules.mk -C $* build.o
|
||||||
|
|
||||||
%.o: %.c Makefile
|
%.ld: $(SRCDIR)/%.ld.S $(SRCDIR)/Makefile
|
||||||
@echo CC $@
|
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
%.o: %.S Makefile
|
|
||||||
@echo AS $@
|
|
||||||
$(CC) $(AFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
%.ld: %.ld.S Makefile
|
|
||||||
@echo CPP $@
|
@echo CPP $@
|
||||||
$(CC) -P -E $(AFLAGS) $< -o $@
|
$(CC) -P -E $(AFLAGS) $< -o $@
|
||||||
|
|
||||||
%.elf: $(OBJS) %.ld Makefile
|
%.elf: $(OBJS) %.ld $(SRCDIR)/Makefile
|
||||||
@echo LD $@
|
@echo LD $@
|
||||||
$(CC) $(LDFLAGS) -T$(*F).ld $(OBJS) -o $@
|
$(CC) $(LDFLAGS) -T$(*F).ld $(OBJS) -o $@
|
||||||
chmod a-x $@
|
chmod a-x $@
|
||||||
@@ -88,23 +79,25 @@ build.o: $(OBJS)
|
|||||||
@echo OBJCOPY $@
|
@echo OBJCOPY $@
|
||||||
$(OBJCOPY) -O ihex $< $@
|
$(OBJCOPY) -O ihex $< $@
|
||||||
chmod a-x $@
|
chmod a-x $@
|
||||||
|
ifneq ($(bootloader),y)
|
||||||
|
srec_cat ../bootloader/target.hex -Intel $@ -Intel -o $@ -Intel
|
||||||
|
endif
|
||||||
|
|
||||||
%.bin: %.elf
|
%.bin: %.elf
|
||||||
@echo OBJCOPY $@
|
@echo OBJCOPY $@
|
||||||
$(OBJCOPY) -O binary $< $@
|
$(OBJCOPY) -O binary $< $@
|
||||||
chmod a-x $@
|
chmod a-x $@
|
||||||
|
|
||||||
%.o: $(RPATH)/%.c Makefile
|
%.upd: %.bin
|
||||||
|
$(PYTHON) $(ROOT)/scripts/mk_update.py new $@ \
|
||||||
|
../bootloader/target.bin $< $(mcu)
|
||||||
|
|
||||||
|
%.o: $(SRCDIR)/%.c $(SRCDIR)/Makefile
|
||||||
@echo CC $@
|
@echo CC $@
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
%.o: $(RPATH)/%.S Makefile
|
%.o: $(SRCDIR)/%.S $(SRCDIR)/Makefile
|
||||||
@echo AS $@
|
@echo AS $@
|
||||||
$(CC) $(AFLAGS) -c $< -o $@
|
$(CC) $(AFLAGS) -c $< -o $@
|
||||||
|
|
||||||
clean:: $(addprefix _clean_,$(SUBDIRS) $(SUBDIRS-n) $(SUBDIRS-))
|
|
||||||
rm -f *.orig *.rej *~ *.o *.elf *.hex *.bin *.ld $(DEPS)
|
|
||||||
_clean_%: FORCE
|
|
||||||
$(MAKE) -f $(ROOT)/Rules.mk -C $* clean
|
|
||||||
|
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
RPATH = $(ROOT)/src
|
|
||||||
|
|
||||||
OBJS += board.o
|
|
||||||
OBJS += build_info.o
|
|
||||||
OBJS += crc.o
|
|
||||||
OBJS += vectors.o
|
|
||||||
OBJS += fw_update.o
|
|
||||||
OBJS += string.o
|
|
||||||
OBJS += cortex.o
|
|
||||||
OBJS += time.o
|
|
||||||
OBJS += timer.o
|
|
||||||
OBJS += util.o
|
|
||||||
|
|
||||||
OBJS-$(debug) += console.o
|
|
||||||
|
|
||||||
SUBDIRS += mcu usb
|
|
||||||
|
|
||||||
.PHONY: $(RPATH)/build_info.c
|
|
||||||
build_info.o: CFLAGS += -DFW_MAJOR=$(FW_MAJOR) -DFW_MINOR=$(FW_MINOR)
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
#if MCU == STM32F1
|
|
||||||
|
|
||||||
#define FLASH_BASE 0x08000000
|
|
||||||
#define FLASH_LEN 8K
|
|
||||||
|
|
||||||
#elif MCU == STM32F7 || MCU == AT32F4
|
|
||||||
|
|
||||||
#define FLASH_BASE 0x08000000
|
|
||||||
#define FLASH_LEN 16K
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../scripts/stm32.ld.S"
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
SUBDIRS-$(stm32f1) += stm32f1
|
|
||||||
SUBDIRS-$(stm32f7) += stm32f7
|
|
||||||
SUBDIRS-$(at32f4) += at32f4
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
RPATH = $(ROOT)/src/mcu/at32f4
|
|
||||||
|
|
||||||
OBJS += stm32.o
|
|
||||||
OBJS += fpec.o
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
RPATH = $(ROOT)/src/mcu/stm32f1
|
|
||||||
|
|
||||||
OBJS += stm32.o
|
|
||||||
OBJS += fpec.o
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
RPATH = $(ROOT)/src/mcu/stm32f7
|
|
||||||
|
|
||||||
OBJS += stm32.o
|
|
||||||
OBJS += fpec.o
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
RPATH = $(ROOT)/src/usb
|
|
||||||
|
|
||||||
OBJS += config.o
|
|
||||||
OBJS += core.o
|
|
||||||
OBJS += cdc_acm.o
|
|
||||||
|
|
||||||
OBJS-$(stm32f1) += hw_usbd.o
|
|
||||||
OBJS-$(stm32f1) += hw_f1.o
|
|
||||||
|
|
||||||
OBJS-$(stm32f7) += hw_dwc_otg.o
|
|
||||||
OBJS-$(stm32f7) += hw_f7.o
|
|
||||||
|
|
||||||
OBJS-$(at32f4) += hw_dwc_otg.o
|
|
||||||
OBJS-$(at32f4) += hw_usbd_at32f4.o
|
|
||||||
OBJS-$(at32f4) += hw_at32f4.o
|
|
||||||
|
|
||||||
$(OBJS) $(OBJS-y): CFLAGS += -include $(ROOT)/src/usb/defs.h
|
|
||||||
@@ -32,8 +32,9 @@ class Version:
|
|||||||
def __init__(self, major, minor):
|
def __init__(self, major, minor):
|
||||||
self.major, self.minor = major, minor
|
self.major, self.minor = major, minor
|
||||||
|
|
||||||
with open('Makefile', 'r') as f:
|
if sys.argv[1] == 'new':
|
||||||
l = f.read()
|
with open('../../../../Makefile', 'r') as f:
|
||||||
|
l = f.read()
|
||||||
major = int(re.search('FW_MAJOR := (\d+)', l).group(1))
|
major = int(re.search('FW_MAJOR := (\d+)', l).group(1))
|
||||||
minor = int(re.search('FW_MINOR := (\d+)', l).group(1))
|
minor = int(re.search('FW_MINOR := (\d+)', l).group(1))
|
||||||
version = Version(major, minor)
|
version = Version(major, minor)
|
||||||
|
|||||||
29
scripts/srcdir.py
Normal file
29
scripts/srcdir.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# srcdir.py
|
||||||
|
#
|
||||||
|
# Helper script to locate the relative source folder for a given object folder.
|
||||||
|
# For example:
|
||||||
|
# objdir = /path/to/out/stm32f105/prod/floppy/usb
|
||||||
|
# srcdir = ../../../../../src/usb
|
||||||
|
#
|
||||||
|
# Written & released by Keir Fraser <keir.xen@gmail.com>
|
||||||
|
#
|
||||||
|
# This is free and unencumbered software released into the public domain.
|
||||||
|
# See the file COPYING for more details, or visit <http://unlicense.org>.
|
||||||
|
|
||||||
|
import sys, re
|
||||||
|
|
||||||
|
# /out/<mcu>/<level>/<target>
|
||||||
|
NR_LEVELS = 4
|
||||||
|
|
||||||
|
objdir = sys.argv[1]
|
||||||
|
|
||||||
|
# stem = /out/<mcu>/<level>/target[/<rest_of_path>]
|
||||||
|
stem = objdir[objdir.rfind('/out'):]
|
||||||
|
|
||||||
|
# stem = [/<rest_of_path>]
|
||||||
|
m = re.match('/[^/]*'*NR_LEVELS+'(/.*)?', stem)
|
||||||
|
stem = '' if m.group(1) is None else m.group(1)
|
||||||
|
|
||||||
|
# srcdir = path to sources, relative to objdir
|
||||||
|
srcdir = '../'*(NR_LEVELS+stem.count('/')) + 'src' + stem
|
||||||
|
print(srcdir)
|
||||||
18
src/Makefile
18
src/Makefile
@@ -2,18 +2,30 @@ OBJS += board.o
|
|||||||
OBJS += build_info.o
|
OBJS += build_info.o
|
||||||
OBJS += crc.o
|
OBJS += crc.o
|
||||||
OBJS += vectors.o
|
OBJS += vectors.o
|
||||||
OBJS += main.o
|
|
||||||
OBJS += string.o
|
OBJS += string.o
|
||||||
OBJS += cortex.o
|
OBJS += cortex.o
|
||||||
OBJS += time.o
|
OBJS += time.o
|
||||||
OBJS += timer.o
|
OBJS += timer.o
|
||||||
OBJS += util.o
|
OBJS += util.o
|
||||||
|
OBJS-$(debug) += console.o
|
||||||
|
|
||||||
|
ifeq ($(blinky),y)
|
||||||
|
|
||||||
|
OBJS += blinky.o
|
||||||
|
|
||||||
|
else ifeq ($(bootloader),y)
|
||||||
|
|
||||||
|
OBJS += fw_update.o
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
OBJS += main.o
|
||||||
OBJS += floppy.o
|
OBJS += floppy.o
|
||||||
OBJS += testmode.o
|
OBJS += testmode.o
|
||||||
|
|
||||||
OBJS-$(debug) += console.o
|
endif
|
||||||
|
|
||||||
SUBDIRS += mcu usb
|
SUBDIRS += mcu usb
|
||||||
|
|
||||||
.PHONY: build_info.c
|
.PHONY: $(SRCDIR)/build_info.c
|
||||||
build_info.o: CFLAGS += -DFW_MAJOR=$(FW_MAJOR) -DFW_MINOR=$(FW_MINOR)
|
build_info.o: CFLAGS += -DFW_MAJOR=$(FW_MAJOR) -DFW_MINOR=$(FW_MINOR)
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
#if MCU == STM32F1
|
|
||||||
|
|
||||||
#define FLASH_BASE 0x08002000
|
|
||||||
#define FLASH_LEN 56K
|
|
||||||
|
|
||||||
#elif MCU == STM32F7 || MCU == AT32F4
|
|
||||||
|
|
||||||
#define FLASH_BASE 0x08004000
|
|
||||||
#define FLASH_LEN 48K
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../scripts/stm32.ld.S"
|
|
||||||
19
src/target.ld.S
Normal file
19
src/target.ld.S
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
#if defined(BOOTLOADER) && (MCU == STM32F1)
|
||||||
|
#define FLASH_BASE 0x08000000
|
||||||
|
#define FLASH_LEN 8K
|
||||||
|
|
||||||
|
#elif defined(BOOTLOADER) && (MCU == STM32F7 || MCU == AT32F4)
|
||||||
|
#define FLASH_BASE 0x08000000
|
||||||
|
#define FLASH_LEN 16K
|
||||||
|
|
||||||
|
#elif MCU == STM32F1
|
||||||
|
#define FLASH_BASE 0x08002000
|
||||||
|
#define FLASH_LEN 56K
|
||||||
|
|
||||||
|
#elif MCU == STM32F7 || MCU == AT32F4
|
||||||
|
#define FLASH_BASE 0x08004000
|
||||||
|
#define FLASH_LEN 48K
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "../scripts/stm32.ld.S"
|
||||||
@@ -12,4 +12,4 @@ OBJS-$(at32f4) += hw_dwc_otg.o
|
|||||||
OBJS-$(at32f4) += hw_usbd_at32f4.o
|
OBJS-$(at32f4) += hw_usbd_at32f4.o
|
||||||
OBJS-$(at32f4) += hw_at32f4.o
|
OBJS-$(at32f4) += hw_at32f4.o
|
||||||
|
|
||||||
$(OBJS) $(OBJS-y): CFLAGS += -include defs.h
|
$(OBJS) $(OBJS-y): CFLAGS += -include $(SRCDIR)/defs.h
|
||||||
|
|||||||
Reference in New Issue
Block a user