cancel
Showing results for 
Search instead for 
Did you mean: 

Can I combine SRAM1 and SRAM2?

Clonimus74
Senior II

Hi,

I use STM32L476QE.

I want to use the entire RAM (96KB SRAM1 and 32KB SRAM2) as one continuous memory, is that possible?

I use IAR

6 REPLIES 6
Uwe Bonnes
Principal III

The memory is continous, so you can combine it. I do not know how IAR linker file work, but in principle remoce the SRAM2 definition and extend the SRAM1 upper limit to the SRAM2 upper limit.

But they are not mapped continuously:

define symbol __ICFEDIT_region_RAM_start__  = 0x20000000;

define symbol __ICFEDIT_region_RAM_end__   = 0x20017FFF;

define symbol __ICFEDIT_region_SRAM2_start__ = 0x10000000;

define symbol __ICFEDIT_region_SRAM2_end__  = 0x10007FFF;

Clonimus74
Senior II

No one has any ideas?

Currently I add variables to SRAM2 manually, which is very inconvenient.

using:

#pragma default_variable_attributes = @ "SRAM2_MEM"

S.Ma
Principal

For a memory segment there should be some #pragma to put the variables in the right sector.

Read the compiler and especially linker documentation.

Otherwise, put the stack in the 16kbyte region SRAM2 to get started with minimal C coding efforts.

I don't think you read my post and comments.

I already use the pragma, and the SRMA2 is 32KB, too big for just stack.

I was looking for a way to combine them so I wouldn't have to do it manually.

S.Ma
Principal

What you ask is very specific and should be asked to the compiler toolchain support team or forum. So far I would say such linker mecanics maynot exist as rarely asked.