STM32F1_External SRAM as running memory

Publisher:TranquilGazeLatest update time:2017-09-15 Source: eefocusKeywords:STM32F1 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Preface

Today's summary of "STM32F103  https://yunpan.cn/cSq3WajiZIcx8   Access password 30c0

 

External SRAM as running memory:

https://yunpan.cn/cSq3n5iBTHuDc   Access password: 4102

 

The information of STM32F10x can be downloaded from my 360 cloud disk:

https://yunpan.cn/crBUdUGdYKam2Access    password ca90

 

Content explanation

Project Overview: The routine defines a global BUF and a local BUF. By assigning values ​​to the two BUFs and then printing the values ​​and their corresponding addresses, the address of the running memory can be detected.

 

The projects provided are based on the principle of simplicity, with detailed Chinese annotations to facilitate yourself and everyone.

 

Regarding "STM32F103 external SRAM as running memory", I will describe the important points below:

1. Configure the startup file

We use the official standard library, copy the "startup_stm32f10x_hd.s" file in the FSMC routine of the standard library (the project uses 103ZE, if you use an interconnected chip, copy the corresponding file), and replace the startup file of our previous project, as shown below:


 

2. Configure FSMC

We use the ready-made function interface (using register configuration) in the "system_stm32f10x.c" file in the official standard library to configure FSMC. We only need to open the macro "DATA_IN_ExtSRAM" on line 122 in the "system_stm32f10x.c" file, as shown in the figure below:


 

3. Allocating RAM

The allocation of RAM addresses is done by the compiler, so the project needs to be configured accordingly, that is, to use external RAM, as shown below:


 

4. Test function description

 

This function is located below the main.c file;

This function is mainly used to test the above configuration and rectification project. Define a global variable and a local variable, and print their addresses through the serial port to determine whether the running memory is external or internal.

 

5. Print (test) results


After looking at the test function, we know what the data printed out in sequence is. Here we can clearly see that the printed address is 0x6800xxxx . The 0x6800xxxx address data here is the external SRAM address (if you don’t understand, please see yesterday’s explanation), indicating that the running memory is indeed external SRAM.

 

5. Today’s Focus

A. In actual development, please try to use the ready-made function interface (using register configuration) in the "system_stm32f10x.c" file in the official standard library to configure FSMC, which is more efficient. Or, if you like the code style configured by STM32CubeMX , you can use either one. The use of STM32CubeMX is actually very simple, and there are some tutorials on the Internet. I will add an article about STM32CubeMX later.

 

illustrate

The software project provided today is based on the STM32F103 large-capacity chip. Medium- and small-capacity chips do not have the FSMC function and naturally cannot be used. In fact, as long as some configurations of the project are appropriately modified, all STM32F1 chips with FSCM function are applicable.


Keywords:STM32F1 Reference address:STM32F1_External SRAM as running memory

Previous article:STM32F1_FSMC reads and writes external SRAM
Next article:STM32F1_External NorFlash storage program code

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号