2009-02-04 08:45 PM
variables in external SRAM
2011-05-17 04:01 AM
Hallo,
I am new user of KEIL MDK tool with ma MCBSTM32E (STM32F103 device) board from KEIL. My variables in main.c are located in on-chip RAM. But some variables i want to locate to external SRAM memory mounted on board. How is syntax to declare (define) this type of variables. In Keil C51 it was XDATA. Thank you very much and sorry for my poor English. [ This message was edited by: dps on 31-01-2009 18:09 ]2011-05-17 04:01 AM
In my opinion,you have to make new .c file(extvar.c) and define variables in this file.
You see, in project workspace of keil, select extvar.c and open option window , select your external SRAM in the memory assignment. Hope your success.2011-05-17 04:01 AM
You should be able to define a section in your .c file. In your .icf file define a region that resides in your external SRAM (0x68000000 - 0x68??????).
Place the section that you define in your .c file in the external SRAM region you just defined. You can now place the variables that you need inside of the section. You will have to refer to your compiler and linker documentation for how to define a section and region. [ This message was edited by: lonnie.walker on 05-02-2009 15:14 ]2011-05-17 04:01 AM
Quote:
I am new user of KEIL MDK tool with ma MCBSTM32E (STM32F103 device) board from KEIL.
Doesn't the kit come with examples to use its off-chip SRAM?Quote:
In Keil C51 it was XDATA.
No, that's not true. Using XDATA simply tells the compiler to use MOVX instructions to address the variables - it does not specify whether the memory is on-chip or off-chip. To force it into off-chip XDATA, you would have to know the address range of the off-chip XRAM, and use Linker directives to specify an off-chip address. You should look at a similar approach here... [ This message was edited by: st7 on 05-02-2009 10:16 ]