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.

TMS320F28379D: I need to create the Structure Array of 8192 size in Flash Section which should have read/write options

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE,

Hi ,

            struct foo {

               uint_16bit dataID;

               uint_8bit MemSpace;

};

struct foo arr[8192] ;

So I want to create this array in flash section , where this array elements in flash section , I need help on this, or any example/video/document which explains on creating the specific memory space for this structure array. 

Thanks,

Sid C

  • Hi Sid,

    Do you want to keep this structure in Flash and have write access to it? For Flash writes, you would need to use Flash API library. CPU cannot directly write to a Flash memory address.

    Regards,

    Veena

  • Hi Veena, 

                Do you want to keep this structure in Flash and have write access to it? Yes , but I have never did, I need some flowchart or any example code, please share if u have any and also with respect to datasheets or technical reference manual , share it.

    Thanks,

    Sid C

  • Hi,

    Let me forward this to the Flash expert to help you further.

    Regards,

    Veena

  • Hi Sid,

    If you want to update the data in the structure mapped to flash, as Veena said, you need to program those values at run time using the flash API.

    Please check this flash API usage guide: https://www.ti.com/lit/pdf/spnu629 

    There is an example in the C2000Ware at: C2000Ware_x_xx_xx_xx\device_support\f2837xd\examples\dual\flash_programming

    Please note updating a given location in flash needs an erase of the entire sector.  It means you have to erase the entire sector every time you want to update a value (programming an already programmed location) in that sector. 

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

                  My requirement : 

    struct array of size 8192 , elements shall be initialized all values 0 at initial level, as when the software becomes runtime, then user shall give values which should be added in struct array located in flash section, and this has to be non-volatile. If this is not possible, then please tell does TMS320F28379D have internal EEPROM which can store data as a non-volatile.

    Thanks,

    Sid C

  • Hi Sid C,

    How often do you need to update the flash to update this variable array?

    And whenever the application needs to update it, does it need to update all the 8192 elements?

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

                      The array is a lookup table, whose elements shall be added in runtime once device is powered up, eg : 

    Struct array is empty at initial stage:

    1. Once device is power Up : user added 5 elments and then microcontroller went to power off.

    2. Power off to Power On : user added , additonal 10 elements in array, now array consists overall 15 elements, again microcontroller went to poweroff.

    3. Power off to Power On : user added , additonal 3 elements in array, now array consists overall 18 elements, again microcontroller went to poweroff.

    Like this above iteration, the elements shall be added in array.

    Thanks,

    Sid C

  • Hi Sid,

    If I understand correctly, it is an additional increment and you won't touch the previously added elements - correct?

    You can program using the flash API:  Please take a look at the different programming modes explained in the guide that I shared with you.  

    Also, below FAQs will help:

    1. [FAQ] FAQ on Flash API usage for C2000 devices: 

         https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/951668 

    2. [FAQ] FAQ for Flash ECC usage in C2000 devices - Includes ECC test mode, Linker ECC options: 

         https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/951658 

    Thanks and regards,
    Vamsi

  • Hi Sid,

    Please note:  I am out of office until February 23rd.  Please reply on February 23rd if you have further questions.  

    Thanks and regards,

    Vamsi

  • Hi Sid,

    I am closing this post since I did not hear back from you.

    Please open a new post if you have further questions.

    Thanks and regards,
    Vamsi