Portenta H7 flash split

How do enable flash split like the way that i can do in the arduino ide?
I want too use a 100/0 split meaning that i want all flash to be allocated towards the m7 core and the m4 only uses the sdram.

Because i can’t get the example “BootM4_from_SDRAM” from arduino working using platformio.

is there an option too enable this type of flash split?

Looking a t the baord definitions

so the first instinct would be to add

board_build.arduino.flash_layout = 100_0

to the platformio.ini.

Internally, this is handled in the builder script

to handle it exactly like the Arduino IDE would

i have done this but it still reports the following,
RAM: [== ] 16.7% (used 87432 bytes from 523624 bytes)
Flash: [===== ] 52.1% (used 409888 bytes from 786432 bytes)
Or does this indicator not update with the change too flash_layout

I think it’s an oversight that upload.maximum_size and upload.maximum_ram_size are not updated with the flash layout split, thus the indicated numbers will be wrong, but the firmware will still be built, linked and uploaded correctly.

You can e.g. check if the effect of

    elif flash_layout == "100_0":
        defines.append(("CM4_BINARY_START", "0x60000000"))

has taken place doing a Project Task → Clean and then Project Task → Advanced → Verbose Build.

Along the wall of compiler invocations, capture one, and it should have -DCM4_BINARY_START=0x60000000 in it hopefully. If not, it didn’t work.

is indeed set, and the code does compile and work.

1 Like

i don’t know i i should add too this, or open a new issue.

but i have an issue my binary has gotten bigger then the default 768KB of flash. and now i can still flash the board when i put this also in my platformio.ini

board_upload.maximum_size = 1966080

but my board get’s stuck on a green light at boot. i know it’s only because of the size. and not the code itself. it tested by creating a big static array in a .h file until it stopped working. with just the basic blinking example as main.

So although a flash spit of 100_0 is selected which should give the Cortex-M7 all the flash, it won’t boot any firmware beyond the space available in a 50_50 split?

Is that reproducable with the same or an equivalent dummy firmware in the Arduino IDE?