S32K314 uart issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K314 uart issue

6,199 次查看
anoop_r
Contributor II

Hi,

I am using an S32K314 board, in our project we are connecting it to a Modem in the UART.

Currently, we are using it with the baud rate "115200" and tried to increase the baud rate to "921600" While running it with the higher baud rate we are not able to read the entire data which is available at the UART, if the modem is sending a data the module would be able to read the data partially.

Also, there is a similar issue with the UART driver when we are processing the CAN data.

We are receiving 5 different CAN data every 200ms, while processing the CAN data the modem data received in the UART is failing.

Iam sharing the APIs which we used to read the UART data.

Please go through the APIs and help me fix this issue.

Regards

Anoop R Chandran

 

0 项奖励
回复
6 回复数

2,116 次查看
dujunqiu
Contributor I

how do i get  Lpuart_Uart_Ip_SyncReceive() had receive number?

0 项奖励
回复

6,129 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @anoop_r,

Do you use Lpuart_Uart_Ip_AsyncReceive() or Lpuart_Uart_Ip_SyncReceive, it is not clear from the code?

There are just 16 priority levels.

Double check the corresponding NVIC_IP registers.

danielmartynek_0-1696411611568.png

Regarding DMA, refer to this thread:

https://community.nxp.com/t5/S32K/S32K344-UART-DMA-example/m-p/1583510

 

Regards,

Daniel

0 项奖励
回复

6,015 次查看
anoop_r
Contributor II

Hi @danielmartynek,

We are using "Lpuart_Uart_Ip_AsyncReceive()" in our code.

How can I check the NVIC_IP register in the S32Design Studio?

I will go through the DMA example.

Regards

Anoop

0 项奖励
回复

6,006 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @anoop_r,

The S32K3xx_Interrupt_map.xlsx attached to the RM lists all the IRQ numbers.

For example, LPUART3 has IRQ 144.

In S32DS, find the NVICIP144 register in the Peripheral Registers view.

danielmartynek_0-1697101201926.png

 

Regards,

Daniel

0 项奖励
回复

6,146 次查看
anoop_r
Contributor II

Thanks @danielmartynek for the response,

What is the return status of the Lpuart_Uart_Ip_AsyncReceive() function?

I am getting zero as the return status. I can see that the UART has received 1024 byes data but while reading I am getting only partial data with zero as return status.

We are using a task to poll the data from the UART using the function "iotsm_get_uart_port_status" (definition in the attached txt file).

 

I assume you use interrupts for both FlexCAN and LPUART.

For the LPUART we have set the priority as 4 by MEX file configuration and the FlexCAN interrupt is set as 20 using the NVIC api "NVIC_SetPriority(FlexCAN0_1_IRQn, 20)".

 

What is the system clock frequency?

160Mhz, please see the snapshot attached.

 

 Can you use DMA for the LPUART instead of interrupts?

We haven't done anything for DMA.

Can you please send any sample code that I can refer to implement DMA for the LPUART?

 

Regards

Anoop

 

 

 

0 项奖励
回复

6,156 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @anoop_r,

What is the return status of the Lpuart_Uart_Ip_AsyncReceive() function?

danielmartynek_0-1696239127630.png

I assume you use interrupts for both FlexCAN and LPUART.

You could increase the interrupt priority level for the LPUART, but this can cause issues on the FlexCAN side.

What is the system clock frequency?

Can you use DMA for the LPUART instead of interrupts?

 

Best regards,

Daniel

0 项奖励
回复