This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Creating a library for ROM symbols for Piccolo A

I'm not sure of the correct terminology to use so I'll explain what I need to do:

I am working on a bootloader that will exist in Flash sector A on a F28027 Piccolo. This is to be factory programmed.

The application code will exist in Sectors B,C&D. It may be field programmed at a later date with a newer build of application code. The bootloader code in Sector would never change. Due to memory size limitations, I need to put some of the application code and some tables (That will never change) in Sector A with the bootloader.

Ideally I would build the project for the bootloader, generate an executable to load at the factory, and a library (?) so that the application project can get at the tables and modules that are piggybacked along.

I considered  using a dependant project and a library for the bootloader, but I dont want to include any of this code in the application (size and security issues) and I dont want the compiler to rebuild the library in case it gets changed somehow (compiler settings ect). In other words, I want the bootloader and piggybacked code to look like "boot ROM" code to the application.

However, on the Piccolo devices the Flash API is built into the ROM, and do not need to be included in the flash code of the application. A library file such as 2802x_FlashAPI_BootROMSymbols_v2.01.lib is included and linked first to get at the ROM code symbols. This is more or less what I need to do. I just have no idea how such a library is created, but not included in the flash code with the application (like the many TI motor control and power libraries ect).

Is there something simple I'm missing? Can I create a symbol library from the .out  or some other file?

  • This app note is not a perfect fit to your problem, but it comes close.  Especially the section titled ROM Symbols Library.

    Thanks and regards,

    -George

  • Thanks George,

    Things are a little more clear now. There is a lot of detail in that app note.

    Is there any way to generate a symbol library from the .out or .map file without using perl scripts?

     

    Regards,

    Jason

  • Also, I'm not worried about loss of patching functionality since this will be in Flash not a ROM mask. So something simple would be fine.

    Regards,

     

    Jason

  • jason wiseman said:
    Is there any way to generate a symbol library from the .out or .map file without using perl scripts?

    In short, no.  There is no solution built-in to the linker.  While, in theory, you could write your own solution in any language you like, it is probably best to start with the Perl scripts mentioned in that app note.

    Thanks and regards,

    -George

  • This solution works well.

    I ended up intalling Perl and using the Perl scripts in a batch file like the examples.

    The newer tools have a few more options which made my job easier!

    The project had a configuration as follows: 28027 target. Custom bootloader in sector A. Application code in Sectors B,C,D.

    I was able to move stable code into sector A to save space in the App code space in B,C,D. The FlashAPI(stored in Flash, run from Ram), lookup tables ect.

    The trick is to locate the shared resource in its own section so that the xml tools can get at it. I ended up using the -s option and the -a option with the get_rom_symbols.pl script.

     

    Thanks George!

  • Hi,

     

    Here you can find a python script which parses XML file produced by ofd470 and generates a single assembler file which contains global symbols and ELF sections

    http://www.assembla.com/code/OpenTI/subversion/nodes/scripts/elfXmlParser.py

     

    Example of usage

     

    ofd470 --obj_display=none,symbols,sections --xml --output ROM.out.xml ROM.out

    elfXmlParser.py --verbose true --xml ROM.out.xml --sections include_sections.txt --include include_symbols.txt --exclude exclude_symbols.txt --asm ROM.asm

    Output (assembler) looks like this

        .global  rom_bss
    rom_bss:            .usect "rom_bss",0x4, 4

        .global  rom_data
    rom_data:            .usect "rom_data",0x0, 4

        .global  irqStackStart
    irqStackStart            .set 0x201204

        .global  userStackStart
    userStackStart            .set 0x200004

        .global  _c_int00
    _c_int00            .set 0x80

        .global  _end_of_world
    _end_of_world            .set 0x210

        .global  irqStackTop
    irqStackTop            .set 0x15c

        .global  userStackTop
    userStackTop            .set 0x150

    Examples of configuration files

    List of sections:

    .bss rom_bss rom_bss
    .data rom_data rom_data

    List of symbols

    _end_of_world
    irqStackStart
    irqStackTop
    userStackStart
    userStackTop
    _c_int00