Function: BootLoaderStartup
Source : C:\Users\Richard\Documents\MyProjects\GSM LAN\Firmwares\FuelGauge\Quectel_GW\CodeWarrior_6.2\Sources\bootloader.c
Options : -Cs08 -D__NO_FLOAT__ -D__DEBUG__ -Env"GENPATH=C:\Users\Richard\Documents\MyProjects\GSM LAN\Firmwares\FuelGauge\Quectel_GW\CodeWarrior_6.2;C:\Users\Richard\Documents\MyProjects\GSM LAN\Firmwares\FuelGauge\Quectel_GW\CodeWarrior_6.2\bin;C:\Users\Richard\Documents\MyProjects\GSM LAN\Firmwares\FuelGauge\Quectel_GW\CodeWarrior_6.2\prm;C:\Users\Richard\Documents\MyProjects\GSM LAN\Firmwares\FuelGauge\Quectel_GW\CodeWarrior_6.2\Sources;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\hc08c\device\src;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\hc08c\lib;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\hc08c\src;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\hc08c\device\include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\hc08c\device\asm_include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\HC08c\include" -Env"LIBPATH=C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\hc08c\device\include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\hc08c\device\asm_include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\HC08c\include" -Env"OBJPATH=C:\Users\Richard\Documents\MyProjects\GSM LAN\Firmwares\FuelGauge\Quectel_GW\CodeWarrior_6.2\bin" -Env"TEXTPATH=C:\Users\Richard\Documents\MyProjects\GSM LAN\Firmwares\FuelGauge\Quectel_GW\CodeWarrior_6.2\bin" -Lasm="C:\Users\Richard\Documents\MyProjects\GSM LAN\Firmwares\FuelGauge\Quectel_GW\CodeWarrior_6.2\QuectelFaG_Data\Debug\ObjectCode\bootloader.c.o.lst" -Ms -Onu -Onf -ObjN="C:\Users\Richard\Documents\MyProjects\GSM LAN\Firmwares\FuelGauge\Quectel_GW\CodeWarrior_6.2\QuectelFaG_Data\Debug\ObjectCode\bootloader.c.o" -Ol0 -OnB -Onbt -Onca -Oncn -One -OnP -Ont= -TE1uE -WmsgSd1106 -WmsgSd1139 -WmsgSd1420 -WmsgSd4000 -WmsgSd4002 -WmsgSd4200
87: /* Set the stack pinter to top of the RAM */
88: asm LDHX #$1080;
0000 451080 [3] LDHX #4224
89: asm TXS;
0003 94 [2] TXS
90:
91: /* Common initialization of the write once registers */
92: /* SOPT1: BKGDPE=1,??=1,STOPE=0,??=1,COPT=2,COPCLKS=0,COPW=0 */
93: SOPT1 = 0xD8U;
0004 a6d8 [2] LDA #-40
0006 c70000 [4] STA _SOPT1
94:
95: /* SPMSC1: LVDF=0,LVDACK=0,LVDIE=0,LVDRE=1,LVDSE=0,LVDE=1,BGBDS=0,BGBE=0 */
96: SPMSC1 = 0x14U;
0009 a614 [2] LDA #20
000b c70000 [4] STA _SPMSC1
97:
98: /* SPMSC2: LPR=0,LPRS=0,LPWUI=0,??=0,PPDF=0,PPDACK=0,PPDE=1,PPDC=0 */
99: SPMSC2 = 0x02U;
000e a602 [2] LDA #2
0010 c70000 [4] STA _SPMSC2
100:
101: /* SPMSC3: LVDV=0,LVWV=0,LVWIE=0 */
102: SPMSC3 &= ~0x38;
0013 450000 [3] LDHX @_SPMSC3
0016 f6 [3] LDA ,X
0017 a4c7 [2] AND #-57
0019 f7 [2] STA ,X
103:
104: /* CCSCTRL: ICS_EXT_CLK_SEL=1 */
105: CCSCTRL |= 0x01U;
001a 450000 [3] LDHX @_CCSCTRL
001d f6 [3] LDA ,X
001e aa01 [2] ORA #1
0020 f7 [2] STA ,X
106:
107: /* ICSC1: CLKS=0,RDIV=0,IREFS=0,IRCLKEN=0,IREFSTEN=0 */
108: ICSC1 = 0;
0021 4f [1] CLRA
0022 c70000 [4] STA _ICSC1
109:
110: /* ICSC2: BDIV=0,RANGE=0,HGO=0,LP=0,EREFS=0,ERCLKEN=1,EREFSTEN=0 */
111: ICSC2 = 2;
0025 a602 [2] LDA #2
0027 c70000 [4] STA _ICSC2
112:
113: /* ICSSC: DRST_DRS=0,DMX32=1 */
114: ICSSC = ( ICSSC & 0x3F ) | 0x20;
002a 450000 [3] LDHX @_ICSSC
002d f6 [3] LDA ,X
002e a43f [2] AND #63
0030 aa20 [2] ORA #32
0032 f7 [2] STA ,X
115:
116: while ( ICSSC & 0xC0U )
0033 2005 [3] BRA L3A
;abs = 003a
0035 L35:
117: {
118: /* Wait until the FLL switches to Low range DCO mode */
119: SRS = 0x55U;
0035 a655 [2] LDA #85
0037 c70000 [4] STA _SRS
003a L3A:
003a c60000 [4] LDA _ICSSC
003d a5c0 [2] BIT #-64
003f 26f4
[3] BNE L35
;abs = 0035 120: }
121:
122: /* Init internal FLASH clock to 155 Khz */
123:
124: /* FSTAT: FCBEF=0,FCCF=0,FPVIOL=1,FACCERR=1,??=0,FBLANK=0,??=0,??=0 */
125: FSTAT = 0x30;
0041 a630 [2] LDA #48
0043 c70000 [4] STA _FSTAT
126:
127: /* FCDIV: DIVLD=0,PRDIV8=1,DIV5=0,DIV4=0,DIV3=1,DIV2=1,DIV1=1,DIV0=0 */
128: FCDIV = 0x4E;
0046 a64e [2] LDA #78
0048 c70000 [4] STA _FCDIV
129:
130: /* Proccess FOTA */
131: proccess_fota();
004b cd0000 [6] JSR proccess_fota
132:
133: /* Goto the application */
134: asm jmp 0x19E0;
004e cc19e0 [4] JMP 6624
135: }