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.

Can no longer fit all the bios memory sections in the "DARAM" segment



Hi,

I'm using a C5515 usb stick for my prototype development, and I can no longer fit all the bios memory sections in the "DARAM" segment (0x00c0 to 0xff00). How do rearrange the memory so it all fits?

I was trying to add usb support to my code trough the chip support libreary (csl_usb.c, csl_dma.c, csl_audioClass - don't know if I need the dma, but I like to change my code to use the chip support library instead for the dma).

I originally created a standard bios 5 project for my project and modified the memory a bit so I got the following memory segments from the Configuration tool (the reason for all these SARAM segments was that I originally wasn't sure how to allocate DMA buffers correctly, so I'm probably going to change that back).

/* MODULE MEM */

-stack 0x800

-sysstack 0x200


MEMORY {

    PAGE 0: VECT: origin = 0xff00, len = 0x100

    PAGE 0: DARAM: origin = 0xc0, len = 0xfe40

    PAGE 0: SARAM9: origin = 0x20000, len = 0x30000

    PAGE 0: SARAM0: origin = 0x10000, len = 0x4000

    PAGE 0: SARAM1: origin = 0x14000, len = 0x4000

    PAGE 0: SARAM2: origin = 0x18000, len = 0x4000

    PAGE 0: SARAM3: origin = 0x1c000, len = 0x4000

}

 

I have moved all the buffers for my own code to another sections with using the SECTION_DATA pragma and a cmd file: 

SECTIONS {

    Data_Section: {} > SARAM9 PAGE 0

}

 

Thanks,

Stefan Gram

 

  • Hi Stefan,

    Specify the section allocations in your custom command file (Not the one generated by BIOS) so that you will have more control on allocation of code sections in the memory segments. You can do something like this

    SECTIONS
    {
         .text            : > SARAM9
        .stack         : > SARAM9
        .sysstack   : > SARAM9
        .data           :  > SARAM0
        .bss            : > SARAM0
        .cinit            : > SARAM1
        .const         : > SARAM1
        .sysmem   : > SARAM2
        .cio              : > SARAM2
        .switch       : > SARAM3
    }

    This should leave enough space in DARAM which can be used the BIOS sections. In case you want to move some of your BIOS sections into SARAM, open your BIOS tcf file in CCS,  right click on 'System->MEM-Memory Section Manager' and select properties. In the properties window you can choose the memory segments for BIOS sections in the 'BIOS Data' and 'BIOS Code' windows.

    Pratap.

  • Hi Pratap,

    Thanks that really helped. I think I missing something with defining my own cmd file, because I had to do it in the tcf generated cmd file. I can't use "-l <tcf file>.cmd" either without getting double definitions. But I could also change all of them in the properties window i mentioned. Thanks.

    Stefan

     

  • Hi Stefan,

    Best way is to use the tcf file to define your memory segments and your custom command file to allocate code sections into the segments. Do not define any memory segments in your command file so that you can avoid double definition errors.

    Pratap.