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 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.
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.