cancel
Showing results for 
Search instead for 
Did you mean: 

Hi. I have been trying to flash an STM32L152RD (STM32L1xxxD) using the CUBE programmer through the USART2 and it never connects (Timeout error occured while waiting for acknowledgement). I have used the software method of branching into the bootloader

JBaue.1
Associate II

Because I do not have access to the BOOT0 pin (custom board, not eval board) I have used the software method of branching into the bootloader : https://stm32f4-discovery.net/2017/04/tutorial-jump-system-memory-software-stm32/

I have adpted this code for the device (notably bootloader address 0x1FF0 0000)

USART2 physical pins are PA2 and 3

My questions are:

  1. Is the bootloader code listening to USART2, is it listening to everything? Or does this require a specific configuration?
  2. Do I need to configure the USART2 with baudrate etc. before jumping to the bootlaoder so that it corresponds to the CUBE->UART settings or is this an automatic process?

____

logs from Cube

15:59:33:510 : Serial Port COM34 is successfully opened.

15:59:33:511 : Port configuration: parity = even, baudrate = 115200, data-bit = 8, stop-bit = 1.0, flow-control = off

15:59:33:511 : No Init bits value is : 0 

15:59:33:511 : Sending init command: 

15:59:33:511 : byte 0x7F sent successfully to target

15:59:34:511 : Wait ends after 1 loop, dataready = 0, delay = 1001

15:59:34:511 : Timeout error occured while waiting for acknowledgement.

15:59:34:512 : No response from target received

15:59:34:519 : byte 0x7F sent successfully to target

15:59:34:621 : Wait ends after 1 loop, dataready = 0, delay = 100

15:59:34:621 : Timeout error occured while waiting for acknowledgement.

15:59:34:621 : No response from target received

15:59:34:621 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...

Any help is appreciated, thank-you!

10 REPLIES 10

I use Clear Terminal (was Connex, but now under Telit), I like the X-Modem-1K implementation. I have target and host side implementations of the algo.

On the L151 boards I have, I'm staging the new firmware in the upper portion of the internal Flash and I can trigger the app to copy a small loader to RAM and overwrite itself. Living on the edge, but it only initiates if the image is valid, and I have other ways to debrick. I don't recall the exact size of the loader, but could likely do it in 512-1024 bytes if pushed.

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