Summary of bare metal program burning method for embedded Linux development board
[Copy link]
1. Use imxdownload to burn (for nxp 6ULL development board)
Copy imxdownload to the project root directory. We need to copy imxdownload to the project root directory, that is, in the same folder as led.bin, otherwise the burning will fail. After the copy is completed, it will be as shown in the figure
Give imxdownload executable permissions. After directly copying the software imxdownload from Windows to Ubuntu, imxdownload does not have executable permissions by default. We need to give imxdownload executable permissions, use the command "chmod", the command is as follows:
When imxdownload is given executable permission, its name turns green. If it is not given executable permission, its name is white.
Burn the bin file to the SD card. Use imxdownload to burn the led.bin file to the SD card. The command format is as follows: /imxdownload <.binfile> <SD Card>. .bin is the .bin file to be burned, and SD Card is the SD card you want to burn. For example, my computer uses the following command to burn led.bin to /dev/sd: ./imxdownload led.bin /dev/sdb. During the burning process, you may be asked to enter a password. Enter your Ubuntu password to complete the burning. The burning process is as shown in the figure:
2. Use USB + DNW + Uboot to burn (for Samsung 6410 and 2440 series)
_Writer.exe burns mmc.bin into the SD card and sets the development board to boot from the SD card. (For specific methods, see the Feiling Development Board Linux 3.0.1 User Manual.pdf)
Install the SD card into the development board and start it. Quickly press the space bar to keep the development board on the uboot startup screen. As shown in the figure below, a menu box will appear. Select 5 to enter the command.
Details Q2859780203
Installation, dnw and USB driver (xp environment)
Execute the following command to burn. The burning principle is to use Linux's uboot command nand to burn the program to the development board.
01. Input: dnw 50008000 to download the program you want to burn.
02. Then send the .bin file you want to download from usbport->Transmit->Transmit of dnw.
03. Input: nand erase 0 100000 to erase the first 1M space of nandflash.
04. Input: nand write.uboot 50008000 0 1000000 to write the 1M data in the memory address 50008000 to the space 0 ~ 100000 of nandflash (i.e. the first 1M bytes).
05. Set the development board to nand boot and restart the development board.
3. Use the network in uboot to verify the bare metal program (universal board, as long as your uboot has transplanted the network function)
Before learning embedded Linux, it is necessary to understand the bare metal program of embedded processors. However, the bare metal program burning methods provided in some tutorials are relatively complicated. Some require using SD cards for burning. Before burning, the SD card must be formatted, and then header information is added to the bare metal program (6ull, 6410/2440 do not need it), and then burned with a dedicated download host computer.
In fact, the bare metal program is just a guide in our process of learning embedded systems, used to understand how these processors work. Therefore, after writing the bare metal program, it is not necessary to actually burn it into the system. You just need to wait for it to run and observe the experimental phenomena.
Uboot generally provides a variety of file transfer methods, such as tftp, nfs, xmodem, ymodem, etc. Select a method supported by uboot on the board. If you are not sure, you can use the pri command to view it and select the corresponding command to view the help information, such as tftp help, etc. (different uboot commands will be different).
Download the compiled bare metal bin file to the corresponding address. Note that this address must be the same as the address specified when the bare metal program is linked (described in the .lds file, or specified when executing the link), such as 0x87800000. Then download to the address 0x87800000. After completion, let uboot jump directly to this address to run the bare metal program: go0x87800000. It should be noted that when the board is reset or powered on again, the default program will be run instead of the bare metal program. Therefore, this method is not burning, but just copying to memory for execution, which omits many necessary steps for burning bare metal.
nfs service mode:
Use nfs to verify bare metal, uboot, and kernel on 6ull. The virtual machine needs to install the nfs service and enable the nfs service. For specific operations, refer to the second section of the development environment construction. The development board runs in the uboot interface, and its ip, service ip, gateway, etc. are modified to ensure that it can be pinged normally with the server (virtual machine) ip
.
After you are ready, you can use the nfs command to download the bare metal to the 0X87800000 link address of the development board DDR. The command is as follows:
nfs 87800000 192.168.0.104:/home/lumeng/linux/nfs/uart.bin
The go command execution jumps to 0x87800000 and the serial port prints the result:
Not only can you test bare metal programs, you can also load uboot and kernel to test uboot and kernel! Use nfs to transfer uboot and execute as follows:
Use nfs to transfer kernel + device tree and boot kernel as follows. Use nfs command to download kernel and device tree from server to DDR.
nfs 80800000192.168.0.104:/home/lumeng/linux/nfs/zImage
nfs 83000000 192.168.0.104:/home/lumeng/linux/nfs/6ull.dtb
Use the bootz command to start the kernel bootz 80800000 – 83000000
tftp service mode:
Use tftp to verify bare metal, uboot, and kernel on 6ull. The virtual machine needs to install nfs service and enable nfs service. For specific operations, refer to the second section of the development environment construction. The development board runs in the uboot interface, and its ip, service ip, gateway, etc. are modified to ensure that it can ping the server (virtual machine) ip normally. q3026240374
After preparation, you can use the tftp command to download the bare metal program uart.bin to the 0X87800000 link address of the development board DDR. The command is as follows: tftp 87800000 uart.bin, and use go 87800000 to execute the bare metal.
Use tftp to test uboot and kernel as follows. The details are similar to nfs and will not be repeated here.
|