How the program is debugged in RAM and how it is run after being solidified

Publisher:Aq123456258Latest update time:2015-11-09 Source: eefocusKeywords:Program Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
How to run the program after solidification:

After the program starts running, the RW and ZI segments need to be moved to the RAM. After the program is downloaded into the Flash, how are the RW and ZI segments moved to the RAM after power-on? Note that after initializing the .s file, IAR and ADS do not jump directly to the main function to execute. IAR jumps to?main and ADS jumps to the __main function. In these functions, according to the configuration of the icf file, the RW and ZI segments are moved to the RAM area specified by the icf file. If the runtime domain of the program is in the off-chip RAM, when does the program initialize the off-chip RAM controller? Because the beginning of the .s file is CODE RO, no RAM space is required, so the off-chip RAM can be configured in the .s file. There is another problem, which must be paid attention to during hardware design. If the program needs to be solidified in the external Flash, it must be noted that the external Flash must be a chip that the default off-chip bus supports after the chip is powered on.

How programs are debugged in RAM

For the convenience of debugging, sometimes the program does not need to be downloaded into the flash for debugging, but runs directly in the RAM. Set the ROM and RAM addresses in the icf file to the addresses of the hardware RAM, turn off the Flashloader, and the program will run in the RAM. But the problem arises again, because sometimes we want to debug the code in the external RAM, so the external RAM controller needs to be initialized before the code is downloaded into the RAM. How can it be achieved? IAR is implemented through the .mac file. It is executed before the program is downloaded. The program in the mac file, the following is an example

execUserFlashInit()
{
    __writeMemory32(0x1000ffef, 0xffe00000 , "Memory");
    __writeMemory32(0x0f000114, 0xE002C014, "Memory"); 
}

This example is an example of LPC initialization of external RAM. After configuring the external RAM, you can run the code in it.

IAR download of the program

1.       The file is downloaded and run in the on-chip Flash

This is the simplest and most commonly used method. Generally, ARM chips have on-chip Flash, and IAR will download binary executable files to Flash through Flashloader. The download method is as follows: if you want to download program B to the chip, IAR first downloads a program A (a program pre-written by IAR) to the RAM on the chip, and then uses this program A to interact with Flashloader through JTAG to complete the download of program B.

2.       Download the file in the off-chip Flash

The program A downloaded into RAM by IAR must support the off-chip Flash and be able to erase the off-chip Flash. Often this program needs to be written by yourself. The download mechanism of HJTAG is the same. HJTAG lists many chips supported by HJTAG. The so-called support means that HJTAG has program A for these chips. In HJTAG, the address of the RAM to which program A will be downloaded must be specified, and the RAM at this address must be available. For example, if an off-chip SDRAM is used, the SDRAM controller must be initialized. This is done in the Init Script of HJTAG and in the mac file of IAR.

3.       Download files in on-chip RAM, download files in off-chip RAM

Since these two methods do not require the participation of Flashloader, the loading domain and runtime domain of the program are the same. The program does not need to be moved after it is running, so you only need to specify the RAM address of the runtime domain to IAR. If it is internal RAM, it is very convenient. Just set the address to internal RAM in the icf file. If it is external RAM, initialize the external SDRAM controller or other RAM in the mac file, and then IAR can put the program in the initialized external RAM and run it.

Keywords:Program Reference address:How the program is debugged in RAM and how it is run after being solidified

Previous article:Many questions about single chip microcomputer
Next article:MSP430 Pull-up Resistors & Secondary Functions of I/O Ports

Recommended ReadingLatest update time:2024-11-15 11:25

Vivo X Fold appears on Geekbench: equipped with Snapdragon 8 Gen 1 and 12GB of memory
       The vivo X Fold foldable phone will be officially released on April 11, and the phone has already appeared in the Geekbench running score.   The vivo X Fold is equipped with a Snapdragon 8 Gen 1 chip, with a single-core score of 1239 and a multi-core score of 3535. It has 12GB of memory and runs the Android 12
[Mobile phone portable]
Vivo X Fold appears on Geekbench: equipped with Snapdragon 8 Gen 1 and 12GB of memory
MCU on-chip memory burning (ROM programming)
The microcontroller application system consists of hardware and software. The carrier of the software is the program memory of the hardware. The program memory uses a read-only memory. This memory can still save the program after the power is turned off. After the system is powered on, the CPU can take out these instr
[Microcontroller]
MCU on-chip memory burning (ROM programming)
Single-chip multi-microcomputer system sharing RAM circuit
  At present, multi-microcomputer systems have been applied in many aspects, such as industrial robot control, CNC machine tool control, etc. Therefore, communication between multiple machines has become the technical key of multi-machine systems. Especially in occasions with special requirements for data transmission
[Microcontroller]
Single-chip multi-microcomputer system sharing RAM circuit
iPhone 12 series configurations and prices revealed: Pro upgrade to 6GB memory
     Recently, the statistics agency TrendForce released a configuration and price information table for all four models of the iPhone 12 series. Although it is a predictive tone, the analysis agency is still quite rigorous, so it may be worth a reference.   Specifically, the iPhone 12 series will include four models:
[Mobile phone portable]
iPhone 12 series configurations and prices revealed: Pro upgrade to 6GB memory
mini2440 entry-level block device driver (using RAM cache to simulate a disk) code record (the kernel uses 2.6.32.2)
#include linux/module.h #include linux/errno.h #include linux/interrupt.h #include linux/mm.h #include linux/fs.h #include linux/kernel.h #include linux/timer.h #include linux/genhd.h #include linux/hdreg.h #include linux/ioport.h #include linux/init.h #include linux/wait.h #include linux/blkdev.h #includ
[Microcontroller]
A new era of intelligent parking: Advantech ROM-2620 core module empowers innovative parking timer case
In today's era of Internet of Everything, many cities are integrating smart parking meters into urban infrastructure. This transformation not only reduces labor and operating expenses for parking services, but also simplifies the management of equipment. 01 Project background Smart parking meters are devices u
[Industrial Control]
A new era of intelligent parking: Advantech ROM-2620 core module empowers innovative parking timer case
Breaking the high-bandwidth memory wall, the pinnacle of domestic one-stop high-speed interface IP
On December 22 (Tuesday) at 20:00, two technical experts from Innosilicon, a leading one-stop IP and custom chip company in China, will be guests at the live broadcast room of Jiwei.com, a well-known domestic integrated circuit and mobile phone industry portal, to share a series of cutting-edge technologies through op
[Mobile phone portable]
ARM Series -- Enable MMU on FS2410 development board to implement virtual memory management
1. Background    The ARM core on the FS2410 development board is ARM920T. What does ARM920T stand for? In fact, ARM920T = ARM9 core + MMU + Cache, which means that ARM920T provides the hardware conditions for implementing virtual memory management, and this hardware condition is MMU - memory management unit. In the pr
[Microcontroller]
ARM Series -- Enable MMU on FS2410 development board to implement virtual memory management
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号