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.

RTOS/TM4C129CNCZAD: After waking up from hibernation and performing soft reset, the code does not start from Bootloader.

Part Number: TM4C129CNCZAD
Other Parts Discussed in Thread: TM4C129XNCZAD, SYSBIOS

Tool/software: TI-RTOS

Hi all,

I hope you are doing fine.

I am working with TM4C129XNCZAD hibernation mode and am having issues with soft reset after waking up from hibernation. I have listed the details below. Please have a look at these.

In our project, we are using a Bootloader based on TI RTOS and it is assigned ROM adresses from 0x00000000  to 0x027FFF. The main application code, also based on TI RTOS, is present on ROM address from 0x00029000 to 0x000FAFFF. In main application code, the shutdown code puts MCU in hibernation mode and tamper events 0(PM7) and 1(PM6) are configured to wake the MCU from hibernation. After waking up from hibernation, in tamper event handler i am  clearing the tamer events and after disabling the tamper module, i do a soft reset. I having problems waking up from hibernation and these are detailed below.

(i) When using bootloader, after waking up from hibernation the control does not return to bootloader. If , in shutdown function, instead of putting MCU to hibernation, i do a soft reset then the code starts execution from bootloader.

(ii )If i don't use the bootloader and configure my main application to start from 0x00000000, it works fine after waking up from hibernation.

If anyone has experience with using hibernation, please let me know what am i missing here that is causing issues with hibernation.


Muhammad Shuaib

  • Hello Muhammad,

    I am not an expert on hibernation, but given my takeaways are accurate in that:

    1. Bootloader has been tested without hibernation and works as expected
    2. Main code has been tested coming out of hibernation but without bootloader and works as expected

    Then the point I think to focus on would be what you said about the tamper interrupt: "After waking up from hibernation, in tamper event handler i am  clearing the tamer events and after disabling the tamper module, i do a soft reset."

    This seems to be the added piece of software execution that could be throwing off the bootloader unless some other information was omitted. Does after the Tamper Event Handler and soft reset are done, the program counter then properly direct to Bootloader for code execution? Might be worth comparing the state of the device after a soft reset from the Tamper Event Handler versus a soft reset from your modified shutdown function to see if that leads you to any differences.

    Can you provide the code setup for waking up from the temper event, entering the Tamper Event Handler, and any configurations/defines etc. related to entering the bootloader after the Tamper Event Handler has finished processing?

  • Hi Ralph,

    Thank you for the quick reply.

    After many hours of struggling with my code, i tried adding the NMI handler , the one i am using in main application, in my bootloader and....voila worked.  For anyone who may end up here looking for help on "how to add NMI handler in TI RTOS based project", here it is how you do it. Place following lines of code in you project's cfg file.

    var m3Hwi = xdc.useModule('');

    m3Hwi.nmiFunc = "&NMITamperEventHandler";

    where NMITamperEventHandler or any other global function will be your custom function for handling NMIs.

    Before closing this thread, I need to ask you just one more question. Is it possible that even after a soft reset(in main application's NMI handler), the tamper event was pending and got cleared in NMI handler that i placed in bootloader?

    Thanks again for all the help.

    Best Regards,

    Muhammad Shuaib

  • Hello Muhammad,

    Honestly, I am not sure. If the NMI handler soft reset you are using is something from a TI source code example if you can point me towards it I can either look or point an expert towards your question.