cancel
Showing results for 
Search instead for 
Did you mean: 

Using of LPUART1 on L031K6

Markus Spiekermann
Associate III

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:

  • Blocking
  • Non-Blocking IT
  • Non-Blocking DMA

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Markus Spiekermann
Associate III

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

View solution in original post

5 REPLIES 5

> 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

Markus Spiekermann
Associate III

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

0693W00000aPNvTQAW.jpg0693W00000aPNnKQAW.jpg0693W00000aPNneQAG.jpg0693W00000aPNnPQAW.jpg0693W00000aPNmqQAG.jpg0693W00000aPNnAQAW.jpg 

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.

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

Markus Spiekermann
Associate III

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

Hi Markus,

Thanks for coming back with the solution. Please select your post as Best so that thread is marked as solved.

JW