In an embedded system, must the program code in FLASH be moved to RAM to run?

The core of this problem still depends on what chip solution you use!

Embedded systems involve a particularly large technology stack, not just the ARM+Linux that everyone understands.

I have been in the industry for 11 years, and I can only say that I am familiar with one of them.

In an embedded system, the core unit is the "brain" of the entire system, similar to the CPU of a computer.

I'm not strictly calling it a processor, so as not to be overwhelmed.

Different processors have different performance, which can be divided into the following types in terms of performance:

 

From different embedded processors, different career directions are derived. The mainstream ones are as follows:

1. MCU engineer

2. Linux driver development

3. Linux system development engineer

4. Linux application engineer

5. Android system development engineer

6. FPGA/DSP development

 

Programs of different processor types run in different ways, so they cannot be generalized.

I compare the two mainstream ones:

1. Embedded Microcontroller (MCU)

That is, single-chip microcomputers, such as 8051, LPC2132, STM32, etc., the chip program storage areas are all on-chip nor flash.

Nor flash can be addressed directly like RAM, so the microcontroller can run programs directly from the internal FLASH.

2. Embedded microprocessor MPU

Generally, it is what everyone calls ARM+Linux.

But not all ARMs need to run Linux. STM32 also belongs to ARM, but most of them are "bare metal programming", and at most run an RTOS.

Generally ARM+Linux is to store the program in an external storage device, such as nand flash and so on.

Before the program is executed, the program will be read from external storage (such as nand flash) and put into ram to run, and the cpu will read the program and data from ram.

3. Summary

Whether it needs to be moved to ram depends on what chip solution you use.

You can simply understand that if you are developing with a single-chip microcomputer, you can directly read and execute the program from the on-chip nor flash.

If it is ARM+Linux, it needs to be moved to ram for execution.

Single-chip microcomputers generally have a project of hundreds of kilobytes of programs, but ARM+Linux is casually tens of MB. If a program of this size is built-in Nor flash, whether it can be realized technically, the cost is not an issue. Estimate.

Last egg time! ! !

Recently, many friends asked me for some MCU learning materials, and then based on my ten years of experience in the industry, I stayed up all night and carefully compiled a "MCU Introduction to Advanced Tutorial + Toolkit" , all free to share with everyone! ! !

In addition, I will share with tears my 22 popular open source projects at the bottom of the box, including source code + schematic diagram + PCB + documentation, so that you can quickly advance to become a master!

It is said that a small partner successfully entered the BAT factory by relying on this information, so you must study hard if you save it.

The tutorial package and detailed learning path can be found at the beginning of my article below.

The learning path from the introduction of MCU to advanced opening and hanging (with tutorial + tools) icon-default.png?t=M3K6https://blog.csdn.net/weixin_43982452/article/details/114134096

 

Guess you like

Origin blog.csdn.net/weixin_43982452/article/details/124340746