cancel
Showing results for 
Search instead for 
Did you mean: 

Application crashing when going from bootloader to application after UART

Hi, I am writing my bootloader, I changed MSP and reset handler value correctly so code is able to got application mode.

0693W000004Ik2tQAC.png

In my application I changed VTOR value as below but still my application is getting stuck post sending data to UART.

0693W000004Ik3XQAS.png

0693W000004Ik3cQAC.png

I am using STM workbench IDE so when I try to debug application code, its erasing bootloader code so I am unable to check exact reason of failure. Any suggestion as code looks fine to me.

5 REPLIES 5

Get a better debugger..

Instrument code to give flow and register info, use the SWV​.

Use UART in polled mode.

Determine where it "crashes", instrument Error_Handler and HardFault_Handler to see if it dies in those functions. Perhaps Default_Handler also.​

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

Yes I am using uart polled mode HAL_UART_Transmit , not HAL_UART_Transmit_IT.

Btw Did u find anything wrong in shared code images?

@Community member​ which debugger u use ? Also seems like issue is bit different. I started sending count 1 byte in while loop. Don't know why after sending 5 times, application code is getting crashed.

Also same result with polled mode and interrupt mode.

Predominantly Keil, but I'll use stand-alone debuggers including in the ST-LINK Utilities, or J-Link tools if that provides access into tight/difficult situations.

Your selective images didn't really provide much insight into what instructions the processor executed, or where it "crashed".

You need to focus on the point of failure, and work backward from there.

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