BLE + WIFI + OTA updates. How much flash should do I need? 4MB or 8MB?. I need to buy thousand of units

chucrut
Posts: 15
Joined: Tue Oct 18, 2022 10:04 pm

BLE + WIFI + OTA updates. How much flash should do I need? 4MB or 8MB?. I need to buy thousand of units

Postby chucrut » Tue Oct 18, 2022 10:06 pm

There are 4MB and 8MB ESP32 models, and I need some help to choose one. I understand the code first is uploaded to Flash (4MB or 8MB), and then is internally copied to RAM. But RAM is fixed to 512kb. So, I dont understand if more Flash means more space to code and variables (because he 512kb limit of RAM).

My actual code size is 1.300.000 bytes, and I still need to add WIFI and OTA. This is possible with 4MB Flash? Or need more memory space?.

Many thanks!

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: BLE + WIFI + OTA updates. How much flash should do I need? 4MB or 8MB?. I need to buy thousand of units

Postby ESP_Sprite » Wed Oct 19, 2022 2:54 am

No, code is not copied to internal RAM; as you probably figured out that wouldn't fit. Small bits of code that need to be able to run fast or also need to run when the flash is unavailable are generally copied to RAM on startup, but the bulk majority of code executes directly from flash (via a cache to make the process go faster).

I don't think it's possible for us to say how much flash you need; it depends on how you implement the missing features and if you e.g. also need a factory partition beside the two OTA partitions needed. Best way is to do a quick-and-dirty implementation and see how far you get; if you get close to the 4MiB limit better take an 8MiB flash part.

Who is online

Users browsing this forum: Google [Bot] and 89 guests