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.

Understanding Flash Memory of TMS320F2806x Microcontrollers



I want to understand the flash memory (256 KB) organization of TMS320F2806x . 

I want to store the program in a specific location (or sector) of flash memory which can be earsed when it is reprogrammed and

I want to store data  in a separate location of flash once when the program has started, which should not be erased when the program is being changed.

The data stored in the separate location should be available to me so that I can read the previously stored data. 

I'm using the flash memory to store the program and using an external EEPROM to store data. I want a way so that I can save the data when the program has started in the flash memory of microcontroller, in a different location, which should not get erased when reprogramming the microcontroller.

Please suggest me as soon as possible.

  • Please suggest me a mail id or a contant number who can help me on this topic

  • Ravi
    When doing a reprogram there will be an erase step. Erase is a per sector operation - that is a sector is the smallest amount of memory that can be erased. Therefore if your data is in one sector (call it sector X) and your program in another (call it sector Y) you can reprogram Y without erasing X. Anything in Y would get erased.

    Doing something like what is suggested in this application note on emulated EEPROM may help. The application note was written for F2812, but the concepts would apply to the 2806x.

    www.ti.com/.../litabsmultiplefilelist.tsp

    Regards
    Lori
  • Madam,

    I'm trying by using the flash API code, whereby I was able to sent values using the following code:
    -------------------------------------------------------------------------------

    Flash_Erase((SECTORH),&FlashStatus);

    // --------------1
    Flash_ptr = (Uint16 *) 0x3E8000; // location 0x3E8000 is in flash H and data memory in .cmd

    i = 0x7171; // value1
    Length = 1;
    Flash_Program(Flash_ptr,&i,Length,&FlashStatus);

    read_value = *Flash_ptr;

    // --------------2
    Flash_ptr = (Uint16 *) 0x3E8001;

    i = 0x7272; //value2
    Length = 1;
    Flash_Program(Flash_ptr,&i,Length,&FlashStatus);

    read_value1 = *Flash_ptr;

    -------------------------------------------------------------------------------
    Is the above method correct ?

    By using the above code I'm only able to store the values once. But if I want to update it in real-time from outside, when my program is running along with ADC, SCI interrupts, then I'm unable to update the values in the location 0x3E8000 and 0x3E8001. (I have read that for using Flash API the interrupts should be disabled and 1 can be programmed to 0)

    By using EEPROM Emulation will I be able to do the above ?

    Please suggest me as soon as possible.
  • The EEPROM emulation demonstrates a method that will store values through the sector until it is full. Then it goes through an erase. Two sectors are used.

    Yes you can only program a 0 to a 1. Going from a 1 to a 0 requires an erase which will impact the whole sector.

    Interrupts can be enabled during flash programming. However all of the interrupts must execute from RAM and the API will block interrupts for time critical code that runs in the API.

    Regards
    Lori