Я пытаюсь выяснить, как отлаживать код на esp8266, используя gdb
с gdbstub
, включенным в Arduino Core, следуя этим инструкциям .
У меня естьзагрузил очень простой пример программы на мою плату esp8266 Amica NodeMCU 1.0 и добавил необходимые вызовы функций Serial.begin
и gdbstub_init
.
#include <Arduino.h>
#include <GDBStub.h>
/*
ESP8266 Blink by Simon Peter
Blink the blue LED on the ESP-01 module
This example code is in the public domain
The blue LED on the ESP-01 module is connected to GPIO1
(which is also the TXD pin; so we cannot use Serial.print() at the same time)
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
*/
void setup() {
Serial.begin(115200);
gdbstub_init();
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN,
LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is active low on the ESP-01)
delay(1000); // Wait for a second
digitalWrite(LED_BUILTIN,
HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}
Когда я загружаю этот код на устройство и запускаю xtensa-lx106-elf-gdb
используя параметры настройки, как указано в инструкции, он запускается правильно, и я могу создавать точки останова. Однако всякий раз, когда я пытаюсь перешагнуть строку кода (например, digitalWrite
в строке 24), gdb
вылетает с ошибкой:
'xtensa-lx106-elf-gdb' terminated by signal SIGABRT (Abort)
Я не могу понять, что вызывает егосбой при переходе через вызовы функций (и я смог воспроизвести это с другими утверждениями). Кто-нибудь знает как это исправить?