SDK包含了构建OpenSTLinux所需的交叉编译工具链和库。
官方教程地址https://wiki.stmicroelectronics.cn/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP135x-DK/Develop_on_Arm%C2%AE_Cortex%C2%AE-A7/Install_the_SDK
首先安装工具:
sudo apt-get update
sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib chrpath socat cpio python3 python3-pip python3-pexpect
额外设置
echo 'options mmc_block perdev_minors=16' > /tmp/mmc_block.conf
sudo mv /tmp/mmc_block.conf /etc/modprobe.d/mmc_block.conf
下载SDK
下载得到en.SDK-x86_64-stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21.tar.gz
解压SDK
cd $HOME/STM32MPU_workspace/tmp
tar xvf en.SDK-x86_64-stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21.tar.gz
创建STM32MP1 Developer Package SDK目录,并执行SDK安装脚本
mkdir -p $HOME/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package/SDK
chmod +x stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sdk/st-image-weston-openstlinux-weston-stm32mp1-x86_64-toolchain-4.2.1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21.sh
./stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sdk/st-image-weston-openstlinux-weston-stm32mp1-x86_64-toolchain-4.2.1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21.sh -d <working directory absolute path>/Developer-Package/SDK
安装成功后显示的信息如下:
1-x86_64-toolchain-4.2.1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21.sh -d /home/ubuntu/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package/SDK
ST OpenSTLinux - Weston - (A Yocto Project Based Distro) SDK installer version 4.2.1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21
===================================================================================================================================
You are about to install the SDK to "/home/ubuntu/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package/SDK". Proceed [Y/n]? Y
Extracting SDK........................................................................................................................................................................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
$ . /home/ubuntu/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package/SDK/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
每次打开终端使用SDK前执行命令加载环境变量
<blockquote> cd $HOME/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Developer-Package
检查是否加载成功,查看架构
检查交叉编译工具链前缀
检查编译器版本
检查SDK版本
|