define a section of code in flash, it is also putting declared variables in flash

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

define a section of code in flash, it is also putting declared variables in flash

790 次查看
c393
Contributor II

I have a section defined in flash

 

 #pragma define_section  boot_text ".code" far_absolute RX 

In this section it is also putting any locate variable (uint8 loop) into flash. It should put this in ram but it links it into the flash area.

 

My .lcf file has the following:

 

 .boot_text:
 {
  MCUinit.c(.code)
  .= ALIGN (0x4);
  mcf5xxx_.s(.text)
  .= ALIGN (0x4);
  *(.code)
  . = ALIGN (0x4);
  *(.rodata)
  . = ALIGN (0x4);
  ___ROM_AT = .;
  ___DATA_ROM = .;
 } > bootcode

Why is it putting my locate variables in flash?

标签 (1)
标记 (1)
0 项奖励
回复
1 回复

335 次查看
CrasyCat
Specialist III

Hello

 

Local variables are  allocated on the stack.

Where did you see they are allocated in Flash?

 

How did you define them?

 

CrasyCat

0 项奖励
回复