2015-09-24 02:16 PM
Hi,
This is to announce a set of Makefile's that aim to build every STM32 Library under Linux using GCC. Comments are welcome. Please see https://github.com/rickbronson/GCC-Makefile-for-Building-STM32-Libraries for more info. Cheers, Rick #gcc-linux2015-09-27 07:14 AM
Hi,
your aim is a noble effort! However, gnu makefiles are a pain to maintain and extend beyod a small project (I speak from experience). A better alternative is CMake. I've successfully used CMAke for building STM32 firmware on FreeBSD for many years. [small excerpt from CMake output for STM32L0] :Scanning dependencies of target SunnaBat.elf[ 93%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/opslag/home/ewout/techniek/projecten/swexternals/STM32/HALLibraries/Processor/stm32l0driver.cpp.o
[ 93%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/opslag/home/ewout/techniek/projecten/swexternals/microprocessor/syscalls.cpp.o
[ 94%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/beheer.cpp.o
[ 95%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/beuk.cpp.o
[ 95%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/init.cpp.o
[ 96%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/meet.cpp.o
[ 96%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/regel.cpp.o
[ 97%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/rtos.cpp.o
[ 97%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/stm32l0.cpp.o
[ 98%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/stm32l0ISR.cpp.o
[ 98%] Building CXX object toepassing/CMakeFiles/SunnaBat.elf.dir/sunnabat.cpp.o
[ 99%] Linking CXX executable SunnaBat.elf
[ 99%] Built target SunnaBat.elf
[100%] SunnaBat.elf is gemaakt. Hier volgt informatie over het ELF bestand.
SunnaBat.elf :
section size addr
.text 49780 134217728
.eh_frame 4 134267508
.ARM.exidx 1176 134267512
.rodata 3824 134268688
.data 40 536870912
.bss 5720 536870952
._usrstack 152 536876672
.comment 112 0
.debug_aranges 4232 0
.debug_info 626377 0
.debug_abbrev 37847 0
.debug_line 58707 0
.debug_frame 18160 0
.debug_str 71704 0
.debug_ranges 3840 0
.ARM.attributes 40 0
Total 881715
CMake is fantastic and very easy to configure. If you need tips about it ask around! Ewout Boks
2015-09-27 08:58 PM
In general I agree. I've struggled with makefiles myself. But in this instance the makefiles are very simple and tiny. The issues here are more about fixing up the wrong case issues (I guess the library assumes it's being built in MSDOS), inconsistency in directory structure names across different chip families and tweaking of loader scripts. Don't think cmake will help with those issues. Appreciate your input.
Rick