Can you please let me know why you want to change the bus width at runtime?
Can you please elaborate on your application and requirement?
Also, can you please let me know the pixel depth you are using ?
- I want to use 24-bit output only with FHD, 2K, 4K resolutions.
- It is a webcam application and expected MJPEG 60fps at FHD.
- It supports MJPEG(8) and YUV(16) preview on 16-bit GPIF bus.
Thanks for the reply.
Can you please let me know what is the buffer size you are using or passing to the CyU3PMipicsiGpifLoad()?
The CyU3PMipicsiGpifLoad() API takes the first parameter as busWidth and the second parameter is the bufferSize being used for the DMA channel.
The CY_U3P_ERROR_BAD_ARGUMENT comes up based on the bufferSize parameter stated above.
For 16-bit busWidth, the bufferSize should be divisible by 2 and if this is not satisfied, the BAD_ARGUMENT error is thrown.
For 24-bit busWidth, the bufferSize should be divisible by 3 and if not, the BAD_ARGUMENT error is thrown.
You can try passing the default generated by the CX3 config utility as the second parameter when changing the bus width:
#define CX3_UVC_DATA_BUF_SIZE (0x8FD0)
I can now change the GPIF bus width at runtime.
I setup the buffer size for DMA and CyU3PMipicsiGpifLoad carefully before changing the resolution and it works without any problems.
Thanks for your help.