2025-01-28 02:43 AM
Dear ST Community,
I have been working on the firmware which contains the AT commands modem, Winbond flash memory. After some time I have relised the microcontroller is automatically getting restarted/. I had doubt on the hardware then we have redeveloped the complete hardware from known pcb designer, but again we are facing the same problem. I have printed the stack details also but not able to find the following issues:
1. Stack overflow.
2. Buffer overflow.
3. dereferencing unassigned memory.
4. power supply issues.
The restart is so random so that we are not able to understand and figure out the section. Also the PC shows the random values.
Thanks and Regards
Sachin Verma.
2025-01-28 03:44 AM
I think you need to reproduce the behavior at your desk / lab.
Then, check the RCC CSR register. Here a snapshot from the F40x manual :
And here a list of reset causes, from the same manual:
You don't have a watchdog activated in your firmware, do you ?
2025-01-28 04:05 AM - edited 2025-01-28 04:11 AM
Welcome to the forum.
For best results, please study How to write your question to maximize your chances to find a solution; some more details would help:
@sachinVerma wrote:the AT commands modem, .
What "AT commands modem"?
Please post the board schematic.
@sachinVerma wrote:not able to find the following issues:
So what tests have you done in an attempt to find those issues?
If your "AT commands modem" is a GSM (or any other radio) device, remember that these have very "peaky" current draw - the peaks demand careful power supply design, and can easily cause problems like "brown-out".
As @Ozone said, your can read the reset reason.
Do you have a watchdog enabled?
Instrument your code so that you can see what's going on.
PS:
Some tips here on instrumenting code so you can see what's going on without intrusive debugging:
Some tips on debugging in general:
#InstrumentCode