joe714 / pixelclient

ESP32 firmware for PixelGW client
Apache License 2.0
11 stars 2 forks source link

Resize partitions to fit 4MB by default #2

Open Everspace opened 2 weeks ago

Everspace commented 2 weeks ago

I was spinning this up for the first time, and I'm very new at electronics and working with these microcontrollers.

I ran into some problems initially flashing my esp32 eventually to learn that the partition table was configured too big for the default 4MB on a ESP32-WROOM. If you have a larger one apparently it's just a warning so targeting the smallest size would allow for anything larger to boot up.

I ended up changing the partition.csv table to the following, and editing a few things in sdkconfig to point to 4MB as the flash size. It's working now but I am unsure if these were the actually correct way to go about things.

Another thing I enabled was build optimizations which seemed to have not been toggled on, which can reduce the size of the resultant binaries.

#Name,    Type,  Subtype,   Offset,   Size,     Flags
otadata,  data,  ota,       0x9000,   0x2000,
nvs,      data,  nvs,       ,         0x4000,
ota_0,    app,   ota_0,     0x10000,  1M,
ota_1,    app,   ota_1,     ,         1M,
spiffs,   data,  spiffs,    ,         500K,
joe714 commented 2 weeks ago

I think this is the right track. I use the 8MB parts for headroom but this can probably shrink to a smaller one. I should probably figure out a way to build multiple release builds (so I can support the WROVER parts with SPI RAM as well) but I'm trying not to pull in platform.io.

If I really need to cut down space the spiffs partition can probably go entirely, I have it for future use but am not currently using it.

If you give me a complete pull request and I can test it on the devices I have I can accept it.

Everspace commented 2 weeks ago

I'm not really familiar on what program or interface I should work with to make these adjustments. What documentation can you point me to?

jmas08 commented 4 days ago

Hi @Everspace. Can you please share what you changed in the sdkconfig.

Thanks