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.

MSP432P401R: Custom BSL compiled image is not working

Part Number: MSP432P401R

Hello Folks,

I am using MSP432BSL_1_01_00_00 BSL version. I flashed the prebuild BSL image available in the package and it is working fine. But when I compile the code and use release or debug images after firmware upgrade shown successfully on the windows terminal(BSL scripter). The device goes to unknown state and after device power cycle it boots with previous firmware image.
Do I need to change anything in the custom BSL code to create binary identical to prebuild image?

Regards,
Amit

  • Amit,

    You should not need to make any changes in the code.  Be sure you have the correct build configuration selected.  Section 5 of the users guide describes building the project and loading properly.

    https://www.ti.com/lit/ug/slau622j/slau622j.pdf 

  • Thanks Eddie for response.

    I have selected Release_BSL_P401R build configuration. I have followed the steps from Section 5 to build the image. When I flash prebuilt BSL  image the firmware upgrade is working so I believe the flashing steps are also correct.

    I have observed that the generated .map file is different from the .map available in the "firmware" directory from the  source code.  Is it possible that I need to use any specific toolchain or build flags?

    When the custom BSL is compiled->flashed and firmware upgrade is initiated I see following logs on BSL-scripter. The BSL scripter is able to communicate with MSP432 but I do not see "success" logs for password and erase. Once this is completed after power cycling the device it boots with previous image.

    Following is the BSL-scripter logs.

    C:\ccs_component\BSL-Scripter>BSL-Scripter.exe script_P4xx_uart.txt
    ---------------------------------------------------------
    BSL Scripter 3.4.0.1
    
    PC software for BSL programming
    2021-May-11 20:06:31
    ---------------------------------------------------------
    Input file script is : C:/ccs_component/BSL-Scripter/script_P4xx_uart.txt
    
    //
    //Script example MSP432 UART BSL
    //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 115200 COM14 PARITY
            Initialization of P4xx BSL succeed!
    RX_PASSWORD_32 .\pass256_wrong.txt
            Read Txt File  : C:\ccs_component\BSL-Scripter\pass256_wrong.txt
    
    RX_PASSWORD_32 .\pass256_default.txt
            Read Txt File  : C:\ccs_component\BSL-Scripter\pass256_default.txt
    
    MASS_ERASE
    
    RX_DATA_BLOCK_32 MSP432P401R_XBB_SC.txt
            Read Txt File  : C:\ccs_component\BSL-Scripter\MSP432P401R_XBB_SC.txt
    
    
            Time elapsed of writing 109390 bytes : 14.5 seconds
            Speed of writing data :7.369(kB/s)
    //RX_DATA_BLOCK_32 Blink_LED.hex
    TX_BSL_VERSION_32
    
    TX_DATA_BLOCK_32 0x0000 0x4000 ReadBlock_MSP432P401R.txt
            Write Txt File : C:/ccs_component/BSL-Scripter/ReadBlock_MSP432P401R.txt
    
            Time elapsed of reading 1 bytes : 0.07496 seconds
            Speed of reading data : 0.01303(kB/s)
    //TX_DATA_BLOCK_32 0x0000 0x4000 ReadBlock_MSP432P401R.hex
    REBOOT_RESET
    
    C:\ccs_component\BSL-Scripter>

  • Hi Amit,

    I am looking into this and expect to have more information by 5/14.  

  • Hi Eddie,

    In order to rule out issues from my application project I used the existing i2cmasterexample1 project and call the "FirmwareUpdate" function from the "mainThread".
    Using precompiled binary the firmware update is working fine.
    With the compiled custom BSL release version I see different issue as "[ACK_ERROR_MESSAGE]Unknown ACK" in BSL-scripter.

    I have provided the error logs and the function. Please let me know if you need more information.

    BSL-scripter Error logs:
    
    
    
    C:\ccs_component\BSL-Scripter>BSL-Scripter.exe script_P4xx_uart.txt
    ---------------------------------------------------------
    BSL Scripter 3.4.0.1
    
    PC software for BSL programming
    2021-May-18 15:30:07
    ---------------------------------------------------------
    Input file script is : C:/ccs_component/BSL-Scripter/script_P4xx_uart.txt
    
    //
    //Script example MSP432 UART BSL
    //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 115200 COM14 PARITY
            Initialization of P4xx BSL succeed!
    RX_PASSWORD_32 .\pass256_wrong.txt
            Read Txt File  : C:\ccs_component\BSL-Scripter\pass256_wrong.txt
            [ACK_ERROR_MESSAGE]Unknown ACK value!
    RX_PASSWORD_32 .\pass256_default.txt
            Read Txt File  : C:\ccs_component\BSL-Scripter\pass256_default.txt
            [ACK_ERROR_MESSAGE]Unknown ACK value!
    MASS_ERASE
            [ACK_ERROR_MESSAGE]Unknown ACK value!
    RX_DATA_BLOCK_32 MSP432P401R_XBB_SC.txt
            Read Txt File  : C:\ccs_component\BSL-Scripter\MSP432P401R_XBB_SC.txt
            [ACK_ERROR_MESSAGE]Unknown ACK value!
            [ACK_ERROR_MESSAGE]Unknown ACK value!
            [ACK_ERROR_MESSAGE]Unknown ACK value!
            [ACK_ERROR_MESSAGE]Unknown ACK value!
            [ACK_ERROR_MESSAGE]Unknown ACK value!
            [ACK_ERROR_MESSAGE]Unknown ACK value!
            [ACK_ERROR_MESSAGE]Unknown ACK value!
    Function to invoke BSL
    
    void FirmwareUpgradeTest(void)
    {
        int i  = 0;
        Display_printf(display, 0, 0, "Vermeo_T1_FirmwareUpgradeTest\n");
        /* Make sure our MPU settings don't cause problems in the BSL. */
            MPU_disableModule();
    
            /* The BSL does not initialize some hardware it uses. It requires
             * the Systick (to determine UART baud rate) and Timer A0 (to set
             * the 10-second timeout). Prepare these for use by BSL. */
            SysTick_disableInterrupt();
            SysTick_disableModule();
            Timer_A_stopTimer(TIMER_A0_BASE);
    
            /* Need to reset UART A0 for firmware update. Be sure to make the
             * corresponding GPIOs input pins. */
            UART_disableModule(EUSCI_A0_BASE);
            GPIO_setAsInputPin(GPIO_PORT_P1, GPIO_PIN2);
            GPIO_setAsInputPin(GPIO_PORT_P1, GPIO_PIN3);
    
        //Vermeo_T1_Invoke_BSL_hw();
        __delay_cycles(20000000);
        __delay_cycles(20000000);
        __delay_cycles(20000000);
        MAP_Interrupt_disableMaster();
        for (i=0; i < 240; i++) NVIC->IP[i] = 0;
        NVIC->ICER[0] = 0xFFFF;
        NVIC->ICPR[0] = 0xFFFF;
        NVIC->ICER[1] = 0xFFFF;
        NVIC->ICPR[1] = 0xFFFF;
        ((void (*)()) BSL_ENTRY_FUNCTION)((uint32_t) BSL_PARAM); // Call the BSL with given BSL parameters
    
    }

  • Hi Eddie,

    I did factory reset. The same issue is observed with compiled image of custom BSL.

    Regards,

    Amit

  • Hi Eddie,

    I am able to fix the issue by modifying  BSL432_PI_IRQ_UART function. Below line was added in it.

    BSL432_RAM_RX_Buf[BSL432_MAX_BUFFER_SIZE + 5] = BSL432_AP_UART;

    Thanks for you support.

    Regards,

    Amit