Hi everyone,
I have been tinkering for the last two days with an issue: I had the issue that we use tkinter in extra_scripts which was apparently not included in the latest shipped-with python version (despite deleting penv and python3 folders as recommended in the changelog) - however, I solved this by using my global python installation instead, which includes tkinter by default, as written here.
Interestingly, an (probably unrelated issue) also occurred: When using either the built-in python (but not tkinter-scripts) or global python, linking ends with the following error:
.pio\build\sensotronic2\libFrameworkArduino.a(WString.cpp.o): In function `String::String(char const*)':
WString.cpp:(.text._ZN6StringC2EPKc+0x1c): undefined reference to `__wrap_realloc'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\sensotronic2\firmware.elf] Error 1
I tried the same procedures on other PCs who did NOT have this issue. I also tried clean-reinstalling VSCode, all extensions including platformio IDE, and C:/.platformio folders, re-cloning the project from git etc. to no success. I then noticed that I had the “GNU Arm Embedded Toolchain” toolchain installed (independently of the automatically downloaded one which comes with the used platform? in .platformio/toolchain-gccarmnoneeabi folder). Uninstalling this + removing PATH variables etc. also did not lead to a solution and was previously also not causing any issues.
At this point, I am kind of running out of options since the behavior is not reproducible on other PCs (Windows machines with same OS version that I have) but potentially one of you has an idea what the reason for this could be.
System: Windows 11 Pro 10.0.22621 Build 22621.
platformio.ini:
[platformio]
default_envs = sensotronic2
;default_envs = config_writer_s2
;default_envs = unit_test_s2
[env]
platform = nordicnrf52
debug_tool = jlink
upload_protocol = jlink
board_build.filesystem = littlefs
board_build.variants_dir = sensotronic_variants
framework = arduino
monitor_speed = 115200
monitor_filters = send_on_enter
monitor_echo = yes
;build_type = debug ;disable optimizations for debugging
lib_deps =
bblanchon/ArduinoJson@^6.19.4
bakercp/CRC32
PowerBroker2/SafeString@^4.1.24
nickgammon/Regexp
https://github.com/bblanchon/ArduinoStreamUtils@^1.7.3
adafruit/Adafruit SPIFlash@^4.0.0
https://github.com/koendv/RTTStream@^1.3.1
https://github.com/thijse/Arduino-Log@^1.1.1
platform_packages =
framework-arduinoadafruitnrf52
[env:sensotronic2]
board = adafruit_feather_nrf52840
build_src_filter = +<*> -<.git/> -<.svn/> -<config/write_config.cpp>
build_flags =
${env.build_flags}
-DNOT_AN_INTERRUPT=-1 ; see https://github.com/evert-arias/EasyButton/issues/50
-DSPI_32MHZ_INTERFACE=1 ; this forces SPIM2 (instead of 3) and avoids this bug: https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev3/ERR/nRF52840/Rev3/latest/anomaly_840_174.html?cp=4_0_1_0_1_16
-DLFS_FLASH_ADDR=0xD9000
lib_deps =
${env.lib_deps}
evert-arias/EasyButton@^2.0.1
https://github.com/sendance/Adafruit_LSM6DS.git
extra_scripts =
${env.extra_scripts}
The issue seems to be related to this line in the framework’s platform.txt for compiler ld-flags:
compiler.ldflags=-mcpu={build.mcu} -mthumb {build.float_flags} -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=realloc -Wl,--wrap=calloc --specs=nano.specs --specs=nosys.specs