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: POWER DOWN while programming controller using ROM boot loader

Part Number: TM4C1294NCPDT

Respected sir/madam,

                         I am programming the tm4c1294ncpdt using ROM_updateUART() function and TI-RTOS platform. So my question is what will happen if power goes OFF in the middle of programming?? How can i restart programming without using JTAG debugger??

Regards,

Digvijay

  • That is a good question. The ROM bootloader will be automatically invoked if the first 8 bytes of flash are 0xFF. However, the ROM bootloader erases the flash on receiving the "COMMAND_DOWNLOAD" and then will program flash from the starting address incrementing through the flash. That means if power is lost before all of the flash is completely programmed, on the subsequent power-on, the ROM bootloader will not be invoked (the first 8 bytes are not 0xFF) but the application may not run correctly. You would have to use JTAG to recover the part.

    One thing to try (although I have not tried it) is to create your application image with the first 8 bytes 0xFF. In the application, at a predetermined address, have a small routine that calls ROM_FlashProgram() to copy the intended SP and reset vector into the first 8 bytes. After successfully loading the new image, send the "COMMAND_RUN" to execute the routine to program the first 8 bytes. If power is lost while programming the first image, the ROM bootloader is automatically invoked because the first 8 bytes are still 0xFF. The method is not foolproof. If power is lost during the initial bulk erase, some bits may be erased and some not. That would also leave the device in a state where a JTAG erase (or UNLOCK) would be required. Also, there is a very small window when power lost during programming the first 8 bytes could cause them to be corrupt, but that is a very small window. My explanation used serial bootloader commands as an example.
  • Would it not appear - due to poster's 'fear and/or dislike of the (saving) JTAG' - that (ONLY) - a 'FAIL-SAFE' Power Supply should be used?
    Battery-backed - 'Uninterruptible Power Supplies' - register as 'ideal' for such tasks. (even when - the invaluable JTAG header - IS present!)

    Most always -  effective 'Prevention' - soundly trumps any/all 'Cures!'    (especially so when the 'cure'  - may not always be - completely effective...)

  • Hi

    cb1_mobile said:
    due to poster's 'fear and/or dislike of the (saving) JTAG' - that (ONLY) - a 'FAIL-SAFE' Power Supply should be used?
    Battery-backed - 'Uninterruptible Power Supplies' - register as 'ideal' for such tasks.

                              There is no fear or dislike for JTAG. Its just that our service guys on the  field don't have JTAG with them. So they have to depend on serial port only. We can not provide JTAG debugger to each and every person.

                     Also our company have uninterrupted power supply , and again problem arises at customers site because they may not have such provisions.

                       Anyway i will try to implement the method suggested by Mr bob. Hope it works.

    Regards,

    Digvijay

  • digvijay khambe said:
    problem arises at customers site because they may not have such provisions.

    While you note that  'client-weakness'  as a 'problem'  -  does it not offer an  'opportunity'  -  as well?

    It comes as (some) surprise - that 'service guys' - seemingly alone - must perform such upgrades.    (this suggests that 'more' is going on - 'behind the scenes.')    With adequately detailed instructions - might the 'properly guided' client himself  - be able to perform such task?    (eliminating the need & cost - of dispatching a 'service guy?')

    Surely your firm is not going to provide such program upgrades/fixes - on a regular basis - is that not so?       Thus - by notifying the client of such need (Uninterruptible Power Supply) - you may be able to 'Rent' such a Supply to those (small) firms - which cannot provide their own.     (that rental fee may just provide 'sufficient motivation' - such that those clients purchase such a, 'Fail Safe' Supply - which may provide (another) Sales Opportunity for you.)

    You note the cost of the JTAG probe - yet has the on-going attempt here (which has spanned many months now) not (also) generated costs?      (And has yet to be fully/positively implemented - and proven?)

    Basic Serial interfaces - which you (seem) to favor - existed prior to the 'Joint Test Action Group' (JTAG is their acronym) meeting & developing the JTAG Standard - which provides: superior, broader, & far more robust Programming & Debug means (along w/multiple 'other' * capabilities) than 'basic serial interfaces.'      JTAG has won major support from ALL of the key firms in industry - and should warrant full & proper consideration.    

    I offer this guidance - as JTAG proves (most) likely to, 'save you from continuing tech challenge'  - and (as of yet unknown) potential for grave & on-going difficulty - downstream...

    * JTAG enables you to probe, test, program & adjust 'multiple' other components (beyond 'just' the MCU) & features of  your board!      As your product & knowledge grows - these extra capabilities will do much to enhance your product,  service and Sales!