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.

MSP432E411Y: Example code for ROM_UpdateUART and ROM_UpdateUSB

Part Number: MSP432E411Y
Other Parts Discussed in Thread: MSP-EXP432E401Y

Dear TI-Expert,

I'm trying to get software updates for our product working. Could you provide some example code how to use ROM_UpdateUART and ROM_UpdateUSB?

  • Hello Sven,

    We don't have specific code examples that show how to use ROM_UpdateUART and ROM_UpdateUSB APIs, but I can provide a brief summary of what to do before these APIs are called:

    For USB:

    • Terminate the USB device from the bus
    • Disable Master interrupt
    • Clear/Disable all interrupts
    Enable and Reset the USB Peripheral using the SysCtlPeripheral* APIs
    • Enable USB Clock and wait for about a second.
    • Re-enable Master interrupt
    • Call the API ROM_UpdateUSB(0)

    For UART - The function SoftwareUpdateBegin in the file "./source/third_party/lwip/ports/msp432e4/utils/swupdate.c" demos the following steps for Ethernet.

    • Clear/Disable all interrupts
    • Call the API ROM_UpdateUART()

    Hope this helps!

    Thanks,

    Sai

  • Hello Sai,

    thank you for your answer. I already had a look into the bootloader examples and derived (almost copied) the following code:

    #define TIMESTAMP_CLOCK     120000000ULL
    
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    
    /* Set GPIO PA0 and PA1 as UART. */
    MAP_GPIOPinConfigure(GPIO_PA0_U0RX);
    MAP_GPIOPinConfigure(GPIO_PA1_U0TX);
    MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    
    /* Configure the UART for 115200, n, 8, 1 */
    MAP_UARTConfigSetExpClk(UART0_BASE, TIMESTAMP_CLOCK, 115200,
                            (UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE |
                                         UART_CONFIG_WLEN_8));
    /* Enable the UART operation. */
    MAP_UARTEnable(UART0_BASE);
    /* We must make sure we turn off SysTick and its interrupt before entering
     * the boot loader! */
    MAP_SysTickIntDisable();
    MAP_SysTickDisable();
    /* Disable all processor interrupts. Instead of disabling them one at a
     * time, a direct write to NVIC is done to disable all peripheral
     * interrupts. */
    NVIC->ICER[0] = 0xffffffff;
    NVIC->ICER[1] = 0xffffffff;
    NVIC->ICER[2] = 0xffffffff;
    NVIC->ICER[3] = 0xffffffff;
    ROM_UpdateUART();
    

    According to SPMU363 (Tiva™ C Series TM4C129x ROM USER’S GUIDE) the UART peripheral must be configured and operational before calling ROM_UpdateUART. I checked the UART by sending a few symbols. It works at the expected bitrate of 115200bit/s.

    Unfortunately this code is not working at all on our MSP432E411Y hardware (BSL scripter gets no response from BSL neither with nor without DISABLE_AUTO_BAUD option).

    After a mass erase I get the blinky example programmed and running, thus connection seems OK.

    Honestly I cannot imagine, that there is no code available at TI. Someone must have done testing on the ROM_UpdateUART function.

    I already spent an unexpected amount of time on getting the MSP432E programmed via UART and it is still not working. The only thing I could get till now is programming our hardware with the blinky example after a mass erase via the MSP-EXP432E401Y's UART and BSL scripter. Programming our real software on the hardware the same way failed - BSL scripter reported everthing ok after 4 minutes, but the application ended in an endless loop. (The same application is running fine after programming via USB/LMFlasher or JTAG/CCS.)

    I'm really frustrated.

    Please ask the developer for a working code example!

  • Hello Sai,

    the reason for our application not being programmed correctly by BSL scripter might be a function in RAM (__attribute__((ramfunc))) resulting in follwing entry in the .txt file:

    @23cd0

    Maybe BSL scripter is unable to deal with it.

  • Hello Sai,

    now I used LM flasher for the serial programming, too. It simply works, thus the code above is fine. When using the explicit ROM_UpdateUART function it even works with a standard USB to RS232 converter.
    Why is TI promoting BSL scripter instead of LM flasher??

  • Hello Sven,

    Thanks for the updates! I will talk to the development team to investigate the issues that you reported.

    Regards,

    Sai

**Attention** This is a public forum