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.
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 ------------------------------------------------------------------------------*/
Ok, so after a few tests, I have managed to get the BSL entry sequence working.
I connected the RST line to the NMI.nRST(PIN 56) and the TEST to NC (PIN 55), applied the BSL sequence as per the SLAA319 document and it seems to have entered the BSL mode. Refer to Page 8 in SLAS897 for the PIN out diagram.
When I send the "check BSL Version Command" = 80 01 00 19 E7 7F (HEX format), I receive the 0x00 which according to SLAA319 is correct and that the unit has received the command and that the CRC is OK. But there is no response from the MCU regarding the BSL version.
Any Assistance will be appreciated.
This is my DEBUG log, and after i send the PASSWORD, I receive ACK (0x00 in this case), I then send the command to check the BSL version, I once again get the ACK (0x00 in this case) and nothing further, even after waiting 10 seconds for a response
------------------------------------------------
---> BSL: START
---> BSL: SET LED - BLINK (1ON | 1OFF)
------------------------------------------------
---> SYS: TIME STAMP
---> "15/03/18,20:28"
---> CFG: FLOW CONTROL OFF
---> CFG: RESET DCD LINE
---> CFG: RESET CTS LINE
---> CFG: UART 9600 8E1
---> BSL: 500mS TIMEOUT
---> BSL: ENTRY SEQUENCE
---> BSL: 500mS TIMEOUT
---> BSL: RX PASSWORD
---> CMR: REPLY FROM MCU
0
---> CMR: OK
---> BSL: SYNC SUCCESS
---> BSL: BSL VERSION
---> ADV: START 5xx:6xx
---> ADV: NO ADDRESS
---> ADV: NO DATA
---> CRC: RUN CRC
---> CRC: DATA IS EVEN
---> CRC: LOW BYTE
231
(HEX = 0xE7)
---> CRC: HIGH BYTE
127
(HEX = 0x7F)
---> ADV: INSTRUCTION
'\200', '\001', '\000', '\031', '\347', '\177'
(HEX Values = 0x80 0x01 0x00 0x19 0xE7 0x7F)
---> CMR: REPLY FROM MCU
0
---> CMR: OK
20:28:47:106 ---> ADV: WAITING FOR MCU
20:28:47:419 ---> ADV: WAITING FOR MCU
20:28:47:668 ---> ADV: WAITING FOR MCU
20:28:47:952 ---> ADV: WAITING FOR MCU
20:28:48:230 ---> ADV: WAITING FOR MCU
20:28:48:480 ---> ADV: WAITING FOR MCU
20:28:48:791 ---> ADV: WAITING FOR MCU
20:28:49:039 ---> ADV: WAITING FOR MCU
20:28:49:354 ---> ADV: WAITING FOR MCU
20:28:49:539 ---> ADV: WAITING FOR MCU
20:28:49:828 ---> ADV: WAITING FOR MCU
20:28:50:136 ---> ADV: WAITING FOR MCU
20:28:50:287 ---> ADV: WAITING FOR MCU
20:28:50:599 ---> ADV: WAITING FOR MCU
20:28:50:786 ---> ADV: WAITING FOR MCU
20:28:51:068 ---> ADV: WAITING FOR MCU
20:28:51:380 ---> ADV: WAITING FOR MCU
20:28:51:574 ---> ADV: WAITING FOR MCU
20:28:51:883 ---> ADV: WAITING FOR MCU
20:28:52:069 ---> ADV: WAITING FOR MCU
20:28:52:347 ---> ADV: WAITING FOR MCU
20:28:52:534 ---> ADV: WAITING FOR MCU
20:28:52:846 ---> ADV: WAITING FOR MCU
20:28:53:034 ---> ADV: WAITING FOR MCU
20:28:53:314 ---> ADV: WAITING FOR MCU
20:28:53:534 ---> ADV: WAITING FOR MCU
20:28:53:813 ---> ADV: WAITING FOR MCU
20:28:54:034 ---> ADV: WAITING FOR MCU
20:28:54:281 ---> ADV: WAITING FOR MCU
20:28:54:503 ---> ADV: WAITING FOR MCU
20:28:54:782 ---> ADV: WAITING FOR MCU
20:28:55:031 ---> ADV: WAITING FOR MCU
20:28:55:253 ---> ADV: WAITING FOR MCU
20:28:55:561 ---> ADV: WAITING FOR MCU
20:28:55:756 ---> ADV: WAITING FOR MCU
20:28:56:030 ---> ADV: WAITING FOR MCU
20:28:56:318 ---> ADV: WAITING FOR MCU
20:28:56:531 ---> ADV: WAITING FOR MCU
20:28:56:817 ---> ADV: WAITING FOR MCU
20:28:57:004 ---> ADV: WAITING FOR MCU
20:28:57:308 ---> ADV: WAITING FOR MCU
20:28:57:503 ---> ADV: WAITING FOR MCU
20:28:57:777 ---> ADV: WAITING FOR MCU
20:28:57:997 ---> ADV: WAITING FOR MCU
20:28:58:277 ---> ADV: WAITING FOR MCU
20:28:58:462 ---> ADV: WAITING FOR MCU
20:28:58:752 ---> ADV: WAITING FOR MCU
20:28:58:935 ---> ADV: WAITING FOR MCU
---> ADV: MCU NO REPLY[0D][0A]
---> BSL: NO VER FOUND[0D][0A]
---> BSL: VER UNKNOWN[0D][0A]
------------------------------------------------
---> SYS: TIME STAMP
---> "15/03/18,20:28"
---> BSL: COMPLETE
------------------------------------------------
---> RSM: START
---> RSM: BSL & GSM SWITCH OFF
---> RSM: UART 115 200 8N1
---> BSL: SET LED - BLINK (1ON | 4OFF)
**Attention** This is a public forum