MSPM0G3519: Problem with UART1

Part Number: MSPM0G3519

Hello,

I am working on MSPM0G3519 Launchpad. I am working on OTA based firmware upgrade.

I have developed custom bootloader, where by pressing SW2 within 10sec, it will wait for the new firmware and I will sending the new firmware as hex bytes using docklight, I am receiving it properly and my fimware is getting upgraded. 

But my requirement is to do OTA based firmware upgrade. for that I am using a bluetooht module at uart1, so when I enabled uart1 and flashed the code, at poweron the code in flash is not running. I need to press reset button. But with uart0 everytime I poweron the code in the flash starts running. after adding uart1 why this problem is happening. Please help me to solve this.

  • Hi Dibyarekha,

    Do you mean every time you upgrade the firmware, the updated program does not run, and only after you press the reset button the program could run properly, am I understanding right?

    You could try manually take a software reset after the firmware is updated by DL_SYSCTL_resetDevice().

  • Hi,

    I am using custom bootloader , where my bootloader code flash I am taking 32KB, I am running the bootloader code, when I press S2, it should wait for the new firmware, the new firmware I am storing in 0x00058000. After receiving the complete firmware I am copying the received firmware to 0x00008000. Then I am doing reset and my new firmware runs. 

    If I won't press S2 then whatever firmware is there in 0x00008000 it's running.

    All are working fine when I am receiving the firmware through Uart0.

    Even repeated on off , reset, restart in all cases with Uart0 it's running fine.

    My objective is to receive the firmware through bluetooth, so I connected the BLE module to uart1. Now I tested in debug, I am perfectly receiving the firmware and it's upgrading too , there is no problem. 

    But when I power on off the board means I am removing the USB cable and connecting again to my laptop, then whatever code is there it is not running. When I am pressing reset button then only it starts running.

    At that time by pressing S2 when I am sending the firmware , it is not upgrading. What is happening I am not understanding. This is not happening when receiving firmware using Uart0. 

    I tried to connect the BLE module to Uart0 but it is not receiving any data, only data is receiving through the programming cable using docklight.

    If I am debugging, then it's working fine. 

    Simply I switched ON , debug, then everytime I reset , it's working fine.

    only with power on off it's not working 

    Please help me.

    What is happening inside at power on I am not able to understand 

  • Hi,

    I have removed 

    NVIC_EnableIRQ(UART_0_INST_INT_IRQN); from my code, then the code is running at power on.
    But at power On when I am doing firmware upgrade, it's not working.
    But when I am using Uart0, everytime at power on firmware upgrade is working.
    with uart1, only in debug mode firmware upgrade is working.
    Now what is the difference, how to solve this issue.
    I am receiving the firmware, but jump_to_application() is not working. same code is working with uart0 in debug mode as well as power on mode. but with uart1 it is working only with debug mode not in power on mode
  • Hi,

    Which pins are you using for UART1 TX and RX pin?

    Notice that the PA18 is the default BSL invoke pin, and if PA18 is detected high when MCU power on, MCU will enter ROM bootloader code and not jump to application code. So if PA18 is used as any other peripherals function, you could refer to section 7.3 of MSPM0 Design Flow Guide (Rev. D) to disable PA18 BSL invoke function.

  • Thanks, My problem got solved. At power On , I was receiving garbage data that's why it was not working. I found the problem.

  • Hi,

    DL_FlashCTL_eraseMemory is not working for me. In debug mode or in the power on case, 1st time only I am able to write, after that i am not able to write. Same bytes writing is working but different bytes writing is not working..

    PLease suggest. I got stuck

  • HI,

    I am flashing the code, after that sending firmware, new firmware is working. again i restarted board and sending another firmware, which is having some bytes same is previous firmware, only those bytes are getting written,new bytes are not getting written. I am erasing memory and writing still I suspect memory is not getting erased. 

    At every debug its working. in debug mode by default memory is 0xFF. so new data is writing. But once data is written, next time I want to erase and write its not working. Any setting change I need to do for it or what is happening . Why erase is not working? please help me