EmbDev.net

Forum: ARM programming with GCC/GNU tools Debugging the Flash Application using OpenOcd/Eclipse IDE


von Flying A. (flying)


Rate this post
useful
not useful
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

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Rajitha Dandu wrote:
> 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.
>
>
> If anyone of you are working with or have any ideas to this problem
> please reply me.
>
> Awaiting your response.
>
> Regards
> Rajitha

my .cfg
#define our ports
telnet_port 4444
gdb_port 3333

#commands specific to the Amontec JTAGKey
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG A"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0003
jtag_speed 0
jtag_nsrst_delay 200
jtag_ntrst_delay 200

#reset_config <signals> [combination] [trst_type] [srst_type]
reset_config srst_only srst_pulls_trst

#jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
jtag_device 4 0x1 0xf 0xe

#daemon_startup <'attach'|'reset'>
daemon_startup reset

#target <type> <endianess> <reset_mode> <jtag#> [variant]
target arm7tdmi little run_and_init 0 arm7tdmi

#run_and_halt_time <target#> <time_in_ms>
run_and_halt_time 0 30

my gdb command

Initialise box

target remote localhost:3333
monitor reset
monitor sleep 500
monitor poll

run command

monitor soft_reset_halt
monitor arm7_9 force_hw_bkpts enable
symbol-file main.elf
thbreak main
continue

hope this help

Jonathan

von fjrg76 (Guest)


Rate this post
useful
not useful
Hi again Jonathan

Where do I need to write these commands??

target remote localhost:3333
monitor reset
monitor sleep 500
monitor poll

run command

monitor soft_reset_halt
monitor arm7_9 force_hw_bkpts enable
symbol-file main.elf
thbreak main
continue


Thanks =)


Jonathan Dumaresq wrote:
> Rajitha Dandu wrote:
>> 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.
>>
>>
>> If anyone of you are working with or have any ideas to this problem
>> please reply me.
>>
>> Awaiting your response.
>>
>> Regards
>> Rajitha
>
> my .cfg
> #define our ports
> telnet_port 4444
> gdb_port 3333
>
> #commands specific to the Amontec JTAGKey
> interface ft2232
> ft2232_device_desc "Olimex OpenOCD JTAG A"
> ft2232_layout "olimex-jtag"
> ft2232_vid_pid 0x15BA 0x0003
> jtag_speed 0
> jtag_nsrst_delay 200
> jtag_ntrst_delay 200
>
> #reset_config <signals> [combination] [trst_type] [srst_type]
> reset_config srst_only srst_pulls_trst
>
> #jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
> jtag_device 4 0x1 0xf 0xe
>
> #daemon_startup <'attach'|'reset'>
> daemon_startup reset
>
> #target <type> <endianess> <reset_mode> <jtag#> [variant]
> target arm7tdmi little run_and_init 0 arm7tdmi
>
> #run_and_halt_time <target#> <time_in_ms>
> run_and_halt_time 0 30
>
> my gdb command
>
> Initialise box
>
> target remote localhost:3333
> monitor reset
> monitor sleep 500
> monitor poll
>
> run command
>
> monitor soft_reset_halt
> monitor arm7_9 force_hw_bkpts enable
> symbol-file main.elf
> thbreak main
> continue
>
> hope this help
>
> Jonathan

von Flying A. (flying)


Rate this post
useful
not useful
Jonathan Dumaresq wrote:
> Rajitha Dandu wrote:
>> 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.
>>
>>
>> If anyone of you are working with or have any ideas to this problem
>> please reply me.
>>
>> Awaiting your response.
>>
>> Regards
>> Rajitha
>
> my .cfg
> #define our ports
> telnet_port 4444
> gdb_port 3333
>
> #commands specific to the Amontec JTAGKey
> interface ft2232
> ft2232_device_desc "Olimex OpenOCD JTAG A"
> ft2232_layout "olimex-jtag"
> ft2232_vid_pid 0x15BA 0x0003
> jtag_speed 0
> jtag_nsrst_delay 200
> jtag_ntrst_delay 200
>
> #reset_config <signals> [combination] [trst_type] [srst_type]
> reset_config srst_only srst_pulls_trst
>
> #jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
> jtag_device 4 0x1 0xf 0xe
>
> #daemon_startup <'attach'|'reset'>
> daemon_startup reset
>
> #target <type> <endianess> <reset_mode> <jtag#> [variant]
> target arm7tdmi little run_and_init 0 arm7tdmi
>
> #run_and_halt_time <target#> <time_in_ms>
> run_and_halt_time 0 30
>
> my gdb command
>
> Initialise box
>
> target remote localhost:3333
> monitor reset
> monitor sleep 500
> monitor poll
>
> run command
>
> monitor soft_reset_halt
> monitor arm7_9 force_hw_bkpts enable
> symbol-file main.elf
> thbreak main
> continue
>
> hope this help
>
> Jonathan

Hi Jonathan

I changed the config file and the commands like Jtag speed 0 .

My config file is also same and before i just wrote the commands in
Initilaize box now i tried as you suggested but no use, i am getting the
same error.

What is the reason the openOcd doesnot recognise the .bin file on board.

I flashed the .bin file and it runs. Now i start debugging it says it
doenot find that file.

I tried even setting some breakpoints before starting and then i powered
the board mayntimes by unplugging the usb from debugger and even i
stopped all internet applications running on pc but the error is always
same.

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
>
> Hi Jonathan
>
> I changed the config file and the commands like Jtag speed 0 .
>
> My config file is also same and before i just wrote the commands in
> Initilaize box now i tried as you suggested but no use, i am getting the
> same error.
>
> What is the reason the openOcd doesnot recognise the .bin file on board.
>
> I flashed the .bin file and it runs. Now i start debugging it says it
> doenot find that file.
>
> I tried even setting some breakpoints before starting and then i powered
> the board mayntimes by unplugging the usb from debugger and even i
> stopped all internet applications running on pc but the error is always
> same.

here the document that you MUST read. it's the reference on how to work
with arm and eclipse.

http://gnuarm.alexthegeek.com/

Jonathan

von Flying A. (flying)


Rate this post
useful
not useful
Jonathan Dumaresq wrote:
>>
>> Hi Jonathan
>>
>> I changed the config file and the commands like Jtag speed 0 .
>>
>> My config file is also same and before i just wrote the commands in
>> Initilaize box now i tried as you suggested but no use, i am getting the
>> same error.
>>
>> What is the reason the openOcd doesnot recognise the .bin file on board.
>>
>> I flashed the .bin file and it runs. Now i start debugging it says it
>> doenot find that file.
>>
>> I tried even setting some breakpoints before starting and then i powered
>> the board mayntimes by unplugging the usb from debugger and even i
>> stopped all internet applications running on pc but the error is always
>> same.
>
> here the document that you MUST read. it's the reference on how to work
> with arm and eclipse.
>
> http://gnuarm.alexthegeek.com/
>
> Jonathan

Hi
Thank you for the information you gave me.

I have gone through the document. The document deals with cygwin
installation and its old document i think because in the new document by
James P.Lynch we dont need to have cygwin installed on our system and
other cdt plugin. Yagarto tools are enough as it has all the required
plugins and libraries i think.

In fact its more clear in James P.Lynch Tutorial on how to 'Create a
Debug Launch Configuration'. Its almost the same also in the material
which you told me to go through.

I did it in the same way, but still the same error.

I dont know really where its going wrong and how to fix this issue. I am
trying my best by seraching online documents.

If you get any idea please inform me.

Have a nice weekend ahead.

Regards
Rajitha

von Flying A. (flying)


Rate this post
useful
not useful
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 <signals> [combination] [trst_type] [srst_type]
reset_config srst_only srst_pulls_trst

#jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
jtag_device 4 0x1 0xf 0xe

#daemon_startup <'attach'|'reset'>
daemon_startup reset

#target <type> <endianess> <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#> <address> <size> <'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

von Flying A. (flying)


Rate this post
useful
not useful
Hi

The problem is solved the openocd.cfg file should have 'attach' while
debugging
and 'reset' while flashing

Regards
Flying

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Rajitha Dandu wrote:
>
> Hi
>
> The problem is solved the openocd.cfg file should have 'attach' while
> debugging
> and 'reset' while flashing
>
> Regards
> Flying

Can you tell me where you find this information ? I use the same cfg
file for flashing and debugging except that i remove a script line for
the flashing.

regards

Jonathan

von Flying A. (flying)


Rate this post
useful
not useful
Jonathan Dumaresq wrote:
> Rajitha Dandu wrote:
>>
>> Hi
>>
>> The problem is solved the openocd.cfg file should have 'attach' while
>> debugging
>> and 'reset' while flashing
>>
>> Regards
>> Flying
>
> Can you tell me where you find this information ? I use the same cfg
> file for flashing and debugging except that i remove a script line for
> the flashing.
>
> regards
>
> Jonathan

Hi

Actually from demo_at91sam7_blink_flash sample program i have different
configuration files so when u observe these .cfg files for flashing and
debugging you can observe they are almost same except just 'reset' and
'attach' is different.

That's what i tried.

Regards
Flying

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.