interrupts not work when running from the Flash

Why do interrupts (UDP endpoint 1 interrupt) not work correctly when running from the Flash, but do work correctly when debugging my application using JTAG/ICE?

any suggestions? Thanks in advance.

UDP enpoint 1 interrupt? You mean USB interrupt?

What makes you think that they do not work correctly?

They work for me.

yup, USB interrupts.

My code is based on the Basic USB (virtual com port )source code provided by ATMEL, and added the UDP endpoint 1 interrupt.

It can enter the interrupt handler routine while in debug mode; however, when the code is downloaded in flash, it cannot enter the interrupt handler routine .

MCU: AT91SAM7S256

Compiler: Keil uVision3.23

Startup file: Cstartup.s, Cstartup_sam7s.c

IIRC, when running from flash vs RAM, some of the interrupt locations change. This may make a branch command invalid if you aren’t branching directly from the VIC’s address value. It’s unlikely (but possible) it could have to do with that.