cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 - Resets for (Seemingly) No Reason

Rogers.Gary
Senior II
Posted on July 23, 2017 at 08:26

Hi,

My application uses and STM32F405. The power supplies are very stable, based on a design I have used in other applications. Dittio for the other hardware peripherals and reset circuit, etc. I have used the 405 in other projects with no such problems as  have here.

I have an application that for all intents and purposes, should be written correctly - this based on existing projects framework that has worked well in other applications. I'm using the newest CMSIS libraries (1.81.)

On reset, I printf the RCC->CSR register, and it always returns 0x24000000, meaning that bits 26 (RCC_FLAG_PINRST) and bit 29 (RCC_FLAG_IWDGRST) are set.

The watchdog timer is set correctly - again, I am using the same function to set up and reload the IWDG as in other applications. The timeout is set for 1000ms, I am resetting it at a 250ms rate. I have a hard fault handler to trap and display errors, and that is not getting triggered.

All my interrupts are set up correctly. I'm using FreeRTOS, and have the configLIBRARY_KERNEL_INTERRUPT_PRIORITY set to 14. I have configASSERT defined so that it will print out any errors caught there, but it does not print anything.

Is there any way of determining what is going on?

Thanks for any help you can provide.

4 REPLIES 4
Posted on July 23, 2017 at 10:39

Hello!

Do you have enabled the hardware watchdog? If yes, this has different timeout values than you set later at your program.

Does this IWDG reset occurs spontaneously or regularly (eg at initialisation phase of program)?

Rogers.Gary
Senior II
Posted on July 23, 2017 at 19:12

'The watchdog timer is set correctly - again, I am using the same function to set up and reload the IWDG as in other applications. The timeout is set for 1000ms, I am resetting it at a 250ms rate. I have a hard fault handler to trap and display errors, and that is not getting triggered.'  Yup, it is running. Same function I used successfully in other programs.

It occurs any any time, typically within 10 minutes of launching.

Thanks for your help.

Posted on July 23, 2017 at 20:08

Hello again.

If i understand well  you put the WDog reload function inside all processes.

Do you use idle task hook function ?

If not, implement it and put also inside the reload function.

In case you dont see any difference , use the hard way! try to isolate the problem by disabling functionalities .:(

Rogers.Gary
Senior II
Posted on July 23, 2017 at 20:47

Hi Vangelis,

I found the problems. In setup of one interrupt, I did NOT have the configLIBRARY_KERNEL_INTERRUPT_PRIORITY set. Also, I switched to a non-blocking binary sempahore to signal my interrupt handlers, and it now works without fault.

Thanks for taking the time to help out!