Skip to main content
PauloASousa
Associate II
Jul 16, 2019 9:09 AM UTC
Solved

Nucleo-L011K4 USART examples not working?

Hi,

I got a brand new Nucleo-L011K4 and was very interested in testing the examples I got from ST, but when I download the USART examples on my board the receive part of them does not work. Is there any flag I need to set/clear that the examples are missing or is it just my board that is not working?

After debugging for a few hours I see that the reception complete flag is never set, could the data be getting lost somewhere? (the only place it could be getting lost is in the STLink, but it works as a virtual port, so it shouldn't happen).

Best regards,

Paulo A Sousa

This topic has been closed for replies.
PauloASousa
PauloASousaBest answer
Associate II
Jul 16, 2019 2:28 PM UTC

Got the error, in the main.h files the Rx pin is configured as PA3 instead of PA15, changed it and now it's working.

Thanks for the answers Ozone and Clive.

7 replies

Ozone
Principal
Jul 16, 2019 9:50 AM UTC

I have no experience with the L011 device specifically, but have you checked the levels at the Rx pin ?

And perhaps the waveforms, if the signals match the expected baudrate.

PauloASousa
Associate II
Jul 16, 2019 9:55 AM UTC

Well, the transmit part is working, so I dont think the problem is baudrate, I would receive some *corrupted* data if that was the problem, but I don't receive anything at all. It is also hard to check the Rx pin, since it is internaly connected to the STLink, which connects it virtually to the USB port.

Tesla DeLorean
Guru
Jul 16, 2019 12:06 PM UTC

Probably need to be clearing any accumulated noise, framing and overrun errors, so the USART goes back into receiving mode.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
PauloASousa
Associate II
Jul 16, 2019 1:01 PM UTC

Clearing the error flags (framing, idle line, noise, overrun and parity) doesn't seem to do much, the application still keeps waiting for data to come in, the RDR register is never filled, so even in interrupt mode the data never reaches the MCU. Also tried to flush both TXDATA and RXDATA, but nothing seems to work.

PauloASousa
PauloASousaAuthorBest answer
Associate II
Jul 16, 2019 2:28 PM UTC

Got the error, in the main.h files the Rx pin is configured as PA3 instead of PA15, changed it and now it's working.

Thanks for the answers Ozone and Clive.