Base on the example here, I added ESP32 BLE Keyboard library to it.
#include <BleKeyboard.h>
BleKeyboard bleKeyboard;
void setup()
{
//...
Serial.println("Starting BLE work!");
bleKeyboard.begin();
return;
}
I found that it crashes at whatever execute later, bleKeyboard.begin()
or USH.init()
.
The ESP32 I am using is ESP32-DevkitC (ESP32WROOM32D).
ble.begin() before USH.init()
Starting BLE work!
USB Soft Host Test for Default Wroom
USB#0 (pins 16 17) is OK!
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
cpu freq = 240 MHz
TIME_MULT = 51
ets Jun 8 2016 00:22:57
rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1240
load:0x40078000,len:13012
load:0x40080400,len:3648
entry 0x400805f8
Starting BLE work!
USB Soft Host Test for Default Wroom
USB#0 (pins 16 17) is OK!
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
cpu freq = 240 MHz
TIME_MULT = 51
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1240
load:0x40078000,len:13012
load:0x40080400,len:3648
entry 0x400805f8
ble.begin() after USH.init()
USB Soft Host Test for Default Wroom
USB#0 (pins 16 17) is OK!
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
cpu freq = 240 MHz
TIME_MULT = 51
D= 0 4800 bits in 1157.000000 uSec 4.148660 MHz 6 ticks in 1.446250 uS
D= 127 4800 bits in 3672.000000 uSec 1.307190 MHz 6 ticks in 4.590000 uS
D= 63 4800 bits in 2411.000000 uSec 1.990875 MHz 6 ticks in 3.013750 uS
D= 95 4800 bits in 3011.000000 uSec 1.594155 MHz 6 ticks in 3.763750 uS
D= 111 4800 bits in 3378.000000 uSec 1.420959 MHz 6 ticks in 4.222500 uS
D= 103 4800 bits in 3192.000000 uSec 1.503759 MHz 6 ticks in 3.990000 uS
D= 107 4800 bits in 3257.000000 uSec 1.473749 MHz 6 ticks in 4.071250 uS
D= 105 4800 bits in 3251.000000 uSec 1.476469 MHz 6 ticks in 4.063750 uS
D= 104 4800 bits in 3198.000000 uSec 1.500938 MHz 6 ticks in 3.997500 uS
D= 104 4800 bits in 3191.000000 uSec 1.504231 MHz 6 ticks in 3.988750 uS
TRANSMIT_TIME_DELAY = 106 time = 3.997500 error = -0.062501%
USB#1 is disabled by user configuration
USB#2 is disabled by user configuration
USB#3 is disabled by user configuration
USB Soft Host init successfully
Starting BLE work!
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400d398c: 0000f01d 91004136 8230f1e6
Core 1 register dump:
PC : 0x400d3992 PS : 0x00060031 A0 : 0x80081216 A1 : 0x3ffbeea0
A2 : 0x3ffc2d80 A3 : 0x3ffc3b70 A4 : 0x0000037c A5 : 0x3ffc2b6c
A6 : 0xfffffff7 A7 : 0x3ffc1464 A8 : 0x800813b1 A9 : 0x3ff00040
A10 : 0x00000011 A11 : 0x00000011 A12 : 0x8008286c A13 : 0x3ffcfa60
A14 : 0x00000020 A15 : 0x13000054 SAR : 0x00000020 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x4008fbb8 LEND : 0x4008fbc3 LCOUNT : 0x00000000
Backtrace:0x400d398f:0x3ffbeea00x40081213:0x3ffbeec0 0x40084af1:0x3ffbeee0 0x4009635b:0x3ffcfa40 0x400960ed:0x3ffcfa60 0x40098aa9:0x3ffcfaa0 0x40082251:0x3ffcfb20 0x400e188a:0x3ffcfb60 0x400e344e:0x3ffcfb90 0x400e3f79:0x3ffcfbb0 0x400e44dd:0x3ffcfbd0 0x400e2881:0x3ffcfc60 0x400e2f2a:0x3ffcfce0 0x400e32e3:0x3ffcfd50 0x400e1b03:0x3ffcfd70 0x400e1f85:0x3ffcfda0 0x40165dd7:0x3ffcfdc0 0x40165fbf:0x3ffcfe30 0x401660a4:0x3ffcfe60 0x400eb010:0x3ffcfe80 0x400db95a:0x3ffcfea0 0x400d74dd:0x3ffcfef0 0x400d453a:0x3ffcff20 0x400d1f4a:0x3ffcff60 0x400dc33f:0x3ffcffb0
ELF file SHA256: 0000000000000000
Rebooting...
ets Jun 8 2016 00:22:57
rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1240
load:0x40078000,len:13012
load:0x40080400,len:3648
entry 0x400805f8
USB Soft Host Test for Default Wroom
USB#0 (pins 16 17) is OK!
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
READ_BOTH_PINS = 0000
cpu freq = 240 MHz
TIME_MULT = 51
D= 0 4800 bits in 1157.000000 uSec 4.148660 MHz 6 ticks in 1.446250 uS
D= 127 4800 bits in 3672.000000 uSec 1.307190 MHz 6 ticks in 4.590000 uS
D= 63 4800 bits in 2411.000000 uSec 1.990875 MHz 6 ticks in 3.013750 uS
D= 95 4800 bits in 3011.000000 uSec 1.594155 MHz 6 ticks in 3.763750 uS
D= 111 4800 bits in 3378.000000 uSec 1.420959 MHz 6 ticks in 4.222500 uS
D= 103 4800 bits in 3192.000000 uSec 1.503759 MHz 6 ticks in 3.990000 uS
D= 107 4800 bits in 3258.000000 uSec 1.473297 MHz 6 ticks in 4.072500 uS
D= 105 4800 bits in 3251.000000 uSec 1.476469 MHz 6 ticks in 4.063750 uS
D= 104 4800 bits in 3198.000000 uSec 1.500938 MHz 6 ticks in 3.997500 uS
D= 104 4800 bits in 3191.000000 uSec 1.504231 MHz 6 ticks in 3.988750 uS
TRANSMIT_TIME_DELAY = 106 time = 3.997500 error = -0.062501%
USB#1 is disabled by user configuration
USB#2 is disabled by user configuration
USB#3 is disabled by user configuration
USB Soft Host init successfully
Starting BLE work!
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400d398c: 0000f01d 91004136 8230f1e6
Core 1 register dump:
PC : 0x400d3992 PS : 0x00060031 A0 : 0x80081216 A1 : 0x3ffbeea0
A2 : 0x3ffc2d80 A3 : 0x3ffc3b70 A4 : 0x0000037c A5 : 0x3ffc2b6c
A6 : 0xfffffff7 A7 : 0x3ffc1464 A8 : 0x800813b1 A9 : 0x3ff00040
A10 : 0x00000011 A11 : 0x00000011 A12 : 0x8008286c A13 : 0x3ffcfa60
A14 : 0x00000020 A15 : 0x13000054 SAR : 0x00000020 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x4008fbb8 LEND : 0x4008fbc3 LCOUNT : 0x00000000
Backtrace:0x400d398f:0x3ffbeea00x40081213:0x3ffbeec0 0x40084af1:0x3ffbeee0 0x40096356:0x3ffcfa40 0x400960ed:0x3ffcfa60 0x40098aa9:0x3ffcfaa0 0x40082251:0x3ffcfb20 0x400e188a:0x3ffcfb60 0x400e344e:0x3ffcfb90 0x400e3f79:0x3ffcfbb0 0x400e44dd:0x3ffcfbd0 0x400e2881:0x3ffcfc60 0x400e2f2a:0x3ffcfce0 0x400e32e3:0x3ffcfd50 0x400e1b03:0x3ffcfd70 0x400e1f85:0x3ffcfda0 0x40165dd7:0x3ffcfdc0 0x40165fbf:0x3ffcfe30 0x401660a4:0x3ffcfe60 0x400eb010:0x3ffcfe80 0x400db95a:0x3ffcfea0 0x400d74dd:0x3ffcfef0 0x400d453a:0x3ffcff20 0x400d1f4a:0x3ffcff60 0x400dc33f:0x3ffcffb0
ELF file SHA256: 0000000000000000
Rebooting...