cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 Uart failure after OTA

nikhivv07
Associate II

hi,

Previously i was using STM32L010K8TX which has 8K memory. I did OTA update in this device via Uart with help of external controller which receive hex file from User.

 

Currently am using STM32L010R8Tx which has 64K memory. And i tried the same OTA program to update the application in this new device but after OTA update the user application is running proper.

The external device which receive hex file has a debug communication port to monitor STM32L0 device by communicating in UART. After updating the application the UART communication not at all responding to external device.

After completing the OTA update am using GO command to run application (0x08000000) and making Boot Pin Low ( which is making HIGH When Entering to OTA mode). Am using same OTA file commands flow to update which was used for previous device (stm32L010K8Tx) including the memory locations. 

 

but in new device after updating the OTA it stops working Uart peripheral. I am not sure about other peripherals are working or Not. because i did not tested other peripherals state. UART is the only communication i can check now with help of another device. if uart is working i can get the other peripherals state through uart messages.

 

is there any memory address change between these two device ?

if not why the new device is not responding in uart?

If we do NRST reset it starts communicating in Uart.

 

kindly help in this topic ..

 

thanks, 

Nikhil

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
nikhivv07
Associate II

Hi,

The issue is resolved now.

It is because of re initialization of global variables which is used in uart receive routine.

i was comparing receive buffer pointer of HAL library with user defined buffer pointer to check any data is received or not.

after FOTA the userdefined variable initial value is assigned with some random value.

After reinitialize the value the uart receive routine works fine. Previously i was initializing the value globaly during declaration.

now it is initializing in main() again.

 

Thanks,

View solution in original post

5 REPLIES 5

Double check status return from UART, perhaps explicitly reset the UART, check for noise, framing, parity type errors.

The system loader doesn't reset the part, so whatever pins, clocks and uart settings might be inherited.

Don't recall if the watchdog is running, or not

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
nikhivv07
Associate II

Hi,

Watchdog is not yet enabled.

 

In application Uart is running on 9600bps with No Parity.

When FOTA is updating application other device changing the parity to EVEN because FOTA works in Even Parity.

After writing all pages other Device executing GO command with address of 0x08000000 then Making Low BOOT0 pin of STM32 and also changing the parity to NONE.

Same FOTA application code works in STM32L010k8 device. currently we updated the device to STM32L010R8 to increase the memory and add other peripheral like GPS which is connected to LPUART.

Normally the application communicate with other device in a minute but after OTA waited for long time still the STM32 not sending any uart message to other device.

After NRST reset the stm32 the device start communicating with updated application code. i Hope Passing 0x08000000 itself a kind of reset for application. by setting memory to 0x8000000 i think peripheral doesnot reset. But in application am re-initializing (MXinit()) all peripheral.(code generated by MXcube).

 

Is there any Boot command to Reset the STM32 from externally. 

 

Noise and parity i checked and everything is fine. 

 

Hi,

I created FOTA commands by referring AN3155 rev16 document.

Start Memory Address : 0x08000000

 

 

nikhivv07
Associate II

hi,

 

I have checked huart2 errors and there was no error.

I tried to print some strings in uart terminal and it is working fine. Getting print on terminal when running.

i think uart receive occurring a problem while receive through interrupt. 

Does it need to enable to get jump to uarterror_callback() if uart getting any error?

 

 

 

nikhivv07
Associate II

Hi,

The issue is resolved now.

It is because of re initialization of global variables which is used in uart receive routine.

i was comparing receive buffer pointer of HAL library with user defined buffer pointer to check any data is received or not.

after FOTA the userdefined variable initial value is assigned with some random value.

After reinitialize the value the uart receive routine works fine. Previously i was initializing the value globaly during declaration.

now it is initializing in main() again.

 

Thanks,