static const - placement in flash or RAM (ARM gcc Question)

Comments

2 comments

  • Avatar
    Dr Danish Ali

    You need to have an attribute for your variable that says where it should be placed. For example:

    const volatile char myVariable __attribute__ ((section (".data") )) = "String in RAM";

    I've never worked out why you need double brackets.

    See Crossworks for Arm: CrossStudio User Guide: Linking and Section Placement

    and Crossworks for Arm: GNU Tools Reference: GNU C/C++ Compiler: Extensions to the C language Family: Specifying Attributes of Variables

    Hope this helps,

    Danish

    0
    Comment actions Permalink
  • Avatar
    Dr Danish Ali

    Oops that should have been myVariable[] to make it a char array

    0
    Comment actions Permalink

Please sign in to leave a comment.