Ebiroll / esp32_blackmagic

esp32 wifi debugger for ARM Cortex microcontrollers https://github.com/blacksphere/blackmagic
74 stars 2 forks source link

Debugging stm32g4 through esp32s3 #6

Open dm128 opened 7 months ago

dm128 commented 7 months ago

Thanks a lot for your project. Trying to repeat it my scenario where stm32g4 connected only by swd clk&io to the esp32s3-n16r8 module on the custom board. As far as I understand you use Platformio plugin to VCS, I repeated same toolchain. Now project compiled with warnings but starting and successfully connected to local network. Connection to the DGB on port 2345 from telnet or gdb client from cubeide(worked with internal gdb server) connection return "accepted new gdb connection" in the console, however no more actions happened. Trying run your project in the debug mode, not sure PIO can do it. Could you please other recommends to me

Ebiroll commented 7 months ago

Yes, sorry about that, You can patch, gdb_if.c add raise_exception(EXCEPTION_ERROR, "Target lost in stub");

include "exception.h"

unsigned char gdb_if_getchar(void) { ..... / Return '+' in case we were waiting for an ACK / raise_exception(EXCEPTION_ERROR, "Target lost in stub");

        return '+';
    }
}
return ret;

}

Ebiroll commented 7 months ago

You can use the pio Unified debugger if you add this to platformio.ini

debug_tool = blackmagic debug_port = 192.168.4.1:2345