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.

TMS320F280023: Storing parameters values in different sector of same flash bank while running the main code

Part Number: TMS320F280023
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hello Guys,

I am using 23 part number and i want to store some parameters values in flash memory of another sector while running the main application code. I am using flash API CODE to do so. If it is possible to do, please do suggest me how to integrate both codes and what precautions i ve to take care of .

Thanks and regards,

Devendra Kumar

  • Hi Devendra,

    Flash API can't be executed from the same flash bank (even from a different sector of the same bank) on which the erase/program operations are targeted for.

    You have to copy the Flash API to RAM as showed in the C2000Ware's flash API usage example.

    Thanks and regards,
    Vamsi

  • Hello Vamsi,

    Thank you for your response.

    I have made a separate project say NEW FLASH API PROJECT which can easily erase first and then write a new value in sector 6 of bank0 and also i ve selected all sectors except sector 6 in erase settings of  flash settings under debug section of project properties  .

    My main code resides in sector 1, 2 &3. I ve added the NEW FLASH API PROJECT into my main code with all the configurations , include options  and libraries too.

    I am calling the FLASH API function in while() after copying it to RAM .

    What other things i need to take care of in this scenarios like timers or any other interrupts or anything else .

    Thanks and regards,

    Devendra 

     

  • Hi Devendra,

    Thank you for the update.

    I will be able to review and get back to you early next week.

    Thanks and regards,
    Vamsi

  • Hello Vamsi ,

    I request you to please consider my querry. Please go through the above posts .

    1) I would like to add that I have integrated the new project code into my main application code and i have observed tht it is affecting my PI control loop code i.e. running under timer0 .What actions should be taken to resolve this issue ?

    2) while programming flash sectors , each sector has 20k W/E cycles. And , i am using @0x86000 and 0x86001 address of sector 6 to update two parameters. Is it possible to erase only specific address or a set of address instead of erasing a whole sector ?

    what are the efficient methods to store only few parameters (which will be updated 10-20 times daily) in a specific sector only. 

    Thanks and regards,

    Devendra

  • Hi Devendra,

    1) Is your PI Control loop executing from the flash bank on which you targeted the erase/program operations?  If yes, then I suggest you to move the control loop code to RAM (timer0 ISR I guess).

    2) You need to erase the entire sector.  You can't erase a specific address.  

    Regarding the methods on storing the parameters to specific sector:  Please refer to below EEPROM guide:

    Application note on EEPROM emulation driver for C2000 Gen3 devices: https://www.ti.com/lit/pdf/sprade8 

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    So good to hear from you .

    Yes , I am using the only bank present in 23 part number (flash bank 0) , whereas my main code resides in same bank but different sector unlike erase/write ops in another sector .

    So. are you suggesting me to copy the control loop code I.e. timer0 ISR to RAM first and then execute? 

    And, i will go through the eeprom emulation .Highly appreciating .

    Thanks and regards,

    Devendra 

  • Hi Devendra,

    Glad to help.

    Regarding the control loop:  Yes, if you need the control loop to not wait while the flash is going through erase/program operations, you better copy it to RAM and execute from there.

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    I have executed the ISR from RAM and it is working fine till now . I wanted to thank you for helping me to achieve fantastic results .

    Now, moving ahead for storing few parameters in sector 6 . These parameters (SAY total energy , total hours, total cycles ) will be changed daily 20 times a day . I have gone through the EEPROM emulation application note . Minimum we can erase is a sector only in both using FLASH API  as well as EEPROM emulation application notes.  My main concern is about not to exceed 20k E/W cycles for each sector.

     In my case,

    1) Whether i am using flash API or EEPROM emulation , what differences will be for erase cycles and write cycles separately in both application APIs ?

    2) writing only a 16 bit data word using Flash API or EEPROM emulation, which API will use more write cycle out of 20k E/W Cycles? Does writting to a whole sector in one shot utilises same write cycle instead of writting one word in a sector ? 

    Please help ,me to understand these basic doubts .

    Thanks and regards,

    Devendra 

  • Hi Devendra,

    Glad it helped.  

    I see you have further EEPROM questions.  I can take a look at them early next week - is that ok?

    Thanks and regards,

    Vamsi

  • Devendra,

    In simple words: EEPROM driver updates the next available address when a new data is given (and it provides the latest data when requested).  It will not erase the sector unless the sector is full.  If the chosen EEPROM sectors are full, then the EEPROM driver will erase the sector to continue writing the new data.  Hence, using EEPROM driver will save the W/E cycles.

    Please read the EEPROM guide.

    Thanks and regards,

    Vamsi