Pumpkin, Inc.

Pumpkin User Forums

Code Banking

For issues specific to the 8051 family, including compilers (e.g. Keil C51) and IDEs (e.g. uVision2).

Code Banking

Postby ILIAKG » Thu Apr 22, 2004 6:16 am

Hello!
We have application with Salvo Pro 8051 v.3.2 with Keil Tools : C51 and BL51,
Large model memory,C8051F124. Does Salvo support the code banking and switching code banking ?
In User Manual only is mentioned about
RAM banks , not ROM banks. Is the problem
to use Salvo with code banking ?
Sincerely,
ILIAKG
I.K.
ILIAKG
 
Posts: 6
Joined: Wed Apr 21, 2004 11:00 pm
Location: Jerusalem, Israel

Re: Code Banking

Postby aek » Fri Apr 23, 2004 2:14 am

The Salvo Cx51 Reference Manual has been updated ...

------------------

-------
aek
aek
 
Posts: 1887
Joined: Sat Aug 26, 2000 11:00 pm

Re: Code Banking

Postby aek » Fri Apr 23, 2004 9:51 am

Hello.

The simplest way to use Salvo in a banked application is to keep all of the Salvo code AND the Salvo tasks in the common area. This will probably also yield the best performance.

This way, the only effect of bank selection on Salvo code is when a banked user function is called from within a Salvo task, e.g.

code:
void Task (void)
{
for ( ; ; )
{
myFnA();
myBankedFnB();
OS_Delay(n);
}
}

where Cx51/BL51 handles the call to myBankedFn() as a banked call. So, you could put all of your user functions in banked ROM, with just Salvo and the Salvo tasks in common ROM.

This is the simplest way, but you may not want to keep all of Salvo and your Salvo tasks in the common area.

The only place I can think of where the Salvo code may have problems with banking is in OSSched(), because tasks are dispatched via an indirect function call, and the stack is affected. Either of these may cause problems with L51_bank.a51. I think (though I have not tested it) that you could do a source-code build with banking where Salvo's sched.c and all of your Salvo tasks are in the common area, but the rest of the Salvo code (e.g. qins.c, delay.c, etc.) is located in a ROM bank. By placing sched.c and the tasks in the common area, there's no banking involved in the critical and complex issue of task dispatching.

I don't think that sched.c and the Salvo tasks van be placed in banked ROM, because l51_bank.a51 affects the stack, and it will probably break the Salvo context switcher. But I'm not sure of this ...

So,

Configuration 1 ***

Common ROM: Salvo source + Salvo tasks
Banked ROM: User functions

will work.

Configuration 2 ***

Common ROM: salvosrcsched.c + Salvo tasks
Banked ROM: rest of Salvo + User functions

should work. 2 will be much slower than 1 because of all the banking that will occur when Salvo's banked internal functions are called.

Configuration 3 ***

Common ROM: user
Banked ROM: Salvo source + Salvo tasks

or

Common ROM: user + Salvo tasks
Banked ROM: Salvo source

probably won't work because the call-by-pointer in OSSched (sched.c) will probably be broken by l51_bank.a51.

Please let us know what you end up with ...

------------------

[This message has been edited by aek (edited April 23, 2004).]

-------
aek
aek
 
Posts: 1887
Joined: Sat Aug 26, 2000 11:00 pm

Re: Code Banking

Postby ILIAKG » Sat Apr 24, 2004 10:27 am

Hello aek !
Thanks for your very good and
timely answer and advice !
Sincerely,
ILIAKG

------------------
I.K.

I.K.
ILIAKG
 
Posts: 6
Joined: Wed Apr 21, 2004 11:00 pm
Location: Jerusalem, Israel


Return to 8051 family

Who is online

Users browsing this forum: No registered users and 1 guest

cron