Skip to main content
Visitor II
December 10, 2009
Question

Questions about the FMI registers (bootloader)

  • December 10, 2009
  • 2 replies
  • 717 views
Posted on December 10, 2009 at 17:43

Questions about the FMI registers (bootloader)

    This topic has been closed for replies.

    2 replies

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:59

    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 :D

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:59

    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.