CX3 config SPI interface not work

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

cross mob
wayu_4276666
Level 3
Level 3
25 replies posted 10 replies posted 10 questions asked

Hi Sir,

I have a question about config SPI 

io_cfg.useSpi = CyFalse;  <- use this setting , the CX3 can work well

io_cfg.useSpi = CyTrue;  <- use this setting , the CX3 can not work, the E-CAM can not recognized CX3

it seems the PC host not get the CX3 descriptor.

My setting as below:

#define DUMMY_COMPLEX_GPIO  56

main()

{

...

/* Configure the IO matrix for the device.*/
io_cfg.isDQ32Bit = CyFalse;
io_cfg.useUart = CyTrue;
io_cfg.useI2C = CyTrue;
io_cfg.useI2S = CyFalse;
io_cfg.useSpi = CyFalse;

io_cfg.lppMode = CY_U3P_IO_MATRIX_LPP_DEFAULT;

/* No GPIOs are enabled. */
io_cfg.gpioSimpleEn[0] = 0;
io_cfg.gpioSimpleEn[1] = 0;
io_cfg.gpioComplexEn[0] = 0x0;
io_cfg.gpioComplexEn[1] = 0x1<<(DUMMY_COMPLEX_GPIO-32);
status = CyU3PDeviceConfigureIOMatrix (&io_cfg);

}

BR

 

Ben

0 Likes
1 Solution
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Ben,

Please refer to pin description in the CX3 datasheet : https://www.cypress.com/file/133591/download.
Pin number 56 is for SPI_MISO when SPI is enabled, but in your application, 56 pin is also used as a complex GPIO. Try changing the pin for Complex GPIO.

Also, check if any of the APIs are failing in the firmware.

Best Regards,
AliAsgar

View solution in original post

0 Likes
2 Replies
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Ben,

Please refer to pin description in the CX3 datasheet : https://www.cypress.com/file/133591/download.
Pin number 56 is for SPI_MISO when SPI is enabled, but in your application, 56 pin is also used as a complex GPIO. Try changing the pin for Complex GPIO.

Also, check if any of the APIs are failing in the firmware.

Best Regards,
AliAsgar

0 Likes

Hi Sir,

when i setting the io_cfg.useSpi = CyTrue, and must not setting the complex GPIO, then the CX3 can work well.

Thank you for your answer.

 

BR

Ben

0 Likes