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.

  • 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.

  • If I can read between the lines, if I can't do this in a C source file, you CAN do this in an assembler file. I can produce an assembly listing as easyly as a C file.

    That's the answer.... Thank you.