We are working on a CX3 and we have a working set (sensor + HW + SW).
Currently we are able to get 6fps (4096x3072 pixel/frame) and we want to increase this rate.
We plan to:
Increase USB data rate.
Increase DMA buffers size to fit USB burst.
and finally change CX3 MIPI receiver configuration and sensor configuration.
Do we start from the right side ?
we are working with an ISO EP and plan to increase burst length from 8 to 12.
Iso packets is set to 3 and packet size to 1024. So from AN86947 we should achieve around 287.9MB/s (theorically: 3*12*1024*8000 B/s).
We understand from datasheet/AN/documentation/community topics that the multichannel DMA connected to the EP should be of the same size as data sent per service interval.
In our case, we are currently working with 24KB/ SI and we want to increase it to 36KB/ SI.
So we need to increase our DMA buffer to 36KB.
We are using the following DMA cfg:
l_t_DmaCfg.size = 24576;
l_t_DmaCfg.count = 4;
l_t_DmaCfg.validSckCount = 2;
l_t_DmaCfg.prodSckId = CY_U3P_PIB_SOCKET_0;
l_t_DmaCfg.prodSckId = CY_U3P_PIB_SOCKET_1;
l_t_DmaCfg.consSckId = CY_U3P_UIB_SOCKET_CONS_3;
l_t_DmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
l_t_DmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT | CY_U3P_DMA_CB_CONS_EVENT;
l_t_DmaCfg.cb = sgm_cb_ManageStream;
l_t_DmaCfg.prodHeader = 192;
l_t_DmaCfg.prodFooter = 0;
l_t_DmaCfg.consHeader = 0;
l_t_DmaCfg.prodAvailCount = 1;
We are using default memory map, so 224KB are reserved for buffers.
If we just change DMA size, we obviously have an error (36KB x 4 buffers x 2 sockets = 288KB) because we demand more space than available.
CyU3PDmaMultiChannelCreate returns CY_U3P_ERROR_MEMORY_ERROR. (0x10)
So we tried to reduce the DMA buffer number, from 4 to 2 (36KB x 2 buffers x 2 sockets = 144KB).
CyU3PDmaMultiChannelCreate is working.
But we have an error when, later, we call a reset (CyU3PDmaMultiChannelReset). the error code is 0x40 (CY_U3P_ERROR_BAD_ARGUMENT).
We don't have it when we keep 4 buffers per socket.
We don't understand why we get this error.
Any idea ?