Skip to content

4.2.2 Causes Nicla ME to crash when receiving input over I2C #1031

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

Closed
kdinev-IEC opened this issue Feb 25, 2025 · 0 comments · Fixed by #1032
Closed

4.2.2 Causes Nicla ME to crash when receiving input over I2C #1031

kdinev-IEC opened this issue Feb 25, 2025 · 0 comments · Fixed by #1032

Comments

@kdinev-IEC
Copy link

Description

I have the bare-bones configuration with Nicla ME and Portenta H7. Running the "App.ino" example from BHY2 library on Nicla ME and "Temperature.ino" example from BHY2Host library on Portenta H7. Connected as a shield configuration.

When using the latest version of the mbed core (4.2.2), whenever the Nicla receives any data over I2C, mbed crashes with the following msg:

Error Log

++ MbedOS Error Info ++
Error Status: 0x80010133 Code: 307 Module: 1
Error Message: Mutex: 0x20005284, Not allowed in ISR context
Location: 0x1C0A3
Error Value: 0x20005284
Current Thread: I2CSlave Id: 0x20009EA8 Entry: 0x49E31 StackSize: 0x800 StackMem: 0x20009EF0 SP: 0x2000A35C 
For more info, visit: https://mbed.com/s/error?error=0x80010133&tgt=NICLA
 -- MbedOS Error Info --

Fix

This error does not appear when using version 4.2.1, and everything works fine.

Source Code

Portenta H7:

#include "Arduino.h"
#include "Arduino_BHY2Host.h"

Sensor temp(SENSOR_ID_TEMP);

void setup()
{
  Serial.begin(115200);
  while(!Serial);

  BHY2Host.begin(false, NICLA_AS_SHIELD);
  temp.begin();
}

void loop()
{
  static auto printTime = millis();
  BHY2Host.update();

  if (millis() - printTime >= 1000) {
    printTime = millis();
    Serial.println(String("Temperature: ") + String(temp.value(), 3));
  }
}

Nicle ME:

#include "Arduino_BHY2.h"

void setup()
{
  BHY2.begin(NICLA_I2C, NICLA_AS_SHIELD);
}

void loop()
{
  // Update and then sleep
  BHY2.update(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant