STM32-Arduino
STM32-Arduino copied to clipboard
Attempting to download C projects with releases 0.3.x and later result in hard fault error
After upgrading tools to the 0.3.x firmware release and later, attempts to program a project containing a C file results in a hard fault blinking red LED error condition as described by Particle Docs.
After review of changes since the 0.2.x platform releases, I noticed the platform.txt compile settings for c files were removed in 145219332a057558590256d33569acd8dc305a94.
Reverting the configuration to the values used before this commit and adding -mthumb as was done with the C++ flags as shown in this commit resolves this issue.
The issue can be demonstrated and fix can be tested with a small change to pull in a C file within the Blink.ino example project. See this branch and example project Blink_C for an example. Building/downloading this project with the platform.txt file on the master tree results in a hard fault condition. Modifying the platform.txt file at C:\Users\Username\AppData\Local\Arduino15\packages\RedBear\hardware\STM32F2\0.3.1\platform.txt as shown in this commit resolves the issue. Tested with Arduino 1.8.5 on Windows.