Upgrade to new mbed framework and PlatformIO build system

This commit is contained in:
Martin Jaeger
2019-03-20 11:56:41 +01:00
parent 9510c05932
commit 3d36e3224c
2 changed files with 48 additions and 36 deletions
+22
View File
@@ -0,0 +1,22 @@
{
"config": {
"enable-led-control-example": true,
"LED": "NC",
"BUTTON": "NC",
"BUTTON_MODE": "PullUp"
},
"target_overrides": {
"NUCLEO_L073RZ": {
"target.lse_available" : 0,
"target.clock_source" : "USE_PLL_HSI",
"target.stdio_uart_tx" : "PA_9",
"target.stdio_uart_rx" : "PA_10"
},
"NUCLEO_F072RB": {
"target.lse_available" : 0,
"target.clock_source" : "USE_PLL_HSE_XTAL|USE_PLL_HSI",
"target.stdio_uart_tx" : "PA_9",
"target.stdio_uart_rx" : "PA_10"
}
}
}
+26 -36
View File
@@ -5,44 +5,35 @@
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
[platformio]
# Select the charge controller hardware by uncommenting one of the following lines
#env_default = libresolar_0_05
env_default = libresolar_0_10
#env_default = libresolar_0_10
#env_default = cloudsolar_0_2
#env_default = cloudsolar_0_4
#env_default = pwm_0_1
[common]
# select specific stm32 version to prevent automatic update of mbed
platform = ststm32@~4.5.0
# select specific stm32 version, as automatic updates of mbed could break compatibility
platform = ststm32@~5.3.0
#platform = https://github.com/platformio/platform-ststm32.git
#upload_protocol = mbed
upload_protocol = stlink
#upload_protocol = jlink
# Custom Serial Monitor port
monitor_port = /dev/ttyACM0
# Custom Serial Monitor baud rate
monitor_speed = 115200
# Settings:
# - enable float formatting for printf, adding approx. 7 kB of bin file size
# - C++11 to be able to define default values for struct members
# - Use low speed internal clock (LSI) for RTC (no LSE crystal on PCB)
# Compiler settings
build_flags =
# -Wl,-u_printf_float
# -fstack-usage
-Wl,-Map,memory.map
-D MBED_CONF_TARGET_LSE_AVAILABLE=0
-D TURN_OFF_MBED_DEPRECATED_WARNING
# removes deprecated warnings until mbed fixes USB stack
# -D PIO_FRAMEWORK_MBED_RTOS_PRESENT
# -D PIO_FRAMEWORK_MBED_EVENTS_PRESENT
-D MBED_BUILD_PROFILE_RELEASE
# -D MBED_BUILD_PROFILE_DEBUG
lib_deps_external =
https://github.com/ThingSet/thingset-cpp
@@ -52,63 +43,62 @@ lib_ignore = USB, mbed-USBDevice, mbed-mbedtls
#### BOARD DEFINITIONS ########################################################
# https://github.com/LibreSolar/MPPT-Charger_20A/tree/0a19fcb8f3
[env:libresolar_0_05]
platform = ${common.platform}
framework = mbed
board = nucleo_f072rb
upload_protocol = ${common.upload_protocol}
monitor_port = ${common.monitor_port}
monitor_speed = ${common.monitor_speed}
build_flags = ${common.build_flags}
-D PCB_LS_005=1
lib_deps = ${common.lib_deps_external}
lib_ignore = ${common.lib_ignore}
# https://github.com/LibreSolar/MPPT-Charger_20A/tree/5bc39183c8
[env:libresolar_0_10]
platform = ${common.platform}
framework = mbed
board = nucleo_f072rb
upload_protocol = ${common.upload_protocol}
monitor_port = ${common.monitor_port}
monitor_speed = ${common.monitor_speed}
build_flags = ${common.build_flags}
-D PCB_LS_010=1
-D MBED_CONF_TARGET_STDIO_UART_TX=PA_9
-D MBED_CONF_TARGET_STDIO_UART_RX=PA_10
lib_deps = ${common.lib_deps_external}
lib_ignore = ${common.lib_ignore}
# https://github.com/LibreSolar/MPPT-Charger_10A/tree/586626f3d8
[env:cloudsolar_0_2]
platform = ${common.platform}
framework = mbed
board = nucleo_f072rb
upload_protocol = ${common.upload_protocol}
monitor_port = ${common.monitor_port}
monitor_speed = ${common.monitor_speed}
build_flags = ${common.build_flags}
-D PCB_CS_02=1
-D MBED_CONF_TARGET_STDIO_UART_TX=PA_9
-D MBED_CONF_TARGET_STDIO_UART_RX=PA_10
lib_deps = ${common.lib_deps_external}
lib_ignore = ${common.lib_ignore}
# https://github.com/LibreSolar/MPPT-Charger_10A/tree/63e5842671
[env:cloudsolar_0_4]
platform = ${common.platform}
framework = mbed
board = nucleo_l073rz
#board = disco_l072cz_lrwan1
#board = cloudsolar_0_3
upload_protocol = ${common.upload_protocol}
#upload_port = /run/media/martin/NODE_F072RB/
monitor_port = ${common.monitor_port}
monitor_speed = ${common.monitor_speed}
build_flags = ${common.build_flags}
-D PCB_CS_04=1
-D MBED_CONF_TARGET_STDIO_UART_TX=PA_9
-D MBED_CONF_TARGET_STDIO_UART_RX=PA_10
# -D MBED_CONF_TARGET_LPTICKER_LPTIM=0
# - disable LP ticker based on LPTIM (because does not work...)
# -D PIO_FRAMEWORK_MBED_RTOS_PRESENT
# -D PIO_FRAMEWORK_MBED_EVENTS_PRESENT
lib_deps = ${common.lib_deps_external}
lib_ignore = ${common.lib_ignore}
# https://github.com/LibreSolar/PWM-Charger_20A
[env:pwm_0_1]
platform = ${common.platform}
framework = mbed
board = nucleo_l073rz
upload_protocol = ${common.upload_protocol}
monitor_speed = ${common.monitor_speed}
build_flags = ${common.build_flags}
-D PCB_PWM_01=1
lib_deps = ${common.lib_deps_external}
lib_ignore = ${common.lib_ignore}