From edc53fc34740bfdd3798d8db60f77f88f355a54d Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sun, 16 Apr 2017 10:55:43 -0300 Subject: [PATCH 1/4] Adding Pi Hat F446 support for stm32flash utility in Makefile --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 8c93c7a..569bde4 100644 --- a/Makefile +++ b/Makefile @@ -173,6 +173,15 @@ ifneq ($(wildcard /opt/openocd/bin/openocd),) /opt/openocd/bin/openocd -f /opt/openocd/share/openocd/scripts/board/stm32f4discovery.cfg -c "program bin/$(BINELF) verify reset exit" endif +deploy-pi: +ifneq ($(wildcard /usr/local/bin/stm32flash),) + /usr/local/bin/stm32flash -w bin/outp.bin -g 0x0 /dev/ttyAMA0 +endif + +ifneq ($(wildcard /usr/bin/stm32flash),) + /usr/bin/stm32flash -w bin/outp.bin -g 0x0 /dev/ttyAMA0 +endif + # Export the current git version if the index file exists, else 000... GitVersion.h: ifneq ("$(wildcard .git/index)","") From ff8bf96abb6b4c50d1dc67b5e89144883318510a Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sun, 16 Apr 2017 11:48:41 -0300 Subject: [PATCH 2/4] Adding GPIO sequence to enter serial bootloader mode (F446) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 569bde4..ea1ac9d 100644 --- a/Makefile +++ b/Makefile @@ -175,11 +175,11 @@ endif deploy-pi: ifneq ($(wildcard /usr/local/bin/stm32flash),) - /usr/local/bin/stm32flash -w bin/outp.bin -g 0x0 /dev/ttyAMA0 + /usr/local/bin/stm32flash -w bin/outp.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 endif ifneq ($(wildcard /usr/bin/stm32flash),) - /usr/bin/stm32flash -w bin/outp.bin -g 0x0 /dev/ttyAMA0 + /usr/bin/stm32flash -w bin/outp.bin -g 0x0 -i 20,-21,21:-20,21 /dev/ttyAMA0 endif # Export the current git version if the index file exists, else 000... From 852785b6164402bfbbde1bde649d42e9502ce186 Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sun, 16 Apr 2017 15:36:10 -0300 Subject: [PATCH 3/4] Workaround for Pi Hat F446 and stm32flash --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ea1ac9d..ba62750 100644 --- a/Makefile +++ b/Makefile @@ -175,11 +175,13 @@ endif deploy-pi: ifneq ($(wildcard /usr/local/bin/stm32flash),) - /usr/local/bin/stm32flash -w bin/outp.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 + -/usr/local/bin/stm32flash -i 20,-21,21:-20,21 /dev/ttyAMA0 + /usr/local/bin/stm32flash -v -w bin/outp.bin -g 0x0 -R -c /dev/ttyAMA0 endif ifneq ($(wildcard /usr/bin/stm32flash),) - /usr/bin/stm32flash -w bin/outp.bin -g 0x0 -i 20,-21,21:-20,21 /dev/ttyAMA0 + -/usr/bin/stm32flash -i 20,-21,21:-20,21 /dev/ttyAMA0 + /usr/bin/stm32flash -v -w bin/outp.bin -g 0x0 -R -c /dev/ttyAMA0 endif # Export the current git version if the index file exists, else 000... From 4b17bcd99110b47d62d0e3e5ccd42647c7b0260a Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sun, 16 Apr 2017 15:40:34 -0300 Subject: [PATCH 4/4] =?UTF-8?q?Changing=20default=20Makefile=20target=20to?= =?UTF-8?q?=20=E2=80=9Cnucleo=E2=80=9D=20and=20adding=20=E2=80=9CGitVersio?= =?UTF-8?q?n.h=E2=80=9D=20rule=20for=20all=20targets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ba62750..85a3cdf 100644 --- a/Makefile +++ b/Makefile @@ -101,9 +101,10 @@ LDFLAGS =-T $(LDSCRIPT) $(MCFLAGS) --specs=nosys.specs $(INCLUDES_LIBS) $(LINK_L # Build Rules .PHONY: all release dis pi nucleo debug clean -# Default target: STM32F4 Discovery board -all: dis +# Default target: STM32F4 Nucleo F446RE board +all: nucleo +pi: GitVersion.h pi: CFLAGS+=$(DEFS_PI) -Os -ffunction-sections -fdata-sections -fno-builtin -Wno-implicit -DCUSTOM_NEW -DNO_EXCEPTIONS pi: CXXFLAGS+=$(DEFS_PI) -Os -fno-exceptions -ffunction-sections -fdata-sections -fno-builtin -fno-rtti -DCUSTOM_NEW -DNO_EXCEPTIONS pi: LDFLAGS+=-Os --specs=nano.specs @@ -115,6 +116,7 @@ nucleo: CXXFLAGS+=$(DEFS_NUCLEO) -Os -fno-exceptions -ffunction-sections -fdata- nucleo: LDFLAGS+=-Os --specs=nano.specs nucleo: release +dis: GitVersion.h dis: CFLAGS+=$(DEFS_DIS) -Os -ffunction-sections -fdata-sections -fno-builtin -Wno-implicit -DCUSTOM_NEW -DNO_EXCEPTIONS dis: CXXFLAGS+=$(DEFS_DIS) -Os -fno-exceptions -ffunction-sections -fdata-sections -fno-builtin -fno-rtti -DCUSTOM_NEW -DNO_EXCEPTIONS dis: LDFLAGS+=-Os --specs=nano.specs