I have a problem with the start-up on my SAM7. I use an Olimex Tiny debugger and if I manually do a soft reset and then resume I the program runs as it’s supposed to. The problem is when I try to run “stand-alone”. Then I just can’t get it working. This also applies when I just run a “reset” through the debugger. To get it running, I must do a soft reset.
I beleive it has something to do with the start-up script, but I really can’t figure out what part. Can I please have some help here?
You need to build it differently. CrossWorks has a special StartFromReset command.
Leon
Sorry, forgot to mention I’m using GCC supplied with the Yagarto-package.
You still need to do something similar. CrossWorks is gcc-based.
Leon
I believe I cracked the nut now. I found out by looking in the script used by the JTAG (Olimex ARM-USB-tiny) when executing the “reset”-command. Apparently, it writes the bin-file to flash, and before exiting, it enables external user-resets in the Reset Controller Mode Register (RSTC_MR).
I had this done in my main-function, but I moved it to the startup-script.
It was so strange because it would start properly if flashed with the JTAG and then reset (hardware button) with the JTAG disconnected, but wouldn’t work from a complete power-cycle.
Must have been something with the PLL needing a hardware reset before it could be used. Eexternal reset-circut could never reset the MCU during power-on as the reset-input was disabled until main-program.
Well, it does work now so I’m happy. Thought it could maybe help someone else.
After this I can definitely say that the ADuC ARM7 is a lot more straight forward when it comes to these things, although it has fallen behind on the market. BTW, is Analog even developing those any more?