OpenOcd fails to run in debug prespective using eclipse ide

Hi

I am trying to debug the flash application using openocd and eclipse ide

(Yagarto tools)

I have Olimex board SAM7-Ex256 and ARM-USB-OCD Debugger.

When i flash the application the application runs, then i change the

perspective to debug from Eclipse IDE and start the openocd. It gives

the error.

I followed Lych Tutorial to configure eclipse for debugging.

The error is as follows:

Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00

CEST)

Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test

logic, too

Info: target.c:219 target_init_handler(): executing reset script

‘c:\temp\temp.ocd’

Info: configuration.c:50 configuration_output_handler(): waiting for

target halted…

Info: configuration.c:50 configuration_output_handler(): target

halted

Info: configuration.c:50 configuration_output_handler(): core state:

ARM

Error: flash.c:513 handle_flash_write_command(): couldn’t stat()

main.bin: No such file or directory

Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test

logic, too

It says that it cannot find the .bin file. I flashed the bin file on

board and it runs and i dont understand when i try to debug the same

flash application it says it cannot find the .bin file.

If anyone of you are working with or have any ideas to this problem

please reply me.

Awaiting your response.

Regards

Rajitha

Hi Rajitha.

When you set up your Eclipse “Debug Launch Configuration”, in the first setup screen you specify the “name” of the Debug Launch Configuration, the “Project” and the “C/C++ Application”.

Most people just use the project name itself for the “Name” and use the “Browse” button to find their “Project”.

In the choice for “C/C++ Application”, the correct answer is “main.out”. Is it possible that you browsed and selected “main.bin” by mistake?

The “main.bin” file is a file containing only the application’s machine language instruction bytes for flash programming. The “main.out” file is a hybrid containing the application’s instruction bytes and the symbol data. Eclipse/GDB uses only the symbol information from the “main.out” file for flash debugging.

Cheers,

Jim Lynch

or main.elf depends on makefile. I always get my debug file a elf file.

my 0.02$

Jonathan

lynchzilla:
Hi Rajitha.

When you set up your Eclipse “Debug Launch Configuration”, in the first setup screen you specify the “name” of the Debug Launch Configuration, the “Project” and the “C/C++ Application”.

Most people just use the project name itself for the “Name” and use the “Browse” button to find their “Project”.

In the choice for “C/C++ Application”, the correct answer is “main.out”. Is it possible that you browsed and selected “main.bin” by mistake?

The “main.bin” file is a file containing only the application’s machine language instruction bytes for flash programming. The “main.out” file is a hybrid containing the application’s instruction bytes and the symbol data. Eclipse/GDB uses only the symbol information from the “main.out” file for flash debugging.

Cheers,

Jim Lynch

No I selected main.out, when i browse it gives me main.out for c programs atleast. I recehecked all my configurations, everything is ok.

The thing i dont understand is when i use ‘Build make target’ its the same openOcd which takes all commands correctly from make file and flashes the bin file succesfully. But when i go to debug perspective and select openocd and run it says it cannot find the .bin file.

But in make file for flashing we are supplying target= main.bin but in debug perspective we are just giving the .exe location and .cfg file so how it will take the .bin file.

Only for me or everyone has the same problem with Yagarto tools when they start initially programming ? Its so unstable.

Hi all again

I uninstalled and installed openocd again.

But no use its the same behavior openocd gives the same error

the configuration i did is as follows:

In EclipseIDE - Goto Run->ExternalTools->Create a new configuartion

Name:OpenOCD

Location:C:\Program Files\openocd-2006re115\bin\openocd-ftd2xx.exe

Working directory: C:\Program Files\openocd-2006re115\bin

Arguments: -f at91sam7x256-armusbocd-flash-program.cfg

my arm-usbocd-flash-program.cfg is as follows:

#define our ports

telnet_port 4444

gdb_port 3333

#commands specific to the JTAG

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG A”

ft2232_layout “olimex-jtag”

ft2232_vid_pid 0x15BA 0x0003

jtag_speed 2

jtag_nsrst_delay 200

jtag_ntrst_delay 200

#reset_config [combination] [trst_type] [srst_type]

reset_config srst_only srst_pulls_trst

#jtag_device

jtag_device 4 0x1 0xf 0xe

#daemon_startup <‘attach’|‘reset’>

daemon_startup reset

#target <reset_mode> <jtag#> [variant]

target arm7tdmi little run_and_init 0 arm7tdmi_r4

#run_and_halt_time <target#> <time_in_ms>

run_and_halt_time 0 30

commands below are specific to AT91sam7 Flash Programming

---------------------------------------------------------

#target_script specifies the flash programming script file

target_script 0 reset c:\temp\temp.ocd

#working_area <target#> <‘backup’|‘nobackup’>

working_area 0 0x40000000 0x4000 nobackup

#flash bank at91sam7 0 0 0 0 <target#>

flash bank at91sam7 0 0 0 0 0

After this configuratio i run the openocd from debug perspective of eclipse by clicking on it then the error is as follows:

Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00 CEST)

Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test logic, too

Info: target.c:219 target_init_handler(): executing reset script ‘c:\temp\temp.ocd’

Info: configuration.c:50 configuration_output_handler(): waiting for target halted…

Info: configuration.c:50 configuration_output_handler(): target halted

Info: configuration.c:50 configuration_output_handler(): core state: ARM

Error: flash.c:513 handle_flash_write_command(): couldn’t stat() main.bin: No such file or directory

Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test logic, too

Do you think that i have any problem with settings on my PC.

I trying this since weeks but cannot trace the where its going wrong.

All the configuration, the .cfg files everything is ok.

I will be really very thankful if anyone of you can just provide some help or guidance to fix this issue.

Have a nice weekend ahead.

Flying

Hello Flying,

Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00 CEST)

Have you try to use an newer version of OpenOCD?

It looks that this is an old Olimex version, is it?

Regards,

mifi

mifi:
Hello Flying,

Have you try to use an newer version of OpenOCD?

It looks that this is an old Olimex version, is it?

Thank you for the reply.

The problem is solved i can debug. There was slight mistake in openocd.cfg it has to be ‘attach’ while debugging.

Regards

Flying