I am using 8051F120 having 127KB Program memory, theoretically. I have written 4 *.C files residing in each bank. The length of the code in Bank1 and Bank2 is less than 32KB (observing the list file). But, instead of this, the linker gives an address space overflow for both the banks. Kindly assist.
Dhaval Solanki
Did you checked this app.note from Silabs? It's all there...
www.silabs.com/.../an130.pdf
- Dejan
You are struggling with Banking - why?
Banking is just a bodge to get around a fundamental limitation of an architecture. It only made sense when a move up to an architecture without that limitation was out of the question.
Nowadays, architectures without that limitation are widely available and easily accessible - so why mess with Banking?
Even SiLabs - that bastion of high-end 8051 - now has ARM Cottex-M3 chips available...
Surely the OP answered that one by saying I am using 8051F120...
Looks like you're misinterpreting the am using as being intend to use.
As a consultant, I have frequently been given platforms to write code for that I would prefer to exist on (what I consider to be) a better platform.
No, I'm saying, "why are you using that platform?"
The post does not give the impression that the OP is an expert on that platform, so the cost of switching may not be high - in particular, not higher than trying to master Banking...
"As a consultant..."
Well, of course, the customer is always right; if they're prepared to pay over the odds due to a sub-optimal platform choice - that's their choice.
Doesn't stop you voicing your opinion that there may be A Better Way, though - does it?
why?
Because we live in the real world.
I am sure someone will make Cottex-M3 chips sometime in the future but I doubt such a chip is available from anyone now, particularly Silabs.
Maybe a competitor for the Petnium?
IMO, one sure fire way of alienating a development department who may have spent a lot of time really understanding a situation is for a consultant new to the task to come in and say "you're bodging it" and "I wouldn't do it that way".
There are always ways to alienating yourself. But being silent instead of bringing up potential issues just means they pay for a consultant that doesn't deliver the full knowledge/experience.
While it is obviously not a good idea to cut someone at the knees by asking who was the fool to select a specific processor, there are lots of ways to point out the potential problems with the selected route and wonder if alternative routes - such as using a (similarly priced) processor with a large linear address space - would be an option to speed up the total development times and cut problem complexity.
Many times, people just don't realize the implications of having a processor with 256kB of flash but an adressing scheme that requires only a small part of that flash to be visible at any one time. Datasheets for the processor (or application notes) will obviously not spend time describing the issues with the processor. At best, the application note will describe the availability of code banking - making it sound like a nice feature of the processor instead of a cludge to work around a huge design issue.
Certainly can't dispute that.
I've witnessed it from both sides; and admit to being really ticked off in one situation where the management recruited a "sharp-as-a-knife consultant" who caused a product to be redesigned very late in the day because what we'd done was "so Heath Robinson" and should be chucked out.
The expert consultant really didn't understand what we'd done and why. He had pre-conceived ideas from which he would not deviate and he would not listen to technical or cost arguments. But the management liked him because he was oh so decisive.
Long story short, the expert consultant failed in his task, he was kicked out, our work was resurrected and the project was successfully completed.
But this is not a cunsultancy session - this is a discussion forum.
If the OP wants to engage in the discussion, he could explain why the bodge is necessary or appropriate in his particular case.
I am open to be persuaded...
To the OP.
Without further details it's hard to determine what might be wrong. You need to check the banking parameters (especially start, size etc).
You, I and nobody apart from the OP (and his team) knows whether it is necessary and/or appropriate to use banking at this time. Until such time, it would be better to avoid looking excessively arrogant and assume it might not be a bodge.
Experience of this and other forums suggests that is quite possibly not a valid assumption.
www.catb.org/.../smart-questions.html
No, he didn't. That's stating a fact, but no reason for why that became a fact.
Well, you'll have to make up your mind: are you actually a consultant, or just a temporary extension of an existing team working a project? IMHO way too much technical "consulting" is actually the latter.
By the actual meaning of the word, a consultant is a person who gives advice. Sometimes that advice will have to be "The only way out of this mess is to start from scratch". Situations like that should be rare, but they exist.
The OP doesn't convey the impression that he fully knows what he's doing, nor that he's fully aware what consequence that will have. At that point, advice to the tone of "You're heading in the wrong direction", like Erik's, is perfectly justified.
But this is a discussion forum - not the Real World...