platform-atmelavr icon indicating copy to clipboard operation
platform-atmelavr copied to clipboard

std::floor() on a float crashes Arduino Nano

Open systemofapwne opened this issue 5 years ago • 0 comments

Hello, I have been redirected here to give an error report.

Calling std::floor() on a float, the arduino gets stuck. Compiling with Arduino IDE instead of PlatformIO does not cause this issue. Using double as datatype does also not cause the issue. Only when using float and PlatformIO.

I tested this on my Arduino Nano (new Bootloader) via PlatformIO and the following platformio.ini [env:uno] platform = atmelavr board = uno framework = arduino monitor_port = COM3 monitor_speed = 9600

Here is an example code, which will make your Arduino unresponsive main.cpp

`` #include <Arduino.h> #include

void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial.println("Did you crash?"); float a = 1.9; std::floor(a); Serial.println("No!"); }

void loop() { // put your main code here, to run repeatedly: } ``

It will print "Did you crash?" on screen while never reaching the Serial.println("No!").

systemofapwne avatar May 27 '19 20:05 systemofapwne