Content originally posted in LPCWare by CodeRedSupport on Tue May 14 15:21:05 MST 2013
Quote: richas
I am not sure how the variable ended up being declared as static. Nor am I sure that it is improper to declare a variable as static in an ISR when it is not used outside the ISR (Just like any other function). If it does not work in an ISR I would be interested in knowing why.
(And why it breaks the debugger would also be interesting.....)
Rich
There's nothing peculiar about declaring a static variable in an ISR. If an initial value is supplied, the startup code will initialize it (along with other initial data) provided it locates within a data section the startup code knows about. The flash driver itself locates in RAM, probably in the same space as your static variable. It's unclear why this would cause a problem for the flash driver initialization since interrupts get disabled at the start of a debug session, and active and pending interrupts are cleared. You'll need to post your code and/or a project which can reproduce the problem.
Regards,
CodeRedSupport