Fixed address variable in C

前端 未结 10 1105
迷失自我
迷失自我 2020-12-01 12:47

For embedded applications, it is often necessary to access fixed memory locations for peripheral registers. The standard way I have found to do this is something like the f

10条回答
  •  悲&欢浪女
    2020-12-01 13:35

    A linker would typically use a linker script to determine where variables would be allocated. This is called the "data" section and of course should point to a RAM location. Therefore it is impossible for a variable to be allocated at an address not in RAM.

    You can read more about linker scripts in GCC here.

提交回复
热议问题