Use a Lpuart and an Uart

cancel
Showing results for 
Search instead for 
Did you mean: 

Use a Lpuart and an Uart

Jump to solution
1,010 Views
arnogir
Senior Contributor II

Hello,

I'm using the MKL17Z32 with MCUExpresso and SDK v2.8.0.

This microcontroller has 2 LPUART (LPUART0 and LPUart1) and 1 UART (UART2)

I don't know the real difference in term of behavior between LPUART and UART, but my main need is to have an RS485 link and 2 Serial port.

Then I want use the 2 LPUART for the Serial port (to communicatte in serial way with other device) and use the UART2 with an RS485 transceiver.

 

By yhe past, I already write a simple code to send and get byte trhought the UART with buffer mechanisum using the uart_adapter.

Then on MCUExpresso, on SDK componaents, I add:

-Drivers\lpuart

-Drivers\uart

-Utilities\uart_adapter

-Utilities\lpuart_adapter

 

But the uart_adapter and lpuart_adapter has the same API.

So on compile time, there are conflict because API are define twice.

Is the conclusion is: We can't use both the lpuart_adapter and uart_adapter in the same time?

 

Thank

 

0 Kudos
1 Solution
954 Views
arnogir
Senior Contributor II

Hello,

 

Then to resume:

- Driver UART and LPUART can be used into the same target.

- Adapter LPUart and Adapter Uart can't be compiled in the same time on the same target.

 

Solution: Get the Lpuart_adapter.c file and rename c function by added i.e "Lp"...

 

Regards

View solution in original post

0 Kudos
4 Replies
980 Views
arnogir
Senior Contributor II

Hello

So it is impossible to use the LPUART AND UART into the same project ! ??

We must make a choice between:

- use LPUART0 and LPUART1

- Use UART2

But we can't have a project using the 3 UART...

The solution I found is to copy the LPuart_Adapter and rename all API with LP...

Regards

 

 

0 Kudos
958 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello arnogir

 

LPUART and UART can be used in the same project, the issue is the multiple definitions in the adapter files. Your solution seems a good approach to solve this issue.

 

If you have more questions do not hesitate to ask me.

Best regards,

Omar

0 Kudos
995 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello

 

The LPUAR and UART adapter have the same HAL functions, however, in each file you can certain handles for LPUART and UART.

To avoid the multiple definitions you may only use the HAL functions in lpuart_adapter or uart_adapter.

 

Let me know if this is helpful, if you have more questions do not hesitate to ask me.

Best regards,

Omar

0 Kudos
955 Views
arnogir
Senior Contributor II

Hello,

 

Then to resume:

- Driver UART and LPUART can be used into the same target.

- Adapter LPUart and Adapter Uart can't be compiled in the same time on the same target.

 

Solution: Get the Lpuart_adapter.c file and rename c function by added i.e "Lp"...

 

Regards

0 Kudos