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

Using COMMON directive through the IDE

I've got a C program written for an ST10F168 that has a number of modules whose functions execute mutually exclusively from one another (the choice is based on a harness configuration into the ECU). Only one module executes at any given time and only its variables are required. I'd like to combine the RAM sections from these mutually exclusive modules to overlap each other since only one is used for any given invocation of the program. I have found the COMMON section directive that I think would work. How do I use this in conjunction with the IDE? through the Target Options for C166 or L166? or do I need to do something else. Thanks for any insight...

  • Looks like section combine type (e.g. COMMON) can only be defined in assembly language. So if you want to make use of COMMON sections, you can generate SRC files from your C source files and edit them manually, which is inconvenient, to say the least.
    Or you can use C unions.

    Regards,
    - mike