文章目录
- STM32MP257开发板初体验
-
- [1. 硬件介绍](#1. 硬件介绍)
- [2. 下载编译源码](#2. 下载编译源码)
- [3. 烧录](#3. 烧录)
- [4. 启动](#4. 启动)
STM32MP257开发板初体验
从本篇文章开始本专栏将详细记录学习STM32MP257过程中的学习心得,旨在详细掌握嵌入式LINUX中的全流程内容,主要包括启动流程分析、驱动分析、Yocto系统定制等内容。
1. 硬件介绍
硬件平台:
本文采用米尔电子的 MYC-LD25X核心板及开发板,硬件配置如下:
- 搭载意法半导体最新一代工业级64位微处理器STM32MP257DAK3
- 2G内存
- 8G EMMC
STM32MP257DAK3搭载 双核Cortex-A35 +Cortex-M33,主频1.5GHz+400MHz;
配备1.35 TOPS的NPU ,Lite-ISP功能的MIPI CSI;
集成3D GPU, H.264 硬件编解码,RGB, MIPI DSI 以及 LVDS 显示接口
2. 下载编译源码
编译源码之前需要安装一系列基础库,执行如下指令安装:
cpp
sudo apt-get update
sudo apt-get install -y gawk wget git-core diffstat \
unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev \
xterm sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 \
help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev \
mercurial autoconf automake groff curl lzop asciidoc u-boot-tools cpio \
sudo locales bc libncurses5-dev screen flex bison vim-tiny \
device-tree-compiler xvfb libgtk2.0-dev libssl-dev net-tools libyaml-dev \
rsync liblz4-tool zstd python3-pip git-lfs iputils-ping jq
接下来就是下载米尔电子官方的yocto源码,可以通过如下指令下载:
cpp
repo init -u https://github.com/MYiR-Dev/myir-st-manifest.git --no-clone-bundle --depth=1 -m myir-stm32mp2-6.1.82-1.0.0.xml -b myd-ld25x-v24.06.26-mickledore
然后执行如下编译指令:
cpp
DISTRO=openstlinux-weston MACHINE=myd-ld25x source layers/meta-myir/scripts/envsetup.sh
bitbake myir-image-full -k //编译全功根软件系统 -k: 错误继续编译
bitbake myir-image-core -k //编译最小系统
然后就是初次编译漫长的等待,根据个人电脑硬件配置和网络环境不同,可能持续一到多个小时,最后会在build-openstlinuxweston-myd-ld25x/tmp-glibc/deploy/images/myd-ld25x
路径下面生成众多image,包括TFA,Uboot, kernel和根文件系统等。
3. 烧录
接下来烧录上面编译得到的产物,首先将开发板上的启动选择拨码开关设置到0000,然后USB OTG口连接到电脑,上位机软件选择配置如下:
注意选择的烧录文件是:
cpp
build-openstlinuxweston-myd-ld25x/tmp-glibc/deploy/images/myd-ld25x/flashlayout_myir-image-core/optee
烧录镜像位置选择是:
cpp
build-openstlinuxweston-myd-ld25x/tmp-glibc/deploy/images/myd-ld25x/
4. 启动
烧录完成以后将开发板的拨码开关重新拨到0100
,即EMMC启动,连接串口线到电脑,电脑打开串口软件,可以看到上电信息:
cpp
Welcome to ST OpenSTLinux - Weston - (A Yocto Project Based Distro) 4.2.4-snapshot-20241215 (mickledore)!
[ OK ] Created slice Slice /system/getty.
[ OK ] Created slice Slice /system/modprobe.
[ OK ] Created slice Slice /system/serial-getty.
[ OK ] Created slice User and Session Slice.
[ OK ] Started Dispatch Password �...ts to Console Directory Watch.
[ OK ] Started Forward Password R�...uests to Wall Directory Watch.
[ OK ] Reached target Path Units.
[ OK ] Reached target Remote File Systems.
[ OK ] Reached target Slice Units.
[ OK ] Reached target Swaps.
[ OK ] Listening on RPCbind Server Activation Socket.
[ OK ] Reached target RPC Port Mapper.
[ OK ] Listening on Syslog Socket.
[ OK ] Listening on Process Core Dump Socket.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket.
[ OK ] Listening on Network Service Netlink Socket.
[ OK ] Listening on udev Control Socket.
[ OK ] Listening on udev Kernel Socket.
Mounting Huge Pages File System...
Mounting POSIX Message Queue File System...
Mounting Kernel Debug File System...
Mounting Temporary Directory /tmp...
Starting Create List of Static Device Nodes...
Starting Load Kernel Module configfs...
Starting Load Kernel Module drm...
Starting Load Kernel Module fuse...
Starting Mount partitions...
Starting RPC Bind...
Starting Journal Service...
Starting Load Kernel Modules...
Starting Generate network �...ts from Kernel command line...
Starting Remount Root and Kernel File Systems...
Starting Coldplug All udev Devices...
[ OK ] Started RPC Bind.
[ OK ] Mounted Huge Pages File System.
[ OK ] Mounted POSIX Message Queue File System.
[ OK ] Mounted Kernel Debug File System.
[ OK ] Mounted Temporary Directory /tmp.
[ OK ] Finished Create List of Static Device Nodes.
[ OK ] Finished Load Kernel Module configfs.
[ OK ] Started Journal Service.
[ OK ] Finished Load Kernel Module drm.
[ OK ] Finished Load Kernel Module fuse.
[ OK ] Finished Load Kernel Modules.
[ OK ] Finished Generate network units from Kernel command line.
[ OK ] Finished Remount Root and Kernel File Systems.
Mounting FUSE Control File System...
Mounting Kernel Configuration File System...
Starting Flush Journal to Persistent Storage...
Starting Apply Kernel Variables...
Starting Create System Users...
[ OK ] Mounted FUSE Control File System.
[ OK ] Mounted Kernel Configuration File System.
[ OK ] Finished Flush Journal to Persistent Storage.
[ OK ] Finished Apply Kernel Variables.
[ OK ] Finished Create System Users.
Starting Create Static Device Nodes in /dev...
[ OK ] Finished Create Static Device Nodes in /dev.
[ OK ] Reached target Preparation for Local File Systems.
Starting Rule-based Manage�...for Device Events and Files...
[ OK ] Finished Mount partitions.
Starting Resize root files�...to fit available disk space...
[ OK ] Started Rule-based Manager for Device Events and Files.
[ OK ] Finished Resize root files�...m to fit available disk space.
Mounting /var/volatile...
[ OK ] Finished Coldplug All udev Devices.
[ OK ] Mounted /var/volatile.
Starting Load/Save OS Random Seed...
[ OK ] Reached target Local File Systems.
Starting Rebuild Dynamic Linker Cache...
Starting Create Volatile Files and Directories...
[ OK ] Finished Load/Save OS Random Seed.
[ OK ] Finished Create Volatile Files and Directories.
Starting Rebuild Journal Catalog...
Starting Network Name Resolution...
Starting Network Time Synchronization...
Starting Record System Boot/Shutdown in UTMP...
[ OK ] Finished Rebuild Journal Catalog.
[ OK ] Finished Record System Boot/Shutdown in UTMP.
[ OK ] Finished Rebuild Dynamic Linker Cache.
Starting Update is Completed...
[ OK ] Finished Update is Completed.
[ OK ] Started Network Name Resolution.
[ OK ] Reached target Host and Network Name Lookups.
[ OK ] Started Network Time Synchronization.
[ OK ] Reached target System Time Set.
[ OK ] Found device /dev/dri/card0.
[ OK ] Started Starts Psplash Boot screen.
[ OK ] Created slice Slice /system/systemd-backlight.
Starting Load/Save Screen �...klight:panel-lvds-backlight...
[ OK ] Finished Load/Save Screen �...acklight:panel-lvds-backlight.
[ OK ] Created slice Slice /system/systemd-fsck.
Starting File System Check on /dev/mmcblk1p7...
[ OK ] Finished File System Check on /dev/mmcblk1p7.
Mounting /run/media/vendorfs-mmcblk1p7...
Starting File System Check on /dev/mmcblk1p9...
[ OK ] Mounted /run/media/vendorfs-mmcblk1p7.
[ OK ] Finished File System Check on /dev/mmcblk1p9.
Mounting /run/media/userfs-mmcblk1p9...
Starting File System Check on /dev/mmcblk1p6...
[ OK ] Mounted /run/media/userfs-mmcblk1p9.
[ OK ] Finished File System Check on /dev/mmcblk1p6.
Mounting /run/media/bootfs-mmcblk1p6...
[ OK ] Mounted /run/media/bootfs-mmcblk1p6.
[ OK ] Found device /dev/tee0.
[ OK ] Found device /dev/hwrng.
[ OK ] Started Hardware RNG Entropy Gatherer Daemon.
[ OK ] Reached target System Initialization.
[ OK ] Started Serves stm32mp clocks calibration..
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target Timer Units.
[ OK ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Listening on dropbear.socket.
[ OK ] Reached target Socket Units.
[ OK ] Reached target Basic System.
Starting ST set alsa state configuration...
Starting Avahi mDNS/DNS-SD Stack...
[ OK ] Started Kernel Logging Service.
[ OK ] Started System Logging Service.
Starting D-Bus System Message Bus...
Starting Ethernet Bridge Filtering Tables...
Starting IPv6 Packet Filtering Framework...
Starting IPv4 Packet Filtering Framework...
Starting Reboot and dump vmcore via kexec...
[ OK ] Started Seat for Weston user.
Starting ST Load M33 firmware via remoteproc...
[ OK ] Started Calibrates HSI/CSI clocks.
Starting Resets System Activity Logs...
Starting User Login Management...
Starting TEE Supplicant...
Starting Check if the gpu �...orrect weston configuration...
[ OK ] Started D-Bus System Message Bus.
[ OK ] Finished Ethernet Bridge Filtering Tables.
[ OK ] Finished IPv6 Packet Filtering Framework.
[ OK ] Finished IPv4 Packet Filtering Framework.
[ OK ] Finished Reboot and dump vmcore via kexec.
[ OK ] Finished Resets System Activity Logs.
[ OK ] Started TEE Supplicant.
[ OK ] Finished ST Load M33 firmware via remoteproc.
[ OK ] Started Avahi mDNS/DNS-SD Stack.
[ OK ] Started User Login Management.
[ OK ] Reached target Preparation for Network.
[ OK ] Reached target Hardware activated USB gadget.
[ OK ] Listening on Load/Save RF �...itch Status /dev/rfkill Watch.
[ OK ] Started Temperature Control Service.
Starting Load Kernel Module drm...
>>>PN:MYC-LD257-8E2D-150-I
>>>SN:WKRD24110702600025U
Starting Network Configuration...
[ OK ] Finished Load Kernel Module drm.
Starting Userfs cleanup package...
[ OK ] Created slice User Slice of UID 1000.
Starting User Runtime Directory /run/user/1000...
[ OK ] Finished Check if the gpu �... correct weston configuration.
Starting Load/Save RF Kill Switch Status...
[ OK ] Finished User Runtime Directory /run/user/1000.
[ OK ] Finished ST set alsa state configuration.
Starting Save/Restore Sound Card State...
[ OK ] Started Load/Save RF Kill Switch Status.
[ OK ] Started Network Configuration.
[ OK ] Finished Save/Restore Sound Card State.
[ OK ] Reached target Network.
[ OK ] Reached target Sound Card.
[ OK ] Started IIO Daemon.
Starting Real time performance monitoring...
Starting Simple Network Ma�...ent Protocol (SNMP) Daemon....
Starting Simple Network Ma�...rotocol (SNMP) Trap Daemon....
Starting TSN service...
Starting Permit User Sessions...
Starting Target Communication Framework agent...
[FAILED] Failed to start TSN service.
See 'systemctl status st-tsn.service' for details.
[ OK ] Finished Permit User Sessions.
[ OK ] Started Target Communication Framework agent.
[ OK ] Started Real time performance monitoring.
[ OK ] Started Getty on tty1.
[ OK ] Started Serial Getty on ttySTM0.
[ OK ] Reached target Login Prompts.
Starting User Manager for UID 1000...
Starting Weston graphical session...
[ OK ] Finished Userfs cleanup package.
[ OK ] Started User Manager for UID 1000.
[ OK ] Started Session c1 of User weston.
[ OK ] Started Session c2 of User weston.
[ OK ] Started Session c3 of User weston.
ST OpenSTLinux - Weston - (A Yocto Project Based Distro) 4.2.4-snapshot myd-ld25x ttySTM0
可以通过命令行终端和开发板交互: