Introduction:
Keywords:STM32 MDK
Reference address:A brief explanation of using external RAM in STM32 MDK
Development Board Shenzhou King STM32F207 Development Board
Problem Description:
When using emwin, due to the large number of variables occupied, the embarrassing situation of insufficient internal RAM of STM32F207 appeared. The development board comes with 4M external SRAM. Therefore, considering the balance between speed and storage, the internal RAM of the chip is used as the stack area, and the external RAM is used to store other variables.
Modifications:
The startup file is startup_stm32f2xx.s file
1. Add the flag: DATA_IN_ExtSRAM EQU 1; mainly to facilitate the control of switching between internal and external RAM
2. Modify the stack area: IF DATA_IN_ExtSRAM == 1
__initial_sp EQU 0x20000000 + Stack_Size
ELSE
__initial_sp
ENDIF
3. Initialize external RAM before entering the main function
There are two ways to initialize
The first one: initialize in SystemInit
The SystemInit function is located in the system_stm32f2xx.c file
Define macro variable DATA_IN_ExtSRAM
In this way, the function SystemInit_ExtMemCtl will be called when the system is initialized
Modify the SystemInit_ExtMemCtl function content to initialize FSMC RAM
The second
Call the RAM initialization function before calling the main function in startup_stm32f2xx.s to complete the RAM initialization
IMPORT __main
IMPORT SystemInit
IMPORT SRAM_Init
LDR R0, =SystemInit
BLX R0
LDR R0, =SRAM_Init
BLX R0
LDR R0, =__main
BX
ENDP
Of course, the most painful way is to initialize the external RAM in startup_stm32f2xx.s, but it needs to be modified into assembly language
Finally, modify the MDK configuration and check the external RAM in option->target
Then you can try to define a large array.
Previous article:ARM -- core
Next article:Analysis of the connection between S3C2440 and SDRAM NorFlash NandFlash
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
Guess you like
- When encountering refurbished chips again, how to identify new and old chips?
- Brushless motor MOS
- [Routine experience of Flathead RVB2601 development board] Part 1: Download the example program successfully, sharing experience!
- Request CKS32F103 information
- JPEG encoding
- How are the engineers in Hubei and Wuhan doing during this epidemic?
- Labor and technology classes are back. From September, primary and secondary school students will learn to cook, grow vegetables, repair home appliances, etc.
- Why choose voltage mode control for fixed frequency pulse width modulation of power supply?
- I often hear people say not to use tantalum capacitors. Why?
- Functional experience of multifunctional handheld digital multimeter before disassembly