SRAM segment

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SRAM segment

1,747 Views
anbui
Contributor II

K22 SRAM is split into 2 64K segments.

Currently the linker is only using SRAM_UPPER.

2018-09-28.png

How should i change the MCUXpresso settings to:

a) merge the SRAM into 1 128K.

or

b) evenly distribute across both segments?

2018-09-28 (2).png

0 Kudos
4 Replies

1,482 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi An Bui

This means your RAM memory has overflowed. You cannot mearge this two RAM into one because it could cause you bus problems. My recomendation is that you place some data memory in the lower ram manually with a Macro definition in #include "cr_section_macros.h" for example

__BSS(SRAM_LOWER) uint8_t s_currSendBuf2[]

Hope this helps

Best regards

Jorge Alcala

0 Kudos

1,482 Views
hedj
Contributor I

Hi Jorge,

Is there any document on why the memory is split into 2, and how MCU works if there is data in both parts?

Thx.

0 Kudos

1,482 Views
hedj
Contributor I

Hi Jorge,

Initially the linker put all my data into SRAM_UPPER, which causes it to overflow.

So I did what you suggested, I put __BSS(SRAM_LOWER) in front of a big float array about 28k size; after compiling I found linker put all data into SRAM_LOWER, which definitely causes another overflow.

How to make the linker to put the rest data in upper RAM without manually adding __BSS(SRAM_UPPER) for rest data? I have a few dozens of them.

Thx.

0 Kudos

1,482 Views
hedj
Contributor I

I think I made a calculation error: the data put into SRAM_LOWER by linker is exactly the size of that big array. That means __BSS() works as expected.

0 Kudos