This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

code banking size controlling

using c8051f120 I built a project with a code size 62 k (2 k less then limit of 64 k).

Next I made my project banked as follows: c8051f120 support 4 banks with 32 k (128 k total), bank#0 is used as common bank. I placed only one small function in separate module in Bank#1 All other project in Common (Bank#0). So the code for common bank exceeds 32 k limit for bank but compilation is successful without errors and warnings. WHY?

Next I chose another small module and placed it in Bank#2
So I Have something like this

60 k => Common
 1 k => Bank#1
 1 k => Bank#2


with the bank size 32 k But this project succesfully compiled again.

Can anybody explain Should there be warning for code size for each bank or not?

Parents

  • "Yes I get common area 60K"
    How do you get that?

    When working with code banked project each source file must be clearly associated with a bank. So I do associate all my source files with the common area (except two extremely small). These two extremely small source files I associated with bank#1 and bank#2 correspondingly.


    The compiler knows nothing about your hardware;

    Type of the controller (c8051f120) is specified in the project options as well as code banking area (0x8000 - 0xFFFF). So I do expect the compiler to be familiar with my intentions.

    Thank you for optimization advices. Optimization really helps to avoid code banking in most cases.

    In my case the question is not how to solve my just in time problem but to be the guru in 8051. So code banking still remains my glowing dream :-)

Reply

  • "Yes I get common area 60K"
    How do you get that?

    When working with code banked project each source file must be clearly associated with a bank. So I do associate all my source files with the common area (except two extremely small). These two extremely small source files I associated with bank#1 and bank#2 correspondingly.


    The compiler knows nothing about your hardware;

    Type of the controller (c8051f120) is specified in the project options as well as code banking area (0x8000 - 0xFFFF). So I do expect the compiler to be familiar with my intentions.

    Thank you for optimization advices. Optimization really helps to avoid code banking in most cases.

    In my case the question is not how to solve my just in time problem but to be the guru in 8051. So code banking still remains my glowing dream :-)

Children