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.

MSP-FET for MSP432 BSL

Other Parts Discussed in Thread: MSP-FET, MSP-GANG

i used MSP-FET to download program to MSP432 through UART BSL(using bsl scripter software on PC),and here is a strange problem:

      at the first time when the MSP432 is blank, i can downed program fuctionally, and i configured the BSL params using flashmailbox at the same time.

then i erased main flash as well as flashmailbox,and i try to down program to MSP432 through BSL using MSP-FET,but i failed to do that. why this happened?

    i have read the BSL space on the MSP432, and the BSL code is still inside.

normally it can downed program to msp432 using MSP-FET through bsl interface whenever the msp432 is blank.

why this happened ?

  • Hi Kissn,

    When power-on, MSP432 will check if a valid program is on the flash memory. If not exists then the BSL will be invoked to run. If exists, then the program will be executed. So, you can download program to MSP432 by BSL only for the first run.

    If you want to download program by debugger, what you need is XDS100v2 or XDS100v3, not MSP-FET. This is because MSP432 is actually ARMv7M based architecture which supports JTAG standard. MSP-FET is not standard JTAG.
  • Hi rcfocus
    thank for you reply,but i do not think you have aware of what i mean.
    firstly, in combination with BSL scripter , MSP-FET can be used for BSL tool to down program to MSP430 or MSP432, and i have realized it both on MSP432 and MSP430.
    secondly,when the main flash of the MSP432 has been erased, the BSL interface on MSP432 can be used for program download. and i have done it successfully.
    but the problem is when i wrote the flashmailbox to configure BSL params, even i have erased MSP432 mian flash or factory reset the MSP432 , i can no longer use BSL interface on MSP432 to down program.
  • Hi Kissn,

    Sorry for misunderstanding your issue description.

  • Hi Kissn,

    "but the problem is when i wrote the flashmailbox to configure BSL params, even i have erased MSP432 mian flash or factory reset the MSP432 , i can no longer use BSL interface on MSP432 to down program."

    Can you elaborate about what you have in the flashmailbox currently? Can you read this out and share? The reason I'm asking is that, even if you have the BSL still in the flash, if the flash mailbox has the BSL set to be disabled for example, or set for some different sort of invocation etc, I could see you having problems. Specifically I'm looking for what is in the "BSL_PARAMS" area of the boot override flash mailbox, as seen in TAble 4-1 of www.ti.com/.../slau356 user's guide, after you did your flash mailbox manipulation that you mentioned?

    Regards,
    Katie
  • hi Katie Pier

    (1)what i have wrote to BSL_PARAMS eara is just as follows:

    (2) after the BSL_PARAMS has been wrote,i reboot the MSP432,and  you can see that

    the address 0x002001f4's value  is 0x00000ACE,it indicates that BSL_COMAND  has   excuted correctly.

    (3) after the step above,i erased the flashmailbox. at last i erase the whole main flash using MSP-GANG and try to download program to MSP432 using BSL interface, and i failed to do that just as describled yesterday.

    bsl_config.zip

  • Hi Kissn,

    Could you please confirm that the BSL section was not erased, from 0x202000 to 0x203FFF?? Also, the factory reset will not restore the boot configurations therefore please use the BSL example code in the SLAA659 App Report to restore these boot configurations.

    Ok, could you please try the following:

    1. Confirm that the BSL section was not erased. If it was erased, you will need to restore the BSL. Please download the BSL from here

    2. If the BSL was not erase, please run the bsl config example code from the SLAA659 (it should restore the default boot configurations).

    3. Run factory reset, this should erase the flash - bsl default entry.

    4. Try to connect to the bsl using the MSP FET

     Best regards,

       David

  • hi,DavidL

    (1)i have done what you said in order, after the 3th step according to your advice,and i read the msp432 via MSP-GANG,

    read_from_msp432.txt

    (2) after that i failed to conect to bsl using msp-fet too!

    so i am superised that :

    if i don't configure bsl through flashmailbox on the msp432,i can use msp-fet to conect to msp432 whenevr  the main flash is blank. if i do bsl configuration using  flashmailbox, i can not   use msp-fet to download program to msp432 via bsl.

    (3)  would you try what you said on msp432 launchpad and give me a feedback.

    this question has confused me so long. could i have your mail address to solve this issue as soon as possible?

    my mail address is     kissn-liu@serialsuccesschina.com

    best regards

    Kissn Liu

  • Hi Kissn Liu,

     Sorry I forgot to mention that the bsl config example code configures P1.1 as HW entry.

    /* BSL Parameter
     * Use HW Invoke on Port 1, Pin 1, on HIGH
     * Use UART
     */

    Please use this file msp432_flashmailbox.c instead and let me know if were able to communicate with the BSL when the flash is erased.

       Regards,

        David

  • Hi,David
    Thanks a lot, i can conect to bsl via MSP-FET according to your advice.

    best regards
    Kissn
  • Hi David,

    I looked at the C file you posted.  It looks like you're using Port0, Pin5 as the BSL invocation.  Is that correct?

    So my question is: unlike the FR5969 (and other MSP's), if I get a blank MSP432P4xx from production, never been programmed, I cannot use the BSL H/W Invocation since its all F's??  If so, why is the appNote SLAU622 on page 16, Figure 6 showing P1.0?

    Also, second question. I've changed the msp432_flashmailbox.c file to add the Reserved bits of 0x1f to the  invoke parameters and noticed under Code Composer (CC), they show up as zeros.  When I'm using IAR EW 7.60.1 version, I cannot see the data at all.  It's all F's 

    Could you expand on why IAR cannot show the BOM and CC can and why CC cannot show the Reserved bits as F's

    One more thing, with the file you posted, I still cannot get the BSL to talk to the BSL_Scripter.exe version 3.1.0.0.  I assume I should be using P0.5, pulling it high while holding the RSTn switch on the Launchpad dev board?

    Thanks,

    -Jim


    Additional:

    It appears I can get the CC (version 6.1.1.00022) to show the correct Flash Mailbox data at address 0x0020201E8 by powering down the Lauchpad.  But just by changing the data of the BSL_PARAMS, cleaning, rebuilding and downloading, does not show the updated data.

    That said, I'm following the code example of AppNote SLAA659 and notice when I pass in COMMAND_BSL_CONFIG (0x00020000), the code (result = BOOT_OVERIDE_OPERATION_FAIL) returns failure:

            if(flashMailboxCommand & COMMAND_BSL_CONFIG)
            {
                if(*((uint32_t*)(ACK_BSL_CONFIG)) != 0xACE)
                {
                    result = BOOT_OVERRIDE_OPERATION_FAIL;
                }
            }
    

    Here is a copy of my Boot Override Mailbox (BOM):

    Do you see any errors as to why I wouldn't get an 0xACE (ack)?  As a matter of fact, I do not even know how the ACK (0xACE) even appears in the BOM address offset of 0x1F4.

    FlashMailBox

    0115ACF6      00020000      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    00000000        00202000      7C48DF50      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      FFFFFFFF

    FFFFFFFF      FFFFFFFF      FFFFFFFF      0011E11D

    This is what I assume: 1.) The H/W invocation of getting into the BSL from toggling RST/Port_X.X is not available (like on the other MSP430 micro's) because the BOM comes from the Factory erased and needs to be JTAG'ed with code to put in (stating the BSL_PARAMS to act upon).

    I still cannot BSL the via P1.5 on the Launchpad (0x7C48DF50). I also cannot see the data at address 0x00200000 using IAR.  I can see the data at said address with the same compiled code using Code Composer.  Maybe there is a option in IAR I'm missing (and yes, I've read the SLAU574C appNote).

    Any ideas or help appreciated.

    Thanks,

    -Jim

  • Hi Jim,

     Let me try to address your multiple questions.

    Jim Patten said:
    I looked at the C file you posted.  It looks like you're using Port0, Pin5 as the BSL invocation.  Is that correct?

    I think you meant Port1 Pin5 and yes that is correct.

    Jim Patten said:
    So my question is: unlike the FR5969 (and other MSP's), if I get a blank MSP432P4xx from production, never been programmed, I cannot use the BSL H/W Invocation since its all F's??  If so, why is the appNote SLAU622 on page 16, Figure 6 showing P1.0?

    If you get a blank MSP432P4xx, the BSL will be called by the ROM bootcode (memory is erased). The bootcode reads out addresses 0x0 and 0x4 from the application flash memory and compares it with 0xFFFFFFFF to determine whether or not the application memory is erased. So in this case, with or without HW entry the BSL will be called. In regards to SLAU622 showing P1.0, it is just a HW entry example when P1.0 is configured AND the application memory is NOT erased.

    Jim Patten said:
    One more thing, with the file you posted, I still cannot get the BSL to talk to the BSL_Scripter.exe version 3.1.0.0.  I assume I should be using P0.5, pulling it high while holding the RSTn switch on the Launchpad dev board?

    Are using the Launchpad and the UART Backchannel? In my case I have a jumper wire connected from P1.5 to 3.3V and then I press/release the reset button. After that I run the bsl scripter like this (please make sure to add the PARITY option on the mode, needed if you are using the LP BackChannel):

    D:\MSPBSL_Scripter_win\BSL_Scripter_Windows\ScriptExample\P4xx_uart>..\..\bsl-scripter-windows.exe script_P4xx_uart_ver.txt
    ---------------------------------------------------------
    BSL Scripter 3.1.0.0
    PC software for BSL programming
    2016-Jun-03 12:21:16
    ---------------------------------------------------------
    Input file script is : D:/MSPBSL_Scripter_win/BSL_Scripter_Windows/ScriptExample
    /P4xx_uart/script_P4xx_uart_ver.txt
    //
    //Script example MSP432 UART BSL
    //Software : BSL Scripter 3.1.0.0
    //Device : MSP432P401R
    //Comm Bridge: XDS110 - MSP432LP BackChannelUART
    //   for this setting, the parity need to be
    //   set from Scripter side
    //   When MSP-BSL Rocket is used, parity will be
    //   generated by the Rocket
    //
    //Download blink application to
    //MSP432 device through UART BSL
    //
    //LOG
    MODE P4xx UART 9600 COM44 PARITY
    Initialization of BSL P432 succeed...
    RX_PASSWORD_32 pass256_wrong.txt
            Read Txt File  : D:/MSPBSL_Scripter_win/BSL_Scripter_Windows/ScriptExample/P4xx_uart/pass256_wrong.txt
            Password is incorrect.
    RX_PASSWORD_32 pass256_default.txt
            Read Txt File  : D:/MSPBSL_Scripter_win/BSL_Scripter_Windows/ScriptExample/P4xx_uart/pass256_default.txt
            Password is correct.
    MASS_ERASE
            Mass erase done.
    RX_DATA_BLOCK_32 BlinkLED_MSP432P401R.txt
            Read Txt File  : D:/MSPBSL_Scripter_win/BSL_Scripter_Windows/ScriptExample/P4xx_uart/BlinkLED_MSP432P401R.txt
            Time elapsed of writing 4391 bytes : 5.421 seconds
            Speed of writing data :0.791(kB/s)
            Data received by BSL.
    TX_BSL_VERSION_32
            BSL Version is : BSL_Vendor[e01],CI[200],API[300],PI[201],Build_ID[300]
    REBOOT_RESET
    
    D:\MSPBSL_Scripter_win\BSL_Scripter_Windows\ScriptExample\P4xx_uart>

    Jim Patten said:
    That said, I'm following the code example of AppNote SLAA659 and notice when I pass in COMMAND_BSL_CONFIG (0x00020000), the code (result = BOOT_OVERIDE_OPERATION_FAIL) returns failure:

    The reason is because the ROM boot code is not being called, so you will need a different class of reset (POR/Reboot - please take a look at the RSTCTL chapter in the Technical Reference Manual). So please change your code to:

    #include <msp.h>
    #include "flashmailbox.h"
    #include "driverlib.h"
    
    volatile bool forceReboot = false;
    
    int main(void)
    {
        volatile uint32_t i;
        WDTCTL = WDTPW | WDTHOLD;               // Stop watchdog timer
        P1DIR |= BIT0;
        if(CheckAndEraseFlashMailbox(COMMAND_BSL_CONFIG) !=
           BOOT_OVERRIDE_AND_MAILBOX_ERASE_OPERATIONS_SUCCESS)
        {
            while(1)
            {
                for(i = 0; i < 10000; i++);
    
                P1OUT ^= BIT0;
    
                if (forceReboot)
                {
                	MAP_SysCtl_rebootDevice();
                }
            }
        }
        else
        {
            P1OUT |= BIT0;
        }
    
        while(1);
    }

    "MAP_SysCtl_rebootDevice" should perform a reboot and the ROM boot code will be called.

    Jim Patten said:
    This is what I assume: 1.) The H/W invocation of getting into the BSL from toggling RST/Port_X.X is not available (like on the other MSP430 micro's) because the BOM comes from the Factory erased and needs to be JTAG'ed with code to put in (stating the BSL_PARAMS to act upon).

    Yes this is correct, but by default if the memory is erased, the BSL will get called.

    Jim Patten said:
    I still cannot BSL the via P1.5 on the Launchpad (0x7C48DF50). 

    1. Please make sure that you are using the PARITY on the MODE

    2. Try again after you erased the application flash

    3. Confirm that the BSL has not been erased, read location 0x00202000

    4. Confirm that your Mailbox has the correct start address and it also enables the BSL

    /*-------BSL Configuration Group-------------------------*/
    
        /* BSL Enable
         * 0xFFFFFFFF: Disable
         * 0x00000000: Enable */
    //    0xFFFFFFFF,
        0x00000000,
    
        /* BSL Starting address, default pointing to TI BSL at 0x00202000 */
    //    0xFFFFFFFF,
    	0x00202000,
    
        /* BSL Parameter
         * Use HW Invoke on Port 1, Pin 5, on HIGH
         * Use UART
         */
        BSL_CONFIG_HW_INVOKE_PORT1 | BSL_CONFIG_HW_INVOKE_PIN5 |
        BSL_CONFIG_HW_INVOKE | BSL_CONFIG_HW_INVOKE_PIN_HIGH |
        BSL_CONFIG_INTERFACE_UART,
    

    Jim Patten said:
    I also cannot see the data at address 0x00200000 using IAR

    Please add the compiler directives __root const (in msp432_flashmailbox.c)

    #elif defined (__ICCARM__) /* IAR Compiler */
    __root const uint32_t FlashMailBox [] @ 0x00200000 =
    

    Hopefully this helps.

      David

  • David,
    A big thank you for getting me started.

    BSL Questions:
    There are several questions I have regarding the BSL, Flash Boot Override Mailbox (BOM), and SYSCTL registers.

    Basically, I want to, just like on the Fram FR5969 micro, blow the JTAG fuse and not allow JTAG access. I want to keep the device (and code) secure. If one wants in, they’d have to erase the flash memory. That said:

    1.) If I want to do a mass erase to a MSP432 and I do not know what pins are set up in the BOM, how do I accomplish this? On the FR5969 micro, there are dedicated pins for the BSL so how does the MSP432 do this? It seems like I’d need to erase it via the JTAG.
    2.) The scripter password (default) in the example program contains 256-bytes of FF’s. It appears the PW resides at address 0x0. But isn’t that where the code starts? So if I know the BSL pins and I toggle them properly, I give the PW, say… to retrieve the version, the PW is al F’s, but the code is non-F’s. I believe on the FR5969 micro, the PW was the Interrupt Vector Table.
    3.) Is the BOM all F’s in the “out of the box” program that comes stock in the Launchpad? If I get a brand new Launchpad, can I access the BSL on it or do I have to erase it first?

    There are many questions in the background when it comes to the BSL. I’ll ask them when I get a better understanding.

    Also, what would cause the Error Header incorrect messages from the BSL_Scripter program:
    ---------------------------------------------------------
    BSL Scripter 3.1.0.0
    PC software for BSL programming
    2016-Jun-06 09:12:44
    ---------------------------------------------------------
    Input file script is : C:/Users/patten/Documents/ArmProjects/BSL/BSL_Scripter_Windows/ScriptExample/P4xx_uart/script_p4.txt
    MODE P4xx UART 9600 COM16 PARITY
    RX_PASSWORD_32 pass256_wrong.txt
    Read Txt File : C:/Users/patten/Documents/ArmProjects/BSL/BSL_Scripter_Windows/ScriptExample/P4xx_uart/pass256_wrong.txt
    Error Header incorrect.
    RX_PASSWORD_32 pass256_default.txt
    Read Txt File : C:/Users/patten/Documents/ArmProjects/BSL/BSL_Scripter_Windows/ScriptExample/P4xx_uart/pass256_default.txt
    Error Header incorrect.
    MASS_ERASE
    Error Header incorrect.
    TX_BSL_VERSION_32
    Error Header incorrect.
    REBOOT_RESET



    Best regards,
    -Jim
  • Hi David,

    You gave me advice on how to see the ACK (0xACE) from the sample program on using the Boot Override Mailbox.  I still cannot get the Ack even with putting in the MAP_SysCtl_rebootDevice() routine as explained in the above post.

    I never get the ack and the code stops at __exit: in the Disassembly window.  Any ideas as to why

    This is my code from main():

    volatile bool forceReboot = false;
    
    
    int main(void)
    {
        volatile uint32_t i;
        WDTCTL = WDTPW | WDTHOLD;               // Stop watchdog timer
        P1DIR |= BIT0;
                    
        if(CheckAndEraseFlashMailbox(COMMAND_BSL_CONFIG) != BOOT_OVERRIDE_AND_MAILBOX_ERASE_OPERATIONS_SUCCESS)
        {
            while(1)
            {
                for(i = 0; i < 10000; i++);
    
                P1OUT ^= BIT0;
    
                if (!forceReboot)
                {
                    forceReboot = 1;
                    MAP_SysCtl_rebootDevice();
                }
            }
        }
        else
        {
            P1OUT |= BIT0;
        }
    
        while(1)
    
        return(0);
    }
    

    Code never returns ACK:

    uint32_t CheckAndEraseFlashMailbox(uint32_t flashMailboxCommand)
    {
        uint32_t result = BOOT_OVERRIDE_AND_MAILBOX_ERASE_OPERATIONS_SUCCESS;
        uint32_t eraseCycles = 0, eraseSuccess;
    
        /* Only check for commands different from COMMAND_NONE */
        if(flashMailboxCommand != COMMAND_NONE)
        {
            if(flashMailboxCommand & COMMAND_FACTORY_RESET)
            {
                if(*((uint32_t*)(ACK_FACTORY_RESET)) != 0xACE)
                {
                    result = BOOT_OVERRIDE_OPERATION_FAIL;
                }
            }
            //NOTE: Code never returns ACK!!!
            if(flashMailboxCommand & COMMAND_BSL_CONFIG)
            {
                if(*((uint32_t*)(ACK_BSL_CONFIG)) != 0xACE)
                {
                    result = BOOT_OVERRIDE_OPERATION_FAIL;
                }
                else
                {
                    __NOP();
                }
            }
    

  • As a follow-on question. I'm looking at Section 4.7.5.2.2 Boot Override Commands and Acknowledgements in the User's Guide SLAU356A.  There's an example I've pasted from page 266.  These examples give the reader just enough info to get confused.  I see that one could manually set up the flash BOM

    __root const uint32_t FlashMailBox [] @ 0x00200000 =...

    But how does the User initiate a reboot int the system to see the 0xACE acknowledgement AND can this be done under IAR EW emulation so I can see the ACK at the
    correct address in the BOM?

  • Hello Robert,
    only FYI the MSP-FET supports all MSP devices including MSP432.

    Regards,
    Tom
  • Hi Thomas!

    How are you? Quite a long time has passed already since we met in Freising.
    So the MSP-FET can be used in 4-wire JTAG mode to debug the MSP432P401R or only BSL programming?

    Dennis

  • Hi Dennis,
    I'm doing well, thanks for asking. Hope everything is OK on you side as well.
    The MSP-FET supports JTAG and SWD on MSP432. We are just about to release an update of slau647.
    So check back in 2-3 days and you can find all the details.

    Regards,
    Tom
  • Hi Thomas!

    Oh, even SWD - this is great news. I will wait for the update!
    Everything is fine here as well - business as usual ;)

    Dennis
  • Hi Dennis,
    the MSP debuggers user guide rev D update is out www.ti.com/lit/pdf/slau647

    An adapter to connect to the MSP432 target socket board is available here http://www.ti.com/tool/MSP-FET-432ADPTR

    Tom

  • Thanks for the update! Now only the MSP432 has to reach production level. But the new LaunchPad is only already, so hopefully this won't take too long now. Dung said, Rev. C silicon availability is planned for end of the month, so I will have to get one of those adapters!

    The link does not work - but the revised version seems to be here.

    Dennis

**Attention** This is a public forum