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: Software BSL Invocation not responding to host

Part Number: MSP432P401R

Right now, I’m trying to test the software BSL invocation, which doesn’t seem to work properly (using a MSP432P401R RED dev board). I used exactly the same configuration as in this post : https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/495521 

In the SLAU622E document, at section 4.3 BSL Invocation, it explains how to call BSL in three different ways. I can tell that the first way (when the memory is erased) is working. I’m using BSL-Scripter.exe with P4xx_uart to flash blink led and it works. 

Now, for the second way (using Software BSL invocation), I want to call the BSL using a GPIO interrupt :

BSL_INVOKE((uint32_t)BSL_DEFAULT_PARAM); // Call the BSL with given BSL parameters

Then, I’m try using the same application (BSL-Scripter.exe) with the same script, but it failed (UART communication failed)

I added my logic analyzer to see what was happening with the UART communication. When I was using the BSL with the memory erased, I could see the communication between the two. But, when I was using the software BSL invocation, the uC wasn't responding to the request to identify the baudrate (Host was sending 0xFF message, but no response from the device)

  • I'm currently debugging it using LED with the dev board.

    So far, I found out that the SysTick Interrupt that I made (toggle blue leds) is only working with the erased memory section BSL invocation, and not with Software BSL invocation.

    Looking at SysTick registers, I can see that the SysTick is counting, but interrupt is never coming. I think that all peripheral interrupts are somehow not enable during software BSL? Is the interrupt vector rightly place?

    I'll continue to investigate
  • Hello,

    Are you trying to invoke the software BSL from inside a task in TI RTOS?

    If that is the case, please take a look at this post: e2e.ti.com/.../2243461

    If not, could you please tell me which version of the BSL are you running?? You can use the command "TX_BSL_VERSION_32"

    Thanks,

    David
  • I started from the blink LED example and added a GPIO interrupt on PORT1 PIN1 to invoke the software BSL :

    /* GPIO ISR */
    void PORT1_IRQHandler(void)
    {
        uint32_t status;

        status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P1);
        MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, status);

        /* Toggling the output on the LED */
        if(status & GPIO_PIN1)
        {
            MAP_Interrupt_disableMaster();
            BSL_INVOKE(BSL_DEFAULT_PARAM); // Call the BSL with given BSL parameters

        }
    }

     

    For the BSL version, I`m using version 0000.0003.0007.0205.000A from the MSP432BSL_1_00_01_00 that I modified a bit to be able to Debug with the LEDS (example : I`m using the RGB led (P2.0/2.1/2.2) to know the differences between the memory erased BSL invocation and the software BSL invocation). I`m flashing the BSL using the Program_MSP432_BSL.bat that was given in the MSP432Ware_3_50_00_02 that is using DSLite.exe to flash.

    I also tried adding the NVIC registers resets to 0xFFFF and added a delay, still not working.

  • Hello,

     Could you please try the following:

    /* GPIO ISR */
    void PORT1_IRQHandler(void)
    {
        uint32_t status;
    
        status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P1);
        MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, status);
    
        /* Toggling the output on the LED */
        if(status & GPIO_PIN1)
        {
            MAP_Interrupt_disableMaster(); 
            
            NVIC->ICER[0] = 0xFFFF;
            NVIC->ICPR[0] = 0xFFFF;
    
            NVIC->ICER[1] = 0xFFFF;
            NVIC->ICPR[1] = 0xFFFF;
    
            BSL_INVOKE(BSL_DEFAULT_PARAM); // Call the BSL with given BSL parameters
        }
    }
    

    Hopefully this helps.

      David

  • As I said in previous post, I tried exactly that code, and still it wasn't  working.

    Just to make sure you understand what I said in the previous posts, I'll reexplain it :

    In the BSL source code project (BSL432_MSP432P401x version 0000.0003.0007.0205.000A), I added a SysTick interrupt function to blink blue LED each time that interrupt is called (using MAP_SysTick_registerInterrupt function) . Also, I activated the _DEBUG predefinition to activate the P1.0 Red LED to light up during 10 sec, during the time I can use the BSL-scripter.exe to send a new code to flash.

    When the memory is erased, the BSL is then loaded with the "modified" BSL that I made. I can see the P1.0 Red LED light up for 10 sec. Also, the blue LED is blinking because of the Systick Interrupt that I added. I then used the BSL-Scripter to flash a new code (Blink LED with GPIO interrupt P1.1 to call BSL software invocation, like shown in the previous post). The BSL-Scripter succeeds to "RX_DATA_BLOCK_32 .\gpio_toggle_output.txt". Then I can see the Red LED blinking, indicating that the software was clearly flashed into the device. The next figure shows the communication between the host PC and the MSP432.

    Then, I pressed the P1.1 Push-Button to invoke the Software BSL. I can see the P1.0 Red LED to stop blinking and will switch on for 10 sec. But, I can't see the blue LED toggle because of the Systick Interrupt (As I told in previous posts, it seems that Interrupt are not enabled correctly, or being called). I used the debugger to see if the SysTick count register was changing (meaning that the SysTick is really counting or not), and It was working properly. I still try to launch the same BSL-scripter.exe to send the same new code, but the device doesn't respond to the "MODE P4xx UART 115200 COM3 PARITY" command. Then the P1.0 red LED switch off (after the 10 sec). As we can see in the next figure, the Host PC sends the command 0xFF (for the automatic baudrate detection of the device), but the device doesn`t respond to it.

  • This is the result of BSL-scripter.exe when the BSL is invoked because of the memory erased :

    Now, this is what I get for using exactly the same BSL-scripter.exe, but when the BSL is invoked by software :

  • Any solution so far?
  • Do you see the same behavior with the Factory BSL??

    Could you please share me your projects (modified BSL and App with SW invoke) so I can try to reproduce the problem on my side.

    Thanks,

    David
  • Same behavior with Factory BSL for both version BSL0000.0003.0007.0205.000A and BSL0000.0003.0006.0203.0008

    I asked Frank Walzer to send you the projects, as I couldn`t find how to share it via the forum.
  • No need for your projects at this time, I was able to reproduce this issue on my side and I'm debugging it. I'll keep you posted as soon as I find a workaround.

    Thanks,

    David
  • The NVIC IABR register (active during  the ISR execution) is not getting cleared when invoking the BSL and it is causing this behavior therefore you will need to invoke the BSL outside of the ISR context, something like this:

    volatile bool jumpToBsl = false;
    
    int main(void)
    {
        /* Stop Watchdog  */
        MAP_WDT_A_holdTimer();
    
        MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
    
        /* Configuring P6.7 as an input and enabling interrupts */
        MAP_GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P6, GPIO_PIN7);
        MAP_GPIO_interruptEdgeSelect(GPIO_PORT_P6, GPIO_PIN7, GPIO_HIGH_TO_LOW_TRANSITION);
        MAP_GPIO_clearInterruptFlag(GPIO_PORT_P6, GPIO_PIN7);
        MAP_GPIO_enableInterrupt(GPIO_PORT_P6, GPIO_PIN7);
        MAP_Interrupt_enableInterrupt(INT_PORT6);
        MAP_Interrupt_enableMaster();
    
        while(1)
        {
            MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0);
            __delay_cycles(2000000);
    
            if (jumpToBsl)
            {
                jumpToBsl = false;
    
                MAP_Interrupt_disableMaster();
    
                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
            }
        }
    }
    
    void PORT6_IRQHandler(void)
    {
        uint32_t status;
    
        status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P6);
        MAP_GPIO_clearInterruptFlag(GPIO_PORT_P6, status);
    
        /* Toggling the output on the LED */
        if(status & GPIO_PIN7)
        {
            jumpToBsl = true;
        }
    }

    We will be update the documentation to reflect this.

     Thanks for your patience.

        David

  • Thanks, it is working now.

**Attention** This is a public forum