placing data in flash

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

placing data in flash

1,932件の閲覧回数
hek
Contributor I
Hi folks,
I have a question for you.
Im porting some code from AVR (the IAR compiler) to Freescale. For the avr there is a prefix '__flash' that tells the linker/compiler that the variable should be located in the flash, not the ram. For example:
__flash const char str[] = "abc";

Is there an equivalent way of doing it in CW witha prefix? or do I have to write something like
const char str[] @"DEFAULT_ROM" = "abc";

Best Regards
Henrik
https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Ftyda.se%2F%3Flang%3Dsv%26w%3Dekvivalen...
ラベル(1)
0 件の賞賛
返信
1 返信

389件の閲覧回数
CrasyCat
Specialist III
Hello
 
I assume you are using CodeWarrior for HC08 or CodeWarrior for HC12.
Is that right?
 
If this is the case, defining a variable as const will place it in a section called .rodata.
If you have created your project using the wizard, the section .rodata will automatically be allocated in flash.
 
So there is no need to specify any additional prefix to get it in there.
 
CrasyCat
0 件の賞賛
返信