cancel
Showing results for 
Search instead for 
Did you mean: 

Bootloader using USART 2 on STM32L152VB

rgrindall
Associate II
Posted on July 03, 2014 at 17:56

I am attempting to communicate to the bootloader through RS232 on USART 2 on the STM32L152VB.  I have Boot 0 pulled up and I believe I am in the bootloader because the application code is clearly not running.  I am using the IAR Kick Start board which has USART 1 pins dedicated to the LCD display and USART 2 brought out as RS232. I have tried the Flash Load Demonstrator as well as Realterm to send the initial auto baud 0x7f byte to the bootloader.  I get no response.  I was able to make this work on a different eval board for the F1 processor using USART 1.  The manual says that USART 1 or 2 can be used for the L152.  Does the bootloader always listen on both 1 and 2 or do I have to do something special to direct it to USART 2? Thanks.

5 REPLIES 5
Posted on July 03, 2014 at 20:11

USART2 has to use PD5/6, Make sure to use EVEN parity, ie 9600 8E1

Have you any other indication that the chip is functioning? Can you access via JTAG/SWD interface?

Need to connect digital/analogue supplies.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rgrindall
Associate II
Posted on July 03, 2014 at 20:44

Thanks for the quick response. Yes the board is fully functional.  I can write, load and test code through the jtag no problem. The board has indicator lights to verify that power is on so I know I have power while I am working on the bootloader.  I have tried several baud rates/settings (including 9600, 8E1).  Also, with these exact port settings using Realterm I can communicate to an F1 device (which uses USART 1) on another eval board.  On the L1 board I am using USART 2.  The board has the CTS/RTS lines connected to the L1.  In RealTerm I selected None for Hardware Flow control but also experimented with other settings.  Realterm also lets me set CTS and RTS low or high which I tried changing those with no success. Do the USART 1 pins need to be forced to a particular state so the bootloader knows to talk to USART 2? Thanks for your help.  

rgrindall
Associate II
Posted on July 03, 2014 at 20:49

Also, yes the USART 2/RS232 port is connected to PD5/6.

Posted on July 04, 2014 at 01:44

You will need to ensure the USART1 RX doesn't transition.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rgrindall
Associate II
Posted on July 07, 2014 at 16:50

Thanks for your help.  The problem was with the eval board.  It needed to have the RS232 port enabled to allow communication to the L1 USART 2.