cancel
Showing results for 
Search instead for 
Did you mean: 

Is this the correct way to combine 2 ram's in STM32 based micro controller

shreyas
Associate II

Can anyone guide me if i am doing the correct way of combining 2 rams in linker script(attached with the message ) for my stm32 based micro controller - which is stm32wle5xx, any help would be much appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

From performance/architectural point of view there is no constraint to use them as the same block (if SRAM1 = 32kB):

SofLit_1-1710513066610.png

But you need to take care about some specificities of the security feature of each SRAM block:

SofLit_2-1710513137214.png

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
TDK
Guru

Since the two memories (SRAM1 and SRAM2) are contiguous in memory, how you have it defined will work just fine.

If you feel a post has answered your question, please click "Accept as Solution".
SofLit
ST Employee

Hello,

It depends on your device. You need to check if your device has 32kB for SRAM1

According to RM0461 & DS13105:

SofLit_1-1710249853464.png

So if SRAM1 size is 32kB this means SRAM1 and SRAM2 are contiguous and you can assume the two RAMs as a same block. If not, you can't combine them.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
shreyas
Associate II

Hi Everyone ,
Thank you for your time and reply ,following are some of the things i had in mind to ask - 

  • what are the drawbacks of combining the ram1 and ram2 , because  i don't want to take any risks combining both the ram, so could anyone please guide me through the drawbacks of combining.
  • What other ways if i keep the ram1 and ram2 separate, are there any ways  to access ram2 could you give an example with the code because there are very less resources explaining ,it would be a great help for me.

I will be attaching the STM 32 based microcontroller(STM32WLE5CC) which i am using with the link - 

-  https://www.st.com/en/microcontrollers-microprocessors/stm32wle5cc.html  

 

shreyas_0-1710393934335.png

 

 

There are no drawbacks.

If you keep them separate, you can access SRAM2 normally. If you combine them, you can still access SRAM2 normally.

All you are doing is telling the linker to act as if they are the same region. It only deals with addresses. It doesn't know or care than you are "combining" SRAM1 and SRAM2.

If you feel a post has answered your question, please click "Accept as Solution".

Hello,

From performance/architectural point of view there is no constraint to use them as the same block (if SRAM1 = 32kB):

SofLit_1-1710513066610.png

But you need to take care about some specificities of the security feature of each SRAM block:

SofLit_2-1710513137214.png

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.