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.

Getting base and size of TCF MEM section into software

I'm using DSP/BIOS 5.33.06 and CCS 3.3.

I have a MEM section configured in the TCF (DSP/BIOS visual configuration). I want to use the base address and size of this MEM section in the code.

I do not want to have to edit the values once in the TCF (visually) and again in the code.

Is this possible? Is there any way of reading the MEM section base addresses and sizes in the code.

I know that I can obtain the address of a heap but this is not what I want: I'm burning a factory image from a MEM section (loaded via CCS) into flash. I want the flash burner software to pick up the MEM base address and size automatically otherwise there is a maintainance nightmare - someone in future may change the MEM section location and size in the TCF but not realize that change is necessary in the code. Then we get incomplete images and time wasted on debugging.

 

  • What you're describing sounds similar to RUN_START as described in the linker chapter of the Assembly Language Tools Guide.  However, this operator is only applied to SECTIONS and not MEMORY, so in that sense I don't think it's quite what you're looking for.

    You might need to describe a little more what you're doing.  One idea would be to do something like this:

    1.  Let's say in BIOS you have a MEM called "FLASH_UPDATE".

    2.  You would need to create a dummy array to fill that space.  You will have redundancy from the perspective that you would have to repeat the size of FLASH_UPDATE here.  However, this approach would not be error prone because if at some point someone made FLASH_UPDATE smaller but forgot to change the size of the array too then they would get a linker error.  For example:

    #pragma DATA_SECTION(flash_data, .far:flash_section)

    char flash_data[10000];

    3.  You then create a second linker command file:

    SECTIONS
    {
       .far:flash_section > FLASH_UPDATE
    }

    4.  Now in your code you just utilize "flash_data" to access the memory.  If your MEM "FLASH_UPDATE" ever gets moved then flash_data will also move.

     

    I recommend giving a higher level description of what you're trying to accomplish because this doesn't seem like something you should be doing!