Update: I have to use this in platform.txt for F4
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/
{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf"
"-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common
-Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} -Wl,--end-group
Please also attach the error messages.
The repo is designed for use with Arduino IDE, so your issues may be due to a Sloeber problematic…
Under PlatformIO I had no problems…
No error messages (provided I changed the chunk in the platform.txt, also see above). It compiles fine.
The older version of my libmaple repo works with Sloeber..
- Arduino_STM32 Org.JPG (17.27 KiB) Viewed 560 times
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/
{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf"
"-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common
-Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} -Wl,--end-group
having the latest version of Roger´s repo:
– I opened Arduino IDE, file->new
– selected “Generic STM32F407V series”, “USB serial (CDC)”
– pasted your example
– pressed the “Verify” button…
-> success.
No warnings, no errors.
– changing to “USB inactive”
– pressed the “Verify” button…
-> success.
No warnings, no errors.
So it doesn’t seem to be a Libmaple issue, since it works fine with Arduino IDE.
AS I told, your issue is probably linked with Sloeber.
Sorry, but there I cannot help you.
Closed from my side.
P.S. please also change the title.
Sorry, but there I cannot help you.
Closed from my side.
@steve: I do not request you to do.. The fact the libmaple does not compile sources under Sloeber is indeed a kind of issue, as the Sloeber is an Eclipse plugin for arduino ide stuff.. There could be people who want to run Sloeber as the Sloeber is a bit more advanced as the arduino ide.. And there is not such code without bugs/issues, you know that well..


I just want you to remove the reference of the issue to libmaple, because people seeing this may think that there is something wrong with libmaple core.
But it works under Arduino IDE, as it should.
In reality your issue is Eclipse+Sloeber plugin related.
http://www.stm32duino.com/viewtopic.php … =20#p32917
http://www.stm32duino.com/viewtopic.php … 924#p32924
When running the demo the latest crashes here, while Daniel’s works.
Maybe a third person may test. It is a quick test, ie with BluePill or Maple Mini.
Set n = 4000 for example.
“Libmaple problem, program crashes with call to malloc.”
You have linked to it yourself
[RogerClark – Tue Aug 15, 2017 10:03 pm] –
This is a duplicate post thread and will be removed
OK from my side.
It is because the multiplication in map() overflows.
This is a fix which works fine here (there is “long” in the original, I assume “long” == “int32_t”):
// Fix by Pito 9/2017
static inline int32_t map(int32_t value, int32_t fromStart, int32_t fromEnd,
int32_t toStart, int32_t toEnd) {
return ((int64_t)(value - fromStart) * (toEnd - toStart)) / (fromEnd - fromStart) +
toStart;
}
I’ve updated LibMaple F1 and F4 with your fix
(and attributed it to you)
On map(), looks like at least Teensy, and perhaps Arduino, have gone a bit further:
https://github.com/PaulStoffregen/cores … ring.h#L46
And I saw some conversation on allowing toend < tostart, not sure if that case is covered already?