cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-L011K4 USART examples not working?

PauloASousa
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
PauloASousa
Associate II

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.

View solution in original post

7 REPLIES 7
Ozone
Lead

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

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.

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 Up vote any posts that you find helpful, it shows what's working..

> 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.

But the UART lines between the ST-Link and the target (L011) are not virtual, and you can place a scope probe at the pins (PA2, PA15).

Check that SB2 and SB3 are closed.

And, if you talk about a ST demo, perhaps power-cycling/resetting the target helps.

If the (demo) application doesn't clear receive error flags (as Clive noted), the UART is done.

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.

SB2 and SB3 are closed, and I checked if the data was reaching the PA15 pin (checking the SB3 connection) and I saw data there, but still no RXNE coming high.

PauloASousa
Associate II

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.