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.

Reserved Flash with dedicated address

Hi,

I work with  CCS5.4 and Piccolo 28069.

I create a variable e.g. constant array with initialisation: const int calib[ ] = {0x1234, 0x5678,0x9abc...};

Now I want as location a dedicated flash section with defined address, how can I do this.

I have experimented with Link cmd- file without  successfulness.

Best Regards

Gerfried

  • Hi Gerfried,

    Let me get this right... you want to store an array/ elements in a defined flash address? right?

    Regards,

    Gautam

  • Hi Gautam,

    Thanks for your quick answer.

    It's right, I will store Constants e.g. in the last Flashsector with fixed address independend from Code

    (section .text; .ebss....)

    in GCC (AVR) I have do

    e.g.

    float  f_coeff1[ ]  __attribute__  ((section(".const1"))) = {1911.381,454.757,0.5249,0.000};

    and then in memory settings:

    .const1 = 0xFF00

    Any Idea?

    Regards

    Gerfried

  • ruediger.gerfried said:
    Gerfried

    The best way to achieve this is to emulate EEPROM in Flash sector. As you won't be able to store & retrieve values from flash individually. Check this out and download the required files: http://www.ti.com/lit/an/sprab69/sprab69.pdf

    Regards,

    Gautam

  • Hi Gautam,

    its simpler possible  too, I will write and erase the entire sector with special Software tool without influence the

    Application code.

    I need no EEPROM Emulation (word by word).

    Regards

    Gerfried

  • Gerfied,

    You can assign variable (or) const to data section using the below option:-


    #pragma DATA_SECTION(Example_variable, "Example_sectionName");
    Uint32 Example_variable;


    And then make sure to assign memory location to Example_sectionName in your linker command file as shown below:-

    PAGE1:

    EXAMPLE_MEMLOCATION   : origin = 0x000400, length = 0x2    //include this in memory section

    Example_sectionName : > EXAMPLE_MEMLOCATION    PAGE = 1 //include this in SECTIONS

    Regards,

    Manoj

  • Thank you Manoj,

    here ist a new question:

    In CCS5.4 debug perspective any Memory display is mismatched:

    e.g. I have create a array

    const Uint16 table[]={0x1234,0x5678,0xABCD,0xEF01,0x2345,0x6789,0xABCD,0xACAC};

    #pragma DATA_SECTION(table,"ba_const");

    in Linker cmd:

    PAGE 1 :
    {
      .....................

     ........................

       RAML8       : origin = 0x012000, length = 0x002000     /* on-chip RAM block L8 */
       FLASHB      : origin = 0x3F0000, length = 0x004000     /* on-chip FLASH Sector B */
    }

    SECTIONS
    {
       ................
       ba_const            : LOAD = FLASHB,
                       //      RUN = RAML8,  // wird hier nicht benötigt,
                                  // weil Daten direkt nach ram_data1
                             LOAD_START(_ba_const_Load_Start),   // globale Variablen
                             LOAD_SIZE(_ba_const_Load_Size),
                       //      RUN_START(_ba_const_Run_Start),   // s. o.
                             PAGE =1  
    }

    Display in Memory window:

    0x3F0000: 0xABCD 

    data 0x1234 and 0x5678 are displayed in the previous addresses, is this a bug in CCS5??

    Regards

    Gerfried

  • Just try   

    SECTIONS:

    {

    .......

    ba_const            : LOAD = FLASHB, PAGE = 1.

    ......

    }
    Please send your memory window snapshot.

    -Manoj

  • Hi Manoj,

    here is a snapshot fro my DebugPerspective.

    I move the data 0x1234.....0xACAC to ram_data1 -> display in Expression ok .

    Then I copy the same data to the fixed RAM address 0x12000 (L8 DPSARAM)

    in memory window I see 0xABCD on 0x12000 ???? the first data 0x1234 is at address 0x11FFFE ????

    When I now copy the data from address 0x12000 to a array var the display in Expression is ok.

    Regards

    Gerfried