I am using sdk CX3 SDK version 1.3.3
 I am encountering irregular things wrt to the CyU3PUsbSendEP0Data / CyU3PUsbGetEP0Data functions.
The first arguement of both of these is suppose to be a size in bytes according to the info in cyu3usb.h, yet I encounter several instances of CyU3PUsbGetEP0Data calls which seem incorrect in the example code (both in the Cypress SDK as in de Econ devkits democode). Most of the time it seems the first argument of the CyU3PUsbGetEP0Data is in bits but even then it sometimes does not make sense.
A nice example is eg in Cx3UvcOV5640\cycx3_uvc.c line 1034:
status = CyU3PUsbGetEP0Data(16, &glStillReq, &readCount);
(with "static uint8_t glStillReq = 0; " ).
Even if the argument is in bits which the 16 seems to suggest, this still looks like a memory corruption because glStillReq is only 8 bits.
 Is would like to have more details about CyU3PDebugPrint, is this function thread safe ? Can it be called from interrupt level ?
Als the documentation of this function is plain wrong: " This function can be used by the application code to log free form message strings, and causes the output message to be written to the UART immediately."
As become apparent by the other functions, it in fact does not immediately outputs the log message but it is placed in a buffer.
How big is this buffer ? Is is statically or dynamically allocated ?
(For some reason i get corrupted uart output from a certain point onwards after modifying the code for my own sensor)
 General question
Is it possible to obtain sources of parts of the SDK ? I understand the sensor and threadx code cannot be released, but it would help a lot if I could dig into the rest to find out the answer to these questions on my own and to debug stuff that is going on. Which threads are running in the system with what parameters ? How is the thread safety of all these functions ? Etc etc.
 Last remark about the code, in cyfxtx.c:
void *CyU3PMemAlloc ( uint32_t size)
/* Cannot wait in interrupt context */
if (CyU3PThreadIdentify ())
status = CyU3PByteAlloc (&glMemBytePool, (void **)&ret_p, size, CY_U3P_MEM_ALLOC_TIMEOUT);
status = CyU3PByteAlloc (&glMemBytePool, (void **)&ret_p, size, CYU3P_NO_WAIT);
threadx memory allocation functions can not be called from interrupt context (and most malloc functions cannot), that is not not what the last argument of tx_byte_allocate is for. So another thing i wanted to check in the sources is that this is never done.