Crash with BT and WIFI
Posted: Mon Jul 05, 2021 7:43 pm
Hello,
I have a very small sketch that just enables bluetooth and WiFi. If I include either esp_bluedroid_init or WiFi.mode in the sketch the program crashes. It never reaches the loop() call, as a matter of fact, even with a Serial.print at the beginning of the setup, I never see it the setup print() output. The following repeats on the console:
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:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10044
load:0x40080400,len:5900
entry 0x400806ac
ets Jun 8 2016 00:22:57
The code is as follows:
[Codebox]#include "Arduino.h"
#include "esp_bt.h"
#include "esp_bt_main.h"
#include "esp_bt_device.h"
#include "esp_gap_bt_api.h"
#include "esp_a2dp_api.h"
#include "esp_avrc_api.h"
#include<WebServer.h>
#include<WiFi.h>
void setup() {
Serial.begin(115200);
Serial.print("Setup!");
//Arduino bluetooth initialization
btStart();
// bluedroid allows for bluetooth classic
esp_bluedroid_init();
esp_bluedroid_enable();
//set up device name
esp_bt_dev_set_device_name("Duh");
// replace ssid and password with your details
const char* ssid = "SomeNetwork";
const char* password = "APassword";
WiFi.mode(WIFI_STA);
while(WiFi.status() != WL_CONNECTED) {
WiFi.begin(ssid, password);
delay(1000);
Serial.print(".");
}
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
}
void loop() {
Serial.println("looop");
delay(5000);
}[/Codebox]
Device: DOIT ESP32 DEVKIT V1 (and Adafruit Huzzah)
Arduino version: 1.8.15
ESP32 SDK version: v3.3.1-61-g367c3c09c
I have a very small sketch that just enables bluetooth and WiFi. If I include either esp_bluedroid_init or WiFi.mode in the sketch the program crashes. It never reaches the loop() call, as a matter of fact, even with a Serial.print at the beginning of the setup, I never see it the setup print() output. The following repeats on the console:
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:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10044
load:0x40080400,len:5900
entry 0x400806ac
ets Jun 8 2016 00:22:57
The code is as follows:
[Codebox]#include "Arduino.h"
#include "esp_bt.h"
#include "esp_bt_main.h"
#include "esp_bt_device.h"
#include "esp_gap_bt_api.h"
#include "esp_a2dp_api.h"
#include "esp_avrc_api.h"
#include<WebServer.h>
#include<WiFi.h>
void setup() {
Serial.begin(115200);
Serial.print("Setup!");
//Arduino bluetooth initialization
btStart();
// bluedroid allows for bluetooth classic
esp_bluedroid_init();
esp_bluedroid_enable();
//set up device name
esp_bt_dev_set_device_name("Duh");
// replace ssid and password with your details
const char* ssid = "SomeNetwork";
const char* password = "APassword";
WiFi.mode(WIFI_STA);
while(WiFi.status() != WL_CONNECTED) {
WiFi.begin(ssid, password);
delay(1000);
Serial.print(".");
}
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
}
void loop() {
Serial.println("looop");
delay(5000);
}[/Codebox]
Device: DOIT ESP32 DEVKIT V1 (and Adafruit Huzzah)
Arduino version: 1.8.15
ESP32 SDK version: v3.3.1-61-g367c3c09c