Thanks mjbcswitzerland.
Yes, I have use the watchdog and tested it to correctly reset the system in the bootloader, and also it works if I just load my MQX project without the bootloader at the base address.
But once I leave the base address that is when it freezes.
So I do believe that it is something that is set incorrectly when the backwatchdog kicks, which is why I would really like someone to tell me exactly what happens when it does. I mean, does it cause the PC to jump to 0x4, the reset vector? (This is obviously not the case since that would cause the code to reboot).
I feed the watchdog immediately in both the bootloader and the main code, and in any event, if i did that incorrectly as you mentioned it should reboot over and over.
Here is a response I got from Freescale:
Dear Stephen Maloney, In reply to your message regarding Service Request SR 1-734970054:Actually you are right. They are “write once” registers. You will have to implement the bootloader in a way that bootloader mode is conditioned to something (i.e. a push button, jumper, etc.). Let’s describe an example:Your board starts. In the interrupt vector you decide if you have to enter or not to the bootloader mode (any condition as previous examples). If yes then you enter to bootloader and do what you need to do (for example, flash with new S19). What dog is used and so on. When the bootloader finished its job it calls software reset to the MCU. This time the enter bootloader condition is not asserted and you will enter to your MQX application. No watchdog is activated and the MQX application runs normally. This is the way we recommend to implement the bootloaders. The preference is to have the MCU starting the application in an after reset state. That way we ensure that all the registers return to the original state.This would be the only way to fix this. The other option is to disable the watchdog in your bootloader. The problem is that this will put in risk the recovery capacity in your application.I hope this helps. Please let me know if you have more doubts. Have a nice weekend.Should you need to contact us with regard to this message, please see the notes below. Best Regards,[Service Request.Owner Fst Name] Technical Information & Commercial Support Freescale Semiconductor---------------------------------------------------------------------This message is in reply to Activity ID: 1-C5ZV80 Comment: I see, that makes sense. The one problem I have is that you cannot disable the backup watchdog once you have enabled it, at least in any way that I can find. The registers are write once.Is there a way to go into a 'supervisor' mode to be able to write them more than once?Thanks,SteveOn 4/8/2011 12:46 PM, Freescale Support wrote:
> Dear Stephen Maloney,>> In reply to your message regarding Service Request SR 1-734970054:>> Now it is clearer to me. What it is happening is that MQX is losing itself in an indeterminate state. The problem is that you cannot use the microcontroller watchdog timer. The MCU has some internal timeouts that may cause the watchdog to restart the MCU. Also the scheduler/kernel gets into some infinite loops needed to wait the initialize of some tasks in the system. MQX is implementing the watchdog timer component. This watchdog is by task. Each task can has its own watchdog timer. You can get more information about this watchdog timer take a look to the section 3.9.6 Watchdogs from the C:\Program Files\Freescale\Freescale MQX 3.6\doc\mqx\MQXUG.pdf document. There are also examples of who to use this watchdog component. C:\Program Files\Freescale\Freescale MQX 3.6\mqx\examples\watchdog>> My suggestion is to disable the watchdog once you enter to MQX application and instead use the Watchdog component. With this you are covering your bootloader and also the MQX application.>> Please let me know if you still have probl...