2008-06-03 09:27 AM
Interrupts while booting from bank 1
2011-05-17 12:53 AM
I implemented a boot loader that runs in bank 1 according to the sample code in an2675.zip. I can start the application in bank 0, but I can not get any interrupts working. This code was working until I implemented the coding changes recommended in the errata for flash memory remapping, in order to solve the external reset issue. I am having no problem getting the code to start, but I can not get any interrupts to occur.
Thanks2011-05-17 12:53 AM
Try this to switch to b0s1
__ramfunc void SwitchToRun (void) { SCU->CLKCNTR = 0x00020002; SCU->GPIOOUT[0] = 0x00000000; SCU->GPIOOUT[1] = 0x00000000; SCU->GPIOOUT[2] = 0x00000000; SCU->GPIOOUT[3] = 0x00000000; SCU->GPIOOUT[4] = 0x00000000; SCU->GPIOOUT[5] = 0x00000000; SCU->GPIOOUT[6] = 0x00000000; SCU->GPIOOUT[7] = 0x00000000; SCU->GPIOIN[0] = 0x00000000; SCU->GPIOIN[1] = 0x00000000; SCU->GPIOIN[2] = 0x00000000; SCU->GPIOIN[3] = 0x00000000; SCU->GPIOIN[4] = 0x00000000; SCU->GPIOIN[5] = 0x00000000; SCU->GPIOIN[6] = 0x00000000; SCU->GPIOIN[7] = 0x00000000; SCU->PRR0 = 0x00001053; SCU->PRR1 = 0x00000000; SCU->PCGRO = 0x000000DB; SCU->PCGR1 = 0x00000000; asm (''MOV R1,#0x10000''); asm (''MOV PC,R1''); }2011-05-17 12:53 AM
Ok. Do I add this code before I jump to bank 0? My code is linked to start at 0x80000, so should I make the asm (''MOV R1,#0x10000'');
read asm (''MOV R1,#0x80000''); instead.2011-05-17 12:53 AM
Looks good to me, if you are jumping to 512K address
2011-05-17 12:53 AM
Yep. 512 K address. Will try it in the morning and let you know.
Thanks2011-05-17 12:53 AM
That suggestion didn't work. It looked good though.