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

About multi bank programming

Hi,

I am doing a multi bank(code banking) programming. I had check the doctuments about code banking, but I got some question.

1.If the settings are right(L51_bank.A51, startup.A51), the bank switching will automatically done while an inter-bank call occurs?

2.If I try to reference arrays(or variables) in other bank, I should call switchbank(n) first, right?

3.If both above are right, what would be reason that it running setup function in bank1(bank1 contains some initial and setup function)
while booting. By default, it should run the function in bank0.

Parents Reply Children
  • Thanks, Vijay!!

    I had found the problem.
    I think it should be the reason cause I moved all initial functions to bank1. And the value in the register may be cleared by the function 8051_init() while it jump to bank1. This is what I thought. I didn't check it yet, but it works fine now after moved all the initial functions back to bank0.

    By the way, if the function going to use the data(array or something else) decleared in other bank. we should extern the data in common bank and call switchbank() before using it(in common bank, too). Otherwise, we could get worning value.