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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
446 Views
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]

Labels (1)
0 Kudos
Reply
1 Solution
185 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
415 Views
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 Kudos
Reply
400 Views
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.

Tags (1)
0 Kudos
Reply
389 Views
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 Kudos
Reply
186 Views
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 Kudos
Reply