Hi
I am trying to implement the UART BSL on the MSP430F5239, I have read through many posts here and I have tried all the suggestions with no success. I have placed all my findings below regarding the BSL entry sequence. I had a previous issue on this MCU and need to know what I am doing wrong here. I am using a GSM module to invoke the BSL (DCD and CTS lines) and using the GSM main UART to communicate to the BSL UART (P1.1 and P1.2).
Even though the entry sequence is correct, the sample code (at the bottom) continues to run (the nRSTDCVIO is set high in the BSL entry sequence). Has anyone tested the BSL on the xxxF5239, on the xxxF5229 there is a BSLEN (PIN 55) line for the BSL. the last issue I had was resolved by copy and past from the F5229.h and 5229.cmd.
Below is the test sequence taken from the documentation and I also set the "use the BSL" tick box in the CCS compiler.
MCU: MSP430F5239 (RGC Package) KIT: MSP-TS430RGC64C PINOUT: PIN64 - DCD (GSM) PIN59 - CTS (GSM) BSLTX - RXD (GSM) (MCU - P1.1) BSLRX - TXD (GSM) (MCU - P1.2) FET-430: Disconnected, SBW JUMPERS removed PSU: External Bench PSU 3.3VDC GSM: 2.8VDC Logic Levels REFERENCE: SLAS897 | Page 23 #------------------------------------------------------------------------------ # HARDWARE BSL START SEQUENCE # +-------------------------------------------------------------+ # | _________ | # | RST(64): ________________| | # | ___ ___ | # | Test(59): _____| 1 |____| 1 |_______ | # | ~6mS ~12mS | # +-------------------------------------------------------------+ # # DCD - nRSTDVCC (PIN 64) # CTS - TEST (PIN 59) # NOTE: Software latency for PIN switching to print on screen ~2-4mS #------------------------------------------------------------------------------ TESTED PIN SWITCHING: YES [2015-03-17_19:15:45:773] DCD:0 CTS:0 RI:0 [2015-03-17_19:15:46:098] DCD:0 CTS:1 RI:0 [2015-03-17_19:15:46:108] DCD:0 CTS:0 RI:0 [2015-03-17_19:15:46:118] DCD:0 CTS:1 RI:0 [2015-03-17_19:15:46:123] DCD:1 CTS:1 RI:0 [2015-03-17_19:15:46:133] DCD:1 CTS:0 RI:0 #------------------------------------------------------------------------------ # BSL INSTRUCTION (5xx, 6xx devices) # # # BSL PACKET FORMAT: # +-------+----+-----+-------------+-----+----+ # | HDR | NL | NH | D1 ... DN | CL | CH | # +-------+----+-----+-------------+-----+----+ # / \ # / \ # D1...DN PACKET FORMAT: # +-------+----+----+----+---------------+ # | CMD | AL | AM | AH | D1... DN | # +-------+----+----+----+---------------+ # # BSL PACKET FORMAT: # HDR: Sync Character for BSL # NL: Number Of BYTES in BSL Core Data Packet (Low BYTE) # NH: Number Of BYTES in BSL Core Data Packet (High BYTE) # CL: Check Sum Low BYTE # CH: Check Sum High BYTE # # D1...DN PACKET FORMAT: # CMD: Instruction to Execute # AL: BLOCK ADDRESS (Low BYTE) # AM: BLOCK ADDRESS (Middle BYTE) # AH: BLOCK ADDRESS (High BYTE) # D1.DN: BSL Data #------------------------------------------------------------------------------ REFERENCE: Document: SLAU319i | Section: 3.7.4 | Page 30 SEND TO MCU: 80 02 00 52 02 90 55 EXPECT: 00 ------------------------------------------------[0D][0A] 19:15:39:938 ---> BSL: START[0D][0A] ---> BSL: SET LED - BLINK (1ON | 1OFF)[0D][0A] ------------------------------------------------[0D][0A] 19:15:40:038 ---> CFG: RESET DCD LINE[0D][0A] 19:15:40:128 ---> CFG: RESET CTS LINE[0D][0A] 19:15:45:358 ---> CFG: UART 9600 8E1[0D][0A] 19:15:45:918 ---> BSL: ENTRY SEQUENCE[0D][0A] 19:15:46:538 ---> BSL: 500mS TIMEOUT[0D][0A] 19:15:47:008 ---> BSL: SET MCU BAUD[0D][0A] 19:15:50:207 ---> BSL: MCU REPLY[0D][0A] [0A] 19:15:52:357 ---> BSL: NO RESPONSE[0D][0A] 19:15:54:267 ---> BSL: EXIT[0D][0A] #------------------------------------------------------------------------------ # SOFTWARE RUNNING ON MCU #---------------------------------------------------------------------------- Basic program running, LED is only for Indication /*------------------------------------------------------------------------------ Project Description -------------------------------------------------------------------------------- * Basic Routine To test Boot load From Cellular Module * TX -> "Test Program Running" on UCA1 * Toggles P6.0 every 1 Second * ECHO back any DATA sent to UCA1 -------------------------------------------------------------------------------- Standard Defined Libraries ------------------------------------------------------------------------------*/ #include <msp430.h> #include <string.h> /*------------------------------------------------------------------------------ Function Prototypes ------------------------------------------------------------------------------*/ void TxData (char *gdata); /*------------------------------------------------------------------------------ MAIN ROUTINE * Disable WDT * Set P6.0 as Output * Initialises UCA1 as UART (115 200 @ 8N1) * Echo On UART active ------------------------------------------------------------------------------*/ void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT // SFRRPCR &= ~SYSNMI; // Configure as RST // SYSCTL &= ~SYSJTAGPIN; // Disable Dedicated JTAG PINS // SYSBSLC &= ~SYSBSLPE; // Enable BSL Operation P4SEL |= BIT4+BIT5; // P4.4,5 = USCI_A1 TXD/RXD UCA1CTL1 |= UCSWRST; // **Put state machine in reset** UCA1CTL1 |= UCSSEL_2; // SMCLK UCA1BR0 = 9; // 1MHz 115200 (see User's Guide) UCA1BR1 = 0; // 1MHz 115200 UCA1MCTL |= UCBRS_1 + UCBRF_0; // Modulation UCBRSx=1, UCBRFx=0 UCA1CTL1 &= ~UCSWRST; // **Initialize USCI state machine** UCA1IE |= UCRXIE; // Enable USCI_A0 RX interrupt P6SEL &= ~BIT0; // P6.0 set to IO P6DIR |= BIT0; // Set P6.0 as Output __bis_SR_register(GIE); // Interrupts enabled // Main Loop while (1) { TxData ("Test Program Running\r");// Send DATA to UCA1 P6OUT ^= BIT0; // Toggle P6.0 __delay_cycles(1000000); // 1MHz - 1s } } /*------------------------------------------------------------------------------ UCA1 INTERRUPT VECTOR ------------------------------------------------------------------------------*/ #pragma vector=USCI_A1_VECTOR __interrupt void USCI_A1_ISR(void) { switch(__even_in_range(UCA1IV,4)) { case 0:break; // Vector 0 - no interrupt case 2: // Vector 2 - RXIFG while (!(UCA1IFG&UCTXIFG)); // USCI_A0 TX buffer ready? UCA1TXBUF = UCA1RXBUF; // TX -> RXed character break; case 4:break; // Vector 4 - TXIFG default: break; } } /*------------------------------------------------------------------------------ UART Send * Checks Data length in routine * RETURN: NONE * PASS: STRING (CHAR) * CALL: NONE ------------------------------------------------------------------------------*/ void TxData (char *gdata) { unsigned int i; // Counter for "FOR" Loop unsigned int size = strlen(gdata); // Get length of data to be sent for (i = 0; i < size; i++) { while (!(UCTXIFG & UCA1IFG)); // Wait UART to finish before next send UCA1TXBUF = gdata[i]; // Send Out On UART } } /*------------------------------------------------------------------------------ END OF MODULE ------------------------------------------------------------------------------*/