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.

How to wright some data to flash and then excute code in ram



Hello!

My microcontroller is 2808

I want to

a.Only write a const data block(Table) in flash

b.And then,excute the program in ram exept Table

Below are the proccess step by step.Are they right?Ple give me some suggestion.

1. To define my constant table

#pragma DATA_SECTION(Table,"myconstants");

const unsigned int Table[] = {...,....,...};

2.Re_write F2808_EzDSP_RAM_lnk.cmd by add follow:

MEMORY

{

PAGE 0:

FLASH_CD    : origin = 0x3E8000, length = 0x008000

}

SECTIONS

{

. myconstants    : > FLASH_CD,        PAGE = 0

}

3. Re_Build the project

4. Open the On-Chip Flash Programmer, Select the sectorsC and section D, Select Execute Operation as the Erase, Program,only write the Table to flash

5. Re_write F2808_EzDSP_RAM_lnk.cmd:

SECTIONS

{

. . myconstants  : > FLASH_CD, PAGE = 0, TYPE = NOLOAD

}

6. Rebuild All.,Load program,Restart,Go main Run.

Than you

  • xufeihx said:

    Hello!

    My microcontroller is 2808

    I want to

    a.Only write a const data block(Table) in flash

    b.And then,excute the program in ram exept Table

    Below are the proccess step by step.Are they right?Ple give me some suggestion.

    1. To define my constant table

    #pragma DATA_SECTION(Table,"myconstants");

    const unsigned int Table[] = {...,....,...};

    2.Re_write F2808_EzDSP_RAM_lnk.cmd by add follow:

    MEMORY
    {
    PAGE 0:
    FLASH_CD    : origin = 0x3E8000, length = 0x008000
    }
    SECTIONS
    {
    . myconstants    : > FLASH_CD,        PAGE = 0
    }

    3. Re_Build the project

    4. Open the On-Chip Flash Programmer, Select the sectorsC and section D, Select Execute Operation as the Erase, Program,only write the Table to flash

    5. Re_write F2808_EzDSP_RAM_lnk.cmd:

    SECTIONS
    {
    . . myconstants  : > FLASH_CD, PAGE = 0, TYPE = NOLOAD
    }

    6. Rebuild All.,Load program,Restart,Go main Run.

    Than you

    The application notes on this wiki page explain how to do this.

    http://processors.wiki.ti.com/index.php/Category:Flash_for_C2000#Other_Flash_Related_Resources

    In particular

    Running an Application from Flash (spra958)

    and

    Copying Compiler Sections from Flash to RAM on the TMS320F28xxx DSCs (spraau8)

    There is also a flash example in the C/C++ Header files and peripheral examples (look in the examples directory for one called flash).

    Regards

    Lori