cancel
Showing results for 
Search instead for 
Did you mean: 

How to make reset button correct-working by using IAP driver?

simple
Associate II
Posted on December 12, 2007 at 16:07

How to make reset button correct-working by using IAP driver?

5 REPLIES 5
simple
Associate II
Posted on May 17, 2011 at 09:48

Hallo. I have a problem and need your help.

I use mcbstr9 and Keil 310.

I remade ST IAP driver for KEIL. There is a bootloader ( bootloader is in flash bank1 and the main programm in flash bank0. When a definite event doesn't occur ( Z/B an interrupt by pressing a button on the board) the main pogram runs, else you see a menu in hyperterminal and you can download new main Program). But it is a problem with this driver. When I press reset button controller buzzs.

I think it is so, because when reset occurs not all registers are set to their reset value, videlicet FMI and some SCU registers. That's mean that controller loads from small flash (bank1), but doesn't find a 0x0000 addr here!

Did anybody solve this problem? /* I need a reset button in my Program. I would thank you very much, if somebody could help me.

mark9
Associate II
Posted on May 17, 2011 at 09:48

I just discovered this bug too. See Errata 2.14 for a description. The work around is to remap your main application to high memory and don't swap banks, which means a headache for your vector table at 0x00000000

najoua
Associate II
Posted on May 17, 2011 at 09:48

Hello,

Yes, you are right.

In this case, the software remapping of both banks should not be done and interrupts are to be redirected to bank0.

Regards,

Najoua.

mikhail
Associate II
Posted on May 17, 2011 at 09:48

see

http://www.st.com/mcu/forums-cat-5096-21.html&start=0

simple
Associate II
Posted on May 17, 2011 at 09:48

Thank you all.

I found a strange solution, but it works. Before the jump to main application, I change (like in IAP, but I don't change BBADR):

FMI->BBSR = 0x0;

FMI->NBBSR = 0x6;

//FMI->BBADR = 0x80000 >> 2; I don't make it

FMI->NBBADR = 0x0 ;

So I have two banks with 0x00 addr. Then I disable the little flash bank:

FMI->CR = 0x010;

Then I jump to main application. And it works!

If I press reset button, I see bootloader again.

But if I change FMI registers in my main Program, jump occurs, but main application works up to this change. I had this Problem in first bootloader (with classical remap too). What is wrong? And why this strage program works?