TTGO T3 V1.6.1 FAILURE oslmic.c:53

Good morning,
Thank you for reading me.
I have a Lilygo TTGO T3 V1.6.1 card and I would like to communicate with the Lorawan protocol.
I installed the MCCI_LoRaWAN_LMIC_library.
I work with the sketch: “ttn-otaa.ino”.
I defined the pinmaps:

const lmic_pinmap lmic_pins = {
        .nss=18,
            .rxtx = 5,
            .rst=23,
            .dio = {26, 33, 34}
        };

I changed the lmic_project_config.h file and put there:

#define CFG_eu868 1
#define CFG_sx1276_radio 1

Following the error “Board not supported – use an explicit pinmap”
I added the line:

#define hal_init LMICHAL_init

A problem occurs when executing @os_init();
I get the error:

FAILURE
f:\Computing\arduino\Programs\libraries\MCCI_LoRaWAN_LMIC_library\src\lmic\oslmic.c:53
Guru Meditation Error: Core 1 panic’ed (Interrupt wdt timeout on CPU1).

I have of course searched the forums but I can’t find a way to continue.

I don’t know what to do now to move on. Thanks for any help you can give me.

I had this exact same problem a few weeks ago on an esp32-c3 board and solved it after a lot of hard debugging. Once you get it running then the ttn_otaa example works extremely well. But the setup is buggy

Here’s what’s missing… even though you set up your pinmap, it never gets loaded. Even worse, when the ASSERT to detect the missing pinmap gets triggered, there’s a bug that causes the processor to segfault. So any useful information gets buried in a never-end log dump. Here are two things that you’ll want to do to fix this:

  1. Open MCCI_LoRaWAN_LMIC_library/src/hal/hal.cpp in the libraries directory. On my Mac, that folder is in ${HOME}/Documents/Arduino/libraries. If you’re using the Arduino IDE and can’t open the file then just try another editor. Once you have the file open, look for a call to hal_disableIRQs around line 479. Comment that out and try again. That should take care of the never-ending segfault loop. I still have to investigate, but it seems that IRQs are not turned on by default and trying to turn them off when displaying the error in the ASSERT function is what causes the processor to crash and restart the MCU

  2. The root cause for the ASSERT is that your pinmap never gets loaded. That’s right, despite how everything appears and any build errors that you worked through to get this far, that pinmap that you worked so hard to adjust never gets loaded. That’s because the setup() function uses os_init to initialize the LMIC library and os_init depends on a global lmic_pins which is never set. Hence the call to ASSERT. If you want to use the predefined HAL configs in the library (after tweaking them like you did), you can put #include <arduino_lmic_hal_boards.h> at the top of your file and then replace the os_init() call in the setup function to this…

const Arduino_LMIC::HalPinmap_t *lmic_pins = Arduino_LMIC::GetPinmap_ThisBoard();
os_init_ex((const void *)lmic_pins);

And with that change you should either start working or get meaningful errors if something is still wrong

One final note… instead of using GetPinmap_ThisBoard, I just copied one of the pinmaps from the library, made my changes, and included it directly into the ttn_otaa.ino file. Then, instead of calling GetPinmap_ThisBoard to get your pinmap you can pass your custom pinmap directly to the os_init_ex function

1 Like