|
Read-Only
Author Dave Fords
Posted 9-Jun-2004 17:43 GMT
Toolset C51
|
 Problem translating application to 0x8000 for debugging
Dave Fords
I am trying to get Mon51 working at address 0x0000 in EPROM. Monitor is built with XDATA(XDATA_AREA(0D000H)), CODE(INITSEG(00000H)), INSTALLCODE(01000H).
Interrupt vectors are translated to 0x8000 except
the serial interrupt vector used by the monitor.
C:0x0000 020100 LJMP C:0100
At C:0x0100 Code from Install.A51(InitSerial) runs
then
LJMP MON51 assembles as LJMP C:0546
C:0x0546 758107 MOV SP(0x81),#0x07
C:0x0549 90D008 MOV DPTR, #0xD008
C:0x054C E4 CLR A
C:0x054D 7805 MOV R0,#05
C:0x054F F0 MOVX @DPTR,A
C:0x0550 A3 INC DPTR
C:0x0551 8DFC DJNZ R0,C:054F
C:0x0553 7480 MOV A,#P0(0x80)
C:0x0555 F0 MOVX @DPTR,A
C:0x0556 A3 INC DPTR
C:0x0557 7400 MOV A,#0x00
C:0x0559 F0 MOVX @DPTR,A
C:0x055A A3 INC DPTR
C:0x055B 7407 MOV A,#0x07
C:0x055D F0 MOVX @DPTR,A
Executing this last step causes the debugger to pause for about 2 seconds, then the PC $= 0x8000
C:0x8000 LJMP STARTUP1(C:9240)
This comes from STARTUP.A51 of my application which has a CSEG at 0x8000.
My target build has my application code starting at 0x9000.
At this point, I can start using the debugger correctly. I have full running, breakpoint, and debugging capability.
If I do not do the single stepping sequence up until the PC $ jumps to 0x8000 the debugger looses communications with the target, and a target reset is required. I cannot use the run until main() option.
Any help is appreciated.
|
|
Read-Only
Author Dave Fords
Posted 9-Jun-2004 22:31 GMT
Toolset C51
|
 RE: Problem translating application to 0x8000 for debugging
Dave Fords
By .MAP file is hope you mean .M51, here is the application code section
* * * * * * * C O D E M E M O R Y * * * * * * *
0000H 8000H *** GAP ***
CODE 8000H 0003H ABSOLUTE
8003H 0FFDH *** GAP ***
CODE 9000H 00E9H UNIT ?C?LIB_CODE
CODE 90E9H 0070H UNIT ?PR?_LCD_DISPLAY?LCDTEST
CODE 9159H 003CH UNIT ?PR?HELLOWORLD?LCDTEST
CODE 9195H 0036H UNIT ?CO?LCDTEST
CODE 91CBH 002BH UNIT ?PR?LCD_INIT?LCDTEST
CODE 91F6H 0025H UNIT ?PR?_DELAYMS?LCDTEST
CODE 921BH 0025H UNIT ?PR?MAIN?LCDTEST
CODE 9240H 000CH UNIT ?C_C51STARTUP
Here is the Code section from MON51.M51
* * * * * * * C O D E M E M O R Y * * * * * * *
CODE 0000H 0043H UNIT INITSEG
0043H 00BDH *** GAP ***
CODE 0100H 0030H UNIT INSTALLCODE
0130H 00D0H *** GAP ***
CODE 0200H 0342H PAGE STOPSEG
CODE 0542H 05BBH UNIT CODE_AREA
CODE 0AFDH 0548H UNIT GOCODE_AREA
|