Skip to content

Commit

Permalink
improved platformio.ini: better comments, added some parts of Almight…
Browse files Browse the repository at this point in the history
…yFrog's "platformio build fails" issue
  • Loading branch information
larsmm committed Oct 31, 2020
1 parent 975f9ab commit 411a29e
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,30 @@ board = genericSTM32F103RC
debug_tool = stlink
upload_protocol = stlink

; Optional: use latest version of toolchain-gccarmnoneeabi: search for "toolchain-gccarmnoneeabi" on https://bintray.com/platformio/tool-packages and look at files-tab to get latest version number. If you are having problems disable it, older version should also work fine. https://launchpad.net/gcc-arm-embedded/+milestones
platform_packages =
toolchain-gccarmnoneeabi @ 1.90301.200702 # https://community.platformio.org/t/can-you-update-toolchain-gccarmnoneeabi/12733
toolchain-gccarmnoneeabi @ >=1.90301.200702

; Serial Port settings (make sure the COM port is correct)
monitor_port = COM3
monitor_speed = 38400

board_build.ldscript=./STM32F103RCTx_FLASH.ld

build_flags =
-I${PROJECT_DIR}/inc/
-DUSE_HAL_DRIVER
-DSTM32F103xE
-Wl,-T./STM32F103RCTx_FLASH.ld
-Wl,-u,_printf_float # enable float for printf
-Wno-comment # surpress warnings for multi-line-comments
-Wno-parentheses
-fsingle-precision-constant # do not use double precision (64 bit) by default
-g -ggdb ; to generate correctly the 'firmware.elf' for STM STUDIO vizualization and gdb debugger
# -Wl,-lnosys
-DSTM32F103xE ; set correct cpu
-Wl,-u,_printf_float ; enable float for printf
; -Wl,-lnosys ; needed for some functions of libc
-Wno-comment ; surpress warnings for multi-line-comments
-Wno-parentheses ; surpress warnings for parentheses
-fsingle-precision-constant ; do not use double precision (64 bit) by default
-g -ggdb ; to generate correctly the 'firmware.elf' for STM STUDIO vizualization and gdb debugger
-D VARIANT_BBCAR
; -Og # optimized for debugging, https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
-O2 # optimized for speed
#-DGIT_BRANCH=´git rev-parse --abbrev-ref HEAD´
#-DDATE=´date´
; -Og ; optimized for debugging, https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
-O2 ; optimized for speed
; Tests for automatically adding git version to compiled binary:
; -DGIT_BRANCH=´git rev-parse --abbrev-ref HEAD´
; -DDATE=´date´
; https://docs.platformio.org/en/latest/projectconf/section_env_build.html#projectconf-dynamic-build-flags
#!echo "-DGIT_HASH="$(git describe --always --dirty)
; !echo "-DGIT_HASH="$(git describe --always --dirty)

0 comments on commit 411a29e

Please sign in to comment.