gcc, linker script, elf, static data and FLASH

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

gcc, linker script, elf, static data and FLASH

1,487件の閲覧回数
Petter
Contributor II
How can I specify that static variables goes into the SRAM, but their init values goes into the FLASH so I can do a copy on boot?

If I specify that static data (.data section) should go in the FLASH it will be read-only. If I specify that the .data section should go in the SRAM I don't the init values (the latter is OK if you have something to load an ELF file into memory).

Thanks
ラベル(1)
0 件の賞賛
返信
1 返信

375件の閲覧回数
Petter
Contributor II
I can solve this by putting the static data in the .data section (in SRAM), and then write a small util to extract the data from the elf file and make a copy in the .rodata section (in FLASH). Then I can copy the static data at startup.
0 件の賞賛
返信