Dear,
i would like to help from you. I programming myself flash update via serial link. I set the all functions (flash page erase, read and write) to address starts with 0x8000. These functions are called after command receieved from serial link (start flashing memory - start from 0x0000, to max 0x4000). the program is running in 0x8000 section but, sometimes are called default libraries(?C?CSTOPTR) which are located in section 0x0000. Is there some possibility how to move these function to user-defined memory space?? I am not able to find some possibility to move these functions to (for example) address 0x8200
in *.m51 called modules like (not all)
------- MODULE ?C?FPDIV C:07D0H PUBLIC ?C?FPDIV ------- ENDMOD ?C?FPDIV ------- MODULE ?C?FPCMP C:086FH PUBLIC ?C?FPCMP C:086DH PUBLIC ?C?FPCMP3 ------- ENDMOD ?C?FPCMP ------- MODULE ?C?FCAST C:08F0H PUBLIC ?C?FCASTC C:08EBH PUBLIC ?C?FCASTI C:08E6H PUBLIC ?C?FCASTL ------- ENDMOD ?C?FCAST ------- MODULE ?C?CASTF C:0924H PUBLIC ?C?CASTF ------- ENDMOD ?C?CASTF ------- MODULE ?C?CLDPTR C:09A5H PUBLIC ?C?CLDPTR ------- ENDMOD ?C?CLDPTR ------- MODULE ?C?CLDOPTR C:09BEH PUBLIC ?C?CLDOPTR ------- ENDMOD ?C?CLDOPTR
BL51 version: BL51 BANKED LINKER/LOCATER V6.22 , MCU C8051F380-TB dev kit.
Thank you for your answers
There is another problem. I set the linker (all routines like main, interrupts etc are located in segment start with 0x0000 (default) but some routines, like (flash erase, copy, read) must be stored in different place (i need to do a flash update).
Process: 1) start sending 2) new firmware is stored in defined place in memory (from 0x4000). 3) loaded a routines located at 0x8000 4) start copy from 0x4000 to 0x0000 (EA=0).
The routines which are necessary to clear and copy data is stored at address 0x8000, but sometimes, the linker link the "default libraries" to place (0x9D, etc) but this is wrong. During the flashing the program jumps to place which (probably) is empty afted flash erase page command. I need to move default routines (?C?CSTOPTR etc stored in C51c.lib (i am not sure about correct name,but it is a default library stored in installation path) to user defined space (for example 0x8200). In *.M51 these routines are descripted like modules :
------- MODULE ?C?FPDIV C:07D0H PUBLIC ?C?FPDIV ------- ENDMOD ?C?FPDIV
Thank you for your response
Learn to build two separate binaries with different functionality and different target address. You should be very careful about trying to build one binary where you may later update half of it and keep the other half. The likelyhood that the remaining part is depending on something already erased or the new part was depending on something not part of the older fixed part is very large.
Just create a traditional boot loader as one binary. And a traditional application. And then let the boot loader take care of replacing an old application with a newer version without having any whatsoever relationsships or internal knowledge about the application binary it downloads/flashes/starts.