Hi,
I am programming a custom bootloader for my application. From now I have split my memory into two sections, one for the boot and the other one for the user program. After a reset, the bootloader is always executed and decide if the user program need to be upgrade or not. If not the application runs, else the bootloader erases the entire section user program + IT vectors+Reset and rewrite the new code (received from UART) into this section.
The problem is that the autoinitialization functions (_c_int00, auto_init, memcpy) are called before my "main"(in the bootloader) and are in the SECTION flash. Unfortunately these function may be erased after a reset if a problem occurs between erasing and rewriting in the upgrage mode. In this case even my bootloader wouldn't be execute because "main" would not be called which would leads to a crash of the micro.
My question is, Is there a linker command to put these autoinialization functions in my section bootloader without modified all of them files using :
_Pragma("CODE_SECTION(_c_int00, \".boot\")")
A solution would be to do my one initialization function but it appears a bit tricky to me.
MCU: MSP430F47166
SW: CCS v4
Thanks