Skip to main content
Visitor II
December 1, 2006
Question

boot flash config

  • December 1, 2006
  • 4 replies
  • 1090 views
Posted on December 01, 2006 at 06:29

boot flash config

    This topic has been closed for replies.

    4 replies

    wwin2000Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:34

    Hello:

    the bootflash config bit is the 0x520006 BIT0 CSX,isn't it? Can i config this bit in my application program? if it be set ,does bank1 flash must map 0x0~0x7fff? if it be reset does the bank0 flash must map 0x0~0x7ffff?if not do this for example set the CSX BIT and map bank0 flash to 0x0~0x7ffff , what is happen?

    Regards

    [ This message was edited by: wwin2006 on 29-11-2006 03:17 ]

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

    You can't set the Bootflash config bit from your application. this must be done by an external Jtag (See documentation)

    Yes once you configure the second flash as boot flash, you must remap flash

    Here is some sample of startup code

    ; --- Remap Flash Bank 1 at address 0x0 and Bank 0 at address 0x8000,

    ; when the bank 1 is the boot bank, then enable the Bank 0.

    LDR R6, =0x54000000

    LDR R7, =0x0 ; Bank 1 is 32 K

    STR R7, [R6]

    LDR R6, =0x54000004

    LDR R7, =0x6 ;Bank 0 is 512K

    STR R7, [R6]

    LDR R6, =0x5400000C

    LDR R7, =0x0 ;Bank 1 Start at 0x0

    STR R7, [R6]

    LDR R6, =0x54000010

    LDR R7, =0x2000 ;Bank 0 Start at 0x8000

    STR R7, [R6]

    LDR R6, =0x54000018

    LDR R7, =0x18

    STR R7, [R6]

    The boot flash config bit is not erased by a reset.

    Regards

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

    Hello,

    So far I know, the actual remaping of boot flash is done by the BootFlash config bit. When programming register at 0x54000000 ... you do not actualy remap flash for the CPU point of view but you only inform the FMI device of the curent mapping. That will enable then the FMI to correctly do his job.

    So far I have understand the Documentation, there now way to change the flash mapping inside a program.

    Regards

    wwin2000Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:34

    hi,acorchia

    thank you for the help.

    the problem is,

    first I use flashlink to set bank1 as bootbank and write bank1 with program 1,it work normal.

    then I use flashlink to set bank0 as bootbank and write bank0 with program 2,NOTICE this time i do not eare bank1. for my program turn to bank1 ,in the end of program 2 i load the follow function:

    RAM_exe void tobank1(void)

    {

    asm(''MOV R6, #0x54000000'');

    asm(''MOV R7, #0x0'');

    asm(''STR R7, [R6]'');

    // asm(''MOV R6, #0x54000004'');

    asm(''add r6, r6, #4'');

    asm(''MOV R7, #0x06'');

    asm(''STR R7, [R6]'');

    // asm(''MOV R6, #0x5400000C'');

    asm(''add r6, r6, #8'');

    asm(''MOV R7, #0x0'');

    asm(''STR R7, [R6]'');

    // asm(''MOV R6, #0x54000010'');

    asm(''add r6, r6, #4'');

    asm(''MOV R7, #0x2000'');

    asm(''STR R7, [R6]'');

    // asm(''MOV R6, #0x54000018'');

    asm(''add r6, r6, #8'');

    asm(''MOV R7, #0x18'');

    asm(''STR R7, [R6]'');

    asm(''MOV PC,#0x0'');

    }

    I found the program can not turn to bank1,it just run in bank0;

    How can i reset in bank0 and remap flash ,then jump to bank1 to run my application. I think this is same as reset in bank1 and remap flash ,then jump to bank0 to run my application.

    I do this just for IAP;

    Regards

    [ This message was edited by: wwin2006 on 29-11-2006 04:06 ]

    [ This message was edited by: wwin2006 on 29-11-2006 04:57 ]