cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L151RBxA UART1 not working

nps
Associate II
Posted on March 03, 2017 at 16:48

Hi all,

I am trying to enable UART1 on stm32l151RBXA controller. I am using code generated by Cube. I tried modifying the code but serial port just does not work. I am only trying to send text to serial port but this is not happening. When I debug using ST Link, I don't see the program getting stuck, but no data is output through Tx pin (PORTA pin 9). Will post the code if needed. Kindly help resolve this issue as I have spent many days trying to figure out the problem. Thank you.

#stm32l151-uart
4 REPLIES 4
Khouloud GARSI
Lead II
Posted on March 03, 2017 at 16:59

Hi

Nayani.Partha

,

I advice you to look at the 'UART' examples provided by ST when downloading the

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubel1.html

package.

The 'UART' examples could be found under the paths below:

STM32Cube_FW_L1_V1.6.0\Projects\STM32L152RE-Nucleo\Examples\UART

or

STM32Cube_FW_L1_V1.6.0\Projects\STM32L152D_EVAL\Examples\UART

You may take those examples as a reference to correctly configure your UART peripheral.

Khouloud

Posted on March 03, 2017 at 17:04

To what exactly do you have it connected? Remember the UART outputs at CMOS levels, and not those used by RS232.

Output a continuous stream of 'U' characters, and use a scope to view the signal. Confirm the bit rate matches expectations.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 09, 2017 at 16:46

Hi Clive One,

Thank you for your time and sorry for replying so late. I have level shifted UART pins (max3232). The issue was that of getting used to new types of functions from ST MCD. I was using CooCox and this controller registers are not defined properly. I switched to Atollic TrueStudio and MXCube. If you notice the functions and their nomenclature in the newer version of the libraries, they are totally different. Finally I got the port working. Thanks once again.

Parmin

edwin marcellin
Associate II
Posted on July 12, 2018 at 16:25

Hello,

I have the same problem, so if someone has any clue to help...

Thx