FX3 SlaveFifoSync with I2c support

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

cross mob
FrSe_4506631
Level 1
Level 1
First like received

Hi All,

I am working on some project based on SlaveFifoSync example and we would like to use I2C for temperature monitoring. Find some examples to modify the SlaveFifoSync firmware but after burning the firmware, there is no Cypress USB device when use lsusb.

Tried to isolate changes and found out as long as I change useI2C from False to True and create new firmware, the USB device is not there.

io_cfg.useI2C    = CyTrue;

I tried to use the GPIFII  designer to turn on "I2C" support by checking it and it does not seem to changes anything in the generated header file cyfxgpif_syncsf.h.

Can anyone give some suggestions on how this should be done properly?

Thank you very much,

Frank.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Hello Frank,

Please find the attached .c file with the above-said modifications and the device is enumerating as expected on my end.

Please test it on your end and let me know if you are still facing issues.

Regards,

Yashwant

View solution in original post

0 Likes
4 Replies
YashwantK_46
Moderator
Moderator
Moderator
100 solutions authored 50 solutions authored 50 likes received

Hello Frank,


This issue with slavefifo and I2C is because of making the GPIO [59] which is the I2C_SDA as an Output GPIO.

To avoid this issue, you can try the following:
1.) In the IO matrix config, change the gpioSimpleEn[1] = 0 and also enable I2C as below:

    

     io_cfg.useI2C    = CyTrue;

     io_cfg.gpioSimpleEn[1]  = 0;      //remove the 0x08000000 and set to 0

2.) In CyFxSlFifoApplnInit(), you can either comment out the entire GPIO[59] config structure or change the GPIO number as follows:

     CyU3PDeviceGpioOverride (45, CyTrue);

    /* Configure GPIO 59 as output */

    gpioConfig.outValue = CyTrue;

    gpioConfig.driveLowEn = CyTrue;

    gpioConfig.driveHighEn = CyTrue;

    gpioConfig.inputEn = CyFalse;

    gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;

    apiRetStatus = CyU3PGpioSetSimpleConfig(45, &gpioConfig);

This will make GPIO[45] as an output and also change the CyU3PGpioSetValue (59, CyFalse); to CyU3PGpioSetValue (45, CyFalse); in CyFxSlFifoApplnStart() function.
The status flag will now be applicable to GPIO[45] instead of GPIO[59].


I have tested it on my end and the device is enumerating properly.

Regards,

Yashwant

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Yashwant,

Thank you very much for your reply.

I tried the changes you suggested and the device still does not enumerate as long as I set the useI2C to true. Here attached is the cyfxslfinisync.c with the changes you mentioned. Maybe you can tell me what I have done wrong.

Or can you attach the file with your changes here so that I can give it a try?

0 Likes
lock attach
Attachments are accessible only for community members.

Hello Frank,

Please find the attached .c file with the above-said modifications and the device is enumerating as expected on my end.

Please test it on your end and let me know if you are still facing issues.

Regards,

Yashwant

0 Likes

Hi Yashwant,

Now it works. Thank you very much for your help.

The issue I had is that I didn't change the following line:

io_cfg.gpioSimpleEn[1]  = 0;//0x08000000;

Frank.

0 Likes