(resolved) I2C malloc error
(resolved) I2C malloc error
Hi all -
Occasionally my program throws this error:
E (2113976) i2c: i2c command link malloc error
abort() was called at PC 0x40123d9f on core 1
Backtrace: 0x4008da28:0x3ffdd390 0x4008dc7d:0x3ffdd3b0 0x40123d9f:0x3ffdd3d0 0x40123de6:0x3ffdd3f0 0x4010aacb:0x3ffdd410 0x40112823:0x3ffdd430 0x400ec0a5:0x3ffdd450 0x400ec428:0x3ffdd4b0 0x400ec52d
At other times, I get a GME without the message, but the same result (reboot). Is anyone aware of a bug in the I2C library, or am I really running out of heap?
Running the ESP-IDF master branch. Thanks...
Occasionally my program throws this error:
E (2113976) i2c: i2c command link malloc error
abort() was called at PC 0x40123d9f on core 1
Backtrace: 0x4008da28:0x3ffdd390 0x4008dc7d:0x3ffdd3b0 0x40123d9f:0x3ffdd3d0 0x40123de6:0x3ffdd3f0 0x4010aacb:0x3ffdd410 0x40112823:0x3ffdd430 0x400ec0a5:0x3ffdd450 0x400ec428:0x3ffdd4b0 0x400ec52d
At other times, I get a GME without the message, but the same result (reboot). Is anyone aware of a bug in the I2C library, or am I really running out of heap?
Running the ESP-IDF master branch. Thanks...
Last edited by mzimmers on Wed Apr 17, 2019 8:49 pm, edited 1 time in total.
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: I2C malloc error
Sounds like you're out of memory; the i2c driver throws that error when a malloc of internal RAM fails.
Re: I2C malloc error
Thanks, Sprite. Well, I can't add memory to our board, so I'll have to try to trim some fat. How do I get make to generate a map file for me?
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: I2C malloc error
It should automatically do that while linking iirc, it's under build/[projectname].map .
Re: I2C malloc error
Doesn't seem to be. Is it possible I have an option set somewhere in my build command files to suppress map generation?
Re: I2C malloc error
1) How many threads do you have? Have you tried monitoring the min stack free on those threads to see if you can lower the stack size?
2) Do you need Bluetooth? Both BLE and classic. I freed up a lot of memory by eliminating Bt. If I need BLE, it's only for configuration and I reboot after with Bt disabled.
John A
2) Do you need Bluetooth? Both BLE and classic. I freed up a lot of memory by eliminating Bt. If I need BLE, it's only for configuration and I reboot after with Bt disabled.
John A
Re: I2C malloc error
I have 8 threads besides main(). I'm sure you're right about being able to reduce the stack sizes.
I don't use Bluetooth, or BLE, but I can't rule out the use of it someday, and since we'd rather not have to do 2 FCC compliance tests (one with Bluetooth and one without), I think I need to keep it enabled.
I read here: https://docs.espressif.com/projects/esp ... m-data-ram
I don't use Bluetooth, or BLE, but I can't rule out the use of it someday, and since we'd rather not have to do 2 FCC compliance tests (one with Bluetooth and one without), I think I need to keep it enabled.
I read here: https://docs.espressif.com/projects/esp ... m-data-ram
What is trace memory?DRAM (data RAM)
Non-constant static data and zero-initialized data is placed by the linker into the 256 kB 0x3FFB0000 — 0x3FFF0000 region. Note that this region is reduced by 64kB (by shifting start address to 0x3FFC0000) if Bluetooth stack is used. Length of this region is also reduced by 16 kB or 32kB if trace memory is used.
Re: I2C malloc error
Hi all -
I am still trying to chase down the cause of this persistent I2C crash. Evidently, a lot of other users are experiencing similar troubles, and I found a post from last year where it's suggested that the problem may be in the hardware:
https://www.esp32.com/viewtopic.php?f=1 ... =20#p20533
We have no such pull-up resistors on the SDA or SCL lines, so if the poster is correct, this might be an issue.
But...could this lack of pull-ups manifest in a GME panic in a call to i2c_master_cmd_begin_static()? Seems like an odd way for this problem to show up...
Thanks for any insights...I really need to get this fixed soon.
I am still trying to chase down the cause of this persistent I2C crash. Evidently, a lot of other users are experiencing similar troubles, and I found a post from last year where it's suggested that the problem may be in the hardware:
https://www.esp32.com/viewtopic.php?f=1 ... =20#p20533
We have no such pull-up resistors on the SDA or SCL lines, so if the poster is correct, this might be an issue.
But...could this lack of pull-ups manifest in a GME panic in a call to i2c_master_cmd_begin_static()? Seems like an odd way for this problem to show up...
Thanks for any insights...I really need to get this fixed soon.
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: I2C malloc error
You certainly need pull-ups, but the likelyhood of it resulting in a crash like that is low. (Depends on what your code does, however.)
Who is online
Users browsing this forum: Bing [Bot], Gaston1980 and 63 guests