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.

TMS320F28069M: WDFLAG Is Cleared By Boot Code

Part Number: TMS320F28069M
Other Parts Discussed in Thread: C2000WARE

I am incorporating the CPU watchdog into an F28069M project. I am able to trigger watchdog resets as expected, but I have found that the WDFLAG gets cleared during boot by some library code. I used a hardware watchpoint on the WDCR register to confirm this -- the WDFLAG is set when the watchpoint is reached, and gets cleared after I step through a few more instructions. This happens when the program counter is around 0x3FF74E. Based on the device memory map, this appears to be in Boot ROM, which leaves me uncertain about how to change the behavior.

I found this post https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/419598 describing the same (or a similar) problem, but the solution isn't clear to me -- I don't recognize the configuration menu shown in the solution. 

I am attaching a screenshot below of the libraries which are included in the project. Which (if any) of these libraries needs to be changed in order to preserve WDFLAG during boot, and how do I go about making those changes?

image.png

Thanks

  • Oliver,

    Can you resend the image of the list of libraries as it is not showing up. Can you use the attach as image feature. Additionally,  have you taken a look at the watchdog examples available for the device in use on the C2000WARE package?

    Regards,

    Ozino

  • Hi Ozino,

    Thanks for your reply. I have included the image as an attachment this time.

    I have looked at the watchdog example for the f2806 in the C2000WARE package. It configures the watchdog to generate an interrupt rather than a reset and does not have any example code for checking WDFLAG. In any case I think what I found with the debugger shows that WDFLAG is set as expected, but gets cleared by something in the boot ROM. 

    Thanks,

    Oliver

  • Hi Oliver,

    Thanks for the updated image. I've gone ahead and forwarded this question to a bootROM expert to comment on whether it clears the WDFLAG. In the interim, you may want to check out the WD chapter in the F2806x TRM.

    Regards,

    Ozino

  • Hi Ozino,

    Any updates regarding the bootROM?

    Thanks,

    Oliver

  • Hi Oliver, 

    We are in the process of investigating the issue that you have reported.  You mentioned the following:

    >>I don't recognize the configuration menu shown in the solution. 

    We assume this is because you are not using SYS BIOS or a BIOS of any kind. Can you please confirm?

    If yes, do you have an equivalent implementation of the file:  F2806x_CodeStartBranch.asm  ( you can see the source in several of our examples)

    If yes, is it possible that the WDFLAG is being cleared some where in there?

    Also, please let us know what is the first place in software where you see the bit is clear after seeing it set?

    In your startup code, can you set a BP at _c_int00 and then check the state of WDFLAG bit when you expect it to be set?  

    Cheers! 

    Krishna

  • Hello Krishna,

    Thank you very much for your reply. You are correct that we are not using a BIOS of any kind. 

    I looked into CodeStartBranch.asm and found that the WDFLAG is not being cleared there. However, while investigating this, I found the real cause, which I somehow overlooked earlier:

    Our application uses the DRV library (from Instaspin FOC). We have a custom bootloader which also uses the DRV library. I found that the WDFLAG is being cleared inside our bootloader by the WDOG_disable function which is called from DRV_init. I was able to fix this by modifying the WDOG_disable to always write `0` to bit 7 of WDCR (the WDFLAG bit). The watchdog is working as expected now.

    Thanks again,

    Oliver