-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fork boards/st-stm32f303re-nucleo/Makefile to boards/st-stm32l432kc-n…
…ucleo/Makefile step 3
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
APP_PATH ?= $(realpath ../..) | ||
-include $(APP_PATH)/config.mk | ||
-include local_config.mk | ||
|
||
OPENMRNPATH ?= $(shell \ | ||
sh -c "if [ \"X`printenv OPENMRNPATH`\" != \"X\" ]; then printenv OPENMRNPATH; \ | ||
elif [ -d /opt/openmrn/src ]; then echo /opt/openmrn; \ | ||
elif [ -d ~/openmrn/src ]; then echo ~/openmrn; \ | ||
elif [ -d ../../../src ]; then echo ../../..; \ | ||
else echo OPENMRNPATH not found; fi" \ | ||
) | ||
|
||
# Find STM32CubeF3 libraries | ||
include $(OPENMRNPATH)/etc/stm32cubef3.mk | ||
|
||
LDFLAGSEXTRA += | ||
SYSLIBRARIESEXTRA += -lfreertos_drivers_stm32cubef303xe | ||
OBJEXTRA += | ||
|
||
CFLAGS += -DSTM32F303xE | ||
CXXFLAGS += -DSTM32F303xE | ||
OPENOCDARGS = -f board/st_nucleo_f3.cfg | ||
|
||
ifndef TARGET | ||
export TARGET := freertos.armv7m | ||
endif | ||
include $(OPENMRNPATH)/etc/prog.mk | ||
|
||
ifndef DEFAULT_ADDRESS | ||
DEFAULT_ADDRESS=0x16 | ||
endif | ||
|
||
include $(OPENMRNPATH)/etc/node_id.mk | ||
|
||
# How to use: make multibin ADDRESS=0x20 ADDRHIGH=0x45 NUM=3 | ||
# starting address, high bits (user range), count | ||
multibin: | ||
for i in $$(seq 1 $(NUM)) ; do $(MAKE) $(EXECUTABLE).bin ADDRESS=$$(printf 0x%02x $$(($(ADDRESS)+$$i))) ; cp $(EXECUTABLE).bin $(EXECUTABLE).f303.$$(printf %02x%02x $(ADDRHIGH) $$(($(ADDRESS)+$$i-1))).bin ; done | ||
|
||
ifeq ($(call find_missing_deps,OPENOCDPATH OPENOCDSCRIPTSPATH),) | ||
all: $(EXECUTABLE).bin | ||
|
||
flash: $(EXECUTABLE)$(EXTENTION) $(EXECUTABLE).lst | ||
@if ps ax -o comm | grep -q openocd ; then echo openocd already running. quit existing first. ; exit 1 ; fi | ||
$(GDB) $< -ex "target remote | $(OPENOCDPATH)/openocd -c \"gdb_port pipe\" --search $(OPENOCDSCRIPTSPATH) $(OPENOCDARGS)" -ex "monitor reset halt" -ex "load" -ex "monitor reset init" -ex "monitor reset run" -ex "detach" -ex "quit" | ||
|
||
gdb: | ||
@if ps ax -o comm | grep -q openocd ; then echo openocd already running. quit existing first. ; exit 1 ; fi | ||
$(GDB) $(EXECUTABLE)$(EXTENTION) -ex "target remote | $(OPENOCDPATH)/openocd -c \"gdb_port pipe\" --search $(OPENOCDSCRIPTSPATH) $(OPENOCDARGS)" -ex "continue" # -ex "monitor reset halt" | ||
|
||
else | ||
|
||
flash gdb: | ||
echo OPENOCD not found ; exit 1 | ||
|
||
endif |