#define ISR(x) \
static void ISR_ ## x () \
{ \
__asm volatile ("bkpt #0\n") ; \
}
ISR(7)
ISR(8)
ISR(9)
ISR(10)
ISR(11)
ISR(13)
ISR(14)
ISR(15)
void (* const g_pfnVectors[])(void) =
{
// Core Level - CM3
(void *)&_vStackTop -1, // The initial stack pointer
ResetISR, // The reset handler
NMI_Handler, // The NMI handler
HardFault_Handler, // The hard fault handler
MemManage_Handler, // The MPU fault handler
BusFault_Handler, // The bus fault handler
UsageFault_Handler, // The usage fault handler
ISR_7, // Reserved
ISR_8, // Reserved
ISR_9, // Reserved
ISR_10, // Reserved
// vPortSVCHandler, // SVCall handler
ISR_11,
DebugMon_Handler, // Debug monitor handler
ISR_13, // Reserved
// xPortPendSVHandler, // The PendSV handler
ISR_14,
// xPortSysTickHandler, // The SysTick handler
ISR_15,
//16
.....
I have such code and after second pass trough crt0 ISR_7 is fired. Can I safely ignore this interrupt or it shows some error in code which I should address? Reference manual of mcu says that this interrupt is reserved.
CRT0 does:
When I had ISR_7 not definied, I was getting HardFaults
Hi
I have never heard of a reserved interrupt firing and don't think that there is any actual interrupt behind it.
If you are hitting this code it may be that your code is running into it (from another fault) so check the call-stack to see whether it is really arriving there from an interrupt and try stepping back out of the code/interrupt to see where it came from.
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT]
Contact me by personal message or on the uTasker web site to discuss professional training, solutions to problems or product development requirements
For professionals searching for faster, problem free Kinetis and i.MX RT 10xx developments the uTasker project holds the key
Backtrace:
(gdb) bt
#0 ISR_7 () at /<redacted>/crt0.c:291
#1 <signal handler called>
#2 main () at /<redacted>/main.cpp:71
main from line 65:
asm("CPSIE if");
//*(uint8_t *)0xFFFFFFFF = (1<<1);
uint32_t zegar=3000000ul;
volatile uint32_t i;
for(i=0;i<zegar/4;i++);
Interrupt fires in busy loop