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.

MSP432P4111: MSP432P4111

Part Number: MSP432P4111

Hi,

I am working in a custom board developed for msp432p4111 the controller was working fine, i tried to debug a sample code for uart protocol now i am getting an error "Error connecting to the target: Unknown devic"

i have attached my sample code

#include <msp432p4111.h>

#include <stdint.h>

int main()

{

    WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD;

    /******************* Clock Module ****************************************/

    CS->KEY  = 0x0000695A;

    CS->CTL0 = 0x00050000;

    CS->KEY  = 0x00000000;

    /******************** UART Module*****************************************/

    uart_a0();

}

int uart_a0(int Ua0_data)

{

     CS->KEY  = 0x0000695A;

     CS->CTL0 = 0x00030000;

     CS->KEY  = 0x00000000;

     P1->SEL0 = 0x03;                                             //GPIO set for UART

     EUSCI_A0->CTLW0 = 0x0001;                                    //UART reset

     EUSCI_A0->CTLW0 = 0x0021;                                    //SMClk selected

     EUSCI_A0->BRW   = 0x004E;

     EUSCI_A0->MCTLW = 0x0021;                                    //Setting for 9600 baud rate

     EUSCI_A0->CTLW0 = 0x0000;                                    //UART ready to transmit and receive

     /************************* Uart Transmit *****************************

     while(1)

     {

         EUSCI_A0->TXBUF = Ua0_data;

     }*/

     /*************************Loop Back ***********************************/

     while(1)

     {

         EUSCI_A0->STATW = 0x0080;

     }

}

Error connecting to the target: Unknown device

  • >    CS->CTL0 = 0x00050000;

    As near as I can tell this is setting CS_CTL0_DCORSEL_5 (there are perfectly good names for these) to run the CPU at 48MHz. But you're not setting the Flash wait states per Data Sheet (SLASEA0B) Sec 5.8, so the CPU is malfunctioning. [Ref also TRM (SLAU356I) Tables 10-14/15]

    At this point you probably need to do a Factory Reset [Ref Launchpad UG (SLAU747B) Sec 4] to recover. Then change your program to set the appropriate wait states. It's not quite clear to me why you set DCORSEL=5 then almost immediately set DCORSEL=3 (12MHz, which doesn't require extra wait states), . Or why you've commented the UART Tx code.

**Attention** This is a public forum