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

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

terbo
Posts: 26
Joined: Sun Oct 06, 2013 11:04 pm

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

Sat Jun 28, 2014 4:36 pm

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
terbo
Posts: 26
Joined: Sun Oct 06, 2013 11:04 pm

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

Sat Jun 28, 2014 9:00 pm

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
terbo
Posts: 26
Joined: Sun Oct 06, 2013 11:04 pm

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

Sun Jun 29, 2014 2:25 pm

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
johni22
Posts: 1
Joined: Tue Jan 20, 2015 7:41 am

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

Tue Jan 20, 2015 7:46 am

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
Last edited by johni22 on Sat Feb 07, 2015 9:53 am, edited 1 time in total.

Return to “Development Tools”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest