Flash Memory Size

Here’s a good tip if you’re building FluidNC manually via Platformio to take advantage of the extra space with the 8MB V1E ESP32:

Create a file called platformio_override.ini and put this as the contents:

[common_esp32_base]
board_build.partitions = FluidNC/ld/esp32/app3M_spiffs1M_8MB.csv  ; For 8Meg ESP32
board_upload.maximum_size = 8388608 ; For 8Meg ESP32
board_upload.flash_size = 8MB ; For 8Meg ESP32

This allows you to leave the existing platformio.ini alone and just override the needed values. I just did this to build and upload 3.9.0. Before, I was modifying platformio.ini and if they touched it, it caused issues when pulling the latest changes.

This works because of this in platformio.ini:

extra_configs=
    platformio_override.ini

The extra_configs parameter allows for additional configuration files which will override existing settings in the base platformio.ini file. Since this file is excluded from checkin via the gitignore file, this means that your local file won’t be overwritten.

https://docs.platformio.org/en/latest/projectconf/sections/platformio/options/generic/extra_configs.html

3 Likes

I bookmarked that for the docs.

1 Like

I just used the install package instead of the webinstaller, it looks like it autodetects the right size. Have you tried this, offhand do you know the command to check, is it $heap or something else?

$LocalFS/Size
LocalFS Total:192.00 KB Used:148.00 KB

or

$LocalFS/List

should give you something like this at the bottom

[/littlefs/ Free:44.00 KB Used:148.00 KB Total:192.00 KB]

1 Like

That says 192kb. But that isn’t the 4 vs 8mb stuff is it?

1 Like

yeah, the 4 MB gets split into multiple partitions, and you end up with like 200Kb of space.
image

spiffs is the part that defines the actual storage area we have access to

0x30000 is 196,608 byte, or 192KB

The 8MB also gets split similarly, and you end up with a little over 1MB

This is because you need a section of Flash for the actual program, and then an equivalent section to support OTA updates saving the firmware copy locally before replacing (or however that happens…).

My understanding is it has to do with how it allocates the memory. With the 8MB config, you get 1.77 MB.

So the default partition file that is in there for the 4MB board, give 1.875MB per partition to the program.

The default for the 8MB board gives a little over 3MB per partition.

that file could probably be edited to take down those partition sizes by about 500KB each, and that would return an extra MB back to addressable space.

You don’t want to take it down too far though, because that loses some of the benefit of the increased size allowing the actual firmware to grow if necessary.

I can’t remember offhand, but I believe we currently use between 80-85% of available disk space currently for the firmware.

However, 1.7MB of FLASH is a lot given the amount of space we currently actually use there, so it gives a lot of headroom as is.

Yes, doubling the flash gives around 9.2 times the usable space for user files, which is a HUGE increase.

So since mine say 192k even though it recognized the 8mb it did not divided it up, or put it to use?

I am not too concerned about it, I could use platformio to do it but I thought the bat files might actually be doing it. I combined all three bat files into one so it is very fast for me to prep boards now, I just use the web installer to load the V1 config files.

correct. You got 4 lonely MB hanging around in there

1 Like

So, the disk partition data and the firmware are built separately.

Once you build the larger partition file, you only have to replace that file in the download, and the scripts should layout the bigger board correctly for you, as well as use the officially built firmware…

Which you could also integrate into your wrapper script to make it easier…

1 Like

Until they order one flashed to take advantage of the extra space, then lose that space when they upgrade.

That should only happen if they choose the ‘fresh-install’ option.

If the new versions are better with OTA updates, and/or flash problems become less frequent, the disk layout shouldn’t ever have to change

2 Likes

I hope so the web installer is getting worse.

So much so I started looking at making my own version of the regular installer. That is why I combined them. I have a lot to learn yet but it seems like I might be able to manage it.

1 Like

So we can use Chrome, edge, opera. I just loaded up edge, so far so good. I have flashed and loaded up 6 boards so far without even refreshing. No issues. Chrome gives me an issue after one usually, even in incognito mode.

3.9.1 webui has a new menu option to load webui v2 or not…looks like v3 as an option is getting closer or easier at least.

WebUI? or web installer?

I see Joacim committed this yesterday, which I guess is a follow-on from this conversation

1 Like

yup, this.

1 Like