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.

MSP430FR2355: MSP430FR2355 , BSL , Does not erase or load new code.

Part Number: MSP430FR2355
Other Parts Discussed in Thread: MSP-EXP430FR2355, MSP-FET

Using the code below I load, run in debug mode in CCS-8. I run the scripter. I get numerous NACK returns and upon power cycle the MSP430FR2355 runs the code previously loaded, not the new code loaded thru the BSL scripter.

Code:

#include <msp430.h>


int main(void)
{
//**************************************************************************************
// Clock Configuration
//**************************************************************************************

// Stop Watch Dog Timer
WDTCTL = WDTPW | WDTHOLD;

// Configure one FRAM wait state as required by the device data sheet for MCLK
// operation beyond 8MHz _before_ configuring the clock system.
FRCTL0 = FRCTLPW | NWAITS_1;

__bis_SR_register(SCG0); // disable FLL

CSCTL1 = DCORSEL_3;// DCO Range = 8MHz

CSCTL2 = FLLD_0 + 243; // DCOCLKDIV = 8MHz

__delay_cycles(3);

__bic_SR_register(SCG0); // enable FLL

// Disable the GPIO power-on default high-impedance mode to activate
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;

__disable_interrupt();
((void (*)() )0x1000)();

}

  • I guess I missed that since it said optional and obviously it isn't. This might be the complete source of my problem. It isn't common to have 8 data bits plus parity and one stop bit, but that appears to be what is being transmitted. (I tried it, it didn't work, but I haven't had a chance today to delve into it.) Hat-tip to George for finding this.
  • Just to clarify, Don, BSL-Scripter depends upon the hardware interface to generate both the hardware invocation pattern on /Reset and Test and the 8/E/1 format the chip is expecting.    (By default, Scripter uses 8/N/1, but will switch to 8/E/1 if the PARITY switch is used on the MODE line.)  So far as I know, the interfaces which do all that are the MSP-FET, the Rocket, and the kludge described in SLAA535a.pdf (which I have tested, and it works).

    If you aren't using one of those, then you can still use BSL scripter, but:

    1.  If you want to use hardare invocation, you'll have to come up with some other way to generate the pattern.  But if you invoke via software from your firmware that's not an issue.

    2.  You'll have to use the PARITY switch.

    I thought back in the beginning you were trying to invoke BSL from your firmware, but may have you confused with someone else.  Anyway, no matter how you invoke, the PARITY switch is something you'll have to consider if you aren't using an approved hardware interface.

    And I guess I should also say that you can use a generic USB-to-serial adapter as the hardware interface, but will have to jump through some hoops, as described in my Github repo on this subject:

    https://github.com/gbhug5a/CP2102-with-BSL-Scripter-for-MSP430

  • Hey Don,

    Wanted to check in and see if there were any more issues/questions? If not I will close out the post.

    Thanks,

    Mitch
  • I've turned this over to Wes to figure out why our configuration acts differently.  I'm suspecting it is that parity thing.  Please leave it open a couple more days in case he needs something.  Thanks!

  • I successfully ran the BSL with the script and our hardware system (USB (Virtual COM Port) to RS232 Converter to CMOS 3.3V Logic).

    MODE FRXX UART 9600 COM188 PARITY

    MASS_ERASE

    DELAY 200

    RX_PASSWORD pass32_default.txt

    RX_DATA_BLOCK your_program.txt

    However, when I change the 16MHz system clock to 8MHz before invoking the BSL in the application code it does not work. I am still working on this issue.

    Also, I should note that when I use the UART (virtual COM port) on the MSP430FR2355 Launchpad it does not seem to accept parity changes from a Terminal Program like (HyperTerminal, Brays or TeraTerm), so it does not work on the Launchpad with the USB to UART converter on-board. This is not an issue but was not expected.

  • I was able to invoke the BSL from our application code with the code snippet below. I set the clock to 1MHz without changing the UART settings and the BSL works perfectly. I found that it worked more reliably with a delay after the FLL is enabled.


    // Disable all interrupts
    __disable_interrupt();

    // Reconfigure Clock to 1MHz (default)
    __bis_SR_register(SCG0); // disable FLL
    CSCTL1 = DCORSEL_0;// DCO Range = 1MHz
    CSCTL2 = FLLD_0 + 30; // DCOCLKDIV = 1MHz
    __delay_cycles(3);
    __bic_SR_register(SCG0); // enable FLL

    // Delay after setting clock to invoke BSL
    __delay_cycles(3);

    // Invoke BSL
    ((void (*)() )0x1000)();


    So, in summary the fixes required were primarily setting the DCO to 1MHz before invoking the BSL and using the PARITY parameter word in the scripter file.
  • Wesley, can you clarify what you used as the hardware interface? It sounded like you used a USB-to-serial adapter, not MSP-FET. Is that right? Which one?

    Also, it may be that none of the Launchpads use anything but 8/N/1. That was true of my old G2 Launchpad, and it appears to be for yours as well. If it's true of all of them, then you can do JTAG flashing with a Launchpad, but not BSL.

    Congratulations on getting it working.
  • Excellent! I'm very happy you were able to get it working! Also thank you, George, for helping out with this issue as well.

    One final note I'd like to make - you are going to want to double check that any peripherals that the FR2355 BSL uses (clock system, eUSCI_A, and TIMER_B) are cleared out before you invoke the BSL. Everything seems to be working, but I wanted to mention this in case your application code touches any of these peripherals before a BSL invocation is attempted. Please see below:

    This means you are going to want to make sure the following conditions are met before SW BSL invocation:

    1. The clock is at or below 8MHz (which you are doing)

    2. eUSCI_A registers are cleared

    3. TIMER_B registers are cleared 

    Since you "set the clock to 1MHz without changing the UART settings..." conditions 1 is met. Please double check that the eUSCI_A registers and TIMER_B registers are cleared. 

    UART must also be configured at 9600 baud before BSL invocation. You are already doing this, but I wanted to highlight this in my post for completeness:

    Thanks and congrats!

    -Mitch

1 2

**Attention** This is a public forum