arduino / ArduinoCore-samd

Arduino Core for SAMD21 CPU
GNU Lesser General Public License v2.1
472 stars 720 forks source link

bug because of a missing feature: SAMD floating point formatting by sprintf ("%f") is missing #407

Closed dsyleixa closed 5 years ago

dsyleixa commented 5 years ago

other than to Arduino Due (ATSAM3X8E) and ESP8266/ESP32, for SAMD the floating point formatting by sprintf (str,"%f",fvar) is missing, both for fp32 (float) and for fp64(double).

could that please be fixed by default for all SAMD cores?

PS, just to mention: The required Arduino implementation must not be limited by INT32_MAX size dimensions for predecimal digits.

facchinm commented 5 years ago

Should be solved by beta branch which uses arm-none-eabi-gcc-7-2017q4

dsyleixa commented 5 years ago

AFAICS, the Beta Branch is featuring just MKR1000 and Vidor4000? (CMIIW) what about M0/Zero/SAMD21 and M4/SAMD51 ? Finally sprintf "%f" should work for all SAMD boards out of the box (like already for SAM3X8E and ESP).

facchinm commented 5 years ago

We don't officially support M4 (D51) so you should ask Adafruit/ any 3rd party core supporting it. The Beta branch supports all Arduino M0 boards, you just need to delete boards.txt and rename boards.txt.disabled into boards.txt (this will be the default once it becomes official).

dsyleixa commented 5 years ago

I already contacted Adafruit, they stated it's a Arduino SAMD core issue: https://forums.adafruit.com/viewtopic.php?f=57&t=151197#p747810

But finally the core is named "SAMD", not "SAMD21", so it's supposed to work for all.

dsyleixa commented 5 years ago

PS, after having changed the boards.txt, the Adafruit M4 port is greyed out and the board cannot be detected any more. Deleting the beta boards doesn't fix it any more, SAMD51 is not accesable at all!

facchinm commented 5 years ago

after having changed the boards.txt, the Adafruit M4 port is greyed out and the board cannot be detected any more.

You needed to change the boards.txt in Beta folder; independent cores are not affected by other cores change, so the disappearing board must be due to something else

dsyleixa commented 5 years ago

I see, perhaps it's due to a coincidental simultaneous issue.

sandeepmistry commented 5 years ago

@facchinm can this be closed not that the toolchain was updated?

dsyleixa commented 5 years ago

is sprintf (str,"%f",fvar) now available for M4 MCUs (edit: SAMD51) by default, just like for M3 Due?

sandeepmistry commented 5 years ago

This core only supports the SAMD21 Cortex-M0 based boards.

facchinm commented 5 years ago

Indeed, it's fixed by the toolchain update to 7-2017q4

dsyleixa commented 5 years ago

@sandeepmistry wrote:

This core only supports the SAMD21 Cortex-M0 based boards.

@facchinm wrote:

Indeed, it's fixed by the toolchain update to 7-2017q4

1) is that/which is true? 2) how to download this 7-2017q4 version?

@dsyleixa wrote:

is sprintf (str,"%f",fvar) now available for M4 MCUs (edit: SAMD51) by default, just like for M3 Due?

facchinm commented 5 years ago

It works in all architectures where the new toolchain is used (M0 for samd, M4 for nrf52-mbed)

dsyleixa commented 5 years ago

how to download this 7-2017q4 version?

facchinm commented 5 years ago

It's included in latest samd core (from 1.8.1 onwards)