Skip to main content
stenasc
Associate III
November 9, 2013
Question

Determining when IWDG has timed out

  • November 9, 2013
  • 4 replies
  • 742 views
Posted on November 10, 2013 at 00:52

Hi Forum,

I need to determine if the IWDG has timed out. After the board resets, can I determine this by checking a flag e.g.

if (RCC_GetFlagStatus(RCC_FLAG_IWDGRST) != RESET)

  // IWDG has reset

or if I know that IWDG is about to timeout  I can set a flag in flash that I can check after reboot. How can I check if IWDG is about to time out?

Many Thanks

Bob
    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    November 10, 2013
    Posted on November 10, 2013 at 01:56

    On which part?

    Typically you'd determine the reset reason through the RCC flags

    [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Software%20reset%20flag%20%28SFTRSTF%29%20in%20RCC%20CSR%20register%20what%20source&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=403]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FSoftware%20reset%20flag%20%28SFTRSTF%29%20in%20RCC%20CSR%20register%20what%20source&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=403
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    stenasc
    stenascAuthor
    Associate III
    November 10, 2013
    Posted on November 10, 2013 at 11:18

    STM32F051

    stenasc
    stenascAuthor
    Associate III
    November 11, 2013
    Posted on November 11, 2013 at 16:09

    Hi Clive,

    Thanks for that. I'll have that tested by tomorrow.

    Bob

    stenasc
    stenascAuthor
    Associate III
    November 11, 2013
    Posted on November 11, 2013 at 16:41

    Hi Clive,

    We are very soon going to ship code to production, so I appreciate all your help along the way. One final thing I want to implement is flash readback protection. I have a couple of questions....

    1...Can I enable this on the STM32f051in software or does it have to be set in the programming tools? I'm using Keil uVision. It would be preferable if I could set this in software as we will be shipping a lot of these units and if we only had to program the binary, it would make production easier and it would stop any units getting out without protection.

    2...Once Flash Readback protection is enabled, can I still use the uVision bugger. Is the board bricked as far as using the debugger on it again, or can I reflash again.

    3...How can I verify if protection is enabled. Will uVision display this?

    Apologies for these questions, but I want to make sure that this stage is correct before we go to production......Bob Carter