A brief explanation of using external RAM in STM32 MDK

Publisher:清新生活Latest update time:2016-08-05 Source: eefocusKeywords:STM32  MDK Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Introduction:
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
A brief explanation of using external RAM in STM32 MDK - Hanjiang Duchui - Hanjiang Duchui
Then you can try to define a large array.

Keywords:STM32  MDK Reference address:A brief explanation of using external RAM in STM32 MDK

Previous article:ARM -- core
Next article:Analysis of the connection between S3C2440 and SDRAM NorFlash NandFlash

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号