Closed lineleb closed 1 year ago
e2prom用的是flash空间,你的代码把代码区域擦了,写bug了
我用的是外置的AT24C128,读写都是通过IIC实现的
给芯片拍张照吧,没见过3F1HH1A
丝印的版本
已使用同一批次同一丝印芯片测试,正常运行,无法复现你描述的问题
项目使用 32196 字节(98%)的程序存储空间。最大值为 32768 字节。
个全局变量使用 1112 个字节(27%)的动态内存,剩下 2984 个字节用于局部变量。最大值为 4096 字节。
AirISP v1.2.7.0
串口 COM27
连接中...
Chip PID is: 0x04 0x40
擦除flash中(请耐心等待)...
擦除成功,耗时 71.9146 ms.
start write data ...
Write 32512 bytes at 0x08000000 in 23719.9374 ms
Leaving...
通过RTS硬件复位...
代码:
const static unsigned char t[1024*21] = {0};
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
for(int i=0;i<sizeof(t);i++)
delay(t[i]);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}
那可能不是flash的问题,我再检查一下是什么原因。 用我提供的代码应该可以复现开启优化可以运行,默认优化无法运行的问题。
描述一下这个bug / Describe the bug
写程序的时候之前调试一直时好的,增加了一些代码之后整个程序不工作,即使在setup部分的代码也不运行。起初怀疑是新增部分代码的问题,后来发现把编译器打开体积优化之后代码就可以运行了。 然后又重新尝试了一下别的程序 也是到65%左右就完全不运行。 芯片丝印后缀是3F1HH1A,不知道是不是这个批次的芯片flash空间不到32k?
复现步骤 / To Reproduce
这段代码正好是编译优化前无法运行 优化后内存占用小一些可以运行
如果正常,应该是什么样 / Expected behavior
正常应该可以运行。
截图 / Screenshots
因为无法运行所以无法截图
日志 / Logs
因为无法运行所以没日志
系统 / System
Win10
PACK包版本 / Version
0.4.5
验证