cancel
Showing results for 
Search instead for 
Did you mean: 

Determining when IWDG has timed out

stenasc
Senior
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
4 REPLIES 4
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 Venmo
Up vote any posts that you find helpful, it shows what's working..
stenasc
Senior
Posted on November 10, 2013 at 11:18

STM32F051

stenasc
Senior
Posted on November 11, 2013 at 16:09

Hi Clive,

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

Bob

stenasc
Senior
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