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.

Flash Api 3.02 problem (2) with Flash_Erase()

Other Parts Discussed in Thread: TMS320F2808

Hi,

I'm using CCSv4.2 and TMS320F2808.  I installed the flash API 3.02.

When I push the debug button of CCS4.2, I'm able to run my code on the eval board eZdsp TMS320F2808.  I'm able to use the function Flash_Erase() without any problem.

When I try to boot from flash by just reseting the board - the program freezes when it arrives to the function Flash_Erase().

Anybody idea why it does that?

What is the difference between booting with the debugger and booting with a reset? 

 

Thanks

 

  • Maxime,

    Here are the following things I would try:

    1) Check your boot mode selections. Confirm whether the DSP boots to flash.

    2) After you connect to the device. Set a breakpoint at 0x3F7FF6, run and check whether it hits the breakpoint (this confirms it correctly boots to flash)

    3) Did you make sure that the example flash api found on the web is working. (http://focus.ti.com/docs/toolsw/folders/print/sprc193.html)

    Regards,

    Manoj

  • Check that ALL flash functions are linked to run from RAM (and NEVER from Flash!!!).

    If you have a call back funciton, that MUST be also ran from RAM.

    If you don't know how to check, look closely at your .map file or just post it here.


    Also, make sure you've copied that code from Flash to RAM before running them.  See TI code examples:

        // Copy the Flash API functions to SARAM
        Example_MemCopy(&Flash28_API_LoadStart, &Flash28_API_LoadEnd, &Flash28_API_RunStart);

        // We must also copy required user interface functions to RAM.
        Example_MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);


    Note that in 2808, RAM is addressed from 0x8000 to 0xC000 (or 0x3F8000 to 0x3FC000).  I would be suspicious of any flash API code set to run outside of that range.

     

  • F28069 should have flash api embedded in BOOT ROM.

    -Manoj

  • Oops, I am sorry, I forgot you were using F2808 and not F28069. As Quark suggested, all the flash related functions should be executed from RAM.

    -Manoj

  • One more thing... during your experiments, make sure you don't erase sector A!

    This is very important while you are still trying to get your code working properly.  If a problem occurs during erase of sector A, it may cause the chip to be unusable due to a permanent lock.

  • Thanks for your answers !

    I found the problem, Quark was right.  En interrupt - which is in flash - was called during the eraseFlashB() fonction.  I disabled the interrupt before to call this fonction and now it works.

    I have one more question for Manoj:  My program does not stop at address 0x3F7FF6, is it normal?  I put a breakpoint at 0x3F7FF6 and I pushed the green button "debug Launch" - I first stop at he first line in the main (addr 0x3F6584) when I push "Run", it never stop at the breakpoint.  

    Thanks, Maxime

     

  • Maxime,

    You should be able to see PC hit the breakpoint at 0x3F7FF6. Please follow the procedure the check that.

    • Connect to the DSP
    • Program the flash with the required COEFF file (.out)
    • Disconnect the device.
    • Reconnect to the DSP
    • Unlock the device.
    • Set a hardware breakpoint at 0x3F7FF6
    • Make sure you are booting to flash
    • Hit Run. It should hit the breakpoinnt @ 0x3F7FF6

    I am sure it will hit. You should be fine.

    Regards,

    Manoj

  • Hi Manoj,

    Are you sure this is the procedure for CCS4.2 ?

    It's really not clear with the options I have...

    Thx

  • Maxime,

     

    The procedure is common for both CCS3.3v and CCS4.0v. Please let me know which step you got stuck.

     

    Regards,

    Manoj