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.

MSP430F5259: The Debug Interface to the device has been secured.

Part Number: MSP430F5259
Other Parts Discussed in Thread: MSP-FET

Hi,

I am getting error while code uploading in my msp430F5259 chipset project board.

Error is ("MSP430: Error connecting to the target: The Debug Interface to the device has been secured")

I am work on flash memory READ/WRITE operation , while i am write data on BSL 3 and power on and off of both my project board and MSP-FET Flash Emulation tool after that this error is came continuous.

Here i provide my code which was i dump in chipset and after that i am getting this error and i can't access my device again.

#include <msp430.h>
#define Segment 1

char FW_ver = 2;
char fw;
char data[] = {0x07,0x01,0x00,0x02,0x74,0x00,0x42,0x43};
char value = 'B';
char pre_value;
_Bool FW_update_flag = 0;

void main(void)
{
    WDTCTL = WDTPW+WDTHOLD;
	//    write_seg1(data);
    read_segment();
    write_Seg2(value, fw, FW_ver);
    if(FW_update_flag == 1){
        update_fw(data);
    }
      __no_operation();                       // Loop forever, SET BREAKPOINT HERE
}


void read_segment()
{
  char *Flash_ptr1;                           // Flash pointer
  Flash_ptr1 = (char *)0x1801;               // Initialize flash pointer
  pre_value = *Flash_ptr1;
  fw = pre_value;
  __no_operation();
}

void write_seg1(char data[])
{
  unsigned int i;
  char * Flash_ptr2;                         // Initialize Flash pointer
  Flash_ptr2 = (char *) 0x1800;
  FCTL3 = FWKEY;                            // Clear Lock bit
  FCTL1 = FWKEY+ERASE;                      // Set Erase bit
  *Flash_ptr2 = 0;                          // Dummy write to erase Flash seg
  FCTL1 = FWKEY+WRT;                        // Set WRT bit for write operation

  for (i = 0; i < 8; i++)
  {
     char pkt = data[i] ;
    *Flash_ptr2++ = pkt;                    // Write value to flash
    __no_operation();
  }
  FCTL1 = FWKEY;                            // Clear WRT bit
  FCTL3 = FWKEY+LOCK;                       // Set LOCK bit
  __no_operation();
}

void write_Seg2(char value, char fw, char FW_ver)
{
  if(fw != FW_ver)
  {
      __no_operation();
      unsigned int i;
      char * Flash_ptr3;                         // Initialize Flash pointer
      Flash_ptr3 = (char *) 0x1600;
      SYSBSLC = FWKEY+SYSBSLPE;
      FCTL3 = FWKEY;                            // Clear Lock bit
      FCTL1 = FWKEY+ERASE;                      // Set Erase bit
      *Flash_ptr3 = 0;                           // Dummy write to erase Flash seg
      FCTL1 = FWKEY+WRT;                        // Set WRT bit for write operation
      for(i = 0; i < (Segment*512); i++)
          {
              *Flash_ptr3++ = value;                   // Write value to flash
              __no_operation();
          }
      FCTL1 = FWKEY;                            // Clear WRT bit
      FCTL3 = FWKEY+LOCK;                       // Set LOCK bit
      __no_operation();
      data[1] = FW_ver;
      FW_update_flag = 1;
  }
}

void update_fw(char data[])
{
      unsigned int i;
      char * Flash_ptr4;                         // Initialize Flash pointer
      Flash_ptr4 = (char *) 0x1800;
      FCTL3 = FWKEY;                            // Clear Lock bit
      FCTL1 = FWKEY+ERASE;                      // Set Erase bit
      *Flash_ptr4 = 0;                          // Dummy write to erase Flash seg
      FCTL1 = FWKEY+WRT;                        // Set WRT bit for write operation
      for (i = 0; i < 8; i++)
        {
           char pkt = data[i] ;
          *Flash_ptr4++ = pkt;                  // Write value to flash
        }
      FCTL1 = FWKEY;                            // Clear WRT bit
      FCTL3 = FWKEY+LOCK;                       // Set LOCK bit
      FW_update_flag = 0;
}

Can anyone help me out to solve my problem.

It will grateful to me. 

  • Only immediate thing I can see is the

        __no_operation():
    won't loop forever. I usually do
        while (1);
    but I've also seen people put the msp430 into a low power state.

    So your code will run to the end, am not sure what happens then, I guess generates a fault, and the fault handler will deal with it, I expect it will be the default fault handler - not sure what that does, but think it may just be a loop forever - I need to check ...

**Attention** This is a public forum