文章目录

  • 配置文件
  • Buildroot 构建
  • SD卡刷写
  • 启动
  • 开机日志
  • 基本测试
  • 配置成5.10内核测试
  • 参考

配置文件

今天的主角是 stm32mp157a-dk1, 一年半前搞活动400块入的, 遂吃灰至今, 终得以重见天日…

幸运的是, Buildroot已经内置了该平台的预定义配置, 今天就跑下默认配置, 走通流程, 混个脸熟, 默认的环境和上一篇一样:

  • 操作系统: Ubuntu 20.04 (focal, 5.11.0-41-generic)
  • Buildroot: 2021.02.8

查看支持的st板子如下

$ cd buildroot-2021.02.8/board
$ tree stm*
stmicroelectronics
├── common
│   ├── stm32f4xx
│   │   └── stm32-post-build.sh
│   └── stm32mp157
│       ├── genimage.cfg.template
│       └── post-image.sh
├── stm32f429-disco
│   ├── flash.sh
│   ├── patches
│   │   └── linux
│   │       └── 0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch
│   └── readme.txt
├── stm32f469-disco
│   ├── extlinux.conf
│   ├── flash.sh
│   ├── genimage.cfg
│   ├── linux.fragment
│   ├── post-build.sh
│   └── readme.txt
├── stm32mp157a-dk1
│   ├── linux.config
│   ├── overlay
│   │   └── boot
│   │       └── extlinux
│   │           └── extlinux.conf
│   ├── readme.txt
│   └── uboot-fragment.config
└── stm32mp157c-dk2├── linux.config├── overlay│   └── boot│       └── extlinux│           └── extlinux.conf├── readme.txt└── uboot-fragment.config15 directories, 20 files

配置文件在 commonstm32mp157a-dk1 两个文件夹内

Buildroot 构建

# Buildroot 直接加载该配置
# 参考 board/stm32mp157a-dk1/readme.txt$ make stm32mp157a_dk1_defconfig
#
# configuration written to /home/z/play/buildroot-2021.02.8/.config
## 查看下配置, 不做任何更改
$ make menuconfig# Target options: 默认配置 cortex-A7# System configuration, 默认
# 根文件系统覆盖目录设置为 board/stmicroelectronics/stm32mp157a-dk1/overlay/, 该选项告诉Buildroot要在构建结束时将该目录的内容复制到根文件系统中
# 创建文件系统镜像后运行的自定义脚本 board/stmicroelectronics/common/stm32mp157/post-image.sh# Kernel, 默认自定义内核, 版本5.8.13, 编译DTB, DTS文件名stm32mp157a-dk1, 安装内核镜像(zImage)到/boot# Target packages, 默认只使能了BusyBox# Bootloaders, 默认使能U-Boot, 自定义版本, 2020.07# 切换到国内源
echo 'BR2_KERNEL_MIRROR="https://mirror.bjtu.edu.cn/kernel/"' >> .config
echo 'BR2_GNU_MIRROR="http://mirrors.nju.edu.cn/gnu/"' >> .config
echo 'BR2_LUAROCKS_MIRROR="https://luarocks.cn"' >> .config
echo 'BR2_CPAN_MIRROR="http://mirrors.nju.edu.cn/CPAN/"' >> .config
make menuconfig# 先make clean, 防止之前其它平台的干扰
make clean# 直接编一把试试, 13:25~13:49, 约花费25分钟
$ make -j $(nproc)
...
INFO: cmd: "mkdir -p "/home/z/play/buildroot-2021.02.8/output/images"" (stderr):
INFO: hdimage(sdcard.img): adding partition 'fsbl1' (in MBR) from 'tf-a-stm32mp157a-dk1.stm32' ...
INFO: hdimage(sdcard.img): adding partition 'fsbl2' (in MBR) from 'tf-a-stm32mp157a-dk1.stm32' ...
INFO: hdimage(sdcard.img): adding partition 'ssbl' (in MBR) from 'u-boot.stm32' ...
INFO: hdimage(sdcard.img): adding partition 'rootfs' (in MBR) from 'rootfs.ext4' ...
INFO: hdimage(sdcard.img): writing GPT
INFO: hdimage(sdcard.img): writing protective MBR
INFO: hdimage(sdcard.img): writing MBR# 一次成功, 查看输出文件
$ cd output/images
$ ls -lh
total 27M
-rw-r--r-- 1 z z 120M Jan 11 21:49 rootfs.ext2  # 下面的ext4指向这个ext2
lrwxrwxrwx 1 z z   11 Jan 11 21:49 rootfs.ext4 -> rootfs.ext2 # 根文件系统镜像, 包含所有用户空间库和应用
-rw-r--r-- 1 z z 122M Jan 11 21:49 sdcard.img   # 完整的即用型SD卡镜像
-rwxr-xr-x 1 z z  53K Jan 11 21:49 stm32mp157a-dk1.dtb  # 设备树Blob
-rw-r--r-- 1 z z 200K Jan 11 21:45 tf-a-stm32mp157a-dk1.stm32   # 第一阶段引导加载程序?
-rw-r--r-- 1 z z 862K Jan 11 21:46 u-boot.stm32 # 第二阶段引导加载程序?
-rw-r--r-- 1 z z 4.0M Jan 11 21:49 zImage   # Linux内核镜像# 全局搜出来的设备树文件位置为
# buildroot-2021.02.8/output/build/arm-trusted-firmware-v2.2/fdts/stm32mp157a-dk1.dts
# 相关的设备树文件都在该文件夹

参考链接中给出了Buildroot干了什么, 直接机器翻译(19年的文章, 部分有出入):

  • 从 ARM 网站下载并安装预构建的 ARM 编译器,并在目标根文件系统中安装 C 和 C++ 库
  • 从意法半导体Github存储库下载Linux内核源代码,使用我们的配置文件对其进行配置,构建,安装以及目录中的目标根文件系统中和目录中。它还在目标根文件系统中安装 Linux 内核模块zImage stm32mp157c-dk2.dtb output/images /boot
  • 从 STMicroelectronics Github 存储库下载 U-Boot 源代码,对其进行配置、构建和安装,并将 u-boot.img 放入u-boot.stm32? output/images
  • 从项目官网下载 Busybox 源代码,对其进行配置、构建并安装到目标根文件系统中。
  • 复制目标根文件系统内的rootfs overlay的内容
  • 生成根文件系统的ext4映像,并将其安装为output/images/rootfs.ext4
  • 调用genimage.sh(post-image.sh?)脚本,其目的是生成最终的SD卡镜像,output/images/sdcard.img

下面的信息也可以参考链接

  • 分区信息: buildroot-2021.02.8/board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
  • 引导信息: buildroot-2021.02.8/board/stmicroelectronics/stm32mp157a-dk1/overlay/boot/extlinux/extlinux.conf, 指定内核/设备树/root的位置

SD卡刷写

固件更新的方式有多种:

  • 官方的STM32CubeProgrammer, 通过USB口, 配合上面输出的两个 .stm32 引导文件 和 .ext4的文件(如果板子上是emmc, 可以启动后把sd卡里的固件拷贝到emmc或者通过)
  • linux下dd命令把sdcard.img写入sd卡
  • win下用rufussdcard.img写入sd卡

stm32mp157a-dk1存储是sd卡(tf卡), 用上面输出的sdcard.img, Linux下制作启动盘常用的dd命令(未测试)

# 有时候会看到选项 bs=1M conv=fdatasync status=progress
# 插入SD卡, 在 buildroot-2021.02.8 目录下执行
# /dev/mmcblk0 换成sd卡对应的dev
$ sudo dd if=output/images/sdcard.img of=/dev/mmcblk0

因为手头的USB读卡器损坏, 恰好笔记本(Win10)有SD卡槽, 所以实际测试把sdcard.img拷贝到win10, 然后用的是win10下的 rufus 制作的启动盘

SD卡所有数据会被清除

完成后, 点关闭, 弹出SD卡

启动

板子插上SD卡, 下面检查下拨码开关的位置

stm32mp157a-dk1板子背面有拨码开关, 丝印BOOT0BOOT2, 查板子的用户手册

要从SD启动, 所以两个拨码开关都拨到ON的位置, 也就是上图最右边的情况.

找根MicroUSB线插到板子上的CN11, 连的是ST-LINK V2, STM32MP157的调试串口就连到ST-LINK上, 波特率默认115200, 可以用串口工具打开, 比如Linux下的minicom, Win10下的Putty, SecureCRT, Xshell, MobaXterm等, 打开后等待调试信息输出.

直接用笔记本的65W的TypeC电源插到板子的CN6来给板子供电.

开机日志

可以从串口终端里看到板子的启动信息, 里面的中文注释是后加的, 开机时间很短, uboot倒计时2s, 内核加载到登录只有大概3s

NOTICE:  CPU: STM32MP157AAC Rev.B
NOTICE:  Model: STMicroelectronics STM32MP157A-DK1 Discovery Board
NOTICE:  Board: MB1272 Var1 Rev.C-01
NOTICE:  BL2: v2.2(release):
NOTICE:  BL2: Built : 21:45:47, Jan 11 2022      # 编译时间对的上
NOTICE:  BL2: Booting BL32
NOTICE:  SP_MIN: v2.2(release):
NOTICE:  SP_MIN: Built : 21:45:47, Jan 11 2022U-Boot 2020.07 (Jan 11 2022 - 21:46:14 -0800)    # U-Boot 版本号CPU: STM32MP157AAC Rev.B
Model: STMicroelectronics STM32MP157A-DK1 Discovery Board
Board: stm32mp1 in trusted mode (st,stm32mp157a-dk1)
Board: MB1272 Var1.0 Rev.C-01
DRAM:  512 MiB
Clocks:
- MPU : 650 MHz
- MCU : 208.878 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
NAND:  0 MiB
MMC:   STM32 SD/MMC: 0
Loading Environment from EXT4... ** File not found /uboot.env **** Unable to read "/uboot.env" from mmc0:4 **
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@5800a000
Hit any key to stop autoboot:  0
Boot over mmc0!
Saving Environment to EXT4... Unsupported feature metadata_csum found, not writing.** Unable to write "/uboot.env" from mmc0:4 **
Failed (1)
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:4...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf   # 检索syslinux引导配置文件
131 bytes read in 29 ms (3.9 KiB/s)
1:      stm32mp157a-dk1-buildroot
Retrieving file: /boot/zImage   # 检索Linux内核镜像文件
4183632 bytes read in 206 ms (19.4 MiB/s)
append: root=/dev/mmcblk0p4 rootwait
Retrieving file: /boot/stm32mp157a-dk1.dtb  # 检索描述硬件平台的设备树Blob
53881 bytes read in 31 ms (1.7 MiB/s)
Kernel image @ 0xc2000000 [ 0x000000 - 0x3fd650 ]
## Flattened Device Tree blob at c4000000Booting using the fdt blob at 0xc4000000    # FDT,flatted device tree,扁平设备树, 将部分设备信息结构存放到device treeLoading Device Tree to cffef000, end cffff278 ... OKStarting kernel ...  # 内核启动的地方[    0.000000] Booting Linux on physical CPU 0x0
# 内核版本5.8.13, 连我的主机信息都打出来了z@ubuntu, 用Buildroot 2021.02.8版本构建, 构建时间2022-1-11
[    0.000000] Linux version 5.8.13 (z@ubuntu) (arm-buildroot-linux-uclibcgnueabihf-gcc.br_real (Buildroot 2021.02.8) 9.4.0, GNU ld (GNU Binutils) 2.35.2) #1 SMP PREEMPT Tue Jan 11 21:46:51 PST 2022
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: STMicroelectronics STM32MP157A-DK1 Discovery Board
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Reserved memory: created DMA memory pool at 0x10000000, size 0 MiB
[    0.000000] OF: reserved mem: initialized node mcuram2@10000000, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x10040000, size 0 MiB
[    0.000000] OF: reserved mem: initialized node vdev0vring0@10040000, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x10041000, size 0 MiB
[    0.000000] OF: reserved mem: initialized node vdev0vring1@10041000, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x10042000, size 0 MiB
[    0.000000] OF: reserved mem: initialized node vdev0buffer@10042000, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x30000000, size 0 MiB
[    0.000000] OF: reserved mem: initialized node mcuram@30000000, compatible id shared-dma-pool
[    0.000000] Reserved memory: created DMA memory pool at 0x38000000, size 0 MiB
[    0.000000] OF: reserved mem: initialized node retram@38000000, compatible id shared-dma-pool
[    0.000000] cma: Reserved 128 MiB at 0xc7800000
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000c0000000-0x00000000dfffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000c0000000-0x00000000d3ffffff]
[    0.000000]   node   0: [mem 0x00000000d8000000-0x00000000dfffffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000c0000000-0x00000000dfffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v65535.65535
[    0.000000] percpu: Embedded 15 pages/cpu s30092 r8192 d23156 u61440
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 113664
[    0.000000] Kernel command line: root=/dev/mmcblk0p4 rootwait
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 280716K/458752K available (6144K kernel code, 188K rwdata, 1560K rodata, 1024K init, 175K bss, 46964K reserved, 131072K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x31c/0x4b0 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000025] Switching to timer-based delay loop, resolution 41ns
[    0.000925] Console: colour dummy device 80x30
[    0.002095] printk: console [tty0] enabled
[    0.002149] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.002197] pid_max: default: 32768 minimum: 301
[    0.002412] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.002460] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.003279] CPU: Testing write buffer coherency: ok
[    0.003641] CPU0: update cpu_capacity 1024
[    0.003678] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.004409] Setting up static identity map for 0xc0100000 - 0xc0100060
[    0.004589] rcu: Hierarchical SRCU implementation.
[    0.005031] smp: Bringing up secondary CPUs ...
[    0.005907] CPU1: update cpu_capacity 1024
[    0.005920] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.006090] smp: Brought up 1 node, 2 CPUs
[    0.006165] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[    0.006191] CPU: All CPU(s) started in SVC mode.
[    0.006814] devtmpfs: initialized
[    0.024393] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.024937] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.025007] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.031510] pinctrl core: initialized pinctrl subsystem
[    0.032576] NET: Registered protocol family 16
[    0.035259] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.055966] /soc/interrupt-controller@5000d000: bank0
[    0.056022] /soc/interrupt-controller@5000d000: bank1
[    0.056054] /soc/interrupt-controller@5000d000: bank2
[    0.057264] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOA bank added
[    0.057695] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOB bank added
[    0.058072] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOC bank added
[    0.058415] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOD bank added
[    0.058761] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOE bank added
[    0.059109] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOF bank added
[    0.059454] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOG bank added
[    0.059785] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOH bank added
[    0.060232] stm32mp157-pinctrl soc:pin-controller@50002000: GPIOI bank added
[    0.060385] stm32mp157-pinctrl soc:pin-controller@50002000: Pinctrl STM32 initialized
[    0.061063] stm32mp157-pinctrl soc:pin-controller-z@54004000: GPIOZ bank added
[    0.061118] stm32mp157-pinctrl soc:pin-controller-z@54004000: Pinctrl STM32 initialized
[    0.071710] usbcore: registered new interface driver usbfs
[    0.071815] usbcore: registered new interface driver hub
[    0.071988] usbcore: registered new device driver usb
[    0.072255] pps_core: LinuxPPS API ver. 1 registered
[    0.072285] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.072343] PTP clock support registered
[    0.072682] Advanced Linux Sound Architecture Driver Initialized.
[    0.073798] clocksource: Switched to clocksource arch_sys_counter
[    0.085100] NET: Registered protocol family 2
[    0.085885] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.085962] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.086052] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.086166] TCP: Hash tables configured (established 4096 bind 4096)
[    0.086325] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.086391] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.086650] NET: Registered protocol family 1
[    0.088104] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    0.096450] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[    0.096509] io scheduler mq-deadline registered
[    0.096536] io scheduler kyber registered
[    0.166609] STM32 USART driver initialized
[    0.167202] 40010000.serial: ttySTM0 at MMIO 0x40010000 (irq = 21, base_baud = 4000000) is a stm32-usart
[    0.898348] printk: console [ttySTM0] enabled
[    0.903275] stm32-usart 40010000.serial: rx dma alloc failed
[    0.908413] stm32-usart 40010000.serial: interrupt mode used for rx (no dma)
[    0.915447] stm32-usart 40010000.serial: tx dma alloc failed
[    0.921092] stm32-usart 40010000.serial: interrupt mode used for tx (no dma)
[    0.943612] brd: module loaded
[    0.951813] random: fast init done
[    0.954606] loop: module loaded
[    0.957179] random: crng init done
[    0.958548] libphy: Fixed MDIO Bus: probed
[    0.964627] CAN device driver interface
[    0.969357] stm32-dwmac 5800a000.ethernet: IRQ eth_wake_irq not found
[    0.974799] stm32-dwmac 5800a000.ethernet: IRQ eth_lpi not found
[    0.980913] stm32-dwmac 5800a000.ethernet: PTP uses main clock
[    0.986626] stm32-dwmac 5800a000.ethernet: no reset control found
[    1.003878] stm32-dwmac 5800a000.ethernet: User ID: 0x40, Synopsys ID: 0x42
[    1.009431] stm32-dwmac 5800a000.ethernet:   DWMAC4/5
[    1.014421] stm32-dwmac 5800a000.ethernet: DMA HW capability register supported
[    1.021725] stm32-dwmac 5800a000.ethernet: RX Checksum Offload Engine supported
[    1.029074] stm32-dwmac 5800a000.ethernet: TX Checksum insertion supported
[    1.035959] stm32-dwmac 5800a000.ethernet: Wake-Up On Lan supported
[    1.042286] stm32-dwmac 5800a000.ethernet: TSO supported
[    1.047567] stm32-dwmac 5800a000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    1.055437] stm32-dwmac 5800a000.ethernet: Enabled Flow TC (entries=2)
[    1.061938] stm32-dwmac 5800a000.ethernet: TSO feature enabled
[    1.067802] stm32-dwmac 5800a000.ethernet: Using 32 bits DMA width
[    1.075156] libphy: stmmac: probed
[    1.080798] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.085955] ehci-platform: EHCI generic platform driver
[    1.091548] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.097401] ohci-platform: OHCI generic platform driver
[    1.104849] stm32_rtc 5c004000.rtc: IRQ index 1 not found
[    1.108824] stm32_rtc 5c004000.rtc: alarm can't wake up the system: -6
[    1.116093] stm32_rtc 5c004000.rtc: registered as rtc0
[    1.120553] stm32_rtc 5c004000.rtc: setting system clock to 2000-01-01T00:00:03 UTC (946684803)
[    1.129551] stm32_rtc 5c004000.rtc: Date/Time must be initialized
[    1.135465] stm32_rtc 5c004000.rtc: registered rev:1.2
[    1.140639] i2c /dev entries driver
[    1.164285] stm32f7-i2c 40012000.i2c: can't request DMA tx channel
[    1.169052] stm32f7-i2c 40012000.i2c: can't use DMA
[    1.175977] stm32f7-i2c 40012000.i2c: STM32F7 I2C-0 bus adapter
[    1.203473] stm32f7-i2c 5c002000.i2c: can't request DMA tx channel
[    1.208270] stm32f7-i2c 5c002000.i2c: can't use DMA
[    1.214892] stpmic1 1-0033: PMIC Chip Version: 0x10
[    1.220929] BUCK1: supplied by regulator-dummy
[    1.227074] BUCK2: supplied by regulator-dummy
[    1.232934] BUCK3: supplied by regulator-dummy
[    1.238978] BUCK4: supplied by regulator-dummy
[    1.244781] LDO1: supplied by v3v3
[    1.250325] LDO2: supplied by regulator-dummy
[    1.256321] LDO3: supplied by vdd_ddr
[    1.261496] LDO4: supplied by regulator-dummy
[    1.265069] LDO5: supplied by regulator-dummy
[    1.271826] LDO6: supplied by v3v3
[    1.276930] VREF_DDR: supplied by regulator-dummy
[    1.282914] BOOST: supplied by regulator-dummy
[    1.286557] VBUS_OTG: supplied by bst_out
[    1.290502] SW_OUT: supplied by bst_out
[    1.296507] input: pmic_onkey as /devices/platform/soc/5c002000.i2c/i2c-1/1-0033/5c002000.i2c:stpmic@33:onkey/input/input0
[    1.306867] stm32f7-i2c 5c002000.i2c: STM32F7 I2C-1 bus adapter
[    1.315234] mmci-pl18x 58005000.sdmmc: Got CD GPIO
[    1.319212] mmci-pl18x 58005000.sdmmc: mmc0: PL180 manf 53 rev1 at 0x58005000 irq 47,0 (pio)
[    1.354244] sdhci: Secure Digital Host Controller Interface driver
[    1.360073] sdhci: Copyright(c) Pierre Ossman
[    1.363381] Synopsys Designware Multimedia Card Interface Driver
[    1.369665] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.377665] usbcore: registered new interface driver usbhid
[    1.381856] usbhid: USB HID core driver
[    1.386560] stm32-ipcc 4c001000.mailbox: ipcc rev:1.0 enabled, 6 chans, proc 0
[    1.393365] OF: Can't handle multiple dma-ranges with different offsets on node(/ahb)
[    1.401948] OF: Can't handle multiple dma-ranges with different offsets on node(/ahb)
[    1.409165] stm32-rproc 10000000.m4: wdg irq registered
[    1.415240] remoteproc remoteproc0: m4 is available
[    1.422022] NET: Registered protocol family 10
[    1.426564] Segment Routing with IPv6
[    1.428895] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.435850] NET: Registered protocol family 17
[    1.439198] can: controller area network core (rev 20170425 abi 9)
[    1.445548] NET: Registered protocol family 29
[    1.449880] can: raw protocol (rev 20170425)
[    1.454205] can: broadcast manager protocol (rev 20170425 t)
[    1.459816] can: netlink gateway (rev 20190810) max_hops=1
[    1.465670] ThumbEE CPU extension supported.
[    1.469589] Registering SWP/SWPB emulation handler
[    1.476248] stm32-dma 48000000.dma-controller: STM32 DMA driver registered
[    1.483165] stm32-dma 48001000.dma-controller: STM32 DMA driver registered
[    1.491998] stm32-mdma 58000000.dma-controller: STM32 MDMA driver registered
[    1.498258] reg11: supplied by vdd
[    1.501131] reg18: supplied by vdd
[    1.504795] stm32-usbphyc 5a006000.usbphyc: registered rev:1.0
[    1.513415] mmc0: new high speed SDHC card at address aaaa
[    1.520800] dwc2 49000000.usb-otg: supply vusb_d not found, using dummy regulator
[    1.527500] mmcblk0: mmc0:aaaa SS16G 14.8 GiB  # TF卡
[    1.531438] dwc2 49000000.usb-otg: supply vusb_a not found, using dummy regulator
[    1.539602] dwc2 49000000.usb-otg: Configuration mismatch. dr_mode forced to host
[    1.552808] usb33: supplied by vdd_usb
[    1.556333] dwc2 49000000.usb-otg: DWC OTG Controller
[    1.560487] dwc2 49000000.usb-otg: new USB bus registered, assigned bus number 1
[    1.568117] dwc2 49000000.usb-otg: irq 42, io mem 0x49000000
[    1.575266] hub 1-0:1.0: USB hub found
[    1.577874]  mmcblk0: p1 p2 p3 p4
[    1.581345] hub 1-0:1.0: 1 port detected
[    1.586904] ehci-platform 5800d000.usbh-ehci: EHCI Host Controller
[    1.591706] ehci-platform 5800d000.usbh-ehci: new USB bus registered, assigned bus number 2
[    1.600496] ehci-platform 5800d000.usbh-ehci: irq 49, io mem 0x5800d000
[    1.633827] ehci-platform 5800d000.usbh-ehci: USB 2.0 started, EHCI 1.00
[    1.640130] hub 2-0:1.0: USB hub found
[    1.642907] hub 2-0:1.0: 2 ports detected
[    1.654628] ALSA device list:
[    1.656167]   No soundcards f  1.681317] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: (null)
[    1.688188] VFS: Mounted root (ext4 filesystem) readonly on device 179:4.    # 此消息表明内核已挂载根文件系统
[    1.698895] devtmpfs: mounted
[    1.702506] Freeing unused kernel memory: 1024K
[    1.724035] Run /sbin/init as init process
[    1.851641] EXT4-fs (mmcblk0p4): re-mounted. Opts: (null)
Starting syslogd: OK    # 正在初始化用户空间服务
Starting klogd: OK
Running sysctl: OK
Saving random seed: OK
[    2.023846] usb 2-1: new high-speed USB device number 2 using ehci-platform
Starting network: OKWelcome to Buildroot
buildroot login: [    2.235101] hub 2-1:1.0: USB hub found    # 登录提示达成
[    2.237514] hub 2-1:1.0: 4 ports detected
[   31.833856] vref: supplied by vdd
[   31.835829] vref: disabling
[   31.838541] vdda: disabling

默认登录名root, 无密码, 默认HDMI无输出

基本测试

提示符默认的是root权限的#, 这里为了高亮显示, 改成$

Welcome to Buildroot
buildroot login: root# 可以看到内核版本是5.8.13
$ uname -a
Linux buildroot 5.8.13 #1 SMP PREEMPT Tue Jan 11 21:46:51 PST 2022 armv7l GNU/Linux# cpu信息: 双核A7 加 M4
$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 5 (v7l)
...
processor       : 1
model name      : ARMv7 Processor rev 5 (v7l)
...
Hardware        : STM32 (Device Tree Support)
...# 内存信息: 512MB
$ cat /proc/meminfo
MemTotal:         412812 kB
MemFree:          402476 kB
...# 磁盘信息
$ df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root               112.2M      7.1M     96.7M   7% /
devtmpfs                137.1M         0    137.1M   0% /dev
tmpfs                   201.6M         0    201.6M   0% /dev/shm
tmpfs                   201.6M     28.0K    201.5M   0% /tmp
tmpfs                   201.6M     16.0K    201.6M   0% /run# 上面是sd卡分的N多区, 查看分区信息
$ cat /proc/partitions
major minor  #blocks  name1        0      65536 ram01        1      65536 ram11        2      65536 ram21        3      65536 ram31        4      65536 ram41        5      65536 ram51        6      65536 ram61        7      65536 ram71        8      65536 ram81        9      65536 ram91       10      65536 ram101       11      65536 ram111       12      65536 ram121       13      65536 ram131       14      65536 ram141       15      65536 ram15179        0   15558144 mmcblk0179        1        199 mmcblk0p1179        2        199 mmcblk0p2179        3        862 mmcblk0p3179        4     122880 mmcblk0p4# 网络信息
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000link/ether 00:80:e1:42:73:5f brd ff:ff:ff:ff:ff:ff
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1000link/sit 0.0.0.0 brd 0.0.0.0# 如果是设置静态IP
# 连到电脑的以太网口, 设置静态IP为192.168.6.77
$ sh -c 'echo -e "auto eth0\niface eth0 inet static\naddress 192.168.6.77\nnetmask 255.255.255.0\ngateway 192.168.6.1" >> /etc/network/interfaces'
# 启动网口, 显示1Gbps
$ ifconfig eth0 up
[ 6381.781930] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:00] driver [Generic PHY] (irq=POLL)
[ 6381.793939] dwmac4: Master AXI performs any burst length
[ 6381.797856] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[ 6381.805313] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[ 6381.814033] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[ 6381.820034] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
# [ 6383.916875] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 6383.923999] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
# 但是 ifconfig eth0 up 没有设置成功ip, reset了板子才有, 主机可以ping通# 如果是DHCP
# 连到路由器
$ sh -c 'echo -e "\nauto eth0 \niface eth0 inet dhcp" >> /etc/network/interfaces'
# reboot    # 失败 udhcpc: no lease, failing# ssh 默认是不行的
# ping其它电脑ping不通# 插入鼠标键盘, lsusb也是能够看到多出了Device# 操作LED
echo 255 > /sys/class/leds/heartbeat/brightness # LD8亮蓝色
echo 0 > /sys/class/leds/heartbeat/brightness # LD8灭# 对于默认的配置来说, USB, 网口都是识别的, 仅此而已
# 还有未完成的 HDMI桥接芯片的支持, SD卡剩余空间的挂载等

配置成5.10内核测试

$ make menuconfigToolchain --> Custom kernel headers series --> 5.10.x or later
Kernel --> Kernel version --> Last version(5.10)# 可以 diff .config .config.old 查看下变动, 摘录几条
# BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
# BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10=y
# BR2_TOOLCHAIN_HEADERS_AT_LEAST="5.10"
# BR2_LINUX_KERNEL_VERSION="5.10.83"$ make clean
$ make -j $(nproc)$ ls -lh output/images/
total 27M
-rw-r--r-- 1 z z 120M Jan 12 02:25 rootfs.ext2
lrwxrwxrwx 1 z z   11 Jan 12 02:25 rootfs.ext4 -> rootfs.ext2
-rw-r--r-- 1 z z 122M Jan 12 02:25 sdcard.img
-rwxr-xr-x 1 z z  56K Jan 12 02:25 stm32mp157a-dk1.dtb
-rw-r--r-- 1 z z 200K Jan 12 02:21 tf-a-stm32mp157a-dk1.stm32
-rw-r--r-- 1 z z 862K Jan 12 02:21 u-boot.stm32
-rw-r--r-- 1 z z 4.2M Jan 12 02:25 zImage# 写到sd卡
# 插到板子上, 上电
$ uname -a
Linux buildroot 5.10.83 #1 SMP PREEMPT Wed Jan 12 02:22:27 PST 2022 armv7l GNU/Linux$ df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root               112.2M      7.2M     96.6M   7% /
devtmpfs                136.2M         0    136.2M   0% /dev
tmpfs                   200.7M         0    200.7M   0% /dev/shm
tmpfs                   200.7M     32.0K    200.7M   0% /tmp
tmpfs                   200.7M     16.0K    200.7M   0% /run

参考

如下:

  • Building a Linux system for the STM32MP1: basic system - Bootlin’s blog

欢迎扫描二维码关注微信公众号, 及时获取最新文章:

STM32MP157A-DK1 Buildroot 基本笔录相关推荐

  1. RISC-V 麻雀 D1s Buildroot 基本笔录

    文章目录 前言 麻雀 Buildroot 开机日志 系统探索 OpenSBI QEMU Buildroot RISCV 参考 前言 RISC-V, BSD许可证之下自由使用的CPU设计, 最早是201 ...

  2. buildroot httpd php

    /********************************************************************* buildroot httpd php* 说明:* 在bu ...

  3. 教你用 buildroot 构建根文件系统

    如果想要构建完整的根文件系统,大家一般都是使用buildroot,它不仅包含了 busybox 的功能,而且里面还集成了各种软件,需要什么软件就选择什么软件,不需要我们去移植. 嵌入式系统三大部分:b ...

  4. buildroot管理uboot+kernel+rootfs

    鉴于自己制作根文件系统太麻烦了,所以想用buildroot管理uboot,kernel,另外还可以自动生产rootfs,于是花了两天研究了下buildroot的框架和使用,在自己的2440开发板上也跑 ...

  5. Buildroot用户指南

    第一章        关于Buildroot Buildroot是一个包含Makefile和修补程序[patch]的集合,这个集合可以使你很容易的为你的目标构建交叉工具链[cross-compilat ...

  6. buildroot mysql

    /********************************************************************* buildroot mysql* 说明:* 这两天要在AR ...

  7. Python 谁是小偷? 嫌疑人A、B、C、D的笔录如下,其中三人为真,一人为假:

    谁是小偷? 嫌疑人A.B.C.D的笔录如下,其中三人为真,一人为假: A:我不是小偷 B:C是小偷 C:小偷肯定是D D:C在冤枉人 要求:提交清晰代码及运行通过截屏.调试须至少输入两次自然数且运行得 ...

  8. linux 使用buildroot制作文件系统

    可以用busybox 或者buildroot等工具 制作文件系统 以下参考陈富林博客使用buildroot制作文件系统   写的比较详细   记录一下 https://www.cnblogs.com/ ...

  9. 使用Buildroot为Nxp i.mx6ul制作文件系统

    随着神U s3c2440,6410的停产,NXP 针对中国市场推出低成本方案i.mx6ul,可用于商业级和工业级应用,10年超长供货周期,市场很有潜力. 官方只支持Yocto,但个人感觉Yocto太多 ...

最新文章

  1. Linux17-磁盘分区、文件系统、逻辑卷管理LVM
  2. node-vue前后端分离记录
  3. python中readlines_python中read() readline()以及readlines()用法
  4. python 清屏_Python学前准备如果你知道要去哪,那么全世界都给你让路
  5. input和output哪个是充电_input是什么接口?告诉大家这个小常识,以后音箱接线更容易...
  6. Intel Sandy Bridge/Ivy Bridge架构/微架构/流水线 (16) - L1数据缓存/存储转发访存消歧存储体冲突
  7. Doule类型转成十六进制查看
  8. 第二篇:操纵MySQL数据库(2) - 基于ORM思想的SQLAlchemy库
  9. 二维数组作为函数的实参,定义函数形参的方法
  10. 使用Easy Duplicate Photo Finder for Mac如何查找重复的图片?
  11. 61850——Da模式、Do模式
  12. WordPress主题仿什么值得买风格模板源码
  13. 铁道部售票网站怎么啦?
  14. MPEG-TS封装格式数据
  15. 电脑桌面图标不见了怎么办如果电脑图标不见了,可以尝试以下方法:
  16. 在ROS中使用中文语音交互(百度语音baidu_speech)
  17. 五种常见的聚类算法总结
  18. 管理运筹学的一些知识点
  19. 基于matlab指纹识别论文,毕业论文-基于Matlab的指纹识别
  20. 1 0.99999的悖论_公交车总迟到?你大概掉进了“等待时间悖论

热门文章

  1. Inventor2018专业版软件安装激活教程
  2. 成就你一生的100个哲理1-10
  3. Word设置段落底纹(段落背景)快捷键
  4. iPad开发-分屏、画中画(即多任务处理增强功能)
  5. access 命令不符 等级考试_2016年计算机二级考试Access备考基础习题(9)
  6. 网站运营三个阶段与运营指标
  7. 如何优雅的跟领导提离职?
  8. 从零开始搭建腾讯云上的SpringBoot容器化应用
  9. English In April(2017)
  10. lol最克制诺手的英雄_LOL最能克制诺手的5大英雄,谁敢来试试?