LPUART BAUD.TDMAE enabling – works in step-by-step but fails in resume execution

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

LPUART BAUD.TDMAE enabling – works in step-by-step but fails in resume execution

跳至解决方案
407 次查看
RickYeh777
Contributor III

Hello NXP Support,

I am working on the S32K324 with LPUART and DMA. I encountered an issue when enabling the transmit DMA request (BAUD.TDMAE bit).

Here is the function I am using, and Enable=TRUE:

/*!
 * @brief Configures DMA requests.
 *
 * This function configures DMA requests for LPUART Transmitter.
 *
 *
 * @Param Base LPUART base pointer
 * @Param Enable Transmit DMA request configuration (enable:1 /disable: 0)
 */
static inline void Lpuart_Uart_Ip_SetTxDmaCmd(LPUART_Type * Base, boolean Enable)
{
Base->BAUD = (Base->BAUD & ~LPUART_BAUD_TDMAE_MASK) | ((Enable ? 1UL : 0UL) << LPUART_BAUD_TDMAE_SHIFT);
}

 

Observed behavior:

  • When I run the code step-by-step (single-step in debugger), it works correctly.

  • When I run the code in resume mode, the system fails (DMA transfer does not start)

Any guidance, best practices, or example sequence for enabling LPUART TX DMA would be greatly appreciated.

Thank you,
[Rick]

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
146 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @RickYeh777

Sorry for the late reply. There really should be no issue —unless the same Dma channel is used for Crc and Uart communication. 

I've imported the Crc example, and added Uart module with Dma transmission, and everything seems to be working:

Snag_555e38a.png

Snag_556294e.png

Please confirm if pin assignation is correct, Dma channel configuration matches the Uart MUX, and if same channel is not used for Tx/Rx:

Snag_5666109.png

Snag_56679b2.png

Snag_5668ea1.png

Best regards,
Julián

在原帖中查看解决方案

0 项奖励
回复
4 回复数
376 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @RickYeh777,

Could you please share your configuration and routine (main.c)?

There is an existing example for LPUART + DMA, please confirm if your routine is configuring everything correctly: Example S32K312 UART Transmit & Receive Using DMA DS3.5 RTD300 - NXP Community.

Best regards,
Julián

 

0 项奖励
回复
361 次查看
RickYeh777
Contributor III

Thank you for your quick response and accurate judgment.
Originally, this project’s LPUART + DMA was working normally. After I added the CRC32 + DMA code, it started failing.
Now, if I remove the CRC32 + DMA code, the LPUART + DMA still works correctly.
However, I cannot figure out how the CRC32 + DMA code affects the operation of LPUART + DMA.
It is really not easy to find the key configuration inside S32 Config Tools.
Below I have attached the CRC32 + DMA configuration, hoping it may reveal the potential issue.

标记 (1)
0 项奖励
回复
350 次查看
RickYeh777
Contributor III

Hi, Julián

RickYeh777_0-1758161890678.png

If I add the CRC32 + DMA code but comment out Dma_Ip_GetLogicChannelStatus(), the LPUART + DMA also works correctly.

0 项奖励
回复
147 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @RickYeh777

Sorry for the late reply. There really should be no issue —unless the same Dma channel is used for Crc and Uart communication. 

I've imported the Crc example, and added Uart module with Dma transmission, and everything seems to be working:

Snag_555e38a.png

Snag_556294e.png

Please confirm if pin assignation is correct, Dma channel configuration matches the Uart MUX, and if same channel is not used for Tx/Rx:

Snag_5666109.png

Snag_56679b2.png

Snag_5668ea1.png

Best regards,
Julián

0 项奖励
回复