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.

TM4C1294NCPDT Flash erase in DFU mode

Other Parts Discussed in Thread: TM4C1294NCPDT, LMFLASHPROGRAMMER, UNIFLASH

Hi all,

I am quite new to tiva series.My queries are below,

I have TM4C1294NCPDT launchpad kit .i am trying to erase full flash chip using USB DFU mode.but i am unable to erase complete Flash.

I have tried with LM flash programmer & using DFUprog.exe as well but still full flash erase it not possible.

As per document , if starting Address of flash is 0x0000 passed then it will erase entire writable region of flash ? What is the range of writable region ?

Also I know that if i have to erase flash then i need to erase it block by block.

but could  anyone  suggest how to erase flash with starting address 0x0000 ?

Thanks

Viraj

 

  • Hello Viraj,

    The writable region of Flash is from 0x0 to 0xFFFFC. The Boot loader does it sector by sector while LMFlashProgrammer based on the settings done in GUI(either required sector or entire flash). What exactly is the issue being faced. Is there a specific location that does not get erased, etc?

    Also is the FMPRE and FMPPE registers been modified which may affect the Erase of the sector?

    Regards
    Amit
  • Hi Amit,

    Thanks for quick reply.

    Yes through LM flash programmer if i try to erase the entire FLASH using GUI "Entire Writable Region" then it gives this error "Error -7:DFU_ERR_INVALID_ADDR" .
    Also in GUI if i used "By Address Range" then from start address 0x0000 to 0x3FFF i am unable erase. Same error is being observed.
    The same error i observed when i use "dfuprog.exe -c -a 0x0000 -l 0x4000" through command line.

    Is there any write protection on first block (0x0000 to 0x3FFF)?

    I just want to erase entire flash in DFU mode by any way(LM Flash / Command line).

    Also is the FMPRE and FMPPE registers been modified which may affect the Erase of the sector?
    I did not get this .but i have not modified any registers for FLASH.where can i find this ?

    -
    Thanks
    Viraj
  • Hello Viraj

    Erase of the flash in DFU is handled by the boot loader. If you have to erase the flash then it must be done via JTAG

    Regards
    Amit
  • Hi Amit,

    Thank you .
    But can you please tell me why i am unable to Erase starting memory block (0x0000 to 0x3FFF)?
    I can erase flash block by block in DFU mode but i want to erase it completely.As in our project we don't use JTAG.we have on USB DFU.


    Thanks
    Viraj
  • Hello Viraj

    Is there a Flash Based DFU boot loader. If yes, then it is located at Sector-0 which is 0x0000 to 0x3FFF.

    Regards
    Amit
  • Hello ,

    No As per my knowledge if flash is blank then it must be execute from ROM Bootloader.
    So First i erase flash using ICDI USB then i tried to ERASE it in DFU mode.
    Still How can i confirm about ROM or FLASH bootloader in FW ?

    Thanks,
    Viraj
  • Hello Viraj

    If the flash is empty then you are correct it is the ROM DFU that is operation. And since the flash is empty then you do not need to erase if via DFU. If the flash location 0x0 and 0x4 are 0xFFFFFFFF then it is the ROM boot loader.

    Regards
    Amit
  • Hi Amit,

    Yes My flash location 0x0 and 0x4 are 0xFFFFFFFF so it is ROM bootloader.
    But if i programmed device (using any USB ICDI/DFU)and then i put my device into DFU mode using "dfuprog.exe -m" .After that i tried to erase it ,how can i erase first page (0x0000 to 0x4000) ?
    Actually in my project i will not use ICDI USB port.so i want to make sure that i can erase entire flash in DFU mode.(I think you got my point why i am asking this of ERASE ?)

    Did you try it to erase first page in DFU mode of TM4C1294NCPDT ?

    Thanks
    Viraj
  • Hello Viraj,

    For the device to enter DFU Mode there are 2 methods

    1. Updating BOOTCFG to be able to detect a GPIO Condition along with reset to force-ably enter ROM Boot Loader
    2. Application detecting the Magic Packet from dfuprog.exe to enter the DFU mode for ROM Boot Loader

    Which one of the methods are you using?

    Regards
    Amit
  • Hi Amit,

    Application detecting the Magic Packet from dfuprog.exe to enter the DFU mode for ROM Boot Loader
    This method i am using.

    Thanks
    Viraj
  • Hello Viraj,

    Have you referred to the following example code which does the same procedure? Of course note that this uses DK-TM4C129 with grpahics to push the update but the procedure from USB remains the same.

    D:\ti\TivaWare_C_Series-2.1.0.12573\examples\boards\dk-tm4c129x\boot_demo_usb

    Note that dfuprog.exe from the CCS will not work with this application but dfuprog.exe from TivaWare must be used.

    Regards
    Amit
  • Hi Amit,

    Sorry for delay reply.
    Thanks for suggestion.
    I have looked in this examples i think it is good example to start.

    Can you please confirm me in DFU mode if we directly program the board using either LMFlash/dfuprog.exe then internally it will erase the flash completely?

    Thanks
    Viraj
  • Hello Viraj,

    Yes that the DFU will handle. But do make sure that before doing a DFU update, the USB boot loader does get called correctly, eithe by BOOTCFg or by API call from Application.

    Regards
    Amit
  • Hi Amit,

    Thanks.
    Yes i will make sure that the device first get correctly into DFU mode.
    Once device get into DFU mode then we can use either LMFLash or dfuprog.exe for programming the device.
    Again thank you for your support.

    Thanks,
    Viraj
  • Hello Viraj

    Yes. Either of the two can be used. Also there is UNIFLASH from TI that would do the same

    Regards
    Amit
  • Hello Amit,

    Thanks for support.
    I have another issue (Not USB) on SSI.I have created new thread for same.Below is link.
    e2e.ti.com/.../426528
    Kindly let me know for your concern

    Thanks
    Viraj