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.

MSP430-GCC-OPENSOURCE: Error when setting hw watchpoint using GDB and the MSP430 GDB Agent

Part Number: MSP430-GCC-OPENSOURCE
Other Parts Discussed in Thread: MSP430FR5994

hello all, I currently debug a test project using GDB 9.1 and the MSP430 GDB Agent 8.0.809.0 that I have obtained from:

https://www.ti.com/tool/MSP430-GCC-OPENSOURCE

The test project runs on a MSP430FR5994 Launchpad. When I attempt to set a watchpoint on the global variable named ii I get the following error message:

(gdb) watch ii
Hardware watchpoint 1: ii
(gdb) info break
Num     Type           Disp Enb Address    What
1       hw watchpoint  keep y              ii
(gdb) c
Continuing.
Warning:
Could not insert hardware watchpoint 1.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.

Command aborted.

On the GDB agent I get the following message:

CPU Name             Port
--------             ----
msp430              :55000

Starting all cores
CPU Name             Status
--------             ------
msp430               Waiting for client
msp430               Client connected...Connecting to Target
Found USB FET at COM18
Target connected...Starting server
ERROR: set_breakpoint() backend call returned 65

It appears that the GDB agent is not able to set hardware watchpoints. Is this a known issue / expected behaviour? Or do I do something wrong here?

Any help on this would be greatly appreciated.

The source of the test project is, for reference, provided below:

#include <msp430.h>

volatile int ii = 10;

int abc(int a){

    return(a+4);

}

int test(int i){

    ii = ii + 1;

    ii = abc(ii);

    return(ii);

}

int main(void) {

    WDTCTL = WDTPW | WDTHOLD;               // Stop watchdog timer

    PM5CTL0 &= ~LOCKLPM5;                   // Disable the GPIO power-on default high-impedance mode

     P1DIR |= 0x01;                          // Set P1.0 to output direction

    for(;;) {

        unsigned int i;            // volatile to prevent optimization

        P1OUT ^= 0x01;                      // Toggle P1.0 using exclusive-OR

        i = 10000;                          // SW Delay

        ii++;

        ii = test(i);

        do i--;

        while(i != 0);

    }

}

**Attention** This is a public forum