Page 1 of 1

static memory I2C?

Posted: Fri Oct 01, 2021 12:12 am
by RMandR
Is there an alternate esp32 I2C driver that does not use malloc?

we have an ESP32 application with contained memory and it seems to fail sometimes because of malloc failing to allocate memory for I2C.

I haven't looked deeper to see if this is a heap fragmentation issue (is that even a thing in FreeRTOS?), memory leak, etc. But given the heavy use of the I2C (dedicated task), it seems more reliable to use an MCU based I2C driver as opposed to RTOS.

short of bit-banging a soft I2C driver, looking for a tested alternate esp32 I2C driver.

Re: static memory I2C?

Posted: Fri Oct 01, 2021 2:12 pm
by ESP_Sprite
FWIW, we're adding support for static memory to ESP-IDF; I'm not sure when that will show up on Github, though.

Re: static memory I2C?

Posted: Fri Oct 01, 2021 10:11 pm
by vonnieda

Re: static memory I2C?

Posted: Sun Oct 03, 2021 9:32 pm
by RMandR
@ESP_Sprite
adding support for static memory to ESP-IDF
thanks for the heads up. Do you see an issue with using the HAL or LL layer version of I2C?

@vonnieda: Thanks for the link. Will look into it. Was hoping for a cleaner solution, though this by definition is what I asked for :D