Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis of using example of Core Board in NAND FLASH version

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you the NAND FLASH version of the core board use example analysis, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.

Preface

The core boards of the NAND FLASH version and the eMMC version are used in the same way. This article mainly describes the differences in the use of core boards between the NAND FLASH version and the eMMC version, and the similarities will not be repeated.

1.U-Boot compilation

When configuring the U-Boot compilation options, execute the following command.

Host# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_evm_nandboot_config

Figure 1

The verified U-Boot image files provided by our company are located in the product data "4-Software material / Linux/U-Boot/image/u-boot-2017.01-gad3370e-v2.1/" directory, which are MLO-nand and u-boot.img-nand respectively. After the system boot card is made, copy the MLO-nand and u-boot.img-nand files to the BOOT partition of the system boot card, back up the original eMMC version MLO and u-boot.img files, and rename the MLO-nand and u-boot.img-nand files to MLO and u-boot.img.

Figure 3

two。 Basic device tree file compilation

The source files of the underlying device tree are tl335x-evm-nandflash.dts and tl335x-evm-nandflash-hdmi.dts under the kernel source code "arch/arm/boot/dts" directory. Use this file when recompiling the underlying device tree. The verified infrastructure tree files are tl335x-evm-nandflash.dtb and tl335x-evm-nandflash-hdmi.dtb under the product data "4-Software data / Linux/Kernel/image/linux-rt-4.9.65-gd8e636c-v2.1/" directory, please copy them to the rootfs section of the system boot card and the boot directory of the rootfs-backup partition.

Figure 4

Execute the following command to softlink tl335x-evm.dtb to the tl335x-evm-nandflash.dtb file. Tl335x-evm-nandflash.dtb supports LCD display. If you need to use HDMI display, you can just soft link tl335x-evm.dtb to the tl335x-evm-nandflash-hdmi.dtb file.

Host# sudo rm tl335x-evm.dtb

Host# sudo ln-s tl335x-evm-nandflash.dtb tl335x-evm.dtb

Host# ls-l

Figure 5

Start the evaluation board with the Linux system boot card that replaces the U-Boot and basic device tree files, and enter the file system and execute the following command to view the NAND FLASH partition information, indicating that the file has been replaced successfully.

Host# cat / proc/mtd

Figure 7

SPI FLASH

MTD0

Spi.spl: store the startup file MLO of the first phase of U-Boot

MTD1

Spi.u-boot: store the U-Boot second phase startup file u-boot.img

MTD2

Spi.env: store environment variables

MTD3

Spi.devicetree: store device tree files (not in use)

MTD4

Spi.kernel: stores kernel images (not in use)

NAND FLASH

MTD5

Nand.spl: store the startup file MLO of the first phase of U-Boot (not used yet)

MTD6

Nand.u-boot: store U-Boot Phase II startup file u-boot.img (not in use)

MTD7

Nand.env: store environment variables (not used yet)

MTD8

Nand.devicetree: store device tree files

MTD9

Nand.kernel: stores kernel images

MTD10

Nand.logo: storing LOGO files

MTD11

Nand.mini-fs: spare partition, which usually holds small file systems (not yet in use)

MTD12

Nand.rootfs: store the file system

Solidified Linux system

When the Linux system boot card is made, the script file mknandboot.sh solidified by the system has been copied to the "/ opt/tools/make-system" directory of the Linux system boot card file system.

Figure 8

Execute the following command for one-click curing.

Target# / opt/tools/make-system/mknandboot.sh

Figure 9

The script does the following:

Erase SPI FLASH, NAND FLASH.

Solidify the U-Boot in the BOOT partition of the Linux system boot card to the SPI FLASH corresponding partition.

Solidify the LOGO in the BOOT partition of the Linux system boot card to the NAND FLASH corresponding partition.

Solidify the kernel image and the underlying device tree file in the file system boot directory in the Linux system boot card rootfs-backup partition to the NAND FLASH corresponding partition.

Solidify the file system in the rootfs-backup partition of the Linux system boot card to the NAND FLASH corresponding partition.

It takes about 5 minutes and 10 minutes for the Linux system to solidify successfully, and the serial port debugging terminal prints the prompt message.

Note: the script file will solidify the device tree file and kernel image into SPI FLASH, and the actual startup will not load the device tree and kernel image from SPI FLASH.

4. Boot the system from SPI+NAND FLASH

When the evaluation board is powered off, remove the Linux system startup card from the Micro SD card slot of the evaluation board, and set the dial switch to 10010 (1x 5) according to the evaluation base plate screen printing, which is in SPI FLASH startup mode. When the evaluation board is powered on, the serial debugging terminal will print similar startup information as follows.

Figure 11

5.NAND FLASH read and write test

This chapter tests the read and write speed of the MTD11 partition of NAND FLASH. MTD11 is a backup partition for NAND FLASH and typically holds small file systems of the size of 32MByte. The read-write test will erase the contents of the partition, please make a good data backup.

Execute the following command to query the NAND FLASH partition, confirm the MTD11 partition size (do not exceed the partition size for reading and writing), and erase the contents of the partition.

Target# cat / proc/mtd

Target# flash_erase / dev/mtd11 0 0

Figure 13

A total of 30MByte test data are written here to the MTD11 partition of NAND FLASH. You can see that the NAND FLASH write speed of this test is about: 30MB/8.24s=3.64MB/s.

NAND FLASH reading speed test

Restart the evaluation board, enter the evaluation board file system, and execute the following command to test the read speed of NAND FLASH.

Target# time dd if=/dev/mtd11 of=/dev/null bs=1024k count=30

Figure 14

Here, reading 30MByte data from the MTD11 partition of NAND FLASH, you can see that the NAND FLASH read speed of this test is about: 30MB/4.47s=6.71MB/s.

The above content is the NAND FLASH version of the core board use example analysis, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report