Hello!
I have seen that this issu have been discussed before.
I try to create an application in C that is able to erase the FLASH in MC9S08GB60 and reprogram it with a new version of the application.
Everything works fine: I am able to create a special SEGMENTS for the "bootloader" and I am able to erase the main() function and reprogram the same data again to restore the main() function.
But when I try to erase the functions that belongs to RTSHC08.C and MC9S08GB60.C and reprogram the same data again it fails. I can not reboot the application and start to execute it again. (Why can I not erase and reprogram these functions is it some thing special with these functions?)
So I like to move the functions in the table below to the SECTOR where the rest of the bootloader is placed. How can I do this?
When I add the file, RTSHC08.C, to my project I get a number of error two of these are:
L1919 dublicate definition of _IDIVU_8
L1919 dublicate definition of _IMODU_8
I did not remove ansiis.lib from my project so maybe this is the problem. Is the whole ansiis.lib based on just this file or is it a pakage of files?
My main question is how can I direct this lib or functions to correct CODE_SEG is it possible to use
#pragma CODE_SEG FAR APPL_ROM_SEG or something like this?
CrasyCat suggested earlier the following: change the link order it comes first and then adapt the content of your local rtshc08.c..
It did not help to change the link order. Instead I moved the SECTIONS:
DEFAULT_ROM, ROM_VAR, STRINGS, COPY INTO BOOTLOADER_ROM.
If we add new code to our project in the feture will some of the code be placed in this section by default? I planning to suround all the application code with following pragma:
#pragma CODE_SEG FAR APPL_ROM_SEG.
will it be enough?
MODULE: -- RTSHC08.C.o (ansiis.lib) --
PROCEDURES:
_PUSH_ARGS_L 182C 20 32 1 .text
_ENTER_UNARY_L 184C 29 41 1 .text
_ENTER_BINARY_L_RC 1875 19 25 1 .text
_LCMP_k_rel_j 188E 1F 31 1 .text
_LINC 18AD 16 22 2 .text
_LCMP_RC 18C3 6 6 2 .text
_POP32 18C9 1A 26 2 .text
Ajn
Message Edited by ajn on 2007-04-1603:56 PM
Message Edited by ajn on 2007-04-1604:02 PM