my Xmega256a3bu is not working after restart.

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello everyone,

 

After flashing the boot and app code to my atxmega256a3bu, it is working fine till some time(even if i do restart-on/off)....

after some time if i do a restart it will not start up, device is getting power perfectly. Also device is not printing any userdebug...

 

after flashing the app code again it is working fine and showing the same above behaviour..

 

Please can anyone help, what can be the problem with my device??

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you enable the watchdog timer?

 

A common cause of failure after some operating time is "stack overflow". When this happens, the program becomes very unpredictable, sometimes stopping all-together, sometimes not. Another cause can be a string that exceeds the length of the provided array; behavior depends on what variables are adjacent to the string in memory. Watchdog will sometimes or often recover from either one.

 

The REAL solution, however, is to find what the real cause. You can sometimes find it by operating with the debugger, occasionally stopping it, and checking the condition of the stack and any string buffers. 

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

Last Edited: Mon. Dec 14, 2020 - 07:51 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm only enabling the watchdog timer in my sampling function , once reading from sensor is done i'm disabling it.

 

but like you have said i have seen the random behaviour of my app code before...and the reason was i have used multiple large array...but then i have reduce it to 1 and reusing the same..

 

also recently i have introduced few lines of code in which i'm doing read and write to eeprom and after that change i am seeing this behaviour on device.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ka7ehk wrote:
You can sometimes find it by operating with the debugger, occasionally stopping it, and checking the condition of the stack and any string buffers.
Stack Overflow Detection Using Data Breakpoint | Atmel Studio 7

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

after some time if i do a restart it will not start up

In addition to the above, what is your power supply?

Have you enabled the Brown Out Detector?

 

Is this a commercial board, or your own design?

 

What is the operating environment?

Is there a lot of EMI present?

(Large motors, RF, wires with high currents or high voltages near by?)

 

JC