-
Notifications
You must be signed in to change notification settings - Fork 22
newlib占用Flash空间过大 #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
arm-none-eabi-gcc的libc采用的是newlib,因此浮点数相关的操作对于Flash的占用可能会略大 后期我们可能会考虑修改Arduino String以减小对资源的占用 |
st的包也编译不过去吧,感觉不应该算bug,锅应该给编译器
…---原始邮件---
发件人: ***@***.***>
发送时间: 2023年8月3日(周四) 晚上10:51
收件人: ***@***.***>;
抄送: ***@***.***>;
主题: Re: [Air-duino/Arduino-AirMCU] String.toFloat() 编译报错 (Issue #32)
arm-none-eabi-gcc的libc采用的是newlib,因此浮点数相关的操作对于Flash的占用可能会略大
后期我们可能会考虑修改Arduino String以减小对资源的占用
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
用string flash占用可以用异常大来形容,没多少代码 flash就快满了 |
Air001开发板,加一句 printf("%d,%d,%d\n",xxx),Flash就会多占用13% |
参考stm32duino/Arduino_Core_STM32#2036 ,只能重写标准库 |
.toFloat()进行转换 编译报错的原因是flash空间用满不够导致的,调用.toFloat()会占用大量Flash。 |
如果是newlib造成的问题,我们恐怕得重新实现一份字符串格式化的库 也许mtfmt.cc是个不错的解决方案 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
描述一下这个bug / Describe the bug
对字符串 string使用 string.toFloat()会编译报错
而string.toInt()则正常
复现步骤 / To Reproduce
用 String 定义一个浮点数,然后使用.toFloat()进行转换
String a="10.234";
Serial.println(a.toFloat());
只用这两行代码就会编译报错。
预期的行为 / Expected behavior
修复
截图 / Screenshots
无
日志 / Logs
无
系统 / System
win10
软件版本 / Version
Arduino IDE 2.1.0
验证
The text was updated successfully, but these errors were encountered: