Hi everyone,
I am trying to use the qwiic openLog with my artemis global tracker, but it create some Mbed OS errors. I’m building my code over Example15_BetterTracker.
I wonder what might be the problem. I know that the artemis global tracker has other i2c devices (barometric sensor and iridium) connected. In the examples for the openlog we need to use Wire and those other device use Twowire.
I wonder if creating two instances can create some bug.
#include <Wire.h> // Needed for I2C
const byte PIN_AGTWIRE_SCL = 8;
const byte PIN_AGTWIRE_SDA = 9;
TwoWire agtWire(PIN_AGTWIRE_SDA, PIN_AGTWIRE_SCL); //Create an I2C port using pads 8 (SCL) and 9 (SDA)
#include "SparkFun_Qwiic_OpenLog_Arduino_Library.h"
OpenLog myLog; //Create instance
void setup()
{
// Start the console serial port
Serial.begin(115200);
Wire.begin();
myLog.begin();
Whenever I use myLog.println(someString) the program crashes. But when I use only the examples of the openlog qwiic library it works without problem. So I wonder, if the problem comes from using Wire and twoWire at the same time.
Here’s the error i’m getting:
++ MbedOS Fault Handler ++
FaultType: HardFault
Context:
R0: 10009FFC
R1: 186A0
R2: 1123456
R3: 50008000
R4: 0
R5: 10009FFC
R6: 10007B2C
R7: 39
R8: 10001404
R9: 10001088
R10: 10007AC8
R11: 10007A74
R12: 30679
SP : 10007958
LR : 31D79
PC : 35498
xPSR : 1000000
PSP : 100078F0
MSP : 1005FF70
CPUID: 410FC241
HFSR : 40000000
MMFSR: 0
BFSR : 82
UFSR : 0
DFSR : 0
AFSR : 0
BFAR : 50008214
Mode : Thread
Priv : Privileged
Stack: PSP
-- MbedOS Fault Handler --
++ MbedOS Error Info ++
Error Status: 0x80FF013D Code: 317 Module: 255
Error Message: Fault exception
Location: 0x35498
Error Value: 0x10006BB8
Current Thread: main Id: 0x10004F94 Entry: 0x2FA09 StackSize: 0x1000 StackMem: 0x10006C18 SP: 0x10007958
For more info, visit: https://mbed.com/s/error?error=0x80FF013D&tgt=SFE_ARTEMIS_ATP
-- MbedOS Error Info --
Let me know if you need more info.