Arduino Giga R1 Memory Split

In the Arduino IDE, the Tools menu for this board includes a “Flash Split” option which allows you to allocate all 2MB of flash to the M7 core (default) or split the memory with the M4 core. In PlatformIO’s configuration for this board, the default appears to be the 50/50 split, which does not leave enough room for an lvgl example that flashes with room to spare using the Arduino IDE.

So, I need to reconfigure the flash allocation in PlatformIO. Looking at the Configuration section here, and the related giga_r1_m7.json file, it seems some options are available, but not functional.

For example, neither attempting to alter the platformio.ini file as described in the above link or changing the flash memory size directly in the giga_r1_m7.json file works. In the latter case, the build log shows the the increased size at the beginning of the build process, but the flash still fails due to the same lack of space. Here’s the json file section.
“upload”: {
“maximum_ram_size”: 523624,
“maximum_size”: 786432,

I also tried altering this section of the json file as it implies a 50/50 memory split between the cores, which is what I don’t want.
“arduino”:{
“ldscript”: “linker_script.ld”,
“flash_layout”: “50_50”
},

Since that didn’t work, I’m thinking I need to change the “MEMORY” section of the linker_script.ld file located in C:\Users\user_name\.platformio\packages\framework-arduino-mbed\variants\GIGA. However, I have no idea how to correctly alter those settings.

Or am I completely missing something obvious? What is the best way to reconfigure flash usage between the two cores like the “flash split” option in the Arduino IDE?

Any help greatly appreciated! BTW, overall I loves me some PlatformIO!!!

I’m using VSCode in Windows 11.

Per the page you linked, you should be able to overwrite the nested flash_layout”: “50_50 attribute by specfifying

; 100% to M7, 0% to M4.
board_build.arduino.flash_layout = 100_0

in the platformio.ini.

See available values.

Max, you are da man!

I had the syntax wrong when I tried adding the flash_layout line in platformio.ini.

There is one more entry required, or the build still fails because the amount of flash available stays at 768k. This did the trick:

board_upload.maximum_size = 2097152

Now the full memory is available and the flash succeeds!!!

Thanks again,
Steve