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

PSoC™ 6 Forum Discussions

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

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
AlenAn14
Moderator
Moderator 500 replies posted 100 solutions authored 250 replies posted
Moderator

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
AlenAn14
Moderator
Moderator 500 replies posted 100 solutions authored 250 replies posted
Moderator

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