Page 1 of 1

What is the MCU doing (where is the program counter) ?

Posted: Sat Jun 28, 2014 4:36 pm
by terbo
Hi.

I have the following scenario (Atmel Studio 6.2 running a SAMD20's on Xplained Pro and EDBG only (no ATMEL-ICE)):
1) I run my program to the Breakpoint (SW stops, OK)
2) I then do a "Step over" (F10) or "Step into" (F11)
3) The program then simply "fly away"; don't return to (stops on) the next line.

My Q is:
How can I find out what the MCU are doing at the moment? Can I see/pinpoint the C-code line at which the MCU is currently executing? Which command do I give Atmel Studio to achieve this?

best regards
Terje Bohler

Re: What is the MCU doing (where is the program counter) ?

Posted: Sat Jun 28, 2014 9:00 pm
by terbo
I'm using all Atmel Studio 6.2 default settings.
Acc. to "Toolchain" settings:
ARM/GNU C Compiler - Optimization:
- Optimization level: "Optimize (-O1)
- Other optimization flags: "-fdata-sections"
v(marking) Prepare functions for garbage collection
v(marking) Allow called functions be located anywhere ...

Q: does it any differnce (optimizations or not) ?

best regards
Terje Bohler

Re: What is the MCU doing (where is the program counter) ?

Posted: Sun Jun 29, 2014 2:25 pm
by terbo
Thanks again awneil.

Yes, that really confused me. When I took a closer look at the "leftmost frame" in the AS6.2, I see no "green bars" (indicating executable code) near a statement: "i=i+1", but an associated pop-up-comment-box saying "The breakpoint will not currently be hit. unable to set requested breakpoint on target".

I then set optimize option to "None(-O0)", and everything is OK ...

best regards
Terje Bohler

Re: What is the MCU doing (where is the program counter) ?

Posted: Tue Jan 20, 2015 7:46 am
by johni22
How can I find out what the MCU are doing at the moment? Can I see/pinpoint the C-code line at which the MCU is currently executing? Which command do I give Atmel Studio to achieve this?



___________________________
Download high quality a+ course dumps to network test prepare and comptia network plus pass with oracle certification dumps  Also get free demos of www.clarku.edu