emelianov / modbus-esp8266

Most complete Modbus library for Arduino. A library that allows your Arduino board to communicate via Modbus protocol, acting as a master, slave or both. Supports network transport (Modbus TCP) and Serial line/RS-485 (Modbus RTU). Supports Modbus TCP Security for ESP8266/ESP32.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Working on ESP32-S3, but the priority must be set with 0, otherwise the CPU will falt to reset。

kylongmu opened this issue · comments

`
xTaskCreatePinnedToCore(
taskModbus,
"taskModbus",
1 << 14,
NULL,
0, //Must be 0
NULL,
0); //ARDUINO_RUNNING_CORE is 1

}

void taskModbus(void* parameter) {
Serial1.begin(9600, SERIAL_8N2, RX_PIN, TX_PIN);
mb.begin(&Serial1);
mb.slave(Hreg_file[0]);
mb.addHreg(0, 0, 16);
mb.addHreg(Hreg_address, 0, Hreg_size);
//Serial.printf("Running task taskModbus%d\n", xPortGetCoreID());
while (1) {
mb.task();
yield();
}
Serial.println("Ending task taskModbus");
vTaskDelete(NULL);
}

`
When the priority set to others, CPU reboot with this output:

E (10135) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (10135) task_wdt: - IDLE (CPU 0)
E (10135) task_wdt: Tasks currently running:
E (10135) task_wdt: CPU 0: taskModbus
E (10135) task_wdt: CPU 1: IDLE
E (10135) task_wdt: Aborting.

abort() was called at PC 0x420122b4 on core 0

Is there any work in progress here? I came to this issue aswell.

Waiting of -s3 board to arrive