UART(Tx)_DMA + UART(Tx) = Hard_fault?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
psoc_student
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

Hello, I have a question about UART.

 

1. Is there a high risk of Hard_Fault when using both UART_Tx and DMA_UART_Tx?

2. Is there a way to use UART_DMA_Tx for frequently changed length and data type for debug log?

For example, you can output "str" or "hex".

3. Do you have any examples for reference for inquiry number 2?

 

I am using Psoc6 Pioneer Kit.

 

Thankyou for your reply.

regard. Psoc_Student

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @psoc_student ,

Regarding your query number 2, I have created an example where you can send/transmit a variable size array over UART DMA TX without having to use the full size of the DMA TX descriptor .

In this example, the routine Uart_DMA_Transmit(), takes 2 arguments, i.e. the string to transmit and the size of the data to be transmitted and the same is sent over DMA TX.

Please check this and let me know if this satisfies your requirement.

Regarding query number 1, I tried sending a large string over the UART using the API Cy_SCB_UART_PutArray and immediately after the same tried sending another large string using Uart_DMA_Transmit() API but did not find any hardfault occurrence but only that the output data for the first API was stopped in half and the second one by the DMA started which is because both are using the same TX FIFO to send the data. So in short, no, it should not cause a hardfault, but only a corruption in the transmitted data.

Warm Regards
Alen

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @psoc_student ,

Regarding your query number 2, I have created an example where you can send/transmit a variable size array over UART DMA TX without having to use the full size of the DMA TX descriptor .

In this example, the routine Uart_DMA_Transmit(), takes 2 arguments, i.e. the string to transmit and the size of the data to be transmitted and the same is sent over DMA TX.

Please check this and let me know if this satisfies your requirement.

Regarding query number 1, I tried sending a large string over the UART using the API Cy_SCB_UART_PutArray and immediately after the same tried sending another large string using Uart_DMA_Transmit() API but did not find any hardfault occurrence but only that the output data for the first API was stopped in half and the second one by the DMA started which is because both are using the same TX FIFO to send the data. So in short, no, it should not cause a hardfault, but only a corruption in the transmitted data.

Warm Regards
Alen

0 Likes