cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F427 internal RAM for code, external SRAM for dynamically alocation memory (heap) - how it get ?

Yurii Stukalo
Associate II

Hi, I have a project based on STM32F427IGH with external SRAM AS6C6416 (64M). for some functions I need a lot of memory, for another -fast access, as the SRAM not fast (50 nSec) I would like to use it only for dynamically allocation memory. After all configuration for the SRAM I am able read/write data to region 0x64000000 and higher, but when I tryed call function malloc(), it not working - Hardfault error. So, I have 2 questions:

  1. How I can get working malloc() function;
  2. Can I get in the configuration fast access to internal RAM and slowly to external, or in the case I will get slowly access for both regions?

My SRAM.ICF file for the project in the attachment.

Thanks.

3 REPLIES 3

This is purely toolchain-related question, as you are apparently using IAR you will want to go for suport there.

JW

SDRAM needs to be initialized in SystemInit() so it is viable to the run-time code that sets of the statics.

Usually the HEAP section is defined in the startup.s file, and associated with memory via linker script or scatter file.

On Keil tricks can be done to add memory ranges into the allocator chain, similar things could be done with IAR if you understood how it works.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Yurii Stukalo
Associate II

Thanks all for helping, I found the isssue .. I it was my msitake. I lost one zero in start address in the SRAM.ICF file, was:

define symbol __ICFEDIT_region_FMC11_start__ = 0x6400000;

should be -> 0x64000000