Will ?C?LIB_CODE increase with my application?

I write a bootloader to update the flash,but when the bootloader update the ?c?LIB_CODE,the MCU(C8051F005) always jump to another incorrect place.
So I put the ?c?LIB_CODE into boot-area when linking.
(BTW,my bootloader and app are compiled together.)

But I am afraid the ?c?LIB_CODE will increase when I use some new function in the newer applcation.then the app will be wrong if I do not update the ?c?LIB_CODE.

Any one has good ideas?

Parents
  • then the app will be wrong if I do not update the ?c?LIB_CODE.

    This is a very valid concern.

    Any one has good ideas?

    Make the bootloader and the actual program separate projects. This way, each of them will have their own copy of the necessary library functions (I assume that the bootloader need fewer library functions than the program), and they are independent as far as size and version of the libraries.

    This would be the "clean" approach - the bootloader should never depend on the program being correct (or even present - the bootloader has to work if the program is missing), and the program should, for the most part, not need to care what the bootloader is doing (except for maybe a small, well defined interface that the bootloader can use to transfer some bits of information to the program).

Reply
  • then the app will be wrong if I do not update the ?c?LIB_CODE.

    This is a very valid concern.

    Any one has good ideas?

    Make the bootloader and the actual program separate projects. This way, each of them will have their own copy of the necessary library functions (I assume that the bootloader need fewer library functions than the program), and they are independent as far as size and version of the libraries.

    This would be the "clean" approach - the bootloader should never depend on the program being correct (or even present - the bootloader has to work if the program is missing), and the program should, for the most part, not need to care what the bootloader is doing (except for maybe a small, well defined interface that the bootloader can use to transfer some bits of information to the program).

Children
More questions in this forum