cancel
Showing results for 
Search instead for 
Did you mean: 

SRAM reserved location usage

A3
Associate III

Hi,

I am using STM32F779NI and Keil IDE. I have defined SRAM start area in Target options from

0x20000000 with size as 0x80000.

Now, I want to write a keyword at known location in the memory. The memory area should be selected such that incremental development of code doesnt affect this keyword location overwriting this location.

Which SRAM location should be selected?

I am writing at particular location in following ways

strcpy((char*)SIGNWORD_ADDRESS,SIGNWORD_DATA);

where SIGNWORD_ADDRESS = some location like below macro

#define SIGNWORD_ADDRESS (const char*)0x20018400

3 REPLIES 3
TDK
Guru

I would reserve a chunk of memory at the end of the SRAM for this information, remove it from your linker region, and use hard-coded address as you're doing.

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

Thanks for the reply,

SRAM has been defined from 0x20000000 till 0x20080000 (target option settings in keil to give start area and size of SRAM). So, till 0x20080000, memory will be utilized by linker. Am I right?

I have tried using memory after 0x20080000 using hardcoded address i.e. 0x20080128, but the sytem hangs maybe because defined SRAM address is till 0x20080000 controller has 512Kb SRAM.

I would reserve a chunk of memory at the end of the SRAM for this information, remove it from your linker region, and use hard-coded address as you're doing.

Does that mean in target options give size of SRAM less than 512Kb like maybe between 0x20000000 - 0x2007FE00. and then for keyword data use between 0x2007FE00-0x20080000.?

TDK
Guru

Obviously, you cannot use memory past 512kB if the chip only has 512kB of memory. You'll need to reduce the amount your program uses so that you can use the remainder for your data.

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