Thursday, 15 September 2011

c - ROM variable not getting the defined value -



c - ROM variable not getting the defined value -

i'm working on developing software stack automotives based on renesas rl78 controller. getting straight problem, variables declared const(rom variables) not getting initialized defined value.

ex : const uint8 var_test = 1;

on other hand, global,static variables getting initialized.

is problem startup code? kindly suggest...

like other answers, const variable isn't placed rom section.

you need tell compiler/linker place it.

with iar toolchain it's like

#pragma set_const_page(constarea) const int myvariable1=42; const int myvariable2=4711; #pragma set_default_const_page

but debugger doesn't show right value problem, it's possible variable optimized. sure happens map file , (with debugger) @ assembly level done.

c embedded

No comments:

Post a Comment