Application does not start on power up

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

I have delevoped an EC++ application using the IAR compiler. The details are:

* Processor: AVR MEGA 128, 64KB external RAM.
* Compiler: AVR IAR C/EC++ Compiler (Version 2.28A).
* AVR JTAG ICE for debugging / processor programming.
* RTOS: CMX-RTX RTOS (version 5.30a).
* AVR Studio 4.07.

Using the IAR compiler I generate an extended intel HEX file.

1) When I load the HEX file into C-SPY, C-SPY transfers the code to the target using the JTAG device. When I then run the application, it starts correctly.

2) When I load the HEX file into the AVR Studio debugger, it transfers the code to the target using the JTAG device. When I then run the application, it starts correctly.

So far, so good.

3) When I program the FLASH RAM of the processor using the HEX file, the code is written correctly to the processor (verify = OK). Afterwards I power off the JTAG device and the target board. When I then power the target board up again, the application does NOT start!? If I force a reset of the processor (connecting GND to the SRST pin on the JTAG interface), the application DOES start!?

Does anybody have any idea, why the application does not start on power up?

Best regards
Claus Gareissen

admin's test signature
 

Last Edited: Tue. Mar 21, 2017 - 08:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

just a rough guess..........

the fact that it does work when you reset the device manualy.....looks like something holds the device in reset.

is the JTAG programmer still pluged in when you power up the system?
if so.....check the reset pin on AVR device,( if it is active low input ), it should be high when you power up the system.

regards,
j

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

No, the JTAG is not plugged anymore, when i power up again.

Another important information: I have developed a small test application, which runs on the same hardware. This test application does not show this strange behaviour, i.e. is starts up correctly on power up.

Best regards
Claus Gareissen

admin's test signature
 

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

Hi,

try extending the power-on delay by setting the CKSEL and SUT fuses for slow rising power supplies.

See page 37 of the data sheet for the options.

Torsten

admin's test signature
 

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

I have the same problem on one project and not on another.

 

I suspected that the project that does not start on power up was somehow leaving the interrupt vectors in the boot space.

 

Now I can confirm that.

 

I single stepped from power up using JTAG ICE MKII while monitoring MCUCR (data mapped IO register hex 35.)

 

It is zero until it hits the first "change of program flow" instruction which was a BRNE.

 

At that point, IVE becomes a 1.

Continuing to single step, 4 cycles later IVSEl becomes a 1 (MCUCR now equals 7)

 

That means the interrupt vectors are switched to the boot space.

 

On the project board that does not have the power-up problem, this does not happen.

 

So now I am am looking for a way to disable  "break on change of program flow".

 

I cannot navigate to any window that displays this possibility.

 

Also, I am kind of puzzled, because wouldn't this have to be a fuse? And no such fuse is shown.

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

Paul this thread is 14 years old!

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

It is, but you know the same problems arise again and again and not necessarily within the same year,

so I think it is reasonable to add to old threads so that people like me searching for answers can at least get a hit.

 

Don't know of you can help me on that problem:

 

Using JTAG ICE MKII and ATMEGA1284,  the User Guide for JTAG ICE MKII shows a window with a check box in it for  "break on branch/skip"

 

I can't find that window anywhere.

 

The problem I have is that on one project, on power up,  the device relocates the interrupt vectors to the boot space upon hitting the the first branch.

It does this on power up with no JTAG ICE connected, so the App won't run unlesS started under the ICE.

 

On the project that works fine, it does not relocate the interrupt vecyots upon hitting the first branch.

I cannot see any difference in AS6.1 settings or hardware or software.

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

But you have already interrupted another thread with this:

 

https://www.avrfreaks.net/comment...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So we lock this one.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Topic locked