Hi Guys,
Hava a problem with I2C bus:
Background:
From August to October I was prototyping my device in Arduino IDE. Simply I was using FreeRTOS, Wifi functionality, reading I2C four sensors VL6180. There was a problem wiht I2c which stuck and did not get up (for exampple short SDA to GND or some EMI couse it). Only HW reset could help, SW did not help to solve this - I2C bus was stucked. Then you add Wire.reset() functionality to solve this and this of course help - i simple handle error by reseting I2C bus. It was ok for me beacuse this error occour very rarely (hours or days). Losing data from sensors wasnt a problem couse I'm sampling with 40 times per second (4 xi2c device ). I left it like this - works fine with wifi and I2c. I was using 21/22 pinns fo SDA/SCL
Then i moved to ESP-IDF with arduino as component. Code was pretty much the same, same library. And here started a problem with randomly ERROR 5 I2C every 3 to 10 second. When I did not use WIFI stack there was no such problem. Wire.Reset of course helps but i lost a lot of readings now witch are critical for my device and sampling time as well.
I know a lot of issue on forum with I2C (stickbreaker lib- didnt try, changing I/O pins, Wifi storage change, changing core pined to etc etc) but any could help. I found a workaround for me - is to set 25 priority for task which use I2C bus and this solve my problem - works the same as in Arduino Ide - no error 5. Wifi also works ok with this setting. I suppose it is a problem with sharing some resoureces with wifi stack (maybe ADC2 or smth else). I did not see this workaround with higher priority on forum.
I wrote this maybe it could be a clue
So my question is:
1) Is it ok and safe to set higher priority for task using i2C phi?
2) What is a difference between I2c driver on Arduino IDE and ESP-IDF? I'm sure that there was no problem with error 5 in Arduino ide using Wire lib
3) Are there any more option to solve that?
4) What pins i could use for SDA/SCL and configure to use ADC1 for I2C comunication?
And aslo want to say Hello to everyone- good job here realy appreciate
Thanks in advance
I2c problem, error 5 - (also I think new workaround)
-
sirkotkies
- Posts: 4
- Joined: Wed Oct 11, 2017 2:16 am
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- ESP32-S31
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- ESP32-S31 中文讨论版
- 喵伴 中文讨论版
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: Bytespider, Qwantbot and 1 guest
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.
Information
Espressif ESP32 ... Available now!