cancel
Showing results for 
Search instead for 
Did you mean: 

Switching between programs in Flash Bank0 and Bank1

darren23
Associate II
Posted on December 13, 2006 at 11:55

Switching between programs in Flash Bank0 and Bank1

5 REPLIES 5
darren23
Associate II
Posted on May 17, 2011 at 09:34

Is it possible to have two totally independent programs, one in Flash Bank0 and the other in Flash Bank1, and swap between the two. I have used :-

/* Private typedef

-----------------*/

typedef void (*pointer)(void );

pointer jump_function;

Then jumped to the other bank by :-

jump_function =(pointer) 0x80000;

jump_function();

Is this the correct way to do this ? Will everything (eg Ram) be re-initialised again for each separate program so that they are truly independent of each other ?

Any ideas/comments welcome. I am using IAR Embedded Workbench as the Compiler.

Thanks

amira1
Associate II
Posted on May 17, 2011 at 09:34

Hi DBowden,

in STR9 there is no possibility to map the internal SRAM to address 0x00000000.

Best regards

mirou

sjo
Associate II
Posted on May 17, 2011 at 09:34

It is possible, infact this is how most bootloaders work.

The trick is to remap the vectors into ram, that way you can have dynamic vectors depending on what program you want to load.

Regards

sjo

darren23
Associate II
Posted on May 17, 2011 at 09:34

Thanks sjo.

Can you give me some details on how to go about doing the ram remapping. I have seen several comments on this and every one seems to be different.

Thanks

sjo
Associate II
Posted on May 17, 2011 at 09:34

oops sorry forgot we are talking str9.

A work around is possible, in one of my applications we just remap the IRQ and FIQ vectors to RAM.

We put s junmp vector at address 0x18 that jumps to 0x04000018 in RAM, this gives us a simulated remap.

Regards

sjo