Hello everyone,
I am a new member in the particle community and a beginner programmer.
I have been working on a code that records an analogue sensor to an sd card and periodically dumbs the file to an FTP server. Everything was working great until yesterday the code stopped compiling out of nowhere. I tracked the issue down and apparently the array I an using as a buffer to store the sensor values is not working. And keep in mind NOTHING has changed it just suddently stopped compiling.
Now here is weird issue number 2, the code used to take 20%ish of the onboard flash, now its around 100%!!
And icing on the cake, I created a new program that’s complitely empty:
void setup() {
}
void loop()
{
}
It takes 84% of the flash and 52% of the RAM!!!
In a nutshell:
Flash used 92544 / 110592 83.7 %
RAM used 10712 / 20480 52.3 %
Is there some online updates going? I’m very confused.
Cheers
Sebastien
@superseb, are you targeting the correct device and firmware version? Those look like stats for a Core target.
2 Likes
@peekay123, thanks a lot, once again you solved my problem. I have already debugged so many issues thanks to your numerous posts on this forum!!
So here is what happened. I just bought an electron and added it to my account. Because of this, there is no device selected by default when you compile, and the compiler finds random errors that did not exist before. That’s what confused me.
The second issue is that the memory summary is only valid for a Core, even if I select a photon it does not show the extra RAM and you can thus use more than 100% of it.
Bug report for particle folks:
-force device selection before compiling otherwise compiler finds fake error
-update flash and RAM usage based on the device used
The problem is is defaults to a Core. Forcing the user to "star" a device before compilation is a great idea.
If you select the correct device, it should give you the correct stats. Here is a test I did with a small app:
Photon:
Output of arm-none-eabi-size:
text data bss dec hex
9084 576 1500 11160 2
In a nutshell:
Flash used 9660 / 110592 8.7 %
RAM used 2076 / 20480 10.1 %
Electron:
Output of arm-none-eabi-size:
text data bss dec hex
9820 476 1636 11932 2
In a nutshell:
Flash used 10296 / 110592 9.3 %
RAM used 2112 / 20480 10.3 %
Core:
Output of arm-none-eabi-size:
text data bss dec hex
97608 1576 9864 109048 1
In a nutshell:
Flash used 99184 / 110592 89.7 %
RAM used 11440 / 20480 55.9 %
I’m confused, I see the same problem in your test.
All the RAM is xxx/20480. 20480 is only for the core, the photon has 70k available for example.
In my code I have this:
Output of arm-none-eabi-size:
text data bss dec hex
25532 220 43712 69464 10
In a nutshell:
Flash used 25752 / 110592 23.3 %
RAM used 43932 / 20480 214.5 %
@superseb, yup that is an ongoing beef we Elites have had since the Photon came out. We continue to gently prod the Particle folks to fix this.
1 Like