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.

CCS/MSP430FR2433: CCS breaks at NOP in mult16_f5hw.asm at 16MHz, and locks outside of debug too.

Part Number: MSP430FR2433

Tool/software: Code Composer Studio

This issue is almost identical to that reported in https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/685882.

During debug in CCS, a "phantom" breakpoint occurs in mult16_f5hw.asm at the NOP; CPU19 Compatibility line (pasted in here for reference).

__mpyi_f5hw:  .asmfunc  stack_usage(2 + RETADDRSZ)
	PUSH.W	SR			; Save current interrupt state
	DINT				; Disable interrupts
	NOP				; Account for latency
	MOV.W	OP1,&MPY_OP1		; Load operand 1 into multiplier
	MOV.W	OP2,&MPY_OP2		; Load operand 2 which triggers MPY
	MOV.W	&RESULT, R12		; Move result into return register
    .if $DEFINED(__LARGE_CODE_MODEL__)
	POP.W  SR
        NOP                             ; CPU19 Compatibility   <----This line
        RETA
    .else
	RETI
    .endif
	.endasmfunc

Similar to the other poster, I am working with GPIO pins. The code essentially implements an Arduino-like interface to set GPIO pin direction:

pinMode(CS_PIN, OUTPUT);

The actual break and hang happens when executing the GPIO direction setting:

    else if (mode == OUTPUT)
    {
        *pins[pin].directionReg |= pins[pin].bitMask;
    }

CS_PIN corresponds to a number that is equivalent to the launchpad boosterpack standard. In my case CS_PIN=18, which refers to P2.2. 

*pins[pin].directionReg are defined in a struct and simply point to &P2DIR. The pins[pin].bitMask is also defined in the struct and simply returns the macro BIT2. This essentially does the following:

P2DIR |= BIT2;

This issue occurs at 16MHz, but does not occur at 12MHz or 8MHz. It occurs at the same line every time. There is no power mode changing. Outside of CCS, the code also fails to run. I assuming it is locking up at the same point.

I couldn't find a resolution in the other post or through searching.

  • Here is a bit more information. From what I can tell the code executes up to 15892480Hz. With DCOSelect = DCORSEL_5 and FLLNSelect = 484 it works. But with FLLNSelect = 485 it breaks. This is with FLL referencing the onboard 32768Hz XT1.
  • Hi Brody,

    You mean this issue is code and clock frequency related. Could you provide your code? I'll try to repeat this issue.

    B.R
    Winter
  • Yes. I also noticed that there was some SPI initialization  before the main() function, outside what is followed by debug. I moved the SPI initialization into the main() function, after clock and gpio initialization, and the code now executes up to 16MHz just fine.

    I still do not have an explanation for it, and I can supply the code. It is part of a much bigger project, so I need some time to isolate it. I will post it as soon as I can. Thanks.

  • Hi Brody,

    How about your issue?

    B.R
    Winter

**Attention** This is a public forum