-
Notifications
You must be signed in to change notification settings - Fork 1
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
Investigate flash and RAM size #32
Comments
A "production" configuration with MQTT + NTP + WEBCONFIG support; logging and serial command server disabled. Compiled with -DCORE_DEBUG_LEVEL=0 -O2. Total Flash size 952925 bytes. Using platform.io "inspect memory" feature:
That adds up to > 750KB. The rest is a little nebulous but corresponds closely to the figure reported for "RAM", 201KB. Anyway it's clear that the firmware proper is only about 75KB (ie, 10% of the Flash) and that the rest is "system" code, and a lot of that is the TLS/TCP/IP/WiFi stack. (LoRa would allow us to ditch MQTT + NTP easily. But WEBCONFIG still requires WiFi, TCP/IP, and HTTP - getting rid of that probably means uploading the config to the device and storing it directly on flash. This impacts the ability to do end-user configuration but with LoRa that is really not much of a concern.) |
FWIW, with a stub LoRa implementation (basically zero bytes) the total code size drops to about 330KB (release build), as we exclude the entire web stack. This configuration will additionally require a small amount of code to implement i2c-based configuration (#55) and a larger and unknown amount of code to support LoRaWAN. The internet is not much help in figuring out how big the code for LoRa might be but for mbedos (presumably on ARM) there was a report of about 150KB added. That would bring us up to about 500KB for a LoRa build, which is pretty hefty for OTA-over-LoRa (while 1MB over WiFi is pretty trivial). See #26. |
Currently the firmware weighs in at 1013853 bytes flash and 48352 bytes RAM during upload (before dynamic allocation during operation). This is pretty hefty and we should look into what's going on. Especially data seems large, but this could just be eg string constants that are copied into RAM, there are a number of those, including help text for serial commands, which can be removed.
There's no need to have very stringent budgets at this time but the dev env says that the limit for flash is 1310720 bytes (0x140000), for some reason. The device has 4MB Flash, supposedly.
The text was updated successfully, but these errors were encountered: