About the running of the bare metal program in the book of Wei Dongshan on the mini2440

Source: Internet
Author: User

Recently, I started to learn about the bare metal driver in the book Wei Dongshan. when running the code in the SDRAM, I found that it could not run correctly. the method I downloaded was to run the program through the D command of the supervivi provided by mini2440. Now, I think we have made many mistakes. Wei Dongshan's book emphasizes more than once that these bare metal programs should be downloaded to nandflash for running, but I downloaded them to the SDRAM through the D command of supervivi. Now, let's summarize the following:

1. These bare metal programs need to be downloaded to nandflash for running. When the CPU is started from nandflash, the CPU will use internal hardware to copy the 4 KB data starting with nandflash to the 4 kb internal RAM called "steppingston" (the starting address is 0 ), then jump to ram address 0 to start execution.

2. The D command of supervivi downloads the program to the memory starting address 0x3000000 of the sdram. At this time, it was actually started from nor flash. In this example, if you start from nor flash and download the program directly to SDRAM to run the program, run the code in SDRAM and copy the 4 kb code in steppingston to SDRAM, at this time, because something in steepingston is unknown, the code in the SDRAM will be overwritten, leading to program disorder.

3. the correct operation is to first start the program from nor flash, and then use the V command (download the program to the VIVI partition of nandflash, And the VIVI partition address is 0x0-0x50000) to download the program to nandflash, in fact, the V command First downloads the program to the SDRAM through dnw, and then executes the NAND write operation, copy the code starting with 0x30000000 to the address 0 of nandflash (this is what a friend on the Internet said ). In this way, the code is downloaded to nandflash. Then restart nandflash, so that stepingston is the code in nandflash, and this experiment will be able to run normally.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.