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.

TMS320F28069: How to use TMS320F2806x Flash API to program the flash?

Part Number: TMS320F28069
Other Parts Discussed in Thread: C2000WARE

Dear Sir,

Please refer to the definition below for program flash function:

Uint16  Flash_Program(Uint16 *FlashAddr, Uint16 *BufAddr, Uint32 Length, FLASH_ST *FProgStatus)

The size of start address is 16-bit but the flash space of TMS320F28069 is 128k Word.

SECTOR A: 0x3F4000 ~ 0x3F7FFF

SECTOR B: 0x3F0000 ~ 0x3F3FFF

SECTOR C: 0x3EC000 ~ 0x3EFFFF

SECTOR D: 0x3E8000 ~ 0x3EBFFF

SECTOR E: 0x3E4000 ~ 0x3E7FFF

SECTOR F: 0x3E0000 ~ 0x3E3FFF

SECTOR G: 0x3DC000 ~ 0x3DFFFF

SECTOR H: 0x3D8000 ~ 0x3DBFFF

My question is how to program these sectors by a 16-bit of start address?

Best Regards,

Johnson

  • Hi Johnson,

    Did you have a look at this example code:
    C:\ti\c2000\C2000Ware_1_00_05_00\device_support\f2806x\examples\c28\flash_programming

    Regards,
    Gautam
  • Hi Gautam,

    Yes, I did.

    Please refer to the example code below.

    typedef struct {
    Uint16 *StartAddr;
    Uint16 *EndAddr;
    } SECTOR;

    SECTOR Sector[8]= {
    (Uint16 *) 0x3D8000,(Uint16 *) 0x3DBFFF,
    (Uint16 *) 0x3DC000,(Uint16 *) 0x3DFFFF,
    (Uint16 *) 0x3E0000,(Uint16 *) 0x3E3FFF,
    (Uint16 *) 0x3E4000,(Uint16 *) 0x3E7FFF,
    (Uint16 *) 0x3E8000,(Uint16 *) 0x3EBFFF,
    (Uint16 *) 0x3EC000,(Uint16 *) 0x3EFFFF,
    (Uint16 *) 0x3F0000,(Uint16 *) 0x3F3FFF,
    (Uint16 *) 0x3F4000,(Uint16 *) 0x3F7FFF,
    };

    Flash_ptr = Sector[1].StartAddr;
    Length = 0x100;
    Status = Flash_Program(Flash_ptr,Buffer,Length,&FlashStatus);

    I don't know how to address these flash spaces by a 16-bit Flash_ptr.
    Sector[1] and Sector[5] would be same when high-word is trimmed.
    Sector[1] = (Uint16 *) 0x3DC000, it would be 0xC0000
    Sector[5] = (Uint16 *) 0x3EC000, it would be 0xC0000

    Can program these sectors by the Flash_Program function properly?

    Best Regards,
    Johnson
  • Hi Johnson,

    You can program using Flash_Program properly.

    (Uint16 *) 0x3DC000 means accessing 16 bit word from 32-bit address.

    I feel you might have thought Sector[1] = (Uint16 *) 0x3DC000 as Sector[1] = (Uint16 ) 0x3DC000.

    Please check.

    Thanks,
    Katta
  • Johnson,

    Yes, Flash_Program function can be used to program the whole sector. The main limitation would come from buffer size which really depends upon the availability of RAM.

    Please check the below project in C2000Ware. This example walks you to how to use the Flash API functions.

    <C2000Ware>\libraries\flash_api\f2806x\Example_Flash2806x_API

    Regards,
    Manoj