This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IAR workbench and MSP-EXP430FR5969

Other Parts Discussed in Thread: MSP-EXP430FR5969, MSP430F2011

Dear Experts,

I encountered a challenge (at the moment it is not clear if this is a bug) in IAR workbench Debugger and the lauchpad MSP-EXP430FR5969: As printed in an appnote from TI, I have removed all jumpers between the application processor and the USB Emulator Interface. Instead of the FR5969 I have wired a MSP430F2011 via SBW and Vcc to the Interface. Wires are approx. 7 cm (means 3 inches) Long and a few Millimeters seperated.

Version of IAR workbench is 6.50.1 (coming from Installation file "EW430-6501-Autorun.exe".

After removing all SW breakpoint in Debugger, (see also https://e2e.ti.com/support/microcontrollers/msp430/f/166/p/523539/1910220#1910220 ) I have started the debugger with a simple "mainloop" in main program and interrupted by a Interrupt Service Routine "TAIFG_ISR".

Following steps are done:
- start Debugger from editor
- reset to start of prog
- start program and wait several seconds
- place breakpoint BP at mainloop

code in mainloop Looks like:

Mainloop    nop
;            bis.w   #LPM3+GIE,SR            ; Enter LPM3 w/ int until Byte RXed
            jmp     Mainloop                ;

ISR Looks like

;-------------------------------------------------------------------------------
TAIFG_ISR ; Interrupt handler for TACCR0 CCIFG Cycles
;-------------------------------------------------------------------------------
            xor.b   #0x10, &P1OUT             ; toggle for scope
            reti

- set 2nd breakpoint inside ISR
- continue runnig
- watch program stops
- remove BP inside ISR
- continue code running
- remove BP in main loop
- continue code running
- set BP again in mainloop

oooh, program does not stop !!!

- press hold button and watch where it stops
- do it several times
- remove BP in main loop
- continue code running
- set BP in main loop
- now, Debugger stops inside ISR, where no BP is placed

This bug replication is a little bit tricky, since one has to play around with the degugger. But after a while, the debuger does not stop at the breakpoint, but at code lines below.

This morning I have send a description of the bug to IAR Munich for verification and awaiting an answer. I have sent out a Video file.

Is there someone else out in the world, who made similar observations?

It would be be nice, if someone replies...

BR

Bernd

  • Bernd,

    Your TAIFG_ISR does not properly clear the LPM3 bits, therefore the program should never return to the Mainloop in order to loop back and re-enter LPM3. The ISR should have a bic.w #LPM3, 0(SP) command before the reti instruction. Please refer to Section 2.3.1 of the MSP430x2xx Family User's Guide (SLAU144): www.ti.com/.../slau144j.pdf

    Nevertheless the debug sequence described could still indicate a bug in the IAR Embedded Workbench debugger, you will need to work with the IAR team to further investigate this possibility.

    Regards,
    Ryan
  • Dear Ryan,

    This code snip is without any sense and is part of the init code which stands before. Pls be Aware of the semicolon making the line inside the Loop into a comment. Yes, you are right, it makes no sense to publish code lines, not relevant or made to become comments.

    I just copied these lines, because this constallation presents the misbehaviour. Within the last days, I have learned, that even unrelevant pieces of code or comments can change the workbench operation. Maybe a command works on an even linenumber, but not on an odd. Operation changes beacause of history, etc.. It is unbelievable, I am not feeling so trusty... at the moment.

    I forgot to mention: Because I am using the unpaid Version of the IDE, the Motivation for bugfixing is less, thats what they said.
     
    BR

    Bernd

  • Dear Folks,

    Meanwhile I got a message from IAR Munich, that setting breakpoint during runtime in debugger will not be recognized the right way. There must be a RESET of the debug software (code of MSP-device) to overcome this problem. I can't believe it, since it makes the debugging of assembler code very inattractive.

    I also got the message that C-code projects do not show this behaviour. also C-coded assembler code replaced by native assembler code is free of hassle. Whatever this means, I spend a little more time to investigate this issue and keep you informed.

    BR
    Bernd

  • Dear Ryan,

    are there any chances to dump register values into a file, during single step debugging?

    I have seen that TAIFG is not reset during entering TAIFG_ISR. ... and so on.

    This Looks not good to me. I would send you my code, but it is about 140 lines. Placing the code here could be Little bit confusing for the other Readers.

    Alternatively, your private E-Mail might be fine, and at the end we might place a result message in this thread.

    BR

    Bernd

  • Bernd,

    I do not know of a way to output register values into a file using the IAR debugger. Feel free to insert your code using Syntaxhighlighter (inside of rich formatting) or send me a friend request so that we can start a private conversation using the E2E messenger tool.

    Regards,
    Ryan
  • Dear Ryan,

    I have done a little bit more work ("a little...", haha) on this issue and figured out, the register values are not updated in debugger window as expected. This lead to a misunderstanding. At the moment, it is not clear to me, if the misunderstanding is betwwen programmer and screen or between screen and target application. For the following description I Changed HW to MSP430F2011 with 32kHz crystal:

    code ____

    ;-------------------------------------------------------------------------------
    TAIFG_ISR   ; Interrupt handler for TAIFG, TACCR1 and TACCR2 CCIFG
    ;-------------------------------------------------------------------------------
                add.w &TAIV,PC ; Add offset to Jump table - this is line 106
                reti ; Vector 0: No interrupt
                jmp CCIFG_1_HND ; Vector 2: TACCR1
                jmp CCIFG_2_HND ; Vector 4: TACCR2
                reti ; Vector 6: Reserved
                reti ; Vector 8: Reserved
    TAIFG_HND   ; Vector 10: TAIFG Flag
                ; Task starts here
                xor.b   #0x10, &P1OUT             ; toggle for scope - this is line 114
                reti
    CCIFG_2_HND ; Vector 4: TACCR2
                ; Task starts here
                reti ; Back to main program
    CCIFG_1_HND ; Vector 2: TACCR1
                ; Task starts here
                reti ; Back to main program

    ____end code

    This is my ISR for timer A2 and in Debugger, I have opend Windows Workspace, main.s43, Register, watch1, Memory,...

    If one Displays in Register window the timer A2 Register (with unfolded TACTL) and puts TACTL into watch1, the values of TACTL should be the same in both Windows. Now set a breakpont on line 106, reset Debugger and let it run. After stopping at BP, the values for TACTL shown in Register window and watch1 window differ. TAIFG is set in Window Register, but it is reset in window watch1. If one changes the Content of window Register to for instance "CPU Register" and than back to "Timer A2 Register", the flag TAIFG is reset and the same as in window watch1.

    Care must be taken, because any BP in line 106 causes a reset of TAIV ... and so on.

    Now removing the BP from line 106 and Setting to line 114 Shows a different behaviour. The flag TAIFG is reset in both Windows at the same time. And that's what I have expected with BP on line 106.

    BR Bernd

**Attention** This is a public forum