CYW20819 I2C timeout

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

cross mob
ToKo_4602001
Level 4
Level 4
50 sign-ins 25 replies posted 25 sign-ins

i2cm_write(), i2cm_read() or wiced_hal_i2c_write(), wiced_hal_i2c_read() functions work well when SDA/SCL lines are correctly pulled up and a slave device is correctly connected.

But when these lines are not pulled up, these functions are not return forever.

In many case, with watchdog timer, system will reset.

I'd like to check if I2C line is OK and even if there are some problems, I want firmware to proceed to next process and to output warnings.

Please tell me a work around for this issue or how to set timeout.

Thanks

0 Likes
1 Solution

Hi ToKo_4602001 ,

If this serves your application requirement , please use  the same.

Regards,

Anjana

View solution in original post

0 Likes
4 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi ToKo_4602001 ,

Unfortunately there is no way to avoid this system reset when I2C is initialized and no I2C device is connected in 20819.

Regards,

Anjana

Hi ToKo_4602001 ,

However , Instead of external pull up, can you configure internal gpio pull up on those pins (using wiced_hal_gpio_configure_pin  - so the device won't kick the watchdog )  and try if the device resets? If this works, you can use this method as a work around.

Regards,

Anjana

0 Likes

Thank you for your reply.

Unfortunately once I set a role of GPIO with wiced_hal_gpio_select_function(), it seems that wiced_hal_gpio_configure_pin() is ignored.

So as workaround, at start-up I will reset GPIO to normal input and then check input level. If input level is high, I will set GPIO to I2C again with wiced_hal_gpio_select_function().

Thanks

0 Likes

Hi ToKo_4602001 ,

If this serves your application requirement , please use  the same.

Regards,

Anjana

0 Likes