My firmware support upgrade by means of a bootloader (USB bootloader). I do not wan't to upgrade all the firmware, but only a specific function in the firmware.
My problem with updating all the firmware at once is that if a user removes power from the target while upating, it won't be possible to recover the target unless some form of backup is on the target board or physical re-porgramming of the target with a programmer.
I do not have the option of a backup.
So to be safe, I only want to update the specific function, and after all that is the only thing that will be changed in the firmware.
The function is compiled at an absolute address and does not use any interrupts.
I am faced with several problems.
1.) Is it possible to compile the function by itself, since the function does use other functions from the project? Because if I want to update the function only I will need a HEX file containing the data of the function only.If possible, how do I do this?
2.) What happens if I size of the function changes, will the rest of the project be able to detect the end address of the function. What affect will this have on the stack, PC etc.?