This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using Bootloader routines from my Flash code

My question revolves using Bootloader routines in my Flash code.
This is legacy code so I have no opportunity to change the Bootloader code.

I have a need to use several Bootloader routines as well as some data in the Bootloader.
I am currently accessing the data by:

 
	Options for Target 1: L51Locate Code: 
			?CO?CRCTABLE(007FH) in the (007FH came from the Bootloader map)

In my Flash code I have a file crctable.c with:
 
			const unsigned int code crc_table[256] = { .... }

This works great

I would like to access several routines in the Bootloader. These are in a file dspdrv.c in the bootloader, this file can be added to the Flash as well. A short listing of this module (just one routine of many):

 
void CmdWrite(unsigned char c) {

	DISPLAY_CD = TRUE;

	while((DisplayAddress & 0x03) != 0x03)
	{ PCON |= 0x10; T3 = 0x00; }

	DisplayAddress = c;

	DISPLAY_CD = FALSE;
}

Note that the routine was not defined as reentrant

Variables that are defined in both Bootloader and Flash seem to make this code compatible:

 
	unsigned char xdata DisplayAddress _at_ 0x0000;	

	sfr P4 = 0xC0;				/* Port 4 - Display control */
  	   sbit DISPLAY_CD = P4 ^ 0;			/*P4.0: Display command/data - data active low */

I modified
Options for Target 1: L51Locate Code:
  
				?CO?CRCTABLE(007FH)
to
				?CO?CRCTABLE(007FH),?CO?DSPDRV(120EH) (120EH came from the Bootloader map)

and added dspdrv.c to my Flash code

When I do a build I get:
 
	**** Warning L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
	SEGMENT:  ?CO?DSPDRV
	**** ERROR L1110: CANNOT FIND SEGMENT
	SEGMENT: ?CO?DSPDRV

My question is how to get this to work.