STM32MP1 getting started: setup environments
I’m planing to do some research on ST newest MPU series: STM32MP1. It’s a Cortex A7(solo or dual core) + M4 solution, not very powerful but the price might be very competitive. In this post we will setup the development environments.
Choose the suitable base software package
There are 3 basic software packages provided by ST:
- Starter Package(For evaluation)
- Developer Package(For limited modification and application development)
- Distribution Package(For creating custom distribution)
Similar with Qualcomm solutions, there are two packages are available for development purpose. In my scenario I will use Distribution Package for sure, so the following parts of this post is about how to setup environments for Developer Package based development.
BTW the experiences I got during Qualcomm apq8009 based SoC really sucks… Their packages just like a huge shit mountain.
Initialize repo
If you are new to Yocto, you need to install some packages before start(i.e. repo)
1 | mkdir openstlinux-4.19-thud-mp1-19-10-09 && cd openstlinux-4.19-thud-mp1-19-10-09 |
Package structure
From ST WIKI:
1 | openstlinux-4.19-thud-mp1-19-10-09 OpenSTLinux distribution |
Test building image
Environment setup
1 | DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh |
If you want to test without wayland or x11 support, using DISTRO=openstlinux-eglfs MACHINE=st-image-core instead.
If build folder has been created, using blow command to re-use it:
1 | source layers/meta-st/scripts/envsetup.sh build-openstlinuxweston-stm32mp1/ |
Trigger building
1 | bitbake st-image-weston |
st-image-core is also available if you want to create a console only image.
USB Flash
USB flash need to use STM32CubeProgrammer. Device need to switched as usb flash mode as well.
After installation, using STM32_Programmer_CLI to check if device can be detected:
1 | $ sudo STM32_Programmer_CLI -l usb |
Notice: You may need to create a soft link from $HOME/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI
You also can add an udev rule to allow connection without su:
1 | sudo cp $HOME/STMicroelectronics/STM32Cube/STM32CubeProgrammer/Drivers/rules/50-usb-conf.rules /etc/udev/rules.d/ |
If device can be found in DFU mode, using blow cmd to trigger usb flash:
1 | STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-weston/FlashLayout_xxxxxx.tsv |
STM32CubeProgrammer using a .tsv
file to specify flash layout and the binaries are going to use.