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

Multiple const code segment in a single source file

We have a sequencer which is in a fixed location in ROM (0xf000-0xffff). It is produced by an external process that creates C source code and is compiled and linked into the final ROM. This I have been able to acomplish with ?CO?SEQUENCER(0XF000) on the BL51 Locate Tab.

At location 0x0030 I maintain version information. I would like to be able to include in the sequencer source file a __DATE__, __TIME__ directive to maintain the sequencer version data in this location.

Parents
  • Unfortunately, there's no pragma to set or change the name of the segment used for C source. There's always exactly one segment whose name is derived from the file. To have multiple segments, you need multiple files. You might want to create a Sequencer.c that contains nothing but your sequencer data, and link that to the desired location.

    __DATE__ and __TIME__ are preprocessor macros that expand into human-readable C strings. This is a somewhat verbose way to store the date, but perhaps that's fine for your application. At least it's easy to build into the code.

Reply
  • Unfortunately, there's no pragma to set or change the name of the segment used for C source. There's always exactly one segment whose name is derived from the file. To have multiple segments, you need multiple files. You might want to create a Sequencer.c that contains nothing but your sequencer data, and link that to the desired location.

    __DATE__ and __TIME__ are preprocessor macros that expand into human-readable C strings. This is a somewhat verbose way to store the date, but perhaps that's fine for your application. At least it's easy to build into the code.

Children