Following on from my posts looking at the Portenta H7 Vision Shield I wanted to see if I could get the dual boot working with Micropython running on the M7 core and C running on the M4 core. So I posted in a bunch of forums and got some help from Ibrahim Abdelkader over on the OpenMV forums.
https://forums.openmv.io/t/portenta-micropython-on-m7-core-c-on-m4-core/6201
Ibrahim pointed me at some suitable code and advised me that I'd need to compile it from source but reminded me that they don't support this kind of custom firmware development. So I thought I'd first start by building the standard micropython firmware and then move across to the OpenMV one and finally add the custom tweaks.
I was building on WSL running a clean image of Ubuntu. After a few false starts took advice from the micropython docs and installed the build essentials package.
sudo apt-get install build-essential
I then cloned the repo, this is essential as the make commands rely on some of the git files to build properly.
git clone https://github.com/micropython/micropython.git cd micropython
Then I build the cross compile tools and the unix variant.
cd mpy-cross make
cd ports/unix make submodules make
To build the STM32 variant you need to have an arm compiler installed. This doesn't seem to be in the apt-get repos so again a few false starts. I followed the advice at https://codelv.com/blog/2021/1/installing-arm-embedded-toolchain-on-ubuntu-20-04 and downloaded and extracted the latest image for my platform. Then updated ~/.bashrc to contain a path to the binaries.
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2 tar -xf gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2
So then I could build the STM32 variant.
cd ports/stm32 make submodules make
That successfully generated some binary images so now over to https://github.com/openmv/micropython to see if I can repeat the process using their fork.