Hi,
I'm a new AVRco user and work with it for a few days now.
Unfortunately I have/had much trouble. (e.g. "Programmer not found" error although it's connected and worked fine on the day before.)
Well, this topic is about a restart problem.
I use AVRco (5.04.15) professional with the ISP3-USB programmer.
My hardware target is an Atmel 90CAN128.
My task is to re-write and extend an existing application.
The old application can be flashed and works fine.
So the general hardware configuration should be correct.
Problem describtion
The problems happen with my new application.
When I flash and run it, then a restart happens periodically after about 1 second.
This behaviour I see by my power LED (will be enabled at application start). Also in the debugger I see that the breakpoint of the first line (of main section) is reached periodically.
There seems to be no specific position in my code, where the restart happens. Sometimes here, sometimes there.
My first idea: The watchdog.
I commented it out. Nothing happens.
Even after removing the Watchdog unig from "import" had no different result.
So I think the watchdog wasn't the reason. (Nethertheless I keep it disabled now.)
My second idea: Any reset command.
There was one System_reset command, which was never reached.
To be shure, I commented out.
Later I disabled multithreading (by commenting out the "Start_processes" command).
No changes.
... some more tests later ...
Ok, now I recognised an interesting behaviour:
When I comment out both sleep(self, 100) (1 second) calls of my application, then it seems to work fine.
When I comment out only 1 (of 2) sleep calls, then the restarts are random.
In other words: When I start the processor, there is a random number of restarts and a few times later, the restarts stops. Sometimes (after processor start) there is even no restart.
When I enable both sleep calls in my code, the restarts always happens.
My application will use multithreading.
So I followed the manual, which propose to use sleep() instead of mDelay() or uDelay().
Additionally I created an IdleProcess (as proposed in the manual) to avoid deadlocks.
Has somebody an idea why sleep() causes that trouble?
Note: The restarts even happens without watchdog.
I'm a new AVRco user and work with it for a few days now.
Unfortunately I have/had much trouble. (e.g. "Programmer not found" error although it's connected and worked fine on the day before.)
Well, this topic is about a restart problem.
I use AVRco (5.04.15) professional with the ISP3-USB programmer.
My hardware target is an Atmel 90CAN128.
My task is to re-write and extend an existing application.
The old application can be flashed and works fine.
So the general hardware configuration should be correct.
Problem describtion
The problems happen with my new application.
When I flash and run it, then a restart happens periodically after about 1 second.
This behaviour I see by my power LED (will be enabled at application start). Also in the debugger I see that the breakpoint of the first line (of main section) is reached periodically.
There seems to be no specific position in my code, where the restart happens. Sometimes here, sometimes there.
My first idea: The watchdog.
I commented it out. Nothing happens.
Even after removing the Watchdog unig from "import" had no different result.
So I think the watchdog wasn't the reason. (Nethertheless I keep it disabled now.)
My second idea: Any reset command.
There was one System_reset command, which was never reached.
To be shure, I commented out.
Later I disabled multithreading (by commenting out the "Start_processes" command).
No changes.
... some more tests later ...
Ok, now I recognised an interesting behaviour:
When I comment out both sleep(self, 100) (1 second) calls of my application, then it seems to work fine.
When I comment out only 1 (of 2) sleep calls, then the restarts are random.
In other words: When I start the processor, there is a random number of restarts and a few times later, the restarts stops. Sometimes (after processor start) there is even no restart.
When I enable both sleep calls in my code, the restarts always happens.
My application will use multithreading.
So I followed the manual, which propose to use sleep() instead of mDelay() or uDelay().
Additionally I created an IdleProcess (as proposed in the manual) to avoid deadlocks.
Has somebody an idea why sleep() causes that trouble?
Note: The restarts even happens without watchdog.