BluePygmyOwl / DieBieMS-Firmware

Firmware for the DieBieMS for GCC compiling
2 stars 0 forks source link

Having trouble compiling the project #1

Closed Peemouse closed 4 years ago

Peemouse commented 4 years ago

Hi,

First, thank you for you work ! I followed your steps there to set my IDE correctly. But no luck to compile it.

Here is the console output while compiling Release configuration

16:35:41 Incremental Build of configuration Release for project DieBieMS-firmware-gcc make all make: *** No rule to make target /Users/clement/Downloads/syscalls.c', needed bySrc/syscalls.o'. Stop. 16:35:41 Build Finished (took 131ms)

And Debug configuration :

16:44:41 Incremental Build of configuration Debug for project DieBieMS-firmware-gcc Info: Internal Builder is used for build arm-none-eabi-objcopy -O ihex DieBieMS-firmware-gcc.elf DieBieMS-firmware-gcc.hex && arm-none-eabi-objcopy -O binary DieBieMS-firmware-gcc.elf DieBieMS-firmware-gcc.bin && arm-none-eabi-size --format=berkeley DieBieMS-firmware-gcc.elf Usage: arm-none-eabi-objcopy [option(s)] in-file [out-file] Copies a binary file, possibly transforming it in the process The options are: -I --input-target Assume input file is in format -O --output-target Create an output file in format -B --binary-architecture Set output arch, when input is arch-less -F --target Set both input and output format to --debugging Convert debugging information, if possible -p --preserve-dates Copy modified/access timestamps to the output -D --enable-deterministic-archives Produce deterministic output when stripping archives -U --disable-deterministic-archives Disable -D behavior (default) -j --only-section Only copy section into the output --add-gnu-debuglink= Add section .gnu_debuglink linking to -R --remove-section Remove section from the output --remove-relocations Remove relocations from section -S --strip-all Remove all symbol and relocation information -g --strip-debug Remove all debugging symbols & sections --strip-dwo Remove all DWO sections --strip-unneeded Remove all symbols not needed by relocations -N --strip-symbol Do not copy symbol --strip-unneeded-symbol Do not copy symbol unless needed by relocations --only-keep-debug Strip everything but the debug information --extract-dwo Copy only DWO sections --extract-symbol Remove section contents but keep symbols -K --keep-symbol Do not strip symbol --keep-file-symbols Do not strip file symbol(s) --localize-hidden Turn all ELF hidden symbols into locals -L --localize-symbol Force symbol to be marked as a local --globalize-symbol Force symbol to be marked as a global -G --keep-global-symbol Localize all symbols except -W --weaken-symbol Force symbol to be marked as a weak --weaken Force all global symbols to be marked as weak -w --wildcard Permit wildcard in symbol comparison -x --discard-all Remove all non-global symbols -X --discard-locals Remove any compiler-generated symbols -i --interleave[=] Only copy N out of every bytes --interleave-width Set N for --interleave -b --byte Select byte in every interleaved block --gap-fill Fill gaps between sections with --pad-to Pad the last section up to address --set-start Set the start address to {--change-start|--adjust-start} Add to the start address {--change-addresses|--adjust-vma} Add to LMA, VMA and start addresses {--change-section-address|--adjust-section-vma} {=|+|-} Change LMA and VMA of section by --change-section-lma {=|+|-} Change the LMA of section by --change-section-vma {=|+|-} Change the VMA of section by {--[no-]change-warnings|--[no-]adjust-warnings} Warn if a named section does not exist --set-section-flags = Set section 's properties to --add-section = Add section found in to output --update-section = Update contents of section with contents found in --dump-section = Dump the contents of section into --rename-section =[,] Rename section to --long-section-names {enable|disable|keep} Handle long section names in Coff objects. --change-leading-char Force output format's leading character style --remove-leading-char Remove leading character from global symbols --reverse-bytes= Reverse bytes at a time, in output sections with content --redefine-sym = Redefine symbol name to --redefine-syms --redefine-sym for all symbol pairs listed in --srec-len Restrict the length of generated Srecords --srec-forceS3 Restrict the type of generated Srecords to S3 --strip-symbols -N for all symbols listed in --strip-unneeded-symbols --strip-unneeded-symbol for all symbols listed in --keep-symbols -K for all symbols listed in --localize-symbols -L for all symbols listed in --globalize-symbols --globalize-symbol for all in --keep-global-symbols -G for all symbols listed in --weaken-symbols -W for all symbols listed in --add-symbol =[

:][,] Add a symbol --alt-machine-code Use the target's 'th alternative machine --writable-text Mark the output text as writable --readonly-text Make the output text write protected --pure Mark the output file as demand paged --impure Mark the output file as impure --prefix-symbols Add to start of every symbol name --prefix-sections Add to start of every section name --prefix-alloc-sections Add to start of every allocatable section name --file-alignment Set PE file alignment to --heap [,] Set PE reserve/commit heap to /

--image-base
Set PE image base to
--section-alignment Set PE section alignment to --stack [,] Set PE reserve/commit stack to / --subsystem [:] Set PE subsystem to [& ] --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}] Compress DWARF debug sections using zlib --decompress-debug-sections Decompress DWARF debug sections using zlib --elf-stt-common=[yes|no] Generate ELF common symbols with STT_COMMON type -M --merge-notes Remove redundant entries in note sections --no-merge-notes Do not attempt to remove redundant notes (default) -v --verbose List all object files modified @ Read options from -V --version Display this program's version number -h --help Display this output --info List object formats & architectures supported arm-none-eabi-objcopy: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex 16:44:41 Build Finished (took 72ms)

The IDE also often crashes, whatever the configuration compiled. Could you guide me through the configuration process ?

This is not my field and I learn by myself. Sorry if some questions seem trivial. 🙂

BluePygmyOwl commented 4 years ago

Hi, I think I fixed it. See my new commits. It was asking for 'syscalls.c' but it is not needed. So that could simply be deleted. However, the SW4STM32 project settings were a bit messed up too. Although it is my doing, I now have a love-hate relationship with SW4STM32. It simply is difficult to change build paths, if not impossible. But I am happy that I have a DieBieMS firmware that I can compile. Hope it will work for you, and other too.

You don't need to follow my previous actions that I wrote here anymore. Now I simply clone it, open SW4STM32, go to "File -- Open Projects From File System" and select the correct directory. It will automatically find the nested project, and hopefully all settings are correctly imported too. Simply build it. Let me know if this works for you.


Good to know if you will change hardware too: What doesn't help is that the .ioc-file is based on CubeMX version 1.5.0. That version makes complete new (undesired) folders when generating code. And it is not possible to change those project settings in CubeMX when opening the ioc-file. At least on my machine. I had more luck when using the CubeMX v1.11.0 firmware, but that gave other side effects. See for instance all defines I had to add under my story-log item 8. By the way; I made those steps for the efoildevelopment branch, but that - judging from the ioc-file - has a somewhat different pin settings if I recall correctly.

Peemouse commented 4 years ago

Hi @BluePygmyOwl, So I deleted the project from SW4STM32 and also all the directory. Then I downloaded the zip file from your repo and opened it with SW4STM32.

Debug configuration compiles fine but with some warnings (seem to be more related to the application itself). Examples :

../Modules/Src/modPowerState.c:18:11: warning: unused variable 'startupDelay' [-Wunused-variable]

../Drivers/HWDrivers/Src/driverHWUART2.c:46:29: warning: unused variable 'temp' [-Wunused-variable]

However, in Release configuration, I get this :

15:01:48 Clean-only build of configuration Release for project DieBieMS-firmware-gcc make clean rm -rf * 15:01:48 Build Finished (took 72ms) 15:01:49 Incremental Build of configuration Release for project DieBieMS-firmware-gcc make all Building file: ../Src/system_stm32f3xx.c Invoking: MCU GCC Compiler /Users/clement/Documents/Projet eBoard/DieBieMS/DieBieMS-Firmware-GCC/Release arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 '-Dweak=attribute((weak))' '-Dpacked=attribute((packed))' -DUSE_HAL_DRIVER -DSTM32F303xC -I../../../../Inc -I../../../../Drivers/STM32F3xx_HAL_Driver/Inc -I../../../../Drivers/STM32F3xx_HAL_Driver/Inc/Legacy -I../../../../Drivers/CMSIS/Device/ST/STM32F3xx/Include -I../../../../Drivers/CMSIS/Include -O2 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Src/system_stm32f3xx.d" -MT"Src/system_stm32f3xx.o" -o "Src/system_stm32f3xx.o" "../Src/system_stm32f3xx.c" ../Src/system_stm32f3xx.c:88:10: fatal error: stm32f3xx.h: No such file or directory

include "stm32f3xx.h"

^~~~~ compilation terminated. make: *** [Src/system_stm32f3xx.o] Error 1 15:01:49 Build Finished (took 124ms)

BluePygmyOwl commented 4 years ago

@Peemouse : paths for release mode fixed. Thanks for your tests!

The warnings due to application coding is out of my scope. Perhaps they will disappear when @DieBieEngineering merged their latest firmware- & tool-version to something awesome again.