cancel
Showing results for 
Search instead for 
Did you mean: 

Bank Switching - Flash Access

giuseppe2
Associate II
Posted on April 23, 2008 at 11:08

Bank Switching - Flash Access

1 REPLY 1
giuseppe2
Associate II
Posted on May 17, 2011 at 09:52

Ciao

I have read many message to bank switching and

the most correct way to switch is:

Code:

/* prepare bank0 for user operation */

FMI->BBSR = 0;

FMI->NBBSR = 6;

FMI->BBADR = 0x20000; //0x80000 >> 2

FMI->NBBADR = 0x0;

FMI->CR |= 0x18; /* Enable banks 0 & 1 */

Jump_To_Application = (pFunction) BANK0_START_ADDR;

Jump_To_Application();

}

well this code is correct for switch and now

I can look the loader code at address 0x00000000

and the program code at address 0x00080000

but...

when i try to access at address

0x00080000 ok

0x00086000 ok

0x00087000 ok

0x00087ffc ok

0x00088000 oh oh i cannot read this why ?

this bank is 512kb large :(

mumble... mumble....

maybe is better if check the loader in bank 1

0x00000000 ok

0x00006000 ok

0x00007000 ok

0x00007ffc ok

0x00008000 ok OK ??? oh oh... why i can read this ?

0x00008000 is redoundacy of 0x00000000

0x00010000 is redoundacy of 0x00000000

0x00018000 is redoundacy of 0x00000000

0x00020000 is redoundacy of 0x00000000

this bank is 32kb large :(

mumble... mumble....

I try to set

Code:

FMI->BBSR = 4; <<<<<<<<<<<<<< Changed

FMI->NBBSR = 2; <<<<<<<<<<<<<< Changed

FMI->BBADR = 0x20000; //0x80000 >> 2

FMI->NBBADR = 0x0;

FMI->CR |= 0x18; /* Enable banks 0 & 1 */

checking....checking....

Wooow

Now work fine, very fine

the loader writed in 0x00080000 is

visible at address 0x00000000 and memory is

accessible thru 0x00007ff0

the program code writed in 0x00000000 is

visible at address 0x00080000 and is

accessible thru 0x000ffff0

Why in all document in this forum and in all example

all says this ?

 

FMI->BBSR = 0;

 

FMI->NBBSR = 6;

 

when work fine this ?

 

FMI->BBSR = 4; <<<<<<<<<<<<<< Changed

 

FMI->NBBSR = 2; <<<<<<<<<<<<<< Changed

 

ciao a tutti

Beppe

p.s. sorry for my english 🙂