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.

TMS320F28377S: Flash programming using the flash_programming_cpu01.c example using F021 API

Part Number: TMS320F28377S
Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE

I need to save some calibration datas permanently into the flash, I'm currently working with the Launchpad LAUNCHXL-F28377S. I loaded the example  flash_programming_cpu01.c found in the control siute. If I understood correctly the example uses the F021API to program FF bytes in the flash  starting from addresses 0x84000 and from 0x82000.

Now, if I comment the  Example_Done() function (which stops the processor) and I pause the processor with a breakpoint just after the  Example_CallFlashAPI() (which sould program the flash) and I inspect the flash using the memory browser tool, I find ant the respective addresses all the data at a value 0xFFFF. For this reason I suppose the flash hasn't been programmed at all, so the example seems not be working.

I need help on this. Thank you very much

  • Hello,
    I am writing to let you know that a C2000 team member has been assigned to this post. We will try our best to address your query. But since one of our sites is affected by bad weather, there may be a delay in response.

    Regards
    Baskaran
  • Andrea,

    May be you are checking incorrect addresses in the memory window.  I remember it is Bank1's sector P that is erased/programmed by the example - which is 0xC2000 (and not 0x82000).  Please check.

    Did you change anything in the code or in the linker cmd file in the example?  Make sure you assign the pump semaphore to the FMC that is being used.  Also, note that Fapi_initializeAPI() and Fapi_setActiveFlashBank() functions have to called with appropriate parameters whenever you switch between FMC0 and FMC1.

    Check if you need more details about these functions: http://www.ti.com/litv/pdf/spnu630 

    Please expect delay in our responses.

    Thanks and regards,

    Vamsi

  • Dear Vamsi,
    I used the example found it in the control suite, I tested it without changing anything, for that reason I suppose it should work.
    As you can see in the comments in the function implementation void Example_CallFlashAPI(void), the example should start to program 0xFF words from Bzero_SectorB_start (0x84000) along the autogenerated ECC, and from Bzero_SectorB_start (0x82000) without ECC. Those addresses can be found in the header file flash_programming_c28.h
    Using hte memory browser to inspect those addresses return only 0xFFFF.
  • Andrea,

    Instead of ControlSuite, could you try Flash programming example from the latest C2000Ware - www.ti.com/.../c2000ware ?

    I am not sure if the example in the ControlSuite has any issue and I can not test it now (office closed due to hurricane).

    In your reply, you mentioned Bzero_SectorB_start as 0x84000 at first but later you mentioned that it is 0x82000. Please make sure you are referring the addresses correctly. In any case, I would suggest you to start using C2000Ware.

    Please try and let me know.

    Thanks and regards,
    Vamsi
  • I'm deeply sorry for that, hope you, your family and your friends are ok..
    thank for helping me anyway..

    About the flasgh memory sectors I did an error in writing you the addresses:
    from Bzero_SectorB_start (0x82000) ->without ECC
    from Bzero_SectorC_start (0x84000) ->with ECC

    I tried importing the same project from C2000ware, it fails at loading the file "F2837xS_GlobalVariableDefs.c"
    ->Error retrieving content description for resource '/flash_programming_cpu01/F2837xS_GlobalVariableDefs.c'.
    So, I found it inside the c2000ware folder , I made a new c file called F2837xS_GlobalVariableDefs.c inside the project, copied and pasted in it the code of the original one.
    triy cto compile:
    ./F2837xS_GlobalVariableDefs.c", line 595: error #237: variable "FlashPumpSemaphoreRegs" was declared with a never-completed type
    "../F2837xS_GlobalVariableDefs.c", line 772: error #237: variable "SyncSocRegs" was declared with a never-completed type

    I didn't changed anything in the code. this happen with the c2000ware as it is..
  • I don't know what was the problem, I reloaded the example from the c2000ware and now it doesn't show the "declared with a never-completed type" errors and it compiles correctly. Still not able to read the written data on the flash memory
  • Andrea,

    After programming the flash sectors, the example code erases those sectors.  May be you are checking the Flash contents after they get erased.  

    Thanks and regards,
    Vamsi

  • Andrea,

    Do you have any update on this?

    Thanks and regards,
    Vamsi
  • yes, you are definitely right, the example code first program the flash sectors and then erases  them. Than you very much for your support Vamsi!

  • Andrea,

    Thank you for the confirmation.

    Regards,
    Vamsi