-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-enable cpu cache. Guru Meditation Error: Core 0 panic'ed (Cache disabled but cached memory region accessed). (IDFGH-5520) #7249
Comments
So maybe it is not wifi issue but I2C issue, as using i2c_driver_install(i2c_port, conf.mode, I2C_MASTER_RX_BUF_DISABLE, I2C_MASTER_TX_BUF_DISABLE, (ESP_INTR_FLAG_IRAM | ESP_INTR_FLAG_LEVEL3)); cause rebooting problem, and if using i2c_driver_install(i2c_port, conf.mode, I2C_MASTER_RX_BUF_DISABLE, I2C_MASTER_TX_BUF_DISABLE, 0) works but cost me reading issues. |
I use optimization for size. I check even with -O0. It wasn't working. So any ideas why, when I want to use ISR in IRAM (I2C) I had such problem? |
I'm seeing the same issue, but on pretty much all the examples like nvs_rw_value that call nvs_flash_init(). I've had stuff running in the past, with older versions of esp-idf, but the latest stuff just seems badly broken (or something changed that I haven't figured out). In any case, I've worked with several different ESP-32's from different vendors, trying to get audio to work, but the esp-adf versions they provide are ancient... I'm quickly becoming disenchanted with this development environment... |
Hello @RuslanSpartak , |
Probably. I just used the defaults. I've since gone back to using an older version and it just worked. |
@RuslanSpartak |
On 4.2.1 it is working. On 4.3 - not.
18 листопада 2021, 04:03:56, від "Axel Lin" ***@***.***>:
I'm seeing the same issue, but on pretty much all the examples like nvs_rw_value that call nvs_flash_init(). Have you figured anything out? I was using the latest code, then went back to 4.3.1. I just now tried v4.2.1 to see if that would work, and it does...
@alamaral
Just wondering if you compile with -O0?
Your report looks like the same as #7835
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
I use platformio ide. So can't decode backtrace.
18 листопада 2021, 05:36:52, від "Axel Lin" ***@***.***>:
@RuslanSpartak
Any chance to decode the backtrace? e.g. by running "idf monitor".
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
@RuslanSpartak In that case, you can decode the backtrace manually using |
Dump file looks like: 0x40078000: ?? ??:0 |
@o-marshmallow |
I'm also seeing this issue. Is there any feedback? |
@raphael-bmec-co @o-marshmallow |
@AxelLin I'm actually using the Arduino core. I have pinned down the issue now and I am not 100% sure it is related but here it is for interest: espressif/arduino-esp32#5751 (comment) |
@AxelLin @RuslanSpartak The other thing, which explains the error is that @AxelLin So yes, I would say it is related to #8422, we should not rely on flash functions in ISR because ISR are/may be in IRAM. |
If that is the case then there may be some connection to this too: espressif/arduino-esp32#5882 (comment) |
A patch is on the way for v4.3, it is currently under review |
@o-marshmallow Thank you for the update. Do you have any idea what the pathway and timelines are for the patch making its way into the Arduino Core? |
Hi @raphael-bmec-co , |
It is true. I found it a long time ago, but forget to mention. Hope that new releases will be with fix. |
@o-marshmallow you mentioned you will be patching 4.3. Will you also be patching 4.4? The latest versions of the Arduino core are built against 4.4 and the issue is also seen there. |
It was tested with 4.3 and I had there that issue. I didn't check it with v4.4, but if developers didn't change anything in ISR of I2C than issue should remain. |
Hi @raphael-bmec-co @RuslanSpartak, Good news, both 4.3 and 4.4 have been patched internally, they will be merged to Github once the internal CI passes |
Awesome! Looking forward to being up and running again soon. |
Did we have updates already in v4.3? |
@RuslanSpartak The fix has been merged to |
So you want to say that fix is ready. As I know problem is in calling i2c_ll_update that implement not in IRAM and for esp32 have just ; as implementation. So I have the same cache problem as before. So want to know if I take release v4.3.2 the fix is also present there? |
@RuslanSpartak No, tag |
I use platformio. Hope it will support v4.3.3 |
@o-marshmallow can you confirm that V4.4 will also be patched still? The Arduino core is now based on V4.4 not V4.3. |
@raphael-bmec-co The fix has already been merged to |
@songruo thank you. I'm a little confused because this fix was merged 9 days ago but just 5 days ago @o-marshmallow said the patch was under internal review. Anyway seems to be the same code so I will give it a go. |
@o-marshmallow crash is still occurring exactly as before. I will repeat the test code and stack trace here: #include <WiFi.h>
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
// Set to 1 to accelerate the crash. Set to zero to see a typical use case.
#define ACCELERATED_CRASH 1
// BLE defines.
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"
void setup() {
// Comment this line and the crash does not happen.
heap_caps_malloc_extmem_enable(0);
// Serial.
Serial.begin(115200);
Serial.println("Starting BLE...");
// Minimum BLE simplified from example.
BLEDevice::init("Long name works now");
BLEServer *pServer = BLEDevice::createServer();
BLEService *pService = pServer->createService(SERVICE_UUID);
BLECharacteristic *pCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID,
BLECharacteristic::PROPERTY_READ |
BLECharacteristic::PROPERTY_WRITE
);
pCharacteristic->setValue("Hello World says Neil");
pService->start();
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
pAdvertising->addServiceUUID(SERVICE_UUID);
BLEDevice::startAdvertising();
Serial.println("Started BLE");
// Minimum WiFi.
Serial.println("Starting WiFi connection attempt...");
WiFi.begin("missing network", "password");
Serial.print("Available heap:");
Serial.println(ESP.getFreeHeap());
}
void loop() {
// This causes a crash to happen faster and may be useful for debugging.
// However the crash will happen even without this block.
if(ACCELERATED_CRASH){
while(!WiFi.isConnected()){
log_i("Attempting connection...");
WiFi.begin("missing network", "password");
delay(100);
}
}
delay(1000);
Serial.println("Loop");
}
Seems like there is something else going on? |
@raphael-bmec-co I checked your code, and I think the problem is My thought is your problem is unrelated to this I2C issue. If you have any further question regarding the |
Hi @songruo thank you for looking into this. The Arduino Core contributors also pointed out this likelihood and that there was a default value of 4096. Unfortunately, using 4096 still used up too much heap for me to use SSL and BLE. That said, I have been using a value of 64 and this seems stable so far. Thanks for your assistance. |
will we have fix for sdk version 4.4.1i (2c_ll_update problem when it is in IRAM)? |
Are you going to add that fix in general? or only at some sdk versions? |
Fix is available in v4.4.2: 0022954 |
FYI: we have added fix for this in |
I checked in platformio sdk v4.4.2 and bug is still there. |
Any updates on that? |
I am getting the same issue on ESP32. As long as matrix is not initiated , LittleFS functions nicely. But after display initiated and if LittleFS is used again, ESP32 raises the above error. Is there any way to re-enable cache or prevent GpxMatrix from disabling it or any other way , like CONFIG settings to overcome this issue ? |
Hello, esp32 sdk developers.
When I don't place I2C driver in IRAM (Core 1) then I had sometimes read problems on I2C bus, but generally other stuff is working. When I want to add it in IRAM, I constantly receive "Re-enable cpu cache. Guru Meditation Error: Core 0 panic'ed (Cache disabled but cached memory region accessed). " So seems like wifi driver (Core 0) not working or somehow I2C placed in IRAM influent on wifi and other stuff.
Guru Meditation Error: Core 0 panic'ed (Cache disabled but cached memory region accessed).
Core 0 register dump:
PC : 0x401f80b0 PS : 0x00060034 A0 : 0x80081f11 A1 : 0x3ffc0260
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x3ffbf728 A5 : 0x00002000
A6 : 0x00000026 A7 : 0x3ffd5ef0 A8 : 0x80081e44 A9 : 0x3ffee0c4
A10 : 0x3ffbf728 A11 : 0x00001000 A12 : 0x3ffed5c9 A13 : 0x3ff53000
A14 : 0x00000020 A15 : 0xffffcffb SAR : 0x0000001f EXCCAUSE: 0x00000007
EXCVADDR: 0x00000000 LBEG : 0x40001609 LEND : 0x4000160d LCOUNT : 0x00000000
Backtrace:0x401f80ad:0x3ffc0260 0x40081f0e:0x3ffc0290 0x40083f75:0x3ffc02c0 0x40096d55:0x3ffbc2a0 0x4009cb6d:0x3ffbc2d0 0x4009cb8e:0x3ffbc2f0 0x400856d3:0x3ffbc370 0x401566a1:0x3ffbc3b0 0x40153e1b:0x3ffbc3e0 0x40154989:0x3ffbc400 0x40154d11:0x3ffbc420 0x40153111:0x3ffbc480 0x40153685:0x3ffbc4d0 0x40153ca9:0x3ffbc530 0x401f889d:0x3ffbc550 0x40152ca7:0x3ffbc570 0x40152ccd:0x3ffbc5a0 0x40112f9b:0x3ffbc5c0 0x400d4e11:0x3ffbc600 0x402016dd:0x3ffbc630 0x40096612:0x3ffbc650
The text was updated successfully, but these errors were encountered: