Hello world, I am using P89LV51RD2 micro-controller and using u-vision V2.40a! I want to remotely update user application on the micro-controller.
For doing it,first I need to download user-application image into the external flash. Once the user application is downloaded, I want the bootloader to write the downloaded image into internal flash of the micro-controller.
On power-reset, the bootloader has to check whether the user-application has to be upgraded or not. If the user-application has to be upgraded, then the bootloader has to write downloaded user application image into the internal flash.
Where should I add the bootloader? Can I modify the STARTUP.A51 file to add the bootloader routine just before when the instruction "LJMP ?C_START" is executed? After bootloder executes,How can make sure that interrupt vector table gets redirected to a given location in user application,Can I get help regarding this?
When I define global xdata or global static xdata, I dont see the code memory content getting modified. When I add a local variable in the new routine defined at address beyond location 32FFH or global volatile bit,the code memory content between 2000H-32FFH gets affected.
How can I control this?
Remember that the Keil compiler converts auto variables into global variables for non-reentrant functions, which means that it is very easy to introduce changes that does change the generated code.
This is a workaround for the very limited stack capabilities of the 8051 and makes this processor not so suited for advanced programming where you mix fixed code with recompiled code. When having two precompiled blocks that are expected to interface with each other, it's normally best to create a BIOS-style interface. Either using a table of jump vectors, or a common entry function that routes to the correct function. Just ot make sure that you reduce the amount of binding between the two code blocks.
You shouldn't be trying to. You're trying to fight the tools instead of using them. You'll lose that fight.
Among all the CPU architectures still in active use today, the '51 is about the worst possible you could use for what you're trying to do. That limitation can be overcome by experts, if absolutely necessary, but I rather heavily doubt you're really in that situation.
Whatever your actual problem is: you need to re-think your approach to it from square one.
Thanks Per Westermark and Hans-Bernhard Broeker for your valuable inputs :) !! Once I do complete,will be revert back to discussion forum :) !