u-boot가 커널 부팅에 멈췄습니다

u-boot가 커널 부팅에 멈췄습니다

내 목표 설정:

SOC: STM32H743 (Cortex m7 single core)
Internal Flash: 2MB
Board: Waveshare CoreH7XXI
On-board DRAM: 8MB, Start_Address: 0xd0000000, Size_in_bytes: 0x7A1200
SDCARD: 1GB

Bootloader: mainline u-boot (only I've modified the device tree and added my board files, almost everything is default)
kernel:     mainline linux (compiled with stm32_defconfig configuration + some tweaks in menuconfig)

내 콘솔(PC) 설정:

OS: Ubuntu 20 LTS on windows10 WSL2
Text Editor: VSCode (Visual Studio Code)
Debug Probe: STLink V2
Debug Software: Openocd + gdb-multiarch integrated in VSCode

원래 U-boot 직렬 콘솔:



U-Boot 2020.07-00610-g610e1487c8-dirty (Sep 07 2020 - 22:06:45 +0430)

Model: Waveshare STM32H743i-Coreh7 board
DRAM:  7.6 MiB
MMC:   STM32 SD/MMC: 0
In:    serial@40004400
Out:   serial@40004400
Err:   serial@40004400
Hit SPACE in 3 seconds to stop autoboot.
stm32_sdmmc2_send_cmd: cmd 6 failed, retrying ...
stm32_sdmmc2_send_cmd: cmd 6 failed, retrying ...
stm32_sdmmc2_send_cmd: cmd 6 failed, retrying ...
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
U-Boot > fatload mmc 0:1 ${kernel_addr_r} zImage
1403424 bytes read in 326 ms (4.1 MiB/s)
U-Boot > fatload mmc 0:1 ${fdt_addr_r} stm32h743i-coreh7.dtb
15116 bytes read in 14 ms (1 MiB/s)
U-Boot > setenv bootargs console=ttySTM1,115200n8
U-Boot > bootz ${kernel_addr_r} - ${fdt_addr_r}
Kernel image @ 0xd0008000 [ 0x000000 - 0x156a20 ]
## Flattened Device Tree blob at d0408000
   Booting using the fdt blob at 0xd0408000
   Loading Device Tree to d064f000, end d0655b0b ... OK

Starting kernel ...

다음 명령을 사용하여 uImage를 만들었는데 여전히 시작되지 않습니다.

mkimage -A arm -O linux -T kernel -C none -a 0xd0008000 -e 0xd0008000 -n "Linux kernel" -d arch/arm/boot/zImage uImage

u 시작 로그:

U-Boot > bootm ${kernel_addr_r} - ${fdt_addr_r}
## Booting kernel from Legacy Image at d0008000 ...
   Image Name:   Linux kernel
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1403424 Bytes = 1.3 MiB
   Load Address: d0008000
   Entry Point:  d0008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at d0408000
   Booting using the fdt blob at 0xd0408000
   Loading Kernel Image

U-부트 환경:

U-Boot > printenv
arch=arm
baudrate=115200
board=coreh7
board_name=coreh7
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc0 
bootcmd=run distro_bootcmd
bootcmd_mmc0=devnum=0; run mmc_boot
bootdelay=3
bootfstype=fat
cpu=armv7m
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
fdt_addr_r=0xD0408000
fdtcontroladdr=d06572a0
fdtfile=stm32h743i-coreh7.dtb
kernel_addr_r=0xD0008000
loadaddr=0xD0400000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
pxefile_addr_r=0xD0428000
ramdisk_addr_r=0xD0438000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0xD0418000
soc=stm32h7
stderr=serial@40004400
stdin=serial@40004400
stdout=serial@40004400
vendor=waveshare

Environment size: 1873/8188 bytes

내 kernel.config 파일을 다음에서 다운로드할 수 있습니다.여기(기본 구성: stm32_defconfig)

내 u-boot .config 파일을 다음에서 다운로드할 수 있습니다.여기.

수정된 장치 트리를 다음에서 다운로드할 수 있습니다.여기.

내 u-boot 특정 수정 장치 트리를 다음에서 다운로드할 수 있습니다.여기.

답변1

커널에 아무 것도 전달하지 않고 bootargs일반 Linux 배포판에서 이를 제공하도록 하는 논리를 우회하므로 콘솔에 있는 모든 것을 Linux에 전달해야 합니다. 그러면 다음과 함께 메시지가 인쇄됩니다. 루트 장치.

관련 정보