2023-03-29 12:59 AM
I'm trying to receive data from the LPUART1 serial port on the L031K6 development board.
Unfortunately all my aproaches failed so far.
Sending data works fine in all three modes:
I'm routing the LPUART1 to PA2 and PA3, which are initially the RX and TX lines of USART2.
The USART2 is already in use.
Are there any restrictions in using the RX line on PA3 or in using the LPUART1 in receiving data?
Solved! Go to Solution.
2023-03-29 11:33 PM
Hi Jan,
thank you for your support and sorry for wasting your time...
I found the mistake. I misread the schematic of the development board and mixed up pin numbers...
The system works fine now in all three modes and in reading and writing.
Best regards
Markus
2023-03-29 01:25 AM
> on the L031K6 development board.
Nucleo?
> Unfortunately all my aproaches failed so far.
What does that mean?
> Are there any restrictions in using the RX line on PA3 or in using the LPUART1 in receiving data?
Check the relevant solder bridges/jumpers on Nucleo. Aren't these pins connected to the on-board ST-Link by default?
JW
2023-03-29 02:05 AM
> on the L031K6 development board.
> Nucleo?
Yes, NUCLEO-L031K6.
> Unfortunately all my aproaches failed so far.
> What does that mean?
Please take a look at the following screenshots:
I just added the following lines of code:
...
/* USER CODE BEGIN PV */
uint8_t rx_data[4] = {0};
/* USER CODE END PV */
...
/* USER CODE BEGIN 0 */
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
HAL_UART_Receive_DMA(&hlpuart1, rx_data, 4);
}
/* USER CODE END 0 */
...
/* USER CODE BEGIN 2 */
HAL_UART_Receive_DMA(&hlpuart1, rx_data, 4);
/* USER CODE END 2 */
...
I just wanted to see the reaction of the LED on the reception of 4 bytes. But no activitiy yet.
> Are there any restrictions in using the RX line on PA3 or in using the LPUART1 in receiving data?
> Check the relevant solder bridges/jumpers on Nucleo. Aren't these pins connected to the on-board ST-Link by default?
Yes, they are connected by default via SB2 and SB3 and I haven't changed that.
2023-03-29 08:21 AM
Try non-DMA reception first.
What's the clock to LPUART? Check in LPUART chapter in Reference Manual (RM) if LPUART is able to receive at 115200 Bauds with that clock.
JW
2023-03-29 11:33 PM
Hi Jan,
thank you for your support and sorry for wasting your time...
I found the mistake. I misread the schematic of the development board and mixed up pin numbers...
The system works fine now in all three modes and in reading and writing.
Best regards
Markus
2023-03-30 04:13 AM
Hi Markus,
Thanks for coming back with the solution. Please select your post as Best so that thread is marked as solved.
JW