2019-07-16 02:09 AM
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
Solved! Go to Solution.
2019-07-16 07:28 AM
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.
2019-07-16 02:50 AM
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.
2019-07-16 02:55 AM
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.
2019-07-16 05:06 AM
Probably need to be clearing any accumulated noise, framing and overrun errors, so the USART goes back into receiving mode.
2019-07-16 05:26 AM
> 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.
2019-07-16 06:01 AM
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.
2019-07-16 06:54 AM
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.
2019-07-16 07:28 AM
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.