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.

F28069 Flash_Erase : ROM and RAM versions give different result?

Other Parts Discussed in Thread: CONTROLSUITE

I have some code that successfully writes data into internal Flash sector-H  and then erases sector-G, using the ROM-resident API, through "2806x_BootROM_API_TABLE_Symbols_fpu32.lib". This works both on our own hardware and on a TI ControlCard.

In anticipation of switching on the CSM at some point, I understand that I need to change to use a RAM-resident API so have installed the "Flash2806x_API_fpu32_V100.lib" ControlSuite patch provided by David Atler, 21-Mar-2014 in thread http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/329360.aspx.

The library is loaded into 0-wait secure L4 SARAM. On both my hardware platforms, Flash_Program still works OK but Flash_Erase now returns '24' (STATUS_FAIL_PRECOMPACT).

I can Erase and reprogram through the X100 debugger so there does not seem to be a 'real' problem with the Flash being over-erased... multiple calls to FlashDeprecover() make no difference. Timings seem correct... Flash_ToggleTest gives an accurate 10KHz output. Both ROM and RAM Flash_APIVersionHex return '100'.

I have reverted to the ROM-resident API and erase now works with no errors.

Any ideas for what might be causing my RAM-resident Flash_Erase to fail? Thank you, Dave.

  • Dave,

    If you configure your code right, you ideally shouldn't be seeing this problem. But, I'm not quite sure what might be causing this behavior. This shouldn't be API problem because the same API is being used by CCS to program / erase your flash in plugin.

    So, can you please answer the following questions to better understand your code settings and configuration:-

    • Did you enable floating point support in your build properties? Please refer Pg11 of Flash2806x_API_Readme.pdf for details

    • Are you including rts2800_fpu32.lib for floating point support?

    • Are you trying to load Flash API into flash and then trying to memcpy the API functions to L4SARAM and then run out of L4SARAM?

    • Is your example project using only software API stored in RAM (or) is it using both RAM And ROMed API function?

    • I would request you to send me your .cmd which shows how you are linking the software library

    Regards,

    Manoj

  • Hi Manoj, thank you for following up this query

    • Did you enable floating point support in your build properties? Please refer Pg11 of Flash2806x_API_Readme.pdf for details

    Yes, options selected: '--float_support', '--large_memory_model', '--reread_libs', '--priority'.

    Search path is in the order:-

    "....controlSUITE\libs\utilities\flash_api\2806x\v100\lib"

    "....DeviceIncludes\ccsv5\tools\compiler\c2000_6.1.1\lib"

    "....DeviceIncludes\f2806x\v136\F2806x_common\lib"

    "....DeviceIncludes\ccsv5\tools\compiler\c2000_6.1.1\include"

    • Are you including rts2800_fpu32.lib for floating point support?

    Yes, '--float_support opion is set to "fpu32" and '--library' contains "rts2800_fpu32.lib"

    • Are you trying to load Flash API into flash and then trying to memcpy the API functions to L4SARAM and then run out of L4SARAM?

    Yes, library is loaded into FLASHF, then copied to L4SARAM... The '.map' shows the following symbols in RAM (sorry, the format has not pasted-in well). My code calls only "Flash_Program" and "Flash_Erase":-

    appfastfunc

    * 0 003e00e0 0000059d RUN ADDR = 0000a000

    003e00e0 000000e4 Flash2806x_API_fpu32_V100.lib : Flash28_Prog.obj (.text)

    003e01c4 000000c8 : Flash28_Erase.obj (.text)

    003e028c 0000009a : Flash28_Erase_Pulse.obj (.text)

    003e0326 00000084 : Flash28_Internals.obj (.text)

    003e03aa 00000080 : Flash28_Prog_Pulse.obj (.text)

    003e042a 0000007d : Flash28_Compact_Pulse.obj (.text)

    003e04a7 0000005c : Flash28_EraseSector.obj (.text)

    003e0503 00000054 : Flash28_CompactSector.obj (.text)

    003e0557 00000041 : Flash28_ClearLoop.obj (.text)

    003e0598 00000034 : Flash28_ClearSector.obj (.text)

    003e05cc 00000015 : Flash28_Init.obj (.text)

    003e05e1 00000014 : Flash28_Utils.obj (.text)

    003e05f5 0000000d : Flash28_Delay.obj (.text)

    003e0602 00000007 : Flash28_DisInt.obj (.text)

    • Is your example project using only software API stored in RAM (or) is it using both RAM And ROMed API function?

    Just the RAM-resident API.

    • I would request you to send me your .cmd which shows how you are linking the software library

    Here is the section of '.cmd' that brings in the library (again, apologies for paste format)...

    /* Application fast functions */

    appfastfunc :

    {

    -lFlash2806x_API_fpu32_V100.lib(.text)

    }

    LOAD = FLASHF,

    RUN = RAML4,

    LOAD_START(_AppFastFuncLoadStart),

    LOAD_SIZE(_AppFastFuncLoadSize),

    RUN_START(_AppFastFuncRunStart),

    PAGE = 0,

    crc_table( _cip_crc_section_appfastfunc, algorithm = CRC32_PRIME )

    Other information that may be relevant....

    Our processor is running at 90MHz.

    In the meantime, I have tried commenting out most of our main application startup so there is very little concurrent activity... as before, I see the "Flash_Program()" calls return 0 and the "Flash_Erase()" call returns 24.

    I switch to the ROM-resident API by removing the "-lFlash2806x_API_fpu32_V100.lib(.text)" line from the '.cmd' file and adding "2806x_BootROM_API_TABLE_Symbols_fpu32.lib" (from the "DeviceIncludes\f2806x\v136\F2806x_common\lib" path) to the C2000 Linker File Search Path "--library" set. If I do this, "Flash_Erase()" returns 0.

    Thank you, Dave.

     

  • Dave,

    I was able to successfully use Flash2806x_API_fpu32_V100.lib file in RAM to perform flash_program and flash_erase operation without any issues. So, I'm pretty sure there is no problem from flash API library standpoint.

    Can you please try our code on other spare F28069 devices at your disposal?

    Regards,

    Manoj

     

  • 1680.Example_2806xFlashProgramming.zip

    8640.Flash2806x_API_fpu32_V100.lib

    Hi Manoj,

    I have reproduced this problem using the TI "flash_programming" example project, modified to use the RAM library. The built project is attached as a '.zip' and includes a '.out' file.

    On both my hardware platforms, this breaks with Example_Error(24) following the first call to Flash_Erase(). Could you please try this image on your hardware and let me know what you see?

    I have also attached the '.lib' that was installed from David Atler's forum post. Can you please confirm whether this matches the one you have used successfully?

    Many thanks, Dave.