Skip to main content
Visitor II
February 8, 2008
Question

flash bank switching & booting.

  • February 8, 2008
  • 2 replies
  • 742 views
Posted on February 08, 2008 at 10:08

flash bank switching & booting.

    This topic has been closed for replies.

    2 replies

    jmullensAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:49

    /*

    I have written an application that sits in bank 0, and have a bios sector in bank 1. I have not been able to get a function I've written to work that, I hope, will allow me to switch banks and run my bios routine in bank 1.

    I can see from the Segger J-Flash utility, that my program is indeed there in bank 1, but I can't switch to it. Sending a ''0'' to this function resets the processor, and sending a ''1'' makes the processor hang, and only gets out of being hung by power cycling the board.

    I am close to having a firmware download routine working, but am unable to get this part working. There is something simple I must be missing..Any help would be greatly appreciated.

    Here is my routine:

    My application starts at address 0x0, and the bios sector starts at 0x80000. I'm using the IAR4.41A compiler, and am using the STR912FAW44 version of the chip.

    */

    typedef void (*pfunc)(void);

    __ramfunc void bankSwitch(char bankNo)

    {

    pfunc jump2App;

    if(bankNo){

    FMI_BankRemapConfig(4,2,0,0x80000);

    }else{

    FMI_BankRemapConfig(0,6,0x80000,0);

    }

    jump2App = (pfunc)0x0;

    jump2App();

    }

    [ This message was edited by: jmullens on 12-02-2008 03:35 ]

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

    Hi,

    Segger offers a free tool(JlinkSTR91x.exe) allowing:

    erase all flash

    protect sector

    switch boot bank

    .....

    The following link(segger forum) explains how to use this tool:

    http://www.segger2.com/index.php?page=Thread&threadID=22

    Rgds,