1144 lines
52 KiB
Plaintext
1144 lines
52 KiB
Plaintext
; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
|
|
; commandline ArmCC [--list --debug -c --asm --interleave -o.\output\updata.o --asm_dir=.\Listing\ --list_dir=.\Listing\ --depend=.\output\updata.d --cpu=Cortex-M4 --apcs=interwork -O3 --diag_suppress=9931 -I..\..\template\Libraries\CMSIS\startup -I..\..\template\Libraries\CMSIS -I..\..\template\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\..\template\Libraries\STM32F10x_StdPeriph_Driver\src -I..\..\nlib -I..\user\inc -I..\user\src -ID:\Keil5\ARM\RV31\INC -ID:\Keil5\ARM\CMSIS\Include -ID:\Keil5\ARM\INC\GD\GD32F30x -D__MICROLIB -D__UVISION_VERSION=538 -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD --omf_browse=.\output\updata.crf ..\user\src\updata.c]
|
|
THUMB
|
|
|
|
AREA ||.text||, CODE, READONLY, ALIGN=2
|
|
|
|
REQUIRE _printf_percent
|
|
REQUIRE _printf_d
|
|
REQUIRE _printf_int_dec
|
|
WordCRC16 PROC
|
|
;;;43 //校验和:命令码+(状态位)+数据长度+数据内容 Modebus
|
|
;;;44 u16 WordCRC16(u8 *pchMsg, u16 wDataLen)
|
|
000000 b570 PUSH {r4-r6,lr}
|
|
;;;45 {
|
|
000002 4603 MOV r3,r0
|
|
;;;46 u16 wCRC = 0xFFFF;
|
|
000004 f64f70ff MOV r0,#0xffff
|
|
;;;47 u16 i;
|
|
;;;48 u8 chChar;
|
|
;;;49
|
|
;;;50 for(i = 0; i < wDataLen; i++)
|
|
000008 2200 MOVS r2,#0
|
|
;;;51 {
|
|
;;;52 chChar = *pchMsg++;
|
|
;;;53 wCRC = wCRCTalbeAbs[(chChar ^ wCRC) & 15] ^ (wCRC >> 4);
|
|
00000a 4dfe LDR r5,|L1.1028|
|
|
00000c e014 B |L1.56|
|
|
00000e bf00 NOP ;52
|
|
|L1.16|
|
|
000010 f8134b01 LDRB r4,[r3],#1 ;52
|
|
;;;54 wCRC = wCRCTalbeAbs[((chChar >> 4)^wCRC) & 15] ^ (wCRC >> 4);
|
|
000014 1c52 ADDS r2,r2,#1
|
|
000016 ea840600 EOR r6,r4,r0 ;53
|
|
00001a f006060f AND r6,r6,#0xf ;53
|
|
00001e b292 UXTH r2,r2 ;50
|
|
000020 f8356016 LDRH r6,[r5,r6,LSL #1] ;53
|
|
000024 ea861010 EOR r0,r6,r0,LSR #4 ;53
|
|
000028 ea801414 EOR r4,r0,r4,LSR #4
|
|
00002c f004040f AND r4,r4,#0xf
|
|
000030 f8354014 LDRH r4,[r5,r4,LSL #1]
|
|
000034 ea841010 EOR r0,r4,r0,LSR #4
|
|
|L1.56|
|
|
000038 428a CMP r2,r1 ;50
|
|
00003a d3e9 BCC |L1.16|
|
|
;;;55 }
|
|
;;;56
|
|
;;;57 return wCRC;
|
|
;;;58 }
|
|
00003c bd70 POP {r4-r6,pc}
|
|
;;;59
|
|
ENDP
|
|
|
|
R_4G_gnm_data_return PROC
|
|
;;;60
|
|
;;;61 void R_4G_gnm_data_return(unsigned char order, u16 num, unsigned char* dtatas)
|
|
00003e e92d41f0 PUSH {r4-r8,lr}
|
|
;;;62 {
|
|
000042 460c MOV r4,r1
|
|
000044 4607 MOV r7,r0
|
|
;;;63 u16 crc_data;
|
|
;;;64 u16 i = 0;
|
|
;;;65 memset(gnm_data_4G, 0, sizeof(gnm_data_4G));
|
|
000046 f44f7808 MOV r8,#0x220
|
|
00004a 4616 MOV r6,r2 ;62
|
|
00004c 2500 MOVS r5,#0 ;64
|
|
00004e 4641 MOV r1,r8
|
|
000050 48ed LDR r0,|L1.1032|
|
|
000052 f7fffffe BL __aeabi_memclr4
|
|
;;;66 memset(CRC_Cal_4G, 0, sizeof(CRC_Cal_4G));
|
|
000056 4641 MOV r1,r8
|
|
000058 48ec LDR r0,|L1.1036|
|
|
00005a f7fffffe BL __aeabi_memclr4
|
|
;;;67 gnm_data_4G[0] = 0x55;
|
|
00005e f8dfc3a8 LDR r12,|L1.1032|
|
|
000062 2055 MOVS r0,#0x55
|
|
000064 f88c0000 STRB r0,[r12,#0]
|
|
;;;68 gnm_data_4G[1] = 0xAA;
|
|
000068 20aa MOVS r0,#0xaa
|
|
00006a f88c0001 STRB r0,[r12,#1]
|
|
;;;69 gnm_data_4G[2] = order;
|
|
;;;70 gnm_data_4G[3] = G4_Status;
|
|
00006e 48e8 LDR r0,|L1.1040|
|
|
000070 f88c7002 STRB r7,[r12,#2] ;69
|
|
;;;71 gnm_data_4G[4] = num >> 8;
|
|
000074 0a21 LSRS r1,r4,#8
|
|
000076 7802 LDRB r2,[r0,#0] ;70 ; G4_Status
|
|
000078 f88c2003 STRB r2,[r12,#3] ;70
|
|
;;;72 gnm_data_4G[5] = (u8)num;
|
|
;;;73
|
|
;;;74 CRC_Cal_4G[0] = order;
|
|
00007c 48e3 LDR r0,|L1.1036|
|
|
00007e f88c1004 STRB r1,[r12,#4] ;71
|
|
000082 f88c4005 STRB r4,[r12,#5] ;72
|
|
000086 7007 STRB r7,[r0,#0]
|
|
;;;75 CRC_Cal_4G[1] = G4_Status;
|
|
000088 7042 STRB r2,[r0,#1]
|
|
;;;76 CRC_Cal_4G[2] = num >> 8;
|
|
00008a 7081 STRB r1,[r0,#2]
|
|
;;;77 CRC_Cal_4G[3] = (u8)num;
|
|
00008c 70c4 STRB r4,[r0,#3]
|
|
;;;78
|
|
;;;79 for(i = 0; i < num; i++)
|
|
00008e e008 B |L1.162|
|
|
|L1.144|
|
|
;;;80 {
|
|
;;;81 gnm_data_4G[6 + i] = dtatas[i];
|
|
000090 eb0c0205 ADD r2,r12,r5
|
|
000094 5d71 LDRB r1,[r6,r5]
|
|
000096 7191 STRB r1,[r2,#6]
|
|
;;;82 CRC_Cal_4G[4 + i] = dtatas[i];
|
|
000098 5d71 LDRB r1,[r6,r5]
|
|
00009a 1942 ADDS r2,r0,r5
|
|
00009c 1c6d ADDS r5,r5,#1
|
|
00009e 7111 STRB r1,[r2,#4]
|
|
0000a0 b2ad UXTH r5,r5 ;79
|
|
|L1.162|
|
|
0000a2 42a5 CMP r5,r4 ;79
|
|
0000a4 d3f4 BCC |L1.144|
|
|
;;;83
|
|
;;;84 }
|
|
;;;85
|
|
;;;86 crc_data = WordCRC16(CRC_Cal_4G, num + 4);
|
|
0000a6 1d20 ADDS r0,r4,#4
|
|
0000a8 b281 UXTH r1,r0
|
|
0000aa 48d8 LDR r0,|L1.1036|
|
|
0000ac f7fffffe BL WordCRC16
|
|
;;;87
|
|
;;;88
|
|
;;;89 gnm_data_4G[6 + num] = crc_data >> 8;
|
|
0000b0 eb0c0104 ADD r1,r12,r4
|
|
0000b4 0a02 LSRS r2,r0,#8
|
|
0000b6 718a STRB r2,[r1,#6]
|
|
;;;90
|
|
;;;91 gnm_data_4G[6 + num + 1] = (u8)crc_data;
|
|
0000b8 71c8 STRB r0,[r1,#7]
|
|
;;;92 gnm_data_4G[6 + num + 2] = 0x77;
|
|
0000ba 2077 MOVS r0,#0x77
|
|
0000bc 7208 STRB r0,[r1,#8]
|
|
;;;93 gnm_data_4G[6 + num + 3] = 0xEE;
|
|
0000be 20ee MOVS r0,#0xee
|
|
0000c0 7248 STRB r0,[r1,#9]
|
|
0000c2 340a ADDS r4,r4,#0xa
|
|
;;;94
|
|
;;;95 Send_TString_GPS(gnm_data_4G, num + 10);
|
|
0000c4 b2a1 UXTH r1,r4
|
|
0000c6 e8bd41f0 POP {r4-r8,lr}
|
|
0000ca 48cf LDR r0,|L1.1032|
|
|
0000cc f7ffbffe B.W Send_TString_GPS
|
|
;;;96
|
|
;;;97 }
|
|
;;;98
|
|
ENDP
|
|
|
|
APP_TO_Bootload PROC
|
|
;;;99
|
|
;;;100 void APP_TO_Bootload()
|
|
0000d0 4770 BX lr
|
|
;;;101 {
|
|
;;;102
|
|
;;;103 // if (((*(__IO uint32_t*)Boot_ADDR) & 0x2FFE0000 ) == 0x20000000)
|
|
;;;104 // {
|
|
;;;105 // __set_PRIMASK(1);//关闭所有中断
|
|
;;;106
|
|
;;;107 // //跳转至Bootload代码
|
|
;;;108 // JumpAddress = *(__IO uint32_t*) (Boot_ADDR + 4);
|
|
;;;109 // Jump_To_Bootload = (pFunction) JumpAddress;
|
|
;;;110 // //初始化用户程序的堆栈指针
|
|
;;;111 // __set_MSP(*(__IO uint32_t*) Boot_ADDR);
|
|
;;;112 // Jump_To_Bootload();
|
|
;;;113 // }
|
|
;;;114
|
|
;;;115 }
|
|
;;;116
|
|
ENDP
|
|
|
|
G4DataHandle PROC
|
|
;;;117
|
|
;;;118 void G4DataHandle(void)
|
|
0000d2 e92d5ff0 PUSH {r4-r12,lr}
|
|
;;;119 {
|
|
;;;120 u16 start_addr = 0; //起始地址
|
|
;;;121 u16 mum = 0; //开关数量
|
|
;;;122 u16 datasss = 0;
|
|
;;;123 u16 Crc_num = 0;
|
|
;;;124 u16 Data_Length = 0;
|
|
;;;125 u16 i = 0;
|
|
;;;126 G4_crc_data = 0;
|
|
0000d6 f8dfc338 LDR r12,|L1.1040|
|
|
;;;127
|
|
;;;128 /*接收一帧报文成功*/
|
|
;;;129 if(updata.G4_Rev_start == 1)
|
|
0000da 4cce LDR r4,|L1.1044|
|
|
0000dc 2700 MOVS r7,#0 ;120
|
|
0000de f8ac7006 STRH r7,[r12,#6] ;126
|
|
0000e2 7820 LDRB r0,[r4,#0] ; updata
|
|
0000e4 463d MOV r5,r7 ;126
|
|
0000e6 2801 CMP r0,#1
|
|
0000e8 d17b BNE |L1.482|
|
|
;;;130 {
|
|
;;;131 updata.G4_Rev_start = 0; //清除标志位
|
|
0000ea 7025 STRB r5,[r4,#0]
|
|
;;;132
|
|
;;;133 /*接收到换电柜数据*/
|
|
;;;134 Data_Length = (updata.G4_Rev_buf[3] << 8 | updata.G4_Rev_buf[4]);
|
|
0000ec 88a0 LDRH r0,[r4,#4] ; updata
|
|
0000ee ba46 REV16 r6,r0
|
|
;;;135 G4_crc_data = WordCRC16(&(updata.G4_Rev_buf[2]), (Data_Length + 3));
|
|
0000f0 1cf0 ADDS r0,r6,#3
|
|
0000f2 b281 UXTH r1,r0
|
|
0000f4 1ce0 ADDS r0,r4,#3
|
|
0000f6 f7fffffe BL WordCRC16
|
|
0000fa f8ac0006 STRH r0,[r12,#6]
|
|
0000fe 4682 MOV r10,r0
|
|
000100 46e0 MOV r8,r12
|
|
;;;136 memset(sbuffer_4G, 0, sizeof(sbuffer_4G));
|
|
000102 f44f7108 MOV r1,#0x220
|
|
000106 f6046034 ADD r0,r4,#0xe34
|
|
00010a f7fffffe BL __aeabi_memclr4
|
|
;;;137 Crc_num = Data_Length + 8;
|
|
00010e f1060008 ADD r0,r6,#8
|
|
000112 b280 UXTH r0,r0
|
|
;;;138
|
|
;;;139 /*条件约束*/
|
|
;;;140 if((unsigned char)(G4_crc_data >> 8) == updata.G4_Rev_buf[Crc_num - 3] && (unsigned char)(G4_crc_data) == updata.G4_Rev_buf[Crc_num - 2])
|
|
000114 1821 ADDS r1,r4,r0
|
|
000116 f6046934 ADD r9,r4,#0xe34 ;136
|
|
00011a f8112c02 LDRB r2,[r1,#-2]
|
|
00011e ebb22f1a CMP r2,r10,LSR #8
|
|
|L1.290|
|
|
000122 d17b BNE |L1.540|
|
|
000124 f8111c01 LDRB r1,[r1,#-1]
|
|
000128 f00a00ff AND r0,r10,#0xff
|
|
00012c 4288 CMP r0,r1
|
|
00012e d1f8 BNE |L1.290|
|
|
;;;141 {
|
|
;;;142 if(updata.G4_Rev_buf[0] == 0x55 & updata.G4_Rev_buf[1] == 0xAA)
|
|
000130 7860 LDRB r0,[r4,#1] ; updata
|
|
000132 2855 CMP r0,#0x55
|
|
|L1.308|
|
|
000134 d173 BNE |L1.542|
|
|
000136 78a0 LDRB r0,[r4,#2] ; updata
|
|
000138 28aa CMP r0,#0xaa
|
|
00013a d1fb BNE |L1.308|
|
|
;;;143 {
|
|
;;;144
|
|
;;;145 switch(updata.G4_Rev_buf[2])
|
|
00013c 78e1 LDRB r1,[r4,#3] ; updata
|
|
00013e f04f0a01 MOV r10,#1 ;129
|
|
000142 2957 CMP r1,#0x57
|
|
|L1.324|
|
|
000144 d06b BEQ |L1.542|
|
|
000146 dc08 BGT |L1.346|
|
|
;;;146 {
|
|
;;;147 case Cell_INF_4G: //电池基本参数
|
|
;;;148 {
|
|
;;;149
|
|
;;;150 }
|
|
;;;151 break;
|
|
;;;152
|
|
;;;153 case Singer_Cell_4G: //单体电压参数
|
|
;;;154
|
|
;;;155
|
|
;;;156 mum = Bms_tt_data.Anal_quanuion.Anal_quan.Cores_num;
|
|
000148 48b3 LDR r0,|L1.1048|
|
|
00014a f1a10151 SUB r1,r1,#0x51
|
|
00014e 2903 CMP r1,#3 ;145
|
|
000150 d265 BCS |L1.542|
|
|
000152 e8dff001 TBB [pc,r1] ;145
|
|
000156 6416 DCB 0x64,0x16
|
|
000158 3400 DCB 0x34,0x00
|
|
|L1.346|
|
|
;;;157 sbuffer_4G[0] = mum;
|
|
;;;158
|
|
;;;159 for(i = 1; i < mum * 2 + 1;)
|
|
;;;160 {
|
|
;;;161 sbuffer_4G[i] = Bms_tt_data.Anal_quanuion.monis[start_addr] >> 8;
|
|
;;;162 sbuffer_4G[i + 1] = Bms_tt_data.Anal_quanuion.monis[start_addr];
|
|
;;;163
|
|
;;;164 i += 2;
|
|
;;;165 start_addr ++;
|
|
;;;166 }
|
|
;;;167
|
|
;;;168 R_4G_gnm_data_return(Singer_Cell_4G, mum * 2 + 1, sbuffer_4G);
|
|
;;;169
|
|
;;;170
|
|
;;;171 break;
|
|
;;;172
|
|
;;;173 case Temper_Cell_4G: //温度参数
|
|
;;;174
|
|
;;;175 sbuffer_4G[0] = 3;
|
|
;;;176 sbuffer_4G[1] = Bms_tt_data.Anal_quanuion.Anal_quan.Cores_Tmp;
|
|
;;;177 sbuffer_4G[2] = Bms_tt_data.Anal_quanuion.Anal_quan.Ambi_Tmp;
|
|
;;;178 sbuffer_4G[3] = Bms_tt_data.Anal_quanuion.Anal_quan.Card_Tmp;
|
|
;;;179
|
|
;;;180 R_4G_gnm_data_return(Temper_Cell_4G, 4, sbuffer_4G);
|
|
;;;181
|
|
;;;182 break;
|
|
;;;183
|
|
;;;184 case Get_Internet_4G: //
|
|
;;;185
|
|
;;;186 break;
|
|
;;;187
|
|
;;;188 case Set_Internet_4G: //
|
|
;;;189
|
|
;;;190 break;
|
|
;;;191
|
|
;;;192 case Get_Product_4G: //生产信息
|
|
;;;193
|
|
;;;194
|
|
;;;195 break;
|
|
;;;196
|
|
;;;197 case Control_4G: //
|
|
;;;198
|
|
;;;199 break;
|
|
;;;200
|
|
;;;201 case Send_Information_4G: //
|
|
;;;202
|
|
;;;203 break;
|
|
;;;204
|
|
;;;205 case Updata_4G: //
|
|
;;;206 sbuffer_4G[0] = 0x52;
|
|
;;;207 sbuffer_4G[1] = 0x53;
|
|
;;;208 sbuffer_4G[2] = 0x54;
|
|
;;;209 memset(FontBuffer_Read2, 0xFF, sizeof(FontBuffer_Read2));
|
|
;;;210 Page_2K = 0;
|
|
;;;211 updata.Update_SuoYin = 0;
|
|
;;;212 Flash_Pack_Size = 0;
|
|
;;;213 Suoyi_Count = 0;
|
|
;;;214 R_4G_gnm_data_return(Reboot_4G, 3, sbuffer_4G);
|
|
;;;215 printf("\r\n............开始升级............\r\n");
|
|
;;;216
|
|
;;;217 break;
|
|
;;;218
|
|
;;;219 case Reboot_4G: //
|
|
;;;220 sbuffer_4G[0] = 0x52;
|
|
;;;221 sbuffer_4G[1] = 0x53;
|
|
;;;222 sbuffer_4G[2] = 0x54;
|
|
;;;223
|
|
;;;224
|
|
;;;225 break;
|
|
;;;226
|
|
;;;227 case File_Size_4G: //A2
|
|
;;;228
|
|
;;;229 memset(FontBuffer_Read2, 0xFF, sizeof(FontBuffer_Read2));
|
|
;;;230 delay_ms(5);
|
|
;;;231 FLASH_Unlock();
|
|
;;;232
|
|
;;;233 updata.G4_PACK_SIZE = updata.G4_Rev_buf[5] << 8 | updata.G4_Rev_buf[6];//数据包大小
|
|
;;;234
|
|
;;;235 updata.G4_PACK_Num = updata.G4_Rev_buf[7] << 8 | updata.G4_Rev_buf[8]; //数据包数量
|
|
;;;236
|
|
;;;237 updata.G4_File_SIZE = updata.G4_Rev_buf[9] << 24 | updata.G4_Rev_buf[10] << 16 | updata.G4_Rev_buf[11] << 8 | updata.G4_Rev_buf[12]; //文件大小
|
|
;;;238
|
|
;;;239 printf("数据包大小:%d 数据包数量:%d 文件大小:%d\r\n", updata.G4_PACK_SIZE, updata.G4_PACK_Num, updata.G4_File_SIZE);
|
|
;;;240
|
|
;;;241 // printf("\r\n............文件大小:%d............\r\n", updata.G4_File_SIZE);
|
|
;;;242
|
|
;;;243 //擦除待升级区程序
|
|
;;;244 for(k = 0; k < FLASH_USER_SIZE / 2; k++)// FLASH_USER_SIZE:100
|
|
;;;245 {
|
|
;;;246 FLASH_ErasePage(k * 2048 + FLASH_APP2_ADDR);
|
|
00015a f8dfb2c0 LDR r11,|L1.1052|
|
|
00015e f44f6700 MOV r7,#0x800 ;209
|
|
000162 29a2 CMP r1,#0xa2 ;145
|
|
000164 d068 BEQ |L1.568|
|
|
000166 dc06 BGT |L1.374|
|
|
000168 2958 CMP r1,#0x58 ;145
|
|
00016a d0eb BEQ |L1.324|
|
|
00016c 29a0 CMP r1,#0xa0 ;145
|
|
00016e d039 BEQ |L1.484|
|
|
000170 29a1 CMP r1,#0xa1 ;145
|
|
000172 d1df BNE |L1.308|
|
|
000174 e056 B |L1.548|
|
|
|L1.374|
|
|
;;;247 delay_ms(10);
|
|
;;;248 }
|
|
;;;249
|
|
;;;250 FLASH_Lock();
|
|
;;;251
|
|
;;;252 R_4G_gnm_data_return(File_Size_4G, 0, sbuffer_4G);
|
|
;;;253
|
|
;;;254 break;
|
|
;;;255
|
|
;;;256 case File_Send_4G: //A3
|
|
;;;257
|
|
;;;258 updata.Updata_Time_Flag = 0;
|
|
;;;259
|
|
;;;260 //printf("开始升级下发升级文件包\r\n");
|
|
;;;261 if(updata.Updata_Time_Count < Over_Time) //等待未超时小于Over_Time ms
|
|
;;;262
|
|
;;;263 {
|
|
;;;264 updata.Updata_Time_Count = 0;
|
|
;;;265 updata.Update_SuoYin = updata.G4_Rev_buf[5] << 8 | updata.G4_Rev_buf[6]; //数据包索引
|
|
;;;266 updata.Updata_Length = (updata.G4_Rev_buf[3] << 8 | updata.G4_Rev_buf[4]) - 2; //升级文件数据长度
|
|
;;;267
|
|
;;;268 if(updata.G4_PACK_Num > 0)
|
|
;;;269 {
|
|
;;;270 // printf("升级进度: %.1f%%\r\n", (float)((updata.Update_SuoYin * 100) / updata.G4_PACK_Num));
|
|
;;;271
|
|
;;;272 }
|
|
;;;273
|
|
;;;274 printf("数据包索引:%d,计数索引:%d\r\n", updata.Update_SuoYin, Suoyi_Count);
|
|
;;;275
|
|
;;;276 if(updata.Update_SuoYin < ( updata.G4_PACK_Num - 1)) //数据包索引小于数据包数量
|
|
;;;277 {
|
|
;;;278
|
|
;;;279 if(updata.Update_SuoYin == Suoyi_Count)
|
|
;;;280 {
|
|
;;;281 updata.Updata_Time_Flag = 1;
|
|
;;;282
|
|
;;;283 memcpy(&(FontBuffer_Read2[Flash_Pack_Size * updata.Updata_Length]), &(updata.G4_Rev_buf[7]), updata.Updata_Length);
|
|
;;;284 delay_ms(5);
|
|
;;;285 Flash_Pack_Size++;
|
|
;;;286 Suoyi_Count++;
|
|
;;;287
|
|
;;;288 if(Flash_Pack_Size == 4)
|
|
;;;289 {
|
|
;;;290 IapWrite_num(FontBuffer_Read2, FLASH_APP2_ADDR + 2048 * Page_2K, 2048);
|
|
;;;291
|
|
;;;292 Page_2K++;
|
|
;;;293
|
|
;;;294 memset(FontBuffer_Read2, 0xFF, sizeof(FontBuffer_Read2));
|
|
;;;295
|
|
;;;296 Flash_Pack_Size = 0;
|
|
;;;297
|
|
;;;298 }
|
|
;;;299
|
|
;;;300 }
|
|
;;;301 else
|
|
;;;302 {
|
|
;;;303 printf("过滤索引重复\r\n");
|
|
;;;304
|
|
;;;305
|
|
;;;306 }
|
|
;;;307
|
|
;;;308 G4_Status = 0x00;
|
|
;;;309 delay_ms(10);
|
|
;;;310 R_4G_gnm_data_return(File_Send_4G, 0, sbuffer_4G);
|
|
;;;311
|
|
;;;312
|
|
;;;313
|
|
;;;314 }
|
|
;;;315
|
|
;;;316 else if( updata.Update_SuoYin == (updata.G4_PACK_Num - 1))
|
|
;;;317 {
|
|
;;;318 memcpy(&(FontBuffer_Read2[Flash_Pack_Size * updata.Updata_Length]), &(updata.G4_Rev_buf[7]), updata.Updata_Length);
|
|
;;;319 IapWrite_num(FontBuffer_Read2, FLASH_APP2_ADDR + 2048 * Page_2K, 2048);
|
|
;;;320 memset(FontBuffer_Read2, 0xFF, sizeof(FontBuffer_Read2));
|
|
;;;321 G4_Status = 0x00;
|
|
;;;322 delay_ms(10);
|
|
;;;323 R_4G_gnm_data_return(File_Send_4G, 0, sbuffer_4G);
|
|
;;;324 Flash_Pack_Size = 0;
|
|
;;;325 Suoyi_Count = 0;
|
|
;;;326 updata.Updata_Data_OK = 1;
|
|
;;;327 // printf("升级进度2: 100%%\r\n");
|
|
;;;328 }
|
|
;;;329 else//发送数据错误
|
|
;;;330 {
|
|
;;;331 printf("发送数据错误\r\n");
|
|
;;;332 memset(FontBuffer_Read2, 0xFF, sizeof(FontBuffer_Read2));
|
|
;;;333 G4_Status = 0x83;
|
|
;;;334 delay_ms(10);
|
|
;;;335 R_4G_gnm_data_return(File_Send_4G, 0, sbuffer_4G);
|
|
;;;336 }
|
|
;;;337
|
|
;;;338
|
|
;;;339 }
|
|
;;;340 else
|
|
;;;341 {
|
|
;;;342 Page_2K = 0;
|
|
;;;343 updata.Updata_Time_Flag = 0;
|
|
;;;344 updata.Updata_Time_Count = 0;
|
|
;;;345 updata.Updata_Data_OK = 0;
|
|
;;;346 Flash_Pack_Size = 0;
|
|
;;;347 G4_Status = 0x82;
|
|
000176 2082 MOVS r0,#0x82
|
|
000178 29a3 CMP r1,#0xa3 ;145
|
|
00017a d077 BEQ |L1.620|
|
|
00017c 29a4 CMP r1,#0xa4 ;145
|
|
00017e d1d9 BNE |L1.308|
|
|
000180 e12e B |L1.992|
|
|
000182 8f02 LDRH r2,[r0,#0x38] ;156 ; Bms_tt_data
|
|
000184 464b MOV r3,r9 ;157
|
|
000186 f8892000 STRB r2,[r9,#0] ;157
|
|
00018a 2101 MOVS r1,#1 ;159
|
|
00018c eb0a0642 ADD r6,r10,r2,LSL #1 ;159
|
|
000190 e00f B |L1.434|
|
|
000192 bf00 NOP ;161
|
|
|L1.404|
|
|
000194 eb000247 ADD r2,r0,r7,LSL #1 ;161
|
|
000198 8ed2 LDRH r2,[r2,#0x36] ;161
|
|
00019a ea4f2c12 LSR r12,r2,#8 ;161
|
|
00019e f803c001 STRB r12,[r3,r1] ;161
|
|
0001a2 eb030c01 ADD r12,r3,r1 ;162
|
|
0001a6 1c89 ADDS r1,r1,#2 ;162
|
|
0001a8 1c7f ADDS r7,r7,#1 ;164
|
|
0001aa f88c2001 STRB r2,[r12,#1] ;162
|
|
0001ae b289 UXTH r1,r1 ;164
|
|
0001b0 b2bf UXTH r7,r7 ;165
|
|
|L1.434|
|
|
0001b2 428e CMP r6,r1 ;159
|
|
0001b4 d8ee BHI |L1.404|
|
|
0001b6 b2b1 UXTH r1,r6 ;168
|
|
0001b8 4a99 LDR r2,|L1.1056|
|
|
0001ba 2052 MOVS r0,#0x52 ;168
|
|
0001bc e073 B |L1.678|
|
|
0001be 2203 MOVS r2,#3 ;175
|
|
0001c0 f8892000 STRB r2,[r9,#0] ;175
|
|
0001c4 f8902044 LDRB r2,[r0,#0x44] ;176 ; Bms_tt_data
|
|
0001c8 f8892001 STRB r2,[r9,#1] ;176
|
|
0001cc f8102f42 LDRB r2,[r0,#0x42]! ;177 ; Bms_tt_data
|
|
0001d0 f8892002 STRB r2,[r9,#2] ;177
|
|
0001d4 7900 LDRB r0,[r0,#4] ;178 ; Bms_tt_data
|
|
0001d6 f8890003 STRB r0,[r9,#3] ;178
|
|
0001da 2104 MOVS r1,#4 ;180
|
|
0001dc 4a90 LDR r2,|L1.1056|
|
|
0001de 2053 MOVS r0,#0x53 ;180
|
|
0001e0 e061 B |L1.678|
|
|
|L1.482|
|
|
0001e2 e1fe B |L1.1506|
|
|
|L1.484|
|
|
0001e4 2152 MOVS r1,#0x52 ;206
|
|
0001e6 f8891000 STRB r1,[r9,#0] ;206
|
|
0001ea 2153 MOVS r1,#0x53 ;207
|
|
0001ec f8891001 STRB r1,[r9,#1] ;207
|
|
0001f0 2154 MOVS r1,#0x54 ;208
|
|
0001f2 f8891002 STRB r1,[r9,#2] ;208
|
|
0001f6 22ff MOVS r2,#0xff ;209
|
|
0001f8 4639 MOV r1,r7 ;209
|
|
0001fa 488a LDR r0,|L1.1060|
|
|
0001fc f7fffffe BL __aeabi_memset
|
|
000200 f8a85008 STRH r5,[r8,#8] ;210
|
|
000204 f8a4540c STRH r5,[r4,#0x40c] ;211
|
|
000208 f8885002 STRB r5,[r8,#2] ;212
|
|
00020c f8a8500a STRH r5,[r8,#0xa] ;213
|
|
000210 4a83 LDR r2,|L1.1056|
|
|
000212 2103 MOVS r1,#3 ;214
|
|
000214 20a1 MOVS r0,#0xa1 ;214
|
|
000216 f7fffffe BL R_4G_gnm_data_return
|
|
00021a e001 B |L1.544|
|
|
|L1.540|
|
|
00021c e1a9 B |L1.1394|
|
|
|L1.542|
|
|
00021e e161 B |L1.1252|
|
|
|L1.544|
|
|
000220 a081 ADR r0,|L1.1064|
|
|
000222 e0da B |L1.986|
|
|
|L1.548|
|
|
000224 2152 MOVS r1,#0x52 ;220
|
|
000226 f8891000 STRB r1,[r9,#0] ;220
|
|
00022a 2153 MOVS r1,#0x53 ;221
|
|
00022c f8891001 STRB r1,[r9,#1] ;221
|
|
000230 2154 MOVS r1,#0x54 ;222
|
|
000232 f8891002 STRB r1,[r9,#2] ;222
|
|
000236 e1cb B |L1.1488|
|
|
|L1.568|
|
|
000238 22ff MOVS r2,#0xff ;229
|
|
00023a 4639 MOV r1,r7 ;229
|
|
00023c 4879 LDR r0,|L1.1060|
|
|
00023e f7fffffe BL __aeabi_memset
|
|
000242 2005 MOVS r0,#5 ;230
|
|
000244 f7fffffe BL delay_ms
|
|
000248 f7fffffe BL FLASH_Unlock
|
|
00024c 88e0 LDRH r0,[r4,#6] ;233 ; updata
|
|
00024e ba41 REV16 r1,r0 ;233
|
|
000250 f8a41404 STRH r1,[r4,#0x404] ;233
|
|
000254 8920 LDRH r0,[r4,#8] ;235 ; updata
|
|
000256 ba42 REV16 r2,r0 ;235
|
|
000258 f8a42406 STRH r2,[r4,#0x406] ;235
|
|
00025c f8d4000a LDR r0,[r4,#0xa] ;237 ; updata
|
|
000260 ba00 REV r0,r0 ;237
|
|
000262 f02003ff BIC r3,r0,#0xff ;237
|
|
000266 7b60 LDRB r0,[r4,#0xd] ;237 ; updata
|
|
000268 4303 ORRS r3,r3,r0 ;237
|
|
00026a e000 B |L1.622|
|
|
|L1.620|
|
|
00026c e01e B |L1.684|
|
|
|L1.622|
|
|
00026e a078 ADR r0,|L1.1104|
|
|
000270 f8c43408 STR r3,[r4,#0x408] ;239 ; updata
|
|
000274 f7fffffe BL __2printf
|
|
000278 4646 MOV r6,r8 ;244
|
|
00027a f8885001 STRB r5,[r8,#1] ;244
|
|
00027e 465f MOV r7,r11 ;246
|
|
|L1.640|
|
|
000280 7870 LDRB r0,[r6,#1] ;246 ; k
|
|
000282 eb0720c0 ADD r0,r7,r0,LSL #11 ;246
|
|
000286 f7fffffe BL FLASH_ErasePage
|
|
00028a 200a MOVS r0,#0xa ;247
|
|
00028c f7fffffe BL delay_ms
|
|
000290 7870 LDRB r0,[r6,#1] ;244 ; k
|
|
000292 1c40 ADDS r0,r0,#1 ;244
|
|
000294 b2c0 UXTB r0,r0 ;244
|
|
000296 7070 STRB r0,[r6,#1] ;244
|
|
000298 2832 CMP r0,#0x32 ;244
|
|
00029a d3f1 BCC |L1.640|
|
|
00029c f7fffffe BL FLASH_Lock
|
|
0002a0 4a5f LDR r2,|L1.1056|
|
|
0002a2 2100 MOVS r1,#0 ;252
|
|
0002a4 20a2 MOVS r0,#0xa2 ;252
|
|
|L1.678|
|
|
0002a6 f7fffffe BL R_4G_gnm_data_return
|
|
0002aa e191 B |L1.1488|
|
|
|L1.684|
|
|
0002ac f8845411 STRB r5,[r4,#0x411] ;258
|
|
0002b0 f8b41412 LDRH r1,[r4,#0x412] ;261 ; updata
|
|
0002b4 f6446220 MOV r2,#0x4e20 ;261
|
|
0002b8 4291 CMP r1,r2 ;261
|
|
0002ba d27c BCS |L1.950|
|
|
0002bc f8a45412 STRH r5,[r4,#0x412] ;264
|
|
0002c0 88e0 LDRH r0,[r4,#6] ;265 ; updata
|
|
0002c2 4646 MOV r6,r8 ;274
|
|
0002c4 ba41 REV16 r1,r0 ;265
|
|
0002c6 f8a4140c STRH r1,[r4,#0x40c] ;265
|
|
0002ca 88a0 LDRH r0,[r4,#4] ;266 ; updata
|
|
0002cc ba40 REV16 r0,r0 ;266
|
|
0002ce 1e80 SUBS r0,r0,#2 ;266
|
|
0002d0 f8a4040e STRH r0,[r4,#0x40e] ;266
|
|
0002d4 f8b8200a LDRH r2,[r8,#0xa] ;274 ; Suoyi_Count
|
|
0002d8 a06a ADR r0,|L1.1156|
|
|
0002da f7fffffe BL __2printf
|
|
0002de f8b43406 LDRH r3,[r4,#0x406] ;276 ; updata
|
|
0002e2 f8b4240c LDRH r2,[r4,#0x40c] ;276 ; updata
|
|
0002e6 484f LDR r0,|L1.1060|
|
|
0002e8 1e5b SUBS r3,r3,#1 ;129
|
|
0002ea f2a0410c SUB r1,r0,#0x40c ;129
|
|
0002ee 429a CMP r2,r3 ;276
|
|
0002f0 da2d BGE |L1.846|
|
|
0002f2 8973 LDRH r3,[r6,#0xa] ;279 ; Suoyi_Count
|
|
0002f4 429a CMP r2,r3 ;279
|
|
0002f6 d125 BNE |L1.836|
|
|
0002f8 f884a411 STRB r10,[r4,#0x411] ;281
|
|
0002fc f8b4240e LDRH r2,[r4,#0x40e] ;283 ; updata
|
|
000300 78b3 LDRB r3,[r6,#2] ;283 ; Flash_Pack_Size
|
|
000302 fb030002 MLA r0,r3,r2,r0 ;283
|
|
000306 f7fffffe BL __aeabi_memcpy
|
|
00030a 2005 MOVS r0,#5 ;284
|
|
00030c f7fffffe BL delay_ms
|
|
000310 78b0 LDRB r0,[r6,#2] ;285 ; Flash_Pack_Size
|
|
000312 1c40 ADDS r0,r0,#1 ;285
|
|
000314 b2c0 UXTB r0,r0 ;285
|
|
000316 70b0 STRB r0,[r6,#2] ;285
|
|
000318 8971 LDRH r1,[r6,#0xa] ;286 ; Suoyi_Count
|
|
00031a 1c49 ADDS r1,r1,#1 ;286
|
|
00031c 8171 STRH r1,[r6,#0xa] ;286
|
|
00031e 2804 CMP r0,#4 ;288
|
|
000320 d113 BNE |L1.842|
|
|
000322 8931 LDRH r1,[r6,#8] ;290 ; Page_2K
|
|
000324 463a MOV r2,r7 ;290
|
|
000326 eb0b21c1 ADD r1,r11,r1,LSL #11 ;290
|
|
00032a 483e LDR r0,|L1.1060|
|
|
00032c f7fffffe BL IapWrite_num
|
|
000330 8930 LDRH r0,[r6,#8] ;292 ; Page_2K
|
|
000332 22ff MOVS r2,#0xff ;294
|
|
000334 1c40 ADDS r0,r0,#1 ;292
|
|
000336 8130 STRH r0,[r6,#8] ;292
|
|
000338 4639 MOV r1,r7 ;294
|
|
00033a 483a LDR r0,|L1.1060|
|
|
00033c f7fffffe BL __aeabi_memset
|
|
000340 70b5 STRB r5,[r6,#2] ;296
|
|
000342 e002 B |L1.842|
|
|
|L1.836|
|
|
000344 a057 ADR r0,|L1.1188|
|
|
000346 f7fffffe BL __2printf
|
|
|L1.842|
|
|
00034a 7035 STRB r5,[r6,#0] ;308
|
|
00034c e02b B |L1.934|
|
|
|L1.846|
|
|
00034e d120 BNE |L1.914|
|
|
000350 f8b4240e LDRH r2,[r4,#0x40e] ;318 ; updata
|
|
000354 78b3 LDRB r3,[r6,#2] ;318 ; Flash_Pack_Size
|
|
000356 fb030002 MLA r0,r3,r2,r0 ;318
|
|
00035a f7fffffe BL __aeabi_memcpy
|
|
00035e 8931 LDRH r1,[r6,#8] ;319 ; Page_2K
|
|
000360 463a MOV r2,r7 ;319
|
|
000362 eb0b21c1 ADD r1,r11,r1,LSL #11 ;319
|
|
000366 482f LDR r0,|L1.1060|
|
|
000368 f7fffffe BL IapWrite_num
|
|
00036c 22ff MOVS r2,#0xff ;320
|
|
00036e 4639 MOV r1,r7 ;320
|
|
000370 482c LDR r0,|L1.1060|
|
|
000372 f7fffffe BL __aeabi_memset
|
|
000376 7035 STRB r5,[r6,#0] ;321
|
|
000378 200a MOVS r0,#0xa ;322
|
|
00037a f7fffffe BL delay_ms
|
|
00037e 4a28 LDR r2,|L1.1056|
|
|
000380 2100 MOVS r1,#0 ;323
|
|
000382 20a3 MOVS r0,#0xa3 ;323
|
|
000384 f7fffffe BL R_4G_gnm_data_return
|
|
000388 70b5 STRB r5,[r6,#2] ;324
|
|
00038a 8175 STRH r5,[r6,#0xa] ;325
|
|
00038c f884a410 STRB r10,[r4,#0x410] ;326
|
|
000390 e11e B |L1.1488|
|
|
|L1.914|
|
|
000392 a048 ADR r0,|L1.1204|
|
|
000394 f7fffffe BL __2printf
|
|
000398 22ff MOVS r2,#0xff ;332
|
|
00039a 4639 MOV r1,r7 ;332
|
|
00039c 4821 LDR r0,|L1.1060|
|
|
00039e f7fffffe BL __aeabi_memset
|
|
0003a2 2083 MOVS r0,#0x83 ;333
|
|
0003a4 7030 STRB r0,[r6,#0] ;333
|
|
|L1.934|
|
|
0003a6 200a MOVS r0,#0xa ;309
|
|
0003a8 f7fffffe BL delay_ms
|
|
0003ac 2100 MOVS r1,#0 ;310
|
|
0003ae 4a1c LDR r2,|L1.1056|
|
|
0003b0 20a3 MOVS r0,#0xa3 ;310
|
|
0003b2 e778 B |L1.678|
|
|
0003b4 e7ff B |L1.950|
|
|
|L1.950|
|
|
0003b6 f8a85008 STRH r5,[r8,#8] ;342
|
|
0003ba f8845411 STRB r5,[r4,#0x411] ;343
|
|
0003be f8a45412 STRH r5,[r4,#0x412] ;344
|
|
0003c2 f8845410 STRB r5,[r4,#0x410] ;345
|
|
0003c6 f8885002 STRB r5,[r8,#2] ;346
|
|
0003ca f8880000 STRB r0,[r8,#0]
|
|
;;;348 R_4G_gnm_data_return(End_Updata_4G, 0, sbuffer_4G);//等待超时重新发送
|
|
0003ce 4a14 LDR r2,|L1.1056|
|
|
0003d0 2100 MOVS r1,#0
|
|
0003d2 20a4 MOVS r0,#0xa4
|
|
0003d4 f7fffffe BL R_4G_gnm_data_return
|
|
;;;349 printf("单次下发升级数据超时\r\n");
|
|
0003d8 a03a ADR r0,|L1.1220|
|
|
|L1.986|
|
|
0003da f7fffffe BL __2printf
|
|
0003de e0f7 B |L1.1488|
|
|
|L1.992|
|
|
;;;350
|
|
;;;351 }
|
|
;;;352
|
|
;;;353 break;
|
|
;;;354
|
|
;;;355 case End_Updata_4G: //
|
|
;;;356
|
|
;;;357 if(updata.G4_Rev_buf[5] == 0x45 && updata.G4_Rev_buf[6] == 0x46 && updata.G4_Rev_buf[7] == 0x47)
|
|
0003e0 79a1 LDRB r1,[r4,#6] ; updata
|
|
0003e2 2945 CMP r1,#0x45
|
|
0003e4 d17e BNE |L1.1252|
|
|
0003e6 79e1 LDRB r1,[r4,#7] ; updata
|
|
0003e8 2946 CMP r1,#0x46
|
|
0003ea d17b BNE |L1.1252|
|
|
0003ec 7a21 LDRB r1,[r4,#8] ; updata
|
|
0003ee 2947 CMP r1,#0x47
|
|
0003f0 d178 BNE |L1.1252|
|
|
;;;358 {
|
|
;;;359 Page_2K = 0;
|
|
0003f2 f8a85008 STRH r5,[r8,#8]
|
|
0003f6 4646 MOV r6,r8
|
|
;;;360
|
|
;;;361 //STMFLASH_Read(FLASH_APP2_ADDR_Password, &flashpassword, 1);
|
|
;;;362
|
|
;;;363 if(updata.Updata_Data_OK == 1)//有下发数据且数据包接收完整
|
|
0003f8 f8941410 LDRB r1,[r4,#0x410] ; updata
|
|
;;;364
|
|
;;;365 {
|
|
;;;366 G4_Status = 0x84; //升级结束待MCU重启
|
|
;;;367 R_4G_gnm_data_return(End_Updata_4G, 0, sbuffer_4G);
|
|
;;;368 printf("接收到升级结束指令\r\n");
|
|
;;;369
|
|
;;;370 UpdataReadDate = 10; //升级结束待MCU重启标志
|
|
;;;371 STMFLASH_Write(FLASH_UPDATE_ADDR, &UpdataReadDate, 1);
|
|
0003fc f8df80dc LDR r8,|L1.1244|
|
|
;;;372
|
|
;;;373 updata.Updata_Data_OK = 0;
|
|
;;;374
|
|
;;;375 __set_PRIMASK(1);//关闭总中断
|
|
;;;376
|
|
;;;377 RESETIO(DC_Power); //DC不工作
|
|
000400 4f37 LDR r7,|L1.1248|
|
|
;;;378 delay_ms(2000);
|
|
000402 e070 B |L1.1254|
|
|
|L1.1028|
|
|
DCD ||.constdata||
|
|
|L1.1032|
|
|
DCD ||.bss||+0xc14
|
|
|L1.1036|
|
|
DCD ||.bss||+0x1054
|
|
|L1.1040|
|
|
DCD ||.data||
|
|
|L1.1044|
|
|
DCD ||.bss||
|
|
|L1.1048|
|
|
DCD Bms_tt_data
|
|
|L1.1052|
|
|
DCD 0x08023000
|
|
|L1.1056|
|
|
DCD ||.bss||+0xe34
|
|
|L1.1060|
|
|
DCD ||.bss||+0x414
|
|
|L1.1064|
|
|
000428 0d0a2e2e DCB "\r\n............",191,170,202,188,201,253,188,182,"...."
|
|
00042c 2e2e2e2e
|
|
000430 2e2e2e2e
|
|
000434 2e2ebfaa
|
|
000438 cabcc9fd
|
|
00043c bcb62e2e
|
|
000440 2e2e
|
|
000442 2e2e2e2e DCB "........\r\n",0
|
|
000446 2e2e2e2e
|
|
00044a 0d0a00
|
|
00044d 00 DCB 0
|
|
00044e 00 DCB 0
|
|
00044f 00 DCB 0
|
|
|L1.1104|
|
|
000450 cafdbedd DCB 202,253,190,221,176,252,180,243,208,161,163,186,"%d ",202
|
|
000454 b0fcb4f3
|
|
000458 d0a1a3ba
|
|
00045c 25642020
|
|
000460 20ca
|
|
000462 fdbeddb0 DCB 253,190,221,176,252,202,253,193,191,163,186,"%d ",206
|
|
000466 fccafdc1
|
|
00046a bfa3ba25
|
|
00046e 64202020
|
|
000472 20ce
|
|
000474 c4bcfeb4 DCB 196,188,254,180,243,208,161,163,186,"%d\r\n",0
|
|
000478 f3d0a1a3
|
|
00047c ba25640d
|
|
000480 0a00
|
|
000482 00 DCB 0
|
|
000483 00 DCB 0
|
|
|L1.1156|
|
|
000484 cafdbedd DCB 202,253,190,221,176,252,203,247,210,253,163,186,"%d,",188
|
|
000488 b0fccbf7
|
|
00048c d2fda3ba
|
|
000490 25642cbc
|
|
000494 c6cafdcb DCB 198,202,253,203,247,210,253,163,186,"%d\r\n",0
|
|
000498 f7d2fda3
|
|
00049c ba25640d
|
|
0004a0 0a00
|
|
0004a2 00 DCB 0
|
|
0004a3 00 DCB 0
|
|
|L1.1188|
|
|
0004a4 b9fdc2cb DCB 185,253,194,203,203,247,210,253,214,216,184,180,"\r\n",0
|
|
0004a8 cbf7d2fd
|
|
0004ac d6d8b8b4
|
|
0004b0 0d0a00
|
|
0004b3 00 DCB 0
|
|
|L1.1204|
|
|
0004b4 b7a2cbcd DCB 183,162,203,205,202,253,190,221,180,237,206,243,"\r\n",0
|
|
0004b8 cafdbedd
|
|
0004bc b4edcef3
|
|
0004c0 0d0a00
|
|
0004c3 00 DCB 0
|
|
|L1.1220|
|
|
0004c4 b5a5b4ce DCB 181,165,180,206,207,194,183,162,201,253,188,182,202,253,190
|
|
0004c8 cfc2b7a2
|
|
0004cc c9fdbcb6
|
|
0004d0 cafdbe
|
|
0004d3 ddb3acca DCB 221,179,172,202,177,"\r\n",0
|
|
0004d7 b10d0a00
|
|
0004db 00 DCB 0
|
|
|L1.1244|
|
|
DCD 0x0803c000
|
|
|L1.1248|
|
|
DCD DC_Power
|
|
|L1.1252|
|
|
0004e4 e074 B |L1.1488|
|
|
|L1.1254|
|
|
0004e6 f44f69fa MOV r9,#0x7d0
|
|
0004ea 2901 CMP r1,#1 ;363
|
|
0004ec d022 BEQ |L1.1332|
|
|
;;;379
|
|
;;;380 //重启
|
|
;;;381 // NVIC_SystemReset(); //重启系统
|
|
;;;382 //
|
|
;;;383
|
|
;;;384 }
|
|
;;;385 else//升级数据异常
|
|
;;;386 {
|
|
;;;387
|
|
;;;388 updata.Updata_Data_OK = 0;
|
|
0004ee f8845410 STRB r5,[r4,#0x410]
|
|
;;;389
|
|
;;;390 G4_Status = 0x82;
|
|
0004f2 7030 STRB r0,[r6,#0]
|
|
;;;391
|
|
;;;392 R_4G_gnm_data_return(End_Updata_4G, 0, sbuffer_4G);//升级失败
|
|
0004f4 4a3c LDR r2,|L1.1512|
|
|
0004f6 2100 MOVS r1,#0
|
|
0004f8 20a4 MOVS r0,#0xa4
|
|
0004fa f7fffffe BL R_4G_gnm_data_return
|
|
;;;393
|
|
;;;394 //重新启动,放弃升级重新运行原来程序
|
|
;;;395 UpdataReadDate = 0;
|
|
0004fe 80b5 STRH r5,[r6,#4]
|
|
;;;396
|
|
;;;397 STMFLASH_Write(FLASH_UPDATE_ADDR, &UpdataReadDate, 1);
|
|
000500 2201 MOVS r2,#1
|
|
000502 493a LDR r1,|L1.1516|
|
|
000504 4640 MOV r0,r8
|
|
000506 f7fffffe BL STMFLASH_Write
|
|
;;;398 __set_PRIMASK(1);//关闭总中断
|
|
00050a 2001 MOVS r0,#1
|
|
00050c f3808810 MSR PRIMASK,r0
|
|
;;;399
|
|
;;;400 RESETIO(DC_Power); //DC不工作
|
|
000510 6878 LDR r0,[r7,#4] ; DC_Power
|
|
000512 6801 LDR r1,[r0,#0]
|
|
000514 68ba LDR r2,[r7,#8] ; DC_Power
|
|
000516 4391 BICS r1,r1,r2
|
|
000518 6001 STR r1,[r0,#0]
|
|
;;;401 delay_ms(2000);
|
|
00051a 4648 MOV r0,r9
|
|
00051c f7fffffe BL delay_ms
|
|
000520 4833 LDR r0,|L1.1520|
|
|
000522 6801 LDR r1,[r0,#0]
|
|
000524 4a33 LDR r2,|L1.1524|
|
|
000526 f40161e0 AND r1,r1,#0x700
|
|
00052a 4311 ORRS r1,r1,r2
|
|
00052c 6001 STR r1,[r0,#0]
|
|
00052e f3bf8f4f DSB
|
|
|L1.1330|
|
|
000532 e7fe B |L1.1330|
|
|
|L1.1332|
|
|
000534 2084 MOVS r0,#0x84 ;366
|
|
000536 7030 STRB r0,[r6,#0] ;366
|
|
000538 4a2b LDR r2,|L1.1512|
|
|
00053a 2100 MOVS r1,#0 ;367
|
|
00053c 20a4 MOVS r0,#0xa4 ;367
|
|
00053e f7fffffe BL R_4G_gnm_data_return
|
|
000542 a02d ADR r0,|L1.1528|
|
|
000544 f7fffffe BL __2printf
|
|
000548 200a MOVS r0,#0xa ;370
|
|
00054a 80b0 STRH r0,[r6,#4] ;370
|
|
00054c 2201 MOVS r2,#1 ;371
|
|
00054e 4927 LDR r1,|L1.1516|
|
|
000550 4640 MOV r0,r8 ;371
|
|
000552 f7fffffe BL STMFLASH_Write
|
|
000556 f8845410 STRB r5,[r4,#0x410] ;373
|
|
00055a 2001 MOVS r0,#1 ;375
|
|
00055c f3808810 MSR PRIMASK,r0 ;375
|
|
000560 6878 LDR r0,[r7,#4] ;377 ; DC_Power
|
|
000562 6801 LDR r1,[r0,#0] ;377
|
|
000564 68ba LDR r2,[r7,#8] ;377 ; DC_Power
|
|
000566 4391 BICS r1,r1,r2 ;377
|
|
000568 6001 STR r1,[r0,#0] ;377
|
|
00056a 4648 MOV r0,r9 ;378
|
|
00056c f7fffffe BL delay_ms
|
|
000570 e02e B |L1.1488|
|
|
|L1.1394|
|
|
;;;402
|
|
;;;403 NVIC_SystemReset(); //重启系统
|
|
;;;404
|
|
;;;405 }
|
|
;;;406
|
|
;;;407
|
|
;;;408 }
|
|
;;;409
|
|
;;;410 break;
|
|
;;;411
|
|
;;;412 default:
|
|
;;;413 break;
|
|
;;;414 }
|
|
;;;415 }
|
|
;;;416 }
|
|
;;;417 else
|
|
;;;418 {
|
|
;;;419
|
|
;;;420 G4_Status = 0x81; //CRC校验错误
|
|
000572 2181 MOVS r1,#0x81
|
|
000574 f8881000 STRB r1,[r8,#0]
|
|
;;;421 //485口监控
|
|
;;;422 printf("\r\n CRC校验错误 \r\n");
|
|
000578 a025 ADR r0,|L1.1552|
|
|
00057a f7fffffe BL __2printf
|
|
;;;423
|
|
;;;424 if(Data_Length == 3 && updata.G4_Rev_buf[2] == 0xA1)
|
|
00057e 2e03 CMP r6,#3
|
|
000580 d102 BNE |L1.1416|
|
|
000582 78e3 LDRB r3,[r4,#3] ; updata
|
|
000584 2ba1 CMP r3,#0xa1
|
|
000586 d003 BEQ |L1.1424|
|
|
|L1.1416|
|
|
;;;425 {
|
|
;;;426 sbuffer_4G[0] = 0x52;
|
|
;;;427 sbuffer_4G[1] = 0x53;
|
|
;;;428 sbuffer_4G[2] = 0x54;
|
|
;;;429 R_4G_gnm_data_return(updata.G4_Rev_buf[2], 3, sbuffer_4G);
|
|
;;;430
|
|
;;;431 }
|
|
;;;432 else if(updata.G4_Rev_buf[2] == 0xA3)
|
|
000588 78e0 LDRB r0,[r4,#3] ; updata
|
|
00058a 28a3 CMP r0,#0xa3
|
|
00058c d00d BEQ |L1.1450|
|
|
00058e e010 B |L1.1458|
|
|
|L1.1424|
|
|
000590 2152 MOVS r1,#0x52 ;426
|
|
000592 f8891000 STRB r1,[r9,#0] ;426
|
|
000596 2153 MOVS r1,#0x53 ;427
|
|
000598 f8891001 STRB r1,[r9,#1] ;427
|
|
00059c 2154 MOVS r1,#0x54 ;428
|
|
00059e f8891002 STRB r1,[r9,#2] ;428
|
|
0005a2 4a11 LDR r2,|L1.1512|
|
|
0005a4 2103 MOVS r1,#3 ;429
|
|
0005a6 4618 MOV r0,r3 ;429
|
|
0005a8 e005 B |L1.1462|
|
|
|L1.1450|
|
|
;;;433 {
|
|
;;;434 updata.Updata_Time_Flag = 0;
|
|
0005aa f8845411 STRB r5,[r4,#0x411]
|
|
;;;435 updata.Updata_Time_Count = 0;
|
|
0005ae f8a45412 STRH r5,[r4,#0x412]
|
|
|L1.1458|
|
|
;;;436 R_4G_gnm_data_return(updata.G4_Rev_buf[2], 0, sbuffer_4G);
|
|
;;;437
|
|
;;;438 }
|
|
;;;439 else
|
|
;;;440 {
|
|
;;;441 R_4G_gnm_data_return(updata.G4_Rev_buf[2], 0, sbuffer_4G);
|
|
0005b2 4a0d LDR r2,|L1.1512|
|
|
0005b4 2100 MOVS r1,#0
|
|
|L1.1462|
|
|
0005b6 f7fffffe BL R_4G_gnm_data_return
|
|
;;;442
|
|
;;;443 }
|
|
;;;444
|
|
;;;445
|
|
;;;446 //发送反馈命令
|
|
;;;447 updata.G4_Rev_buftmp = 0; //数据索引清零
|
|
;;;448 UartData4GMsCnt = 0;
|
|
0005ba 481a LDR r0,|L1.1572|
|
|
0005bc f8a45402 STRH r5,[r4,#0x402] ;447
|
|
;;;449 UartData4GMsCntEnable = 0;
|
|
;;;450 memset(updata.G4_Rev_buf, 0, sizeof(updata.G4_Rev_buf));
|
|
0005c0 f44f6180 MOV r1,#0x400
|
|
0005c4 8005 STRH r5,[r0,#0] ;448
|
|
0005c6 4818 LDR r0,|L1.1576|
|
|
0005c8 7005 STRB r5,[r0,#0] ;449
|
|
0005ca 1c60 ADDS r0,r4,#1
|
|
0005cc f7fffffe BL __aeabi_memclr
|
|
|L1.1488|
|
|
;;;451 }
|
|
;;;452
|
|
;;;453 /*清除缓存数据*/
|
|
;;;454 Uart14GNWDataFlag = 0;
|
|
0005d0 4816 LDR r0,|L1.1580|
|
|
;;;455 memset(updata.G4_Rev_buf, 0, sizeof(updata.G4_Rev_buf));
|
|
0005d2 f44f6180 MOV r1,#0x400
|
|
0005d6 7005 STRB r5,[r0,#0] ;454
|
|
0005d8 1c60 ADDS r0,r4,#1
|
|
0005da e8bd5ff0 POP {r4-r12,lr}
|
|
0005de f7ffbffe B.W __aeabi_memclr
|
|
|L1.1506|
|
|
;;;456
|
|
;;;457 }
|
|
;;;458 }
|
|
0005e2 e8bd9ff0 POP {r4-r12,pc}
|
|
ENDP
|
|
|
|
0005e6 0000 DCW 0x0000
|
|
|L1.1512|
|
|
DCD ||.bss||+0xe34
|
|
|L1.1516|
|
|
DCD ||.data||+0x4
|
|
|L1.1520|
|
|
DCD 0xe000ed0c
|
|
|L1.1524|
|
|
DCD 0x05fa0004
|
|
|L1.1528|
|
|
0005f8 bdd3cad5 DCB 189,211,202,213,181,189,201,253,188,182,189,225,202,248,214
|
|
0005fc b5bdc9fd
|
|
000600 bcb6bde1
|
|
000604 caf8d6
|
|
000607 b8c1ee0d DCB 184,193,238,"\r\n",0
|
|
00060b 0a00
|
|
00060d 00 DCB 0
|
|
00060e 00 DCB 0
|
|
00060f 00 DCB 0
|
|
|L1.1552|
|
|
000610 0d0a2043 DCB "\r\n CRC",208,163,209,233,180,237,206,243," \r\n",0
|
|
000614 5243d0a3
|
|
000618 d1e9b4ed
|
|
00061c cef3200d
|
|
000620 0a00
|
|
000622 00 DCB 0
|
|
000623 00 DCB 0
|
|
|L1.1572|
|
|
DCD UartData4GMsCnt
|
|
|L1.1576|
|
|
DCD UartData4GMsCntEnable
|
|
|L1.1580|
|
|
DCD Uart14GNWDataFlag
|
|
|
|
AREA ||.bss||, DATA, NOINIT, ALIGN=2
|
|
|
|
updata
|
|
% 1044
|
|
FontBuffer_Read2
|
|
% 2048
|
|
gnm_data_4G
|
|
% 544
|
|
sbuffer_4G
|
|
% 544
|
|
CRC_Cal_4G
|
|
% 544
|
|
|
|
AREA ||.constdata||, DATA, READONLY, ALIGN=1
|
|
|
|
wCRCTalbeAbs
|
|
000000 0000cc01 DCW 0x0000,0xcc01
|
|
000004 d8011400 DCW 0xd801,0x1400
|
|
000008 f0013c00 DCW 0xf001,0x3c00
|
|
00000c 2800e401 DCW 0x2800,0xe401
|
|
000010 a0016c00 DCW 0xa001,0x6c00
|
|
000014 7800b401 DCW 0x7800,0xb401
|
|
000018 50009c01 DCW 0x5000,0x9c01
|
|
00001c 88014400 DCW 0x8801,0x4400
|
|
|
|
AREA ||.data||, DATA, ALIGN=1
|
|
|
|
G4_Status
|
|
000000 00 DCB 0x00
|
|
k
|
|
000001 00 DCB 0x00
|
|
Flash_Pack_Size
|
|
000002 0000 DCB 0x00,0x00
|
|
UpdataReadDate
|
|
000004 0000 DCW 0x0000
|
|
G4_crc_data
|
|
000006 0000 DCW 0x0000
|
|
Page_2K
|
|
000008 0000 DCW 0x0000
|
|
Suoyi_Count
|
|
00000a 0000 DCW 0x0000
|
|
|
|
AREA ||area_number.7||, DATA, ALIGN=1
|
|
|
|
EXPORTAS ||area_number.7||, ||.data||
|
|
flashpassword
|
|
000000 0000 DCW 0x0000
|
|
|
|
AREA ||area_number.8||, DATA, ALIGN=2
|
|
|
|
EXPORTAS ||area_number.8||, ||.data||
|
|
Jump_To_Bootload
|
|
DCD 0x00000000
|
|
|
|
AREA ||area_number.9||, DATA, ALIGN=2
|
|
|
|
EXPORTAS ||area_number.9||, ||.data||
|
|
JumpAddress
|
|
DCD 0x00000000
|