Running Debugger Outside of E2 Studio


I am working on a project using a RA2L1 micro. My goal is to build an automated testing suite that will be run on the target for overnight test runs. I'm trying to use GDB to flash and run the software but have run into some issues. For reference we're using an E2 emulator. Debugging through E2 Studio works fine, as does the Renesas Flash loader. So I know it's not a power issue or anything like that. E2 studio prints the following command to the console to start e2-server-gdb.exe:

Starting server with the following options:
Raw options : C:\Users\dm\.eclipse\com.renesas.platform_1435879475\DebugComp\\RA\e2-server-gdb -g E2 -t R7FA2A1AB -uConnectionTimeout= 30 -uClockSrc= 0 -uAllowClockSourceInternal= 1 -uInteface= SWD -uIfSpeed= auto -w 0 -z 33 -uIdCodeBytes= FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -uResetCon= 1 -uLowPower= 1 -uSWOclockDiv= 4 -uresetOnReload= 1 -n 0 -uFlashBp= 0 -ueraseRomOnDownload= 0 -ueraseDataRomOnDownload= 0 -uTraceMTB= 0 -uTraceSizeMTB= 1024 -uProgReWriteIRom= 0 -uProgReWriteDFlash= 0 -uOSRestriction= 0 -uTimeMeasurementEnable= 1 -uMemRegion= 0x00000000:0x40000:FLASH:e -uMemRegion= 0x40100000:0x2000:DATA_FLASH:e -l -uCore= SINGLE_CORE|enabled|1|main -uSyncMode= async -uFirstGDB= main --english

This command works from a terminal fine, and it provides the port number. From the E2 console I also found the following commands to supply to arm-none-eabi-gdb.exe:

source .gdbinit
set step-mode off
set loose-breakpoint-match off
set breakpoint always-inserted on
symbol-file C:\\Devel\\RA_Project\\Debug\\RA_Project.elf
inferior 1
set remotetimeout 10
set tcp connect-timeout 30
target extended-remote localhost:<port_number>

As soon as I execute the target command I get an E31 error.

(gdb) target extended-remote localhost:57916
Remote debugging using localhost:57916
Could not read registers; remote failure reply 'E31'

I suspect there's more commands getting run somewhere, but I'm not sure what commands those would be or where E2 is logging them. Any suggestions would be super helpful.


  • Hello ! Apologies for the delayed response. 

    Were you able to make any progress on this? Let us know if there are any updates so that we can assist you further.

    Thank you,

    Renesas Engineering Community Moderators

  • I believe the problem is that your GDB server "arm-none-eabi-gdb.exe" doesn't know how to interface to the E2 hardware debugger.

    I believe you need to use the "e2-server-gdb" server, although I am not finding much info on how to use it directly.  I see other questions on the forum for this topic, but not a lot of useful answers.  If I create a bare-metal RA project and configure for the E2 debugger and try to launch the debugger after building, I find the desired executable in my "C:\users\..." folder:

    You should find this in your "C:\Users\dm\.eclipse\com.renesas.platform_1435879475\DebugComp\\RA\" folder and be able to launch it manually.

  • Thanks, Jim. I have been running both the e2-server-gdb server and arm-none-eabi-gdb.exe. Thankfully E2 Studio provides the full raw command to start the server in the console output. I can run that and it seems like it's interfacing with the E2 emulator, ie the server starts and provides a port number to connect to. So far so good.

    Issues begin when I try to run arm-none-eabi-gdb.exe and supply it the "target extended-remote localhost:<portnumber>" command. When I give it the port number I got from the server, I get the E31 error. I suspect there's additional inputs that need to go into arm-none-eabi-gdb.exe. It sounds like it can't read register values which makes me wonder if there's an issue with the symbol table. I tried loading the symbol file from the generated debug .elf. GBD didn't complain about the command. So it's hard to say if the issue is symbol related.

  • Hi Jayesh,

    We haven't had much luck. I wrote out a stub program and swapped out arm-none-eabi-gdb.exe to try and get a better sense for what inputs E2 studio was passing to it. The only interesting thing I found was that E2 studio was running with "--interpreter mi2 --nx". I did a bit of reading and it sounds like the console version of GDB is maybe not feature complete, and it's preferable to run with GDB/MI. My plan is to try it, although it seems unlikely that GBD console can't function at all on it's own without GDB/MI. Beyond that, we're kind of at a dead-end. 


  • HI Dave M,

    A quick comment for you that might help. We run our GDB Server in non-stop mode so that we can perform live updates while the program is running.

    Without non-stop mode being setup I think it won't work well.

    So in addition to the above commands. Please also add:

    set non-stop on

    Try this and see if your situation improves.

    Best regards,


  • Thanks for the suggestion Mark! This fixed the issue for us.