Hello, I am programming, via a bootloader, interrupt driven application code on a LPC2468. I certainly need to remap the interrupt vectors. What is a 100% clear to me is when the re-mapping needs to occur: Assuming IAP was successful, the bootloader, when starting up and before jumping to the application, would copy the first 32 bytes from internal flash to internal RAM (for example) and then set MEMMAP, while the bootloader is still running? Is this the right way to do it? Can you advise me of other issues that need to be dealt with, if any?
No, I think it is perfectly fine for the boot loader to do the copy. At least it works for me with LPC23xx :)
But the boot loader has to make sure that it has disabled all interrupt sources it has been playing with before doing the remapping and jumping to the application.
Per, As far as I understand/have done, unless the startup file of the application is prepared for it, MEMMAP settings of the bootloader are overwritten. But maybe it is the exact startup file flavor.
Can you perhaps tell me what is wrong here?
I am using the following code to install an IRQ:
unsigned char install_irq( unsigned long IntNumber, void *HandlerAddr, unsigned long Priority ) { unsigned long *vect_addr; unsigned long *vect_prio; VICIntEnClr = 1 << IntNumber; /* Disable Interrupt */ if ( IntNumber >= VIC_SIZE ) { return 0 ; } else { /* find first un-assigned VIC address for the handler */ vect_addr = (unsigned long *)(VIC_BASE_ADDR + VECT_ADDR_INDEX + IntNumber*4); vect_prio = (unsigned long *)(VIC_BASE_ADDR + VECT_PRIO_INDEX + IntNumber*4); *vect_addr = (unsigned long)HandlerAddr; /* set interrupt vector */ *vect_prio = Priority; VICIntEnable = 1 << IntNumber; /* Enable Interrupt */ return 1 ; } }
the handler is called without a problem, but the IRQ entry at 0x18 in the startup file is not (I varified that using a breakpoint). why is that?
Can you be more specific about what you mean by "the handler is called without a problem, but the IRQ entry at 0x18 in the startup file is not"?
thanks for your reply - false alarm, all is fine!