arduio IDE的开发环境 跑FreeRTOS操作系统 的重启问题
硬件和环境:是ESP32开发板 arduio IDE的开发环境 跑FreeRTOS操作系统问题 :会一直重启
串口打印信息如下
收←◆E (12434) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (12434) task_wdt:- IDLE0 (CPU 0)
E (12434) task_wdt: Tasks currently running:
E (12434) task_wdt: CPU 0: TaskOne
E (12434) task_wdt: CPU 1: IDLE1
E (12434) task_wdt: Aborting.
abort() was called at PC 0x400d43e7 on core 0
Backtrace: 0x400907f0:0x3ffbe190 0x40090a21:0x3ffbe1b0 0x400d43e7:0x3ffbe1d0 0x40084729:0x3ffbe1f0 0x400d14d4:0x3ffc76f0 0x4008d2ed:0x3ffc7710
Rebooting...
ets Jun8 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:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
代码:
#include "WiFi.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
BluetoothSerial SerialBT;//蓝牙定义
WiFiServer server(80); //定义服务器
int wstatus=0;
String comdata = "";
String currentLine = ""; // 制作一个字符串以容纳来自客户端的传入数据
void BLInit(); //蓝牙初始化
void setup() {
Serial.begin(115200); //串口初始化
delay(1000);
vTaskDelay(pdMS_TO_TICKS(100));//等待系统初始化
xTaskCreate(
taskOne, /* Task function. */
"TaskOne", /* String with name of task. */
10000, /* Stack size in bytes. */
NULL, /* Parameter passed as input of the task */
1, /* Priority of the task. */
NULL); /* Task handle. */
xTaskCreate(
taskTwo, /* Task function. */
"TaskTwo", /* String with name of task. */
10000, /* Stack size in bytes. */
NULL, /* Parameter passed as input of the task */
2, /* Priority of the task. */
NULL); /* Task handle. */
}
void loop() {
vTaskDelay(1000);
}
void taskOne( void * parameter )
{
while(1)
{
comdata="";
while (Serial.available()) //时刻读取硬件串口数据
{
comdata += char(Serial.read());
vTaskDelay(2);
}
while (Serial.read() >= 0) {} //清除串口缓存
if (comdata.length() > 0)
{
Serial.println(comdata);
}
}
Serial.println("Ending task 1");
vTaskDelete( NULL );
}
void taskTwo( void * parameter)
{
while(1){
//Serial.println("taskTwo");
vTaskDelay(1000);
}
Serial.println("Ending task 2");
vTaskDelete( NULL );
}
void BLInit()
{
SerialBT.begin("ESP32test"); //蓝牙名字设定Bluetooth device name
}
尝试过
把串事件处理放到loop 函数就没有问题 求助 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
页:
[1]