code banking in keil

Jun 27, 2006 8 Replies

Hi all!



About "code banking" using keil compiler, I read first 32k memory of bank is kept as common area and rest 32k for bank in each bank. Can we reduce common area memory and increase actual bank memory as per the requirement?



Best regards, Ishita



In article , ishita writes

It is fully explained in the manuals.

Ask Grant Edwards... he like answering this sort of question.

\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

No manual available?

Meindert

C51: CREATING CODE BANKING PROGRAMS

formatting link
'For example, if you specify that the bank area is from 0x4000 to

0xFFFF, that gives 48K for the code banks and only 16K for the common area (0x0000 to 0x3FFF).'

BL51 Code-banking Linker/Locator

formatting link

BL51: WRITING YOUR OWN CODE BANKING SYSTEM

formatting link

The answer must be in there somewhere.

Hi! Thankyou for timely suggetion. This helped me a lot. Best regards, Aparna

sivadnz wrote:

Hi! Thankyou for timely suggetion. This helped me a lot. Best regards, Ishita

Please share the solution with other readers. Or at least a pointer to the solution.

Regards Alec

Hi!

Here is the solution to use code banking. For eg. we want to use 8 code banks.

  1. 8 code banks ie memory pages.
  2. Steps to achive code banking- a. Enable code banking in Startup.a51 file. b. Target options- i. Select code banking. ii. Select no. of banks. iii. Write start & end address of bank area.********** c. Copy L51_bank.a51 file from LIB and modify as per the hardware. d. Modifications in L51_bank.a51- i. ?B_NBANKS = 8 -no. of baks ii. ?B_MODE = 4 -for user defined switch code. iii. Modify the switch code for first 4 banks. iv. Add switch code for remaining 4 banks.
  3. If you want to call any function/variable from one bank to other or from common area to bank or vise-versa, those functions/variables have to be imported using keyword "extern".

Best regards, Ishita

sivadnz wrote:

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required