zxvcv / 3D_Printer

Eclipse Public License 2.0
0 stars 0 forks source link

CMake build #11

Closed zxvcv closed 3 years ago

zxvcv commented 3 years ago

Create build system independent from eclipse, with no need to code and run program form eclipse GUI Related to #9

zxvcv commented 3 years ago

Software necessary to compile and flash:

gcc-arm-none-eabi (installation: sudo apt-get install gcc-arm-none-eabi) STM32 ST-LINK utility (tests on version: 4.6.0)

zxvcv commented 3 years ago

Add linker flag:

-specs=nosys.specs

On stm32 forum there is information that "This is a known error when you don’t add syscalls.c or specify -specs=nosys.specs in linker miscellaneous flags." Post on STM32 forum Explanation why this error occurs

zxvcv commented 3 years ago

Build with cmake implemented. To restore project functionality it's nesessary to end #16

zxvcv commented 3 years ago

CMake for separeated Drivers and main executable implementation is needed. Some parts of aplication uses HAL drivers, the best approatch is to make separate library for this drivers. Problem occurs afted move files from main CMakeLists.txt in add_executable to add_library in separate folder. In that situation file stm32f3xx_hal.h can't see file stm32f3xx_hal_conf.h

Scanning dependencies of target EEPROM_24AA01
[ 67%] Building C object Components/EEPROM_24AA01/CMakeFiles/EEPROM_24AA01.dir/source/EEPROM_24AA01.c.obj
In file included from /mnt/c/Users/ppisk/Projects/3D_Printer/3D_Printer/Components/EEPROM_24AA01/source/../header/EEPROM_24AA01.h:3
,
                 from /mnt/(...)/3D_Printer/Components/EEPROM_24AA01/source/EEPROM_24AA01.c:18:
/mnt/(...)/3D_Printer/Components/EEPROM_24AA01/source/../header/../../../Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h:30:10: fatal error: stm32f3xx_hal_conf.h: No such file or directory
   30 | #include "stm32f3xx_hal_conf.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Components/EEPROM_24AA01/CMakeFiles/EEPROM_24AA01.dir/build.make:63: Components/EEPROM_24AA01/CMakeFiles/EEPROM_24AA01.dir/source/EEPROM_24AA01.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:271: Components/EEPROM_24AA01/CMakeFiles/EEPROM_24AA01.dir/all] Error 2
make: *** [Makefile:84: all] Error 2