1. STM32F103C8, Official core 1.9.0 Compilation of an empty sketch.
Flash 9760 (14%), Ram 820 (4%)
2. STM32F103C8, Official core 1.9.0 dtostrf
Code: Select all
float f;
String s;
void setup() {
Serial.begin(9600);
f = 1.23;
}
void loop() {
char buforS[9];
dtostrf(f, 7 ,2 , buforS);
//s = String(f, 2);
//Serial.print(f, 4);
}
3. STM32F103C8, Official core 1.9.0 s = String(f, 2);
Flash 14412 (21%), Ram 820 (4%)
4. STM32F103C8, Rogers core 2020.5.16 Compilation of an empty sketch.
Flash 18356 (28%), Ram 4256 (20%)
5. STM32F103C8, Rogers core 2020.5.16 dtostrf
Flash 34536 (52%), Ram 4312 (21%)
6. STM32F103C8, Rogers core 2020.5.16 s = String(f, 2);
Flash 34728 (52%) Ram 4312 (21%)
7. Arduino Nano V3 (ATmega328P) Compilation of an empty sketch.
Flash 2774 (9%), Ram 202 (9%)
8. Arduino Nano V3 (ATmega328P) dtostrf
Flash 4298 (13%), Ram 206 (10%)
9. Arduino Nano V3 (ATmega328P) s = String(f, 2);
Flash 4576 (14%), Ram 206 (10%)
In summary, when I use the Official Core, the dtostrf command takes 4480 bytes, the second method s = String (f, 2); takes 4652 bytes.
But if I use Rogers core, the dtostrf command takes 16180 bytes, s = String (f, 2); 16372 bytes.
Similarly for Aurduino Nano V3: 1524 bytes, and 1802 bytes.
Is there any other way to do this conversion? The one that won't eat 16KB? Using Arduino and STM32F103C8, I have a lot of RAM, but 64KB Flash is very low. Especially with the Rogers core.