One of the embedded boot Methods: resource-limited system startup

Source: Internet
Author: User

Startup refers to the program to run when the chip is powered on and reset. It is started as a module independent of the operating system, because the operating system needs to start this module to load and boot. Therefore, the start term is boot loader. My definition of Boot Loader includes two parts: 1. Loading OS 2. hardware and software initialization to make the OS run properly.

We often see that the term boot loader is used for ARM-guided Linux, x86-guided windows, and so on. It can be seen that in general, boot loader can be used as some Soc solutions with strong computing power and plug-in of SDRAM. So let's understand the startup of a finite-size embedded system with memory resources? Take 51 as an example.

The 51 system SOC is generally built into the K-byte level nor flash for Running code, and built into a K-level RAM for data read and write. Obviously, this kind of system cannot run a tall Linux system. What should we do when we start 51? Let's start with the Program Development Process:

1) Compile, compile, and link the program to an executable file. Generally in the Keil integration environment.

2) the executable file in Keil's binary tool (similar to GCC's objcopy) 1) extracts code and data to generate a. hex format file with the loading address. Remember to load the address, not the run address.

3) Burn the. HEX file data to nor FLASH based on the loading address in the file. Generally, the loading address and running address of the code segment are the same, so that the code can be run in nor flash. However, data can be read and written only when it is stored in the built-in Ram region. However, if the ram power is down, it will disappear. Therefore, data is first loaded to nor flash. That is, the data running address is in the ram region, and the loading address is in the Flash region.

4) after power-on reset, the startup code will initialize the hardware, such as clock, watchdog, and serial port.

5) Prepare the stack and copy the data from the loaded location to the ram running region (link address)

6) initialize the BSS and then run the jump command on the main program.

A simple embedded system generally does not have an OS, which is the process above. The amount of code for such a system is generally relatively small, all of which are placed in the built-in nor flash, and there is no plug-in for NAND Flash or card. It supports reading and writing cards, but the code is only placed in the built-in nor flash, rather than in the external card.

In fact, 51 can also guide the operating system like arm. Of course, the operating system not only has requirements on memory, but also has requirements on CPU computing capabilities. Therefore, 51 is not competent to run Linux. But 51 can also guide and run a simple operating system, such as UCOS. Only Ram is large enough. Therefore, the 51-based SoC system can also look like the s5pv210 SoC system. The code is stored in an external NAND Flash or card, then the startup will become an independent module and U start cos, and the application will be placed in an external NAND. when the power is on, the startup code will be loaded to Iram through irom first, then run the startup code and boot the OS in the startup code. For details, see the next blog.

One of the embedded boot Methods: resource-limited system startup

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.