LPC2148 USB Bootloader

I’m working with an LPC2148 micro with an SD card. So, I’ve tried the SFE bootloader and it is working great. It executes the program, but only a simple led-on program like in the example is showed. When working with interrupts, it seems they are not serviced.

When I execute my program without the bootloader, the interrupts work fine. So the mistake must be in the copy of the interrupt vector table. The new application starts the ROM memory at 0x10000, but I can’t see that the interrupts are copied to this address, and I guess they should be copied in some way.

I need some help.

Thanks.

in my LPC21xx code, I always setup the interrupt vectors in my initialization code (and the PLL too).

OK. Me too. I initialise the vectors this way in the crt.S:

__Vectors: LDR PC,Reset_Addr

LDR PC,Undef_Addr

LDR PC,SWI_Addr

LDR PC,PAbt_Addr

LDR PC,DAbt_Addr

NOP /* Reserved Vector */

LDR PC,IRQ_Wrapper_Addr

LDR PC,FIQ_Addr

/* Post-link processing stuffs a flash check(crc or checksum) value here.

This variable must be located at this address(0x20). */

.global flash_check

flash_check: .space 4

Reset_Addr: .word Reset_Handler

Undef_Addr: .word Undef_Handler

SWI_Addr: .word SWI_Handler

PAbt_Addr: .word PAbt_Handler

DAbt_Addr: .word DAbt_Handler

.word 0 /* Reserved Address */

IRQ_Wrapper_Addr: .word __IRQ_Wrapper

FIQ_Addr: .word FIQ_Handler

Undef_Handler: B Undef_Handler

SWI_Handler: B SWI_Handler

PAbt_Handler: B PAbt_Handler

DAbt_Handler: B DAbt_Handler

.size __Vectors, . - __Vectors

And i have the routines “Reset Handler”," __IRQ_Wrapper" and “FIQ_handler” in the same crt.S.

But the problem I guess, it’s that when there is an interrupt, the micro goes to adresses 0x00 - 0x20. But in these adresses, we find the interrupt vectors of the bootloader, but not the interrupt vectors of my application, which are at the start of ROM defined in 0x10000. So, in the bootloader, there shouldn’t be a copy of the IVT at this address 0x10000.

Uau! Sorry for such a long post…

The MP3 Development Platform and the KinetaMap both use the USB bootloader, and also both have interrupt service routines. You can download more sample code that uses the SFE bootloader from their product pages:

http://www.sparkfun.com/commerce/produc … ts_id=8725

http://www.sparkfun.com/commerce/produc … ts_id=8603

Look at the “bootup” functions in both of these examples to see how the addresses of the interrupts are assigned. I haven’t thought about how to do this in the startup.S file yet…