News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

How to debug .elf file with a code::blocks GDB/CDB debugger

Started by Wojtek, August 25, 2017, 07:10:41 PM

Previous topic - Next topic

Wojtek

Hi,
I have compiled an ARM project with gcc compiler and got .elf file.
However, I do not know how to debug this project.
Any help would be appreciated.
Thanks.

Wojtek

I get the following error:

[debug]Error creating process D:/wj_CCode/wj_ARM_SAMA5/wj_Test1/default/wj_Test1.elf, (error 193).
[debug]Starting program: D:/wj_CCode/wj_ARM_SAMA5/wj_Test1/default/wj_Test1.elf
[debug]>>>>>>cb_gdb:

BlueHazzard

What debugger are you using?
You can not debug arm binaries on the development machine...

Wojtek

Thank you for reply.
What debugger do I need for working with ATMEL-ICE and code::blocks?

BlueHazzard

this can be a bit complicated:
# You have to add the debugger to the settings:
1) Settings->Debugger->GDB/CDB->Create Config-> Enter a usefull name like ARMGDB
2) Switch to the new configuration
3) Executable path-> Set the path to the the gdb in your arm toolchain folder
4) Untick "Enable watch scripts", "Disable startup scripts"
5) Ok
# Set up the project
1) Project->Properties->Debugger->Select target:<Project> ->Remote connection:
Ip address: 127.0.0.1 Port: 2331
2) Additional GDB commands:
monitor reset
load

3) Ok
Now you have to start the gdb server for the ATMEL-ICE. Then you can run the debugger...

BlueHazzard

ok, i have read into this and you probably won't find an easy gdb server for the amtel-ice. It is a shame that atmel does not support opens source any more....
You have two possibilities:
* AVaRICE
* OpenOCD

For ACaRICE you probably need cygwin and have to compile it by yourself....

#For OpenOCD:
you can get a ready build binary via pacman from here http://www.msys2.org/
After this you can follow this guide: http://omzlo.com/articles/programming-samd21-using-atmel-ice-with-openocd It is for mac, but just use the steps to configure openocd...