Fixed address variable in C

前端 未结 10 1108
迷失自我
迷失自我 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:43

    To expand on litb's answer, you can also use the --just-symbols={symbolfile} option to define several symbols, in case you have more than a couple of memory-mapped devices. The symbol file needs to be in the format

    symbolname1 = address;
    symbolname2 = address;
    ...
    

    (The spaces around the equals sign seem to be required.)

提交回复
热议问题