1 Reply Latest reply on Jan 10, 2018 7:16 AM by madhul_36

    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.

    jallen_2266616

      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

        • 1. Re: 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.
          madhul_36

          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