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.

DSP/BIOS, move VECT memory section at the beginning of the DARAM (c5517)

Hello everybody,

For a number of reasons, I would like to move the VECT memory section, from the end of the DARAM, to the beginning of it, right after the memory mapped registers in the first block.

what I do is basically just swap the two memory sections, keeping their size, but changing the base address. The .tcf file can be saved regularly.

When I build the project though, I get this error from the linker: (appl_v is the name of my project

"./appl_vcfg.cmd", line 366: error #10099-D: program will not fit into
available memory. placement with alignment/blocking fails for section
".hwi_vec" size 0x100 page 0. Available memory ranges:

VECT size: 0x100 unused: 0x100 max hole: 0x100
>> Compilation failure
error #10010: errors encountered during linking; "appl_v.out" not built
gmake: *** [appl_v.out] Error 1
gmake: Target `all' not remade because of errors.

does anybody know how to solve it? thank you very much.

  • Hi Vittorio,

    I was able to reproduce the problem you are seeing with the basic hello world example from DSP/BIOS 5.x.

    I then was able to get around this by creating a new memory segment called "MYVECS" and placing the .hwi_vecs section into it.  To make room for "MYVECS", I had to shorten the length of DARAM.

    Here's the *.tcf code:

    bios.MEM.create("MYVECT");
    bios.MEM.instance("MYVECT").base = 0x000060;
    bios.MEM.instance("MYVECT").len = 0x000200;
    bios.MEM.instance("MYVECT").createHeap = false;

    bios.MEM.instance("DARAM").base = 0x000260;
    bios.MEM.instance("DARAM").len = 0x7D20;

    bios.MEM.HWIVECSEG = prog.get("MYVECT");

    Note that I was not able to try loading/running the app after these changes, as I don't have the necessary hardware handy.

    Steve

  • Ok, I solved the problem, this might actually be useful for many:

    You CAN actually replace the VECT section as you like, BUT, in the make file, it is mentioned as alligned to 0x80 words (0x100 bytes). I didn't want to risk tweaking that, so I simply moved it to the first DARAM block, but starting at word 0x80 (instead of 0x60, where the memory mapped registers end).

    This way I waiste 20 words, but it's not such a big deal, and I earned the possibility to dedicate the entire last memory block to a custom section for timing-critical buffers. I obviousely had to shift and shrink the DARAM to make that fit. And in the end I shrinked the DARAM even more in order to let the last block (0xE000 to 0xFFFF) free, and create a new custom section there called DARAM_7.

    Then I had to tell the linker to do something with this section, for that I needed to tweak the linker cmd file

    To create and arrange custom sections:

    1) use the .tcf editor in CCS to arrange the memory more or less as needed, with new custom sections
    2) save and compile
    3) save a copy of the linker command file generated (in debug)
    4) go back on the tcf editor and select the option "use cmd file" in system->memory Manager-> properties-> compiler sections
    5) exclude the previously saved copy from build
    6) save and compile
    7) you will now get several warning, because the linker doesn't find information about where to allocate the compiler sections.
    8) go back to the previous cmd file backup, and delete everything except for the lines regarding the compiler sections and, if needed, add your custom ones there, blindly copying the syntax of the other entries
    9) include also this file in the build and rebuild (yes, you have two cmd files that are passed sequentially to the linker)
    10) you might get errors if the two cmd files are allocating overlapping memory areas (conflict) or a warning if you forgot to add back some of the compiler sections.

    Now you can use the compiler #pragma DATA_SECTION(my_array, "MY_SECTION") to place your buffers wherever you like

    I hope this wil be helpful for somebody else