2009-12-10 08:43 AM
Questions about the FMI registers (bootloader)
2011-05-17 12:59 AM
Hello,
I work with the STR9FA12W47, with bank0 = 2048kB and bank1 = 128kB. And I have some questions about the using of the FMI registers. I build a bootloader in the bank1, witch jumps into the bank0, where there is my user application. So my boot bank is the bank1 (128kB). When I jump, I have to remapping my configuration of boot bank. Here the code of the jump function void __ramfunc ROM_Jump (void) { pFunction JumpTo; // before change mapping, disable all VIC VIC0->INTECR |= 0xFFFF; VIC1->INTECR |= 0xFFFF; // Change mapping: FMI->BBADR = 0x200000 >> 2; FMI->NBBADR = 0x0; JumpTo = (pFunction)0x0; JumpTo(); } This code is working very well ! :) But When I try to redefine the Boot and Non Boot Bank size my application crash.. Here the code of the function jump that causes a crash of the user application. void __ramfunc ROM_Jump (void) { pFunction JumpTo; // before change mapping, disable all VIC VIC0->INTECR |= 0xFFFF; VIC1->INTECR |= 0xFFFF; // Change mapping: FMI->BBSR = 0x6; FMI->NBBSR = 0x5; //0x4 FMI->BBADR = 0x200000 >> 2; FMI->NBBADR = 0x0; JumpTo = (pFunction)0x0; JumpTo(); } So the only difference between the two codes is the redefinition of the FMI->BBSR and FMI->NBBSR. It is the reason why I post this message. I would like to know how STR9 uses this register ? What are their impacts on the STR9 ? If somebody have the answers of this questions, please let's me to kown it :D2011-05-17 12:59 AM
It *may work*, but I recommend not to remap. Boot always into Bank 1 (set permanently by JTAG) and implement something like ''IVT forward'' in RAM.
This approach works fluently, the cost is first 64 bytes of RAM are wasted by IVT, and a little different start-up routine.