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.
Tool/software: Code Composer Studio
Good afternoon.
I used CCS 6.2.0 and was programming the MSP-EXP430FR5969 through the USB port. I was testing a serial communication program behind port A1 (P2.5 and P2.6). Communication was working perfectly. After a write, the IDE returned this message: "Error connecting to the target: The Debug Interface to the device has been secured". Until then the card is not being able to be recorded. How do I unlock the recording?
Good Morning.
As figure below, I am downloading on msp430 through the USB port. I already downloaded this program on the board, through the USB port more than 1000x, and always worked. At some point IDE has this failure.
When I said that I was doing UART tests, I was referring to a communication with another device; but nothing related to msp430 recording.
How do I unlock the MSP430?
Good Morning.
I did as you indicated, but I did not succeed. I uninstalled CCS 6.2.0, and installed CCS 8.1.0, but I was not successful. The error remains the same. I installed the program on another computer, but the error continues. I think it's something on the board.
With that certainty, I wanted to know how I can proceed. Which BSL device should I buy to unlock my card? And how do I unlock?
If possible, send me links so you can buy the right stuff.
Thank you.
For BSL hardware can be used any USB to Serial bridge chip or G2 LP (slaa535 LaunchPad-Based MSP430 UART BSL Interface).
http://sustburbia.blogspot.com/2016/02/the-great-msp430-bootloader-swindle.html
http://www.kerrywong.com/2013/03/27/schmartboard-msp430f5172-development-kit/
https://forum.43oh.com/topic/2972-sbw-msp430f550x-based-programmer/?do=findComment&comment=43889
Peter Spevak said:
While you're getting the message, that the device is locked, there is a certain risk, that e.g. something on the board is damaged, and in this case potentially even the BSL attempt will not help
On board ez-FET Lite functionality can be easily verified by using another external (any MSP430) target device, with removed jumpers to break default connection between eZ-FET Lite and LP target device (FR5969).
Peter Spevak said:So I would think about purchasing another LP. That is most probably the easiest and cheapest solution of the problem.
With the new LP you would have even maybe the chance to fix the first one, but could hopefully immediately stark working again. Just a thought of mine.
Device is locked probably by downloaded bad code, or downloaded firmware overwrite fuse values by itself. The same thing will happen with brand new LP, so buying one or ten new LP's will not resolve the problem.
Good Morning.
I'll buy another card and see if the error will continue.
Thanks for listening.
Good Morning.
It follows the last code that has been compiled and run on the card.
By looking at it, can you identify something that may have caused board failure?
#include "driverlib.h"
#include <stdio.h>
#include <string.h>
//******************* CONFIGURA??ES DA TAG ******************
#define TIPO STA //DEFINIR O MODELO DA TAG
#define COLETOR "homolog.senfio.com.br" //BASE DO COLETOR
#define PORTA "80" //PORTA DE ENVIO
#define FW_VERSION "7.1.0" //VERS?O DO FIRMWARE
//******************* Outras Definicoes ******************
#define FLAG_LOG 2 //FLAG DE MEM?RIA QUE INDICA A QUANTIDADE DE DATALOGGERS
#define MAC_MEM 4 //POSI??O INICIAL DA MEM?RIA DE ALOCA??O DO MAC
#define LOG_MEM 40 //POSI??O INICIAL DA MEM?RIA DE ALOCA??O DOS DATALOGGERS
#define LIM_DTLGR 50 //LIMITA??O DO ESP PARA ENVIO DE DADOS (M?X 536 CARACTERES = 21 DATALOGGERS)
#define ERRO 0x32 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA
#define OK 0x33 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA
#define ON true //VARI?VEIS PARA UTILIZA??O NO PROGRAMA
#define OFF false//VARI?VEIS PARA UTILIZA??O NO PROGRAMA
#define NONE 00 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA
#define ODD 01 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA
#define EVEN 10 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA
#define STA 100 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (TIPO DA TAG)
#define STB1 101 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (TIPO DA TAG)
#define STB2 102 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (TIPO DA TAG)
#define STC 103 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (TIPO DA TAG)
#define STA2 104 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (TIPO DA TAG)
//******************* Maquina de Estados *************
#define WDT 98 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define START 0 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define WAKE 1 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define DISASSOCIATE1 2 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define READ_MAC 3 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define RESGATA_MAC 4 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define CONFERE_LOG 5 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define TESTE_WIFI 6 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define TESTE_COLET 7 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define SEND 8 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define ENVIA_LOG 9 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define RECEIVE 10 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define RECEIVE_FROM_LOG 11 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define ARMAZENA 12 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define SLEEP 13 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define TESTE_RSSI 14 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define TESTE_WIFI2 15 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define TESTE_COLET2 16 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
#define END 17 //VARI?VEIS PARA UTILIZA??O NO PROGRAMA (SWITCH CASE - STATE MACHINE)
char string1[120];
char string2[120];
unsigned int i, z, flag; //Counter
volatile unsigned int j;
char recebe_mac[30]; //VARIÁVEL DE ALOCAÇÃO DE DADOS RECEBIDOS VIA UART (MAC)
char recebe_wifi[15]; //VARIÁVEL DE ALOCAÇÃO DE DADOS RECEBIDOS VIA UART (RESPOTA DE CONEXÃO)
char recebe_wifi2[15]; //VARIÁVEL DE ALOCAÇÃO DE DADOS RECEBIDOS VIA UART (RESPOTA DE CONEXÃO)
char recebe_wifi3[15]; //VARIÁVEL DE ALOCAÇÃO DE DADOS RECEBIDOS VIA UART (RESPOTA DE CONEXÃO)
char recebe_rssi[8]; //VARIÁVEL DE ALOCAÇÃO DE DADOS RECEBIDOS VIA UART (RESPOTA DE CONEXÃO)
char msgok[22] = "XHTTP/1.1 200 OKZ\0"; //STRING PARA COMPARA??O COM O DADO RECEBIDO (RESPOSTA WEB)
char wifiok[10] = "XOK\0"; //STRING PARA COMPARA??O COM O DADO RECEBIDO (RESPOTA DE CONEX?O)
char MAC1[30];
char RSSI[4];
volatile char estado;
void sendUART(char string123[50]);
void receiveUART(void);
void setup();
void delayReceive();
void main(void)
{
setup();
i = 0;
z = 0;
estado = START; //ESTADO INICIAL DO SWITCH CASE
while (1) //LOOP INFINITO
{
switch (estado) //SWITCH CASE DA M?QUINA DE ESTADOS
{
case START:
estado = DISASSOCIATE1; //PR?XIMO ESTADO DO SWITCH CASE
break;
case DISASSOCIATE1:
estado = READ_MAC; //PR?XIMO ESTADO DO SWITCH CASE
break;
case READ_MAC:
strcpy(string1,"MAC ");
sendUART(string1);
flag = 0;
while (flag != 1) //LOOP ENQUANTO N?O RECEBE OS DADOS VIA UART
{
j = 500; // SW Delay
do j--;
while(j != 0);
}
for (i = 0; i < 17; i++) //M?TODO DE REALOCAMENTO DOS DADOS NUMA VARI?VEL
{
MAC1[i] = recebe_mac[i]; //SALVA O MAC NA VARI?VEL CORRETA
}
MAC1[2] = MAC1[3];
MAC1[3] = MAC1[4];
MAC1[4] = MAC1[6];
MAC1[5] = MAC1[7];
MAC1[6] = MAC1[9];
MAC1[7] = MAC1[10];
MAC1[8] = MAC1[12];
MAC1[9] = MAC1[13];
MAC1[10] = MAC1[15];
MAC1[11] = MAC1[16];
MAC1[12] = '\0'; //TERMINADOR DOS DADOS DA VARI?VEL
if((MAC!=NULL)) //VERIFICA SE O MAC EST? CORRETO (POSI??O DOS ':')
{
estado = TESTE_WIFI; //PR?XIMO ESTADO DO SWITCH CASE
} else //CASO O MAC ESTEJA INCORRETO
{
estado = READ_MAC; //RETORNA PARA O MESMO ESTADO
}
break;
case TESTE_WIFI:
__delay_cycles(1200000);
strcpy(string1,"testa1");
sendUART(string1);
flag = 0;
while (flag != 1) //LOOP ENQUANTO N?O RECEBE OS DADOS VIA UART
{
j = 500; // SW Delay
do j--;
while(j != 0);
}
recebe_wifi[3]='\0'; //TERMINADOR DOS DADOS DA VARI?VEL
if (strcmp(wifiok, recebe_wifi) == 0) //VERIFICA SE A RESPOSTA FOI POSITIVA (CONEX?O OK)
{
estado = TESTE_RSSI; //PR?XIMO ESTADO DO SWITCH CASE
}
else //CASO A CONEX?O N?O FOI POSITIVA
{
estado = TESTE_WIFI; //PR?XIMO ESTADO DO SWITCH CASE
}
break;
case TESTE_RSSI:
__delay_cycles(1200000);
strcpy(string1,"rssi ");
sendUART(string1);
flag = 0;
while (flag != 1) //LOOP ENQUANTO N?O RECEBE OS DADOS VIA UART
{
j = 500; // SW Delay
do j--;
while(j != 0);
}
for (i = 0; i < 2; i++) //M?TODO DE REALOCAMENTO DOS DADOS NUMA VARI?VEL
{
RSSI[i] = recebe_rssi[i+2]; //SALVA O RSSI NA VARI?VEL CORRETA
}
RSSI[3] = '\0'; //TERMINADOR DOS DADOS DA VARI?VEL
estado = TESTE_COLET;
break;
case TESTE_COLET:
__delay_cycles(1200000);
strcpy(string1, "conect");
sendUART(string1);
flag = 0;
while (flag != 1) //LOOP ENQUANTO N?O RECEBE OS DADOS VIA UART
{
j = 500; // SW Delay
do j--;
while(j != 0);
}
recebe_wifi2[3]='\0'; //TERMINADOR DOS DADOS DA VARI?VEL
if (strcmp(wifiok, recebe_wifi2) == 0) //VERIFICA SE A RESPOSTA FOI POSITIVA (CONEX?O OK)
{
estado = CONFERE_LOG; //PR?XIMO ESTADO DO SWITCH CASE
}
else //CASO A CONEX?O N?O FOI POSITIVA
{
estado = TESTE_COLET; //PR?XIMO ESTADO DO SWITCH CASE
}
break;
case CONFERE_LOG:
estado = SEND; //PR?XIMO ESTADO DO SWITCH CASE
break;
case SEND:
__delay_cycles(1300000);
strcpy(string1, "end3");
sendUART(string1);
__delay_cycles(1000000);
strcpy(string1, "Content-Length: 23\r\n");
sendUART(string1);
__delay_cycles(10000);
strcpy(string1, "User-Agent: STA+\r\n");
sendUART(string1);
__delay_cycles(10000);
strcpy(string1, "Manufacturer: Senfio\r\n");
sendUART(string1);
__delay_cycles(10000);
strcpy(string1, "Tipo-Evento: NOVO_EVENTO_ATUALIZACAO\r\n");
sendUART(string1);
__delay_cycles(10000);
strcpy(string1, "Fw-Version: ");
sendUART(string1);
sendUART(FW_VERSION);
strcpy(string1, "\r\n");
sendUART(string1);
__delay_cycles(10000);
strcpy(string1, "From: DC4F2211E20A\r\n");
sendUART(string1);
__delay_cycles(10000);
strcpy(string1, "Connection: close\r\n");
sendUART(string1);
__delay_cycles(10000);
strcpy(string1, "\r\n");
sendUART(string1);
__delay_cycles(10000);
strcpy(string1, "6DC4F2211E20A3161273608");
sendUART(string1);
__delay_cycles(10000);
strcpy(string1, "\r\n");
sendUART(string1);
estado = END; //PR?XIMO ESTADO DO SWITCH CASE
break;
case END:
j = 120; // SW Delay
do j--;
while(j != 0);
break;
default:
break;
}
}
}
void setup()
{
PM5CTL0 &= ~LOCKLPM5;
//clock config
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
CSCTL0 = CSKEY; //super secret password
CSCTL1 &= 0x0000; //set DCOCLK to 1 MHz
CSCTL2 |= 0x0030; //Tie SMCLK to DCOCLK
CSCTL3 &= 0x0000; //CLK divider set to /1
__enable_interrupt();
//UART A0 config
UCA0CTLW0 |= UCSWRST; //set reset
UCA0CTLW0 |= 0x0091; // 0000000010010000
UCA0BRW = 0x0006; //set baudrate of 9600
UCA0MCTLW = 0x0081; //000000001000
//Port config
P2DIR |= 0xFF; // All P2.x outputs
P2OUT &= 0x00; // All P2.x reset
P1DIR |= 0x01; // Set P1.0 to output direction
//UART A1 Config
UCA1CTLW0 |= UCSWRST; //set reset
UCA1CTLW0 |= 0x0081; // 0000000010010000
UCA1BRW = 0x0006; //set baudrate of 9600
UCA1MCTLW = 0x0081; //000000001000
//Port config
P2SEL0 |= 0x00; // P2.5 = TXD, P2.6=RXD
P2SEL1 |= 0x60; // P2.5 = TXD, P2.6=RXD
UCA1CTLW0 &= 0xFFFE; //clear reset
UCA1IE |= UCRXIE; //enable UART A1 interrupts (RX and TX)
UCA1IE |= UCTXIE;
UCA1IE |= UCTXCPTIE;
}
void sendUART(char string123[50])
{
volatile unsigned int j;
int strSize = 0;
strSize = strlen(string123);
i = 0;
while (i<strSize)
{
UCA1TXBUF = string123[i];
i++;
j = 200; // SW Delay
do j--;
while(j != 0);
}
}
void delayReceive()
{
volatile unsigned int j = 120; // SW Delay
do j--;
while(j != 0);
}
void receiveUART(void)
{
z = 0;
while(UCA1RXBUF != 'Z')
{
string2[z] = UCA1RXBUF;
z++;
delayReceive();
}
if(estado == READ_MAC)
{
strcpy(recebe_mac, string2);
flag = 1;
}
if(estado == TESTE_WIFI)
{
strcpy(recebe_wifi, string2);
flag = 1;
}
if(estado == TESTE_RSSI)
{
strcpy(recebe_rssi, string2);
flag = 1;
}
if(estado == TESTE_COLET)
{
strcpy(recebe_wifi2, string2);
flag = 1;
}
}
//interrupt vector
#pragma vector = USCI_A1_VECTOR
__interrupt void USCI_A1_ISR(void)
{
switch(__even_in_range(UCA1IV,18))
{
case 0x00: // Vector 0: No interrupts
break;
case 0x02: // Vector 2: UCRXIFG
receiveUART();
// sendUART(string2);
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
break;
case 0x04: // Vector 4: UCTXIFG
// P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
break;
default: break;
}
}
Hello,
I assume, there is no further activity on this. Thus I'll be closing this thread soon. In case you need further support on this, please let us know. In case you need support in a different case, please open a separate thread. many thanks in advance.
Best regards
Peter
**Attention** This is a public forum