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?
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.