This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

define variable in the designated address space

I want to define the variable in the designated address space.I used another compiler,before the variable define,I can use the #pragma to distribute the address space.
What can I do with Keil?Such as the #pragma!
Thank you very much!

Parents
  • I have tested the way you told me like this,but it not effective:
    int__attribute__((section("foo"))) data;

    define the section in the .sct like this :

    RAM 0x20000000 0x7FFF
    { RAM_Data 0x20000000 0x7FFF { data_common.o(+RW) (foo) ; select section foo from data_common.o }
    }

    but the address in the .map didn't in the expect address:
    data 0x1fff800c Data 4 data_common.o(foo)

    so,if I define variable by this method,what can I do?
    Thank you very much!

Reply
  • I have tested the way you told me like this,but it not effective:
    int__attribute__((section("foo"))) data;

    define the section in the .sct like this :

    RAM 0x20000000 0x7FFF
    { RAM_Data 0x20000000 0x7FFF { data_common.o(+RW) (foo) ; select section foo from data_common.o }
    }

    but the address in the .map didn't in the expect address:
    data 0x1fff800c Data 4 data_common.o(foo)

    so,if I define variable by this method,what can I do?
    Thank you very much!

Children
No data