openocd and interrupt

hi all,

I would like to know if it is possible to debug in flash with a interrupt enabled ?

i try to debug a usb application (at91) device. Event i put a break point in the isr, the gdb never stop there. BUT if i only execute the code without the gdb, the interrupt is working fine.

I use sam7S256 device:

here me 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_halt 0 arm7tdmi

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

my gdb command:

target remote localhost:3333
monitor reset
monitor sleep 500
monitor poll
monitor soft_reset_halt
monitor arm7_9 force_hw_bkpts enable
symbol-file main.elf
thbreak main
continue

the application is in flash.

regards

dumarjo

Debugging interrupts should be the same as normal code.

Could you upload a openocd log to help solve your problem.

Regards

spen

here the log file.

http://www.cimeq.qc.ca/dumarjo/openocd.log

i have not seen any error there but i hope this can help you to help me :wink:

dumarjo

hi,

i think i found a small trace to where is my problem, this seam to be a problem of timing. The problem is when i use the debugger, the main is halted but i think befor the debuger take to control of the cpu, i have some interrupt that rise. So normally probably the interrupt is not rised befor i enter in the main function. So i will try to enable the interrupt in the main function instead of the startup.S file.

regards

Jonathan

I found the problem,

The problem is when openocd reset the board, the interrupt controler is not resseted to his initial value. Than if you have an interrupt that is enabled in the program, you must disabled all interrupt in the low_level initialisation of the arm7.

Now i have a strange problem with the UDP (usb) register under debug. On the AT91sam7S device, we have an usb controller. So when i enable an entry point, i have to write in UDP_CSR[0…3] to enable the entry point. When the program is not controoled under opnocd, i can write to this register. BUT, when i use openocd, i connot write to it. Even if i write a value in that register, the register is remain to 0.

here the code i use normaly to write in it.

    while (((AT91PS_UDP)(0xFFFB0000))->UDP_CSR[0] & 0x00008000) != 0x00008000))
    	((AT91PS_UDP)(0xFFFB0000))->UDP_CSR[0] |= 0x00008000;

normaly this is working but under openocd is not working.

i’m a little lost on that one.

regards

dumarjo