diff --git a/Makefile b/Makefile index 57d75fc..0d5ff62 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Makefile -- stm32bringup -# Copyright © 2020-2024 Renaud Fivet +# Copyright © 2020-2025 Renaud Fivet ### Build environment selection @@ -15,7 +15,8 @@ ifeq (linux, $(findstring linux, $(MAKE_HOST))) #REVDIR = arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi #REVDIR = arm-gnu-toolchain-12.2.mpacbti-rel1-x86_64-arm-none-eabi #REVDIR = arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi - REVDIR = arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi +#REVDIR = arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi + REVDIR = arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi else DRIVE = d ifeq (cygwin, $(findstring cygwin, $(MAKE_HOST))) @@ -40,7 +41,8 @@ endif #REVDIR = GNU Arm Embedded Toolchain/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi #REVDIR = GNU Arm Embedded Toolchain/arm-gnu-toolchain-12.2.mpacbti-rel1-mingw-w64-i686-arm-none-eabi #REVDIR = GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi - REVDIR = GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi +#REVDIR = GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi + REVDIR = GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi endif GCCDIR = $(INSTALLDIR)/$(REVDIR) diff --git a/docs/11_toolchain.html b/docs/11_toolchain.html index d12de28..663f4a2 100644 --- a/docs/11_toolchain.html +++ b/docs/11_toolchain.html @@ -27,10 +27,10 @@ IDE or encapsulate those paths and names in Makefile variables.
### Build environment selection -GCCDIR = "D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi" +GCCDIR = "D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi" -BINPFX = $(GCCDIR)/bin/arm-none-eabi- -CC = $(BINPFX)gcc +BINPFX = $(GCCDIR)/bin/arm-none-eabi- +CC = $(BINPFX)gcc ### Build rules @@ -49,11 +49,11 @@ share the same name prefix arm-none-eabi-. So I have created aCompilation is succesful and empty.o file is generated. @@ -139,9 +140,9 @@ use the simplest script: mem.ld. ### Build environment selection ifeq (linux, $(findstring linux, $(MAKE_HOST))) - GCCDIR = $(HOME)/Packages/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi + GCCDIR = $(HOME)/Packages/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi else - GCCDIR = "D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi" + GCCDIR = "D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi" endif BINPFX = $(GCCDIR)/bin/arm-none-eabi- @@ -152,6 +153,11 @@ LD_SCRIPT = $(GCCDIR)/share/gcc-arm-none-eabi/samples/ldscripts/mem.ld ### Build rules +.PHONY: version + +version: + $(CC) --version + %.elf: %.o $(LD) -T$(LD_SCRIPT) -o $@ $< @@ -159,23 +165,24 @@ LD_SCRIPT = $(GCCDIR)/share/gcc-arm-none-eabi/samples/ldscripts/mem.ld$ make -"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-m +"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-m ingw-w64-i686-arm-none-eabi"/bin/arm-none-eabi-gcc --version -arm-none-eabi-gcc.exe (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24)) 13.3.1 202 -40614 -Copyright (C) 2023 Free Software Foundation, Inc. +arm-none-eabi-gcc.exe (Arm GNU Toolchain 14.2.Rel1 (Build arm-14.52)) 14.2.1 202 +41119 +Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.@@ -65,20 +65,20 @@ means that the Makefile on Linux will be the same as the Windows one except for the value of the GCCDIR variable.-GCCDIR = $(HOME)/Packages/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi +GCCDIR = $(HOME)/Packages/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabiBy selecting the path based on the development environment, there is no need -to make changes while switching between OS. Gmake has the built-in +to make changes while switching between OS. gmake has the built-in variable MAKE_HOST that can be tested for this.### Build environment selection ifeq (linux, $(findstring linux, $(MAKE_HOST))) - GCCDIR = $(HOME)/Packages/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi + GCCDIR = $(HOME)/Packages/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi else - GCCDIR = "D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi" + GCCDIR = "D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi" endif BINPFX = $(GCCDIR)/bin/arm-none-eabi- @@ -94,9 +94,9 @@ version:I use the path prefix $(HOME)/Packages instead of ~/Packages when -defining GCCDIR as some sub-processes called by gmake may have -issues with ~ expansion (in this case ld). This way gmake -will handle the expansion before calling the sub-processes. +defining GCCDIR as some sub-processes called by gmake may +have issues with ~ expansion (in this case ld). This way +gmake will handle the expansion before calling the sub-processes.Toolchain’s chain of events
In order to generate a file that can be loaded in the micro-controller, I @@ -109,7 +109,8 @@ executable (.elf) loading or flashing (.bin or .hex).1. Compile
-Gmake has default rules to built .o files out of .c files. +gmake has default rules to built .o files out of .c +files. As I have already defined with CC the command to compile, I can make a simple test of this step by creating an empty .c file and checking what happens when I try to compile it. @@ -118,7 +119,7 @@ happens when I try to compile it. $ touch empty.c $ make empty.o -"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-m +"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-m ingw-w64-i686-arm-none-eabi"/bin/arm-none-eabi-gcc -c -o empty.o empty.c
$ make empty.elf -"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-m +"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-m ingw-w64-i686-arm-none-eabi"/bin/arm-none-eabi-ld -T"D:/Program Files (x86)/GNU -Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi" +Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi" /share/gcc-arm-none-eabi/samples/ldscripts/mem.ld -o empty.elf empty.oLink terminates successfully and creates empty.elf.
### Build environment selection ifeq (linux, $(findstring linux, $(MAKE_HOST))) - GCCDIR = $(HOME)/Packages/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi + GCCDIR = $(HOME)/Packages/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi else - GCCDIR = "D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi" + GCCDIR = "D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi" endif BINPFX = $(GCCDIR)/bin/arm-none-eabi- @@ -187,6 +194,11 @@ LD_SCRIPT = $(GCCDIR)/share/gcc-arm-none-eabi/samples/ldscripts/mem.ld ### Build rules +.PHONY: version + +version: + $(CC) --version + %.elf: %.o $(LD) -T$(LD_SCRIPT) -o $@ $< @@ -203,23 +215,23 @@ empty empty.c file, I can successfully build.$ make empty.bin empty.hex -"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-m +"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-m ingw-w64-i686-arm-none-eabi"/bin/arm-none-eabi-gcc -c -o empty.o empty.c -"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-m +"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-m ingw-w64-i686-arm-none-eabi"/bin/arm-none-eabi-ld -T"D:/Program Files (x86)/GNU -Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi" +Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-mingw-w64-i686-arm-none-eabi" /share/gcc-arm-none-eabi/samples/ldscripts/mem.ld -o empty.elf empty.o -"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-m +"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-m ingw-w64-i686-arm-none-eabi"/bin/arm-none-eabi-objcopy -O binary empty.elf empty .bin -"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-13.3.rel1-m +"D:/Program Files (x86)/GNU Arm Embedded Toolchain/arm-gnu-toolchain-14.2.rel1-m ingw-w64-i686-arm-none-eabi"/bin/arm-none-eabi-objcopy -O ihex empty.elf empty.h ex rm empty.o empty.elf-Notice that gmake automatically removes the intermediary .o and -.elf files on completion. +Notice that gmake automatically removes the intermediary +.o and .elf files on completion.The generated empty.bin is empty. @@ -229,7 +241,7 @@ of the long command names. Also I need a way to clean the working directory back to its initial state.