Any way to use CyU3PDebugInit on an already initialized socket? I want debug output and other DMA output to both be directed to the UART.

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

cross mob
Anonymous
Not applicable

Any way to use CyU3PDebugInit on an already initialized socket?  I want debug output and other DMA output to both be directed to the UART.

I know if I call CyU3PDebugInit first, then a subsequent call to CyU3PDmaChannelCreate fails with return value of 64.

Is there any other way to achieve this result?

I'm using FX3.

Thanks,

Joe

0 Likes
1 Solution
Anonymous
Not applicable

Hi,

You cannot use the same socket for both DebugInit and DmaChannelCreate. The CyU3PDebugDeInit function must be called before using that socket for some other purpose.

If you want to have both the Debug data and some other data both to be directed to the UART, follow these steps:

1) Create the DMA Channel as for your usual operation that uses the UART socket.

2) Whenever you want to send Debug data through the same socket, call the CyU3PDmaChannelSetupSendBuffer API. This API is used to send a user provided buffer to the consumer of a DMA Channel (in your case, it is the UART). In other words, it overrides the DMA Channel for time being. In the buffer, you can include you Debug Data (usually debug texts sent as bytes in ASCII form)

Regards,

- Madhu Sudhan

View solution in original post

0 Likes
1 Reply
Anonymous
Not applicable

Hi,

You cannot use the same socket for both DebugInit and DmaChannelCreate. The CyU3PDebugDeInit function must be called before using that socket for some other purpose.

If you want to have both the Debug data and some other data both to be directed to the UART, follow these steps:

1) Create the DMA Channel as for your usual operation that uses the UART socket.

2) Whenever you want to send Debug data through the same socket, call the CyU3PDmaChannelSetupSendBuffer API. This API is used to send a user provided buffer to the consumer of a DMA Channel (in your case, it is the UART). In other words, it overrides the DMA Channel for time being. In the buffer, you can include you Debug Data (usually debug texts sent as bytes in ASCII form)

Regards,

- Madhu Sudhan

0 Likes