BLE with the arduino framework



  • We are using the M5core2 and we want to run a BLE-based application using the Arduino programming framework. We download the library for the ESP architecture: https://www.arduino.cc/reference/en/libraries/esp32-ble-arduino/

    But, it seems that the library is not compatible with this architecture. We got the following error when initializing the library.

    ***Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1)
    Core 1 register dump:
    PC : 0x40096769 PS : 0x00060334 A0 : 0x800987a2 A1 : 0x3ffc8080
    A2 : 0x37735134 A3 : 0x0000abab A4 : 0xb33fffff A5 : 0x00000001
    A6 : 0x00060120 A7 : 0x0000cdcd A8 : 0x400df228 A9 : 0x3ffc81a0
    A10 : 0x3f41ef14 A11 : 0x00000069 A12 : 0x3f41f248 A13 : 0x3f41efa0
    A14 : 0x00000001 A15 : 0x00000000 SAR : 0x00000020 EXCCAUSE: 0x00000006
    EXCVADDR: 0x00000000 LBEG : 0x40092a50 LEND : 0x40092a6c LCOUNT : 0xffffffff

    ELF file SHA256: 0000000000000000

    Backtrace: 0x40096769:0x3ffc8080 0x4009879f:0x3ffc80b0 0x40098dc9:0x3ffc80d0 0x4008239d:0x3ffc80f0 0x400825d4:0x3ffc8110 0x40082639:0x3ffc8130 0x400f1a6d:0x3ffc8180 0x400f1065:0x3ffc81a0 0x400d66a2:0x3ffc81d0 0x400d1825:0x3ffc8200 0x400dd3e2:0x3ffc8250 0x40095736:0x3ffc8270

    Core 0 register dump:
    PC : 0x40015c45 PS : 0x00060434 A0 : 0x80015e4d A1 : 0x3ffcb8d0
    A2 : 0x3ffcb9e0 A3 : 0x3ffcb940 A4 : 0x4efc3e53 A5 : 0x00000008
    A6 : 0x3ffcb940 A7 : 0x3ffcb9e0 A8 : 0x3ffcb9fc A9 : 0x00000007
    A10 : 0x6a73bc23 A11 : 0xffffffff A12 : 0x00000000 A13 : 0x6a73bc23
    A14 : 0x00060220 A15 : 0x00000000 SAR : 0x0000001f EXCCAUSE: 0x00000006
    EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000

    ELF file SHA256: 0000000000000000

    Backtrace: 0x40015c45:0x3ffcb8d0 0x40015e4a:0x3ffcb8f0 0x4001606a:0x3ffcb940 0x400161b9:0x3ffcb990 0x400162a1:0x3ffcba30 0x40016889:0x3ffcbc40 0x40016c1a:0x3ffcbd70 0x40019d11:0x3ffcbdf0 0x40055b4d:0x3ffcbe10 0x4016abbf:0x3ffcbe30 0x4016b1cd:0x3ffcbe50 0x40095736:0x3ffcbe80

    Rebooting...***

    Does the M5core 2 support the BLE communication? Is there any Arduino-based library to handle the communication?

    We have tested the library with the M5stack core hardware and it run properly.



  • Hello. Not sure if you managed to get this working yet, but if not, there is a ble library that ships with M5Stack Core2 Arduino install.

    #include <BLEDevice.h>
    on my computer this was installed at this location: .//Library/Arduino15/packages/m5stack/hardware/esp32/2.0.3/libraries/BLE/src/BLEDevice.h
    Hence I did not have to install the package separately.
    I have implemented a project using this just recently using a variety of BLE technology so confident that it works on at least my copy of Core2.

    If you go to the docs link from the library link you posted (https://github.com/nkolban/ESP32_BLE_Arduino) you can see that the project has now been directly incorporated into Arduino. The lib version you may have downloaded may be out of date. You can find BLEDevice.h/BLEDevice.cpp on your machine and check against the main Arduino source.

    Hope this helps?