[Linux bottom layer] U-boot debugging command usage tips

Publisher:TranquilWhisperLatest update time:2022-07-14 Source: csdnKeywords:Linux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

If you debug the driver at the uboot stage, you can make full use of the existing resources of uboot. This is more convenient and can speed up the development process. Only by standing on the shoulders of giants can you achieve twice the result with half the effort.


1. uboot provides operation commands to cover


2. Nand Flash operation, reading, writing, erasing, and status printing;


3. DDR operation, memory byte printing;


4. Network operation, ping command, ftp download function, command code details see [Linux bottom layer] U-boot burning script introduction SecureCRT


=> ping 192.168.2.108

5. Operation of MAC controller, MII can read the data of MAC controller and change the data controlled by MAC;


//Dual network cards, activate the current network card setting ethprime=ethernet@f0028000, the current network card


=> setenv ethprime ethernet@f0028000 //eth0 gmac

=> setenv ethprime ethernet@f802c000 //eth1 emac


=> mii device ethernet@f802c000 //MII interface switch PHY

=> mii device ethernet@f0028000        


=> mii device //Query which PHY is enabled on the current MII interface

MII devices: 'ethernet@f0028000' 'ethernet@f802c000' 

Current device: 'ethernet@f802c000'


=>mii read 0 3 //Use the MII interface to read the information of register address 3 of eht0


=>mii read 1 3 //Use the MII interface to read the information of register address 3 of eht1


uboot command can correctly read PHY information


Use the MII interface to read PHY information


=> mii info

MII_PHYSID2 @ 0x0 = 0xb8a0

PHY_PHYIDR[1,2] @ 0x0 = 0x0181b8a0

PHY 0x00: OUI = 0x606E, Model = 0x0A, Rev = 0x00, 10baseT, HDX


6. Change startup parameters


bootargs=console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,768k(uboot)ro,256K(env_redundant),256k(env),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=6 root=ubi0:rootfs

bootcmd=nand read 0x21000000 0x180000 0x80000;nand read 0x22000000 0x200000 0x600000;bootz 0x22000000 - 0x21000000


7. Setting and viewing environment variables


//Environment variables

=>pri

arch=arm

baudrate=115200

board=sama5d3_xplained

board_name=sama5d3_xplained

bootargs=console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,768k(uboot)ro,256K(env_redundant),256k(env),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=6 root=ubi0:rootfs

bootcmd=nand read 0x21000000 0x180000 0x80000;nand read 0x22000000 0x200000 0x600000;bootz 0x22000000 - 0x21000000

bootdelay=3

cpu=armv7

eth1addr=EE:AB:C1:D2:E6:C6

ethact=ethernet@f802c000

ethaddr=EE:AB:C1:D2:E6:C6

fdtcontroladdr=2fb16b48

ipaddr=192.168.1.100

ipaddr1=192.168.2.100

serverip=192.168.1.108

soc=at91

stderr=serial@ffffee00

stdin=serial@ffffee00

stdout=serial@ffffee00

vendor=atmel


8. The debugging command of EMMC can check whether the drive is successful and print out the size;


9. Use the help command to check which commands uboot supports, and the list will be printed out;


10. Command usage can also be obtained through help, for example: command line $mii help

Keywords:Linux Reference address:[Linux bottom layer] U-boot debugging command usage tips

Previous article:[Linux bottom layer] U-boot ksz9031 network driver debugging
Next article:[Linux bottom layer] U-boot compilation and transplantation

Recommended ReadingLatest update time:2024-11-23 19:06

Discussion on the Selection of Linux Embedded System Development Platform
  1 Embedded Systems and Linux   According to a definition of the Institute of Electrical Engineers: Embedded systems are devices used to control or monitor large-scale systems such as machines, devices or factories. Specifically, it is a combination of computer software and hardware; it is application-centric, based
[Power Management]
Discussion on the Selection of Linux Embedded System Development Platform
Design of handheld entertainment system based on Linux embedded operating system
    In recent years, with the development of microprocessor technology, DSP technology, multimedia codec technology and embedded technology, multimedia entertainment terminals have become a hot spot for consumer electronic products. At the same time, the gradually mature market will develop rapidly in the next few yea
[Microcontroller]
Design of handheld entertainment system based on Linux embedded operating system
Porting QT5.6.0 to embedded linuxS3C2440 board
Currently, the online QT5.6 migration tutorial is not perfect. This blog describes the detailed steps of migrating QT5.6.0 to embedded Linux boards. The migrated files will be shared on GitHub. 1. Experimental Environment (1) Compilation tool chain arm-Linux-gcc-4.4.3.tar.gz (2) Linux system linux-3.4.2 (3)
[Microcontroller]
OK6410A Development Board (VIII) 35 linux-5.11 OK6410A Memory Management Phase III
C setup_arch- paging_init- bootmem_init- memblock_allow_resize returns - mm_init- mem_init returns ----At this time, memblock disappears, buddy initialization is completed, and the era of buddy memory manager based on virtual memory era begins process setup_arch(&command_line);- paging_init bootmem_init find_lim
[Microcontroller]
Accessing GPIO ports under ARM Linux
GPIO (abbreviation of General Purpose Input/Output) is the pin of the chip. The pin is programmable and can set the working mode of the pin: input mode (detecting input signal), output mode (output 0 or 1), high impedance state (commonly used for AD conversion), and prohibiting or allowing internal pull-down resistors
[Microcontroller]
Preliminary creation of makefile, detailed explanation of arm-linux- (gcc/ld/objcopy/objdump)
Enter vi Makefile in linux to create a Makefile file Note: You must add the TAB key before the command line For example: assemble two files led.c and crt0.S to create a Makefile 1 1 led.bin : crt0.S led.c 2 2 arm-linux-gcc -c -o crt0.o crt0.c 3 3 arm-linux-gcc -c -o led.o l
[Microcontroller]
02 Linux entry command
1 Shell Interpreter The shell interpreter receives the input characters and displays them immediately. After you press Enter, it searches for the command based on the string. Where to search? It searches in the path specified by the environment variable. # Display environment variables echo $PATH # The results are a
[Microcontroller]
02 Linux entry command
Build STM8 development environment under Linux
Use SDCC+STM8Flash+STLink to build Linux development STM8 development environment. Corresponding MCS51, LPC and the like can also use SDCC 1. Install SDCC $ sudo apt-get install sdcc 2. Install stm8flash git clone https://github.com/vdudouyt/stm8flash.git cd stm8flash make sudo make install 3. Install STlink dri
[Microcontroller]
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号