Portenta Micropython on M7 core, C on M4 core?

Hi, which C examples are you referring to ? We don’t have any C examples. If you referring to Arduino’s code, you should ask on Arduino’s forums, if you mean ST HAL examples you should ask on ST’s forums. For what it’s worth, I don’t think what you’re trying to do will work because booting the CM4 alone is not enough, it needs a binary to run and that binary’s address needs to be set somewhere first.

That said I added very basic support for the CM4 in our code, but it’s not enabled by default. If you’re comfortable with building the firmware from source, and using command line tools on Linux you can test it and edit the M4 code if needed. Assuming you can do that, first you need to enable this option in omv/boards/PORTENTA/omv_boardconfig.mk

OMV_ENABLE_CM4=1

And then rebuild the firmware for TARGET=PORTENTA. This will generate two binaries one for the CM7 and CM4. You’ll need to upload the binaries manually with dfu-util… Reset the board to DFU bootloader (double tap reset) then execute the following commands in order:

../tools/dfu-util -w -d 2341:035b -a 1 -s 0x90F00000 -D drivers/cyw4343/firmware.bin
../tools/dfu-util -w -d 2341:035b -a 0 -s 0x8020000 -D build/bin/cm4.bin
../tools/dfu-util -w -d 2341:035b -a 0 -s 0x8040000:leave -D build/bin/firmware.bin

After reset, the CM4 should blink the green LED a few times and then it go to sleep. You can change the CM4 code/main.c here: cm4/src/main.c

NOTE: If you don’t want the CM4 running anymore just reupload the default firmware with the IDE.

Note: At some point we’ll add support for loading the CM4 binary from SD/flash from Python scripts and booting it, it’s just that this feature is not high priority right now. For now you’re on your own, so please don’t post further questions about this feature or building the firmware in general because it’s not something that we officially support.