| Details |
Message |
|
Read-Only
Author Stefan Hartwig
Posted 11-Mar-2010 10:14 GMT
Toolset ARM
|
 Problem using J-Link while debugging
Stefan Hartwig
Hi,
I have an AT91SAM9260 and use a segger J-Link for HW-debugging. The
problem is, that debugging does only work on every second time.
That means, if I want to debug, I click onto start/stop debugging,
wait for the debugger to load the code into external RAM and then the
program counter is somewhere in the program but the main or I get an
error "cannot stop arm device".
On the second try (after I switch off and on power of the device)
debugging works fine.
|
|
|
Read-Only
Author Steve O
Posted 11-Mar-2010 20:29 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
Steve O
Stefan,
I have had this occur too. The solution always seems to be
associated with something I have done in code or in a
configuration.
Aside from the obvious problems with hardware and external bus
timing setup issues, you may want to look at some things which can
cause the processor to utilize 100% of its execution time. It also
seems that when you do a 'power cycle' the state(s) that caused this
issue to occur are removed. That is a hint to follow.
I recall reading somewhere that when you download your code it
begins running on the processor prior to the debugger gaining control
of the processor and stopping it. You have also seen that once you
release the debugger the code you loaded continues to execute.
Your code may contain a few while(1){} loops which can be, at
times, hard to overcome in gaining processor control. An interrupt
could be firing prior to actually having an ISR to vector to (all
obvious but tedious to solve).
You may also want to try and verify the syatem and peripheral
device settings on a load and a power cycle compared to a failed load
when 'the program counter is somewhere in the program'.
Also try to do a flash Erase command prior to executing a
Start/Debug and see if that makes a difference.
|
|
|
Read-Only
Author Steve O
Posted 11-Mar-2010 20:34 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
Steve O
Stefan,
I hate being vague with the "I recall reading somewhere" statement
so here is a link to that statement for an explanation:
http://www.keil.com/support/man/docs/ulink/ulink_hw_reset_sequence.htm
|
|
|
Read-Only
Author Stefan Hartwig
Posted 11-Mar-2010 21:02 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
Stefan Hartwig
Thanks for the information.
I will check if it is solved, when the bootloader is disabled by
erasing the first page of the DataFlash.
|
|
|
Read-Only
Author Stefan Hartwig
Posted 12-Mar-2010 13:27 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
Stefan Hartwig
It isn't a solution I might use.
When my bootloader is disabled, SAMBA is getting started and I have
other problems.
My app cannot configure the watchdog register, which seems to be
configured by SAMBA which starts in the "background", and throws tons
of errors...
But debugging starts fine ;-)
|
|
|
Read-Only
Author while (1);
Posted 12-Mar-2010 16:50 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
while (1);
Why don't you used ULINK?
|
|
|
Read-Only
Author Stefan Hartwig
Posted 12-Mar-2010 18:07 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
Stefan Hartwig
Because the J-Link is much faster when downloading code or
debugging.
|
|
|
Read-Only
Author while (1);
Posted 13-Mar-2010 08:04 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
while (1);
Then why don't you use ULINK Pro?
|
|
|
Read-Only
Author Stefan Hartwig
Posted 15-Mar-2010 08:13 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
Stefan Hartwig
Because I don't have one and it's very expensive...
|
|
|
Read-Only
Author Thorsten de Buhr
Posted 15-Mar-2010 09:26 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
Thorsten de Buhr
Hi,
did you also try Adaptive Clocking?
Just tested and works fine...
BR,
/th.
|
|
|
Read-Only
Author Stefan Hartwig
Posted 15-Mar-2010 09:39 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
Stefan Hartwig
Hi,
yes, we work with adaptive clocking. Otherwise we would have to use a
very slow frequency for JTAG, because the device starts with some
100kHz and speeds up JTAG frequency afterwards.
We had a device (same µC but different design), where
the "adaptive clocking pin" was not connected to the JTAG-port... it
took some minutes to load the firmware to SD-Ram and debugging was
slow as a snail
|
|
|
Read-Only
Author Stefan Hartwig
Posted 3-May-2010 06:43 GMT
Toolset ARM
|
 RE: Problem using J-Link while debugging
Stefan Hartwig
We found the problem!
After startup, the user reset is disabled in revision B of the
AT91SAM9260. After enabling the user reset, the debugger works
fine...
|
|