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 shared RAM be assigned to .ebss section?

Hi, gurus

I am using C28M36 to develop a motion controller and this is my first embedded programming.

I encountered an link error:

"../F28M36x_GIAT_C28_FLASH.cmd", line 154: error #10099-D: program will not fit into available memory.  run placement with alignment/blocking fails for section ".ebss" size 0x22e1 page 1.  Available memory ranges:
   RAML2        size: 0x1000       unused: 0xee0        max hole: 0xee0    

It might seem the section size is not enough...  I tried to assign shared rams to ebss:

   .ebss : > RAMS4|RAMS5  PAGE = 1

Still not working...

"../F28M36x_GIAT_C28_FLASH.cmd", line 154: error #10099-D: program will not fit into available memory.  run placement with alignment/blocking fails for section ".ebss" size 0x22e1 page 1.  Available memory ranges:
   RAMS4        size: 0x1000       unused: 0x1000       max hole: 0x1000   
   RAMS5        size: 0x1000       unused: 0x1000       max hole: 0x1000   
   RAMS6        size: 0x1000       unused: 0x1000       max hole: 0x1000   

I modified section definitions... replacing

   RAMS4       : origin = 0x010000, length = 0x001000
   RAMS5       : origin = 0x011000, length = 0x001000
   RAMS6       : origin = 0x012000, length = 0x001000
   RAMS7       : origin = 0x013000, length = 0x001000

with

   RAMS4       : origin = 0x010000, length = 0x004000

and assigning RAMS4 to ebss:

   .ebss : > RAMS4  PAGE = 1

Linking is successful but... a local data is not properly assigned...

M3 part:

    RAMMReqSharedMemAccess((S0_ACCESS | S1_ACCESS), 1); // 0: M3, 1: C28

C28 Part:

#pragma DATA_SECTION("SHARERAMS0")
SvControl svctrl_; // my structure

SvControl* svctrl = &svctrl_;

At debug, the value of svctrl is 0 not 0xC000.

Maybe, the problem is caused by another bugs... I want to know my approcah is correct or not. If near the taret, what I missed?

Thanks in advance.

  • Hi,

    Please use following code to place variable in specifc location.

    #pragma DATA_SECTION(svctrl_, "SHARERAMS0");

    Also when you want to combine multiple memories for section, use following in linker cmd file.

    .ebss : >> RAMS4|RAMS5,  PAGE = 1

    I hope this helps.

    Regards,

    Vivek Singh