; generated by Component: ARM Compiler 5.05 update 2 (build 169) Tool: ArmCC [4d0f38]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\..\..\..\build\bootloader\mico-fire_f429\obj_rvmdk\update_for_ota.o --asm_dir=..\..\..\..\Build\Bootloader\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\Bootloader\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\bootloader\mico-fire_f429\obj_rvmdk\update_for_ota.d --cpu=Cortex-M4.fp --apcs=interwork --diag_suppress=9931,1,1293 -I..\..\..\..\Bootloader -I..\..\..\..\Board\fire_F429 -I..\..\..\..\include -I..\..\..\..\libraries\utilities -I..\..\..\..\libraries\utilities\json_c -I..\..\..\..\MICO\core -I..\..\..\..\MICO\security -I..\..\..\..\MICO\system -I..\..\..\..\MICO\system\command_console -I..\..\..\..\Platform\include -I..\..\..\..\Platform\Cortex-M4 -I..\..\..\..\Platform\Cortex-M4\CMSIS -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries -I..\..\..\..\Platform\MCU\STM32F4xx\wlan_bus_driver -I..\..\..\..\Platform\Drivers\spi_flash -I..\..\..\..\Platform\Drivers -IG:\GIT_OSC\F429_OV2640_MICO_SDRAM\Projects\STM32F429\bootloader\RVMDK\RTE -ID:\work\keil5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -ID:\work\keil5\ARM\CMSIS\Include -ID:\work\keil5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__MICROLIB -D__UVISION_VERSION=516 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DBOOTLOADER -DNO_MICO_RTOS -DHSE_VALUE=25000000 --omf_browse=..\..\..\..\build\bootloader\mico-fire_f429\obj_rvmdk\update_for_ota.crf ..\..\..\..\Bootloader\Update_for_OTA.c]
                          THUMB

                          AREA ||i.checkcrc||, CODE, READONLY, ALIGN=2

                  checkcrc PROC
;;;57     
;;;58     static OSStatus checkcrc(uint16_t crc_in, int partition_type, int total_len)
000000  e92d43fe          PUSH     {r1-r9,lr}
;;;59     {
000004  4606              MOV      r6,r0
;;;60         uint16_t crc = 0;
000006  2000              MOVS     r0,#0
000008  f8ad0000          STRH     r0,[sp,#0]
;;;61         mico_logic_partition_t* part;
;;;62         int len;
;;;63         OSStatus err = kNoErr;
00000c  4607              MOV      r7,r0
;;;64         uint32_t update_data_offset = 0x0;
;;;65         CRC16_Context contex;
;;;66     
;;;67         CRC16_Init( &contex );
00000e  9002              STR      r0,[sp,#8]
000010  4614              MOV      r4,r2                 ;59
000012  460d              MOV      r5,r1                 ;59
000014  a801              ADD      r0,sp,#4
000016  f7fffffe          BL       CRC16_Init
;;;68         
;;;69         if (crc_in == 0xFFFF)
00001a  f5a6407f          SUB      r0,r6,#0xff00
00001e  38ff              SUBS     r0,r0,#0xff
000020  d01f              BEQ      |L1.98|
;;;70             goto exit;
;;;71     
;;;72         part = MicoFlashGetInfo((mico_partition_t)partition_type);
000022  b268              SXTB     r0,r5
000024  f7fffffe          BL       MicoFlashGetInfo
;;;73         if (part == NULL)
;;;74             goto exit;
;;;75     
;;;76         while(total_len > 0){
;;;77           if( SizePerRW < total_len ){
000028  f44f5180          MOV      r1,#0x1000
00002c  b1c8              CBZ      r0,|L1.98|
00002e  4688              MOV      r8,r1
                  |L1.48|
000030  2c00              CMP      r4,#0                 ;76
000032  dd12              BLE      |L1.90|
000034  4645              MOV      r5,r8
000036  42ac              CMP      r4,r5
000038  dc00              BGT      |L1.60|
;;;78             len = SizePerRW;
;;;79           } else {
;;;80             len = total_len;
00003a  4625              MOV      r5,r4
                  |L1.60|
;;;81           }
;;;82           err = MicoFlashRead( MICO_PARTITION_OTA_TEMP, &update_data_offset, data , len);
00003c  462b              MOV      r3,r5
00003e  4a0a              LDR      r2,|L1.104|
000040  a902              ADD      r1,sp,#8
000042  2003              MOVS     r0,#3
000044  f7fffffe          BL       MicoFlashRead
000048  0007              MOVS     r7,r0
;;;83           require_noerr(err, exit);
00004a  d10a              BNE      |L1.98|
;;;84     
;;;85           total_len -= len;
00004c  1b64              SUBS     r4,r4,r5
;;;86     
;;;87           CRC16_Update( &contex, data, len );
00004e  462a              MOV      r2,r5
000050  4905              LDR      r1,|L1.104|
000052  a801              ADD      r0,sp,#4
000054  f7fffffe          BL       CRC16_Update
000058  e7ea              B        |L1.48|
                  |L1.90|
;;;88         }
;;;89     
;;;90       CRC16_Final( &contex, &crc );
00005a  4669              MOV      r1,sp
00005c  a801              ADD      r0,sp,#4
00005e  f7fffffe          BL       CRC16_Final
                  |L1.98|
;;;91         if (crc == crc_in)
;;;92             err = kNoErr;
;;;93     exit:
;;;94         update_log("CRC check return %d, got crc %x, calcuated crc %x", err, crc_in, crc);
;;;95         return err;
000062  4638              MOV      r0,r7
;;;96     }
000064  e8bd83fe          POP      {r1-r9,pc}
;;;97     
                          ENDP

                  |L1.104|
                          DCD      ||.bss||

                          AREA ||i.update||, CODE, READONLY, ALIGN=2

                  update PROC
;;;133    
;;;134    OSStatus update(void)
000000  e92d4ff0          PUSH     {r4-r11,lr}
;;;135    {
000004  b08b              SUB      sp,sp,#0x2c
;;;136      boot_table_t updateLog;
;;;137      uint32_t i, j, size;
;;;138      uint32_t update_data_offset = 0x0;
000006  f04f0b00          MOV      r11,#0
;;;139      uint32_t dest_offset;
;;;140      uint32_t boot_table_offset = 0x0;
00000a  f8cdb000          STR      r11,[sp,#0]
;;;141      uint32_t para_offset = 0x0;
00000e  f8cdb004          STR      r11,[sp,#4]
;;;142      uint32_t copyLength;
;;;143      //uint8_t *paraSaveInRam = NULL;
;;;144      mico_logic_partition_t *ota_partition_info, *dest_partition_info, *para_partition_info;
;;;145      mico_partition_t dest_partition;
;;;146      OSStatus err = kNoErr;
;;;147    
;;;148      ota_partition_info = MicoFlashGetInfo(MICO_PARTITION_OTA_TEMP);
000012  2003              MOVS     r0,#3
000014  f8cdb008          STR      r11,[sp,#8]
000018  f7fffffe          BL       MicoFlashGetInfo
00001c  4605              MOV      r5,r0
;;;149      require_action( ota_partition_info->partition_owner != MICO_FLASH_NONE, exit, err = kUnsupportedErr );
00001e  7800              LDRB     r0,[r0,#0]
000020  f8df81b8          LDR      r8,|L2.476|
000024  2803              CMP      r0,#3
000026  d058              BEQ      |L2.218|
;;;150      
;;;151      para_partition_info = MicoFlashGetInfo(MICO_PARTITION_PARAMETER_1);
000028  2005              MOVS     r0,#5
00002a  f7fffffe          BL       MicoFlashGetInfo
00002e  4606              MOV      r6,r0
;;;152      require_action( para_partition_info->partition_owner != MICO_FLASH_NONE, exit, err = kUnsupportedErr );
000030  7800              LDRB     r0,[r0,#0]
000032  2803              CMP      r0,#3
000034  d051              BEQ      |L2.218|
;;;153      
;;;154      memset(data, 0xFF, SizePerRW);
000036  f44f5980          MOV      r9,#0x1000
00003a  22ff              MOVS     r2,#0xff
00003c  464c              MOV      r4,r9
00003e  4649              MOV      r1,r9
000040  4867              LDR      r0,|L2.480|
000042  f7fffffe          BL       __aeabi_memset
;;;155      memset(newData, 0xFF, SizePerRW);
000046  22ff              MOVS     r2,#0xff
000048  4621              MOV      r1,r4
00004a  4866              LDR      r0,|L2.484|
00004c  f7fffffe          BL       __aeabi_memset
;;;156    
;;;157      //paraSaveInRam = malloc( para_partition_info->partition_length );
;;;158      //require_action( paraSaveInRam, exit, err = kNoMemoryErr );
;;;159      memset(paraSaveInRam, 0xFF, para_partition_info->partition_length);
000050  22ff              MOVS     r2,#0xff
000052  4865              LDR      r0,|L2.488|
000054  68f1              LDR      r1,[r6,#0xc]
000056  f7fffffe          BL       __aeabi_memset
;;;160        
;;;161      err = MicoFlashRead( MICO_PARTITION_PARAMETER_1, &boot_table_offset, (uint8_t *)&updateLog, sizeof(boot_table_t));
00005a  2318              MOVS     r3,#0x18
00005c  aa04              ADD      r2,sp,#0x10
00005e  a901              ADD      r1,sp,#4
000060  2005              MOVS     r0,#5
000062  f7fffffe          BL       MicoFlashRead
000066  0004              MOVS     r4,r0
;;;162      require_noerr(err, exit);
000068  d121              BNE      |L2.174|
;;;163    
;;;164      /*Not a correct record*/
;;;165      if(updateLogCheck( &updateLog, &dest_partition) != Log_NeedUpdate){
00006a  a90a              ADD      r1,sp,#0x28
00006c  a804              ADD      r0,sp,#0x10
00006e  f7fffffe          BL       updateLogCheck
000072  2802              CMP      r0,#2
000074  d01c              BEQ      |L2.176|
;;;166        size = ( ota_partition_info->partition_length )/SizePerRW;
000076  68e8              LDR      r0,[r5,#0xc]
000078  0b07              LSRS     r7,r0,#12
;;;167        for(i = 0; i <= size; i++){
00007a  2600              MOVS     r6,#0
00007c  e015              B        |L2.170|
                  |L2.126|
;;;168          if( i==size ){
00007e  d103              BNE      |L2.136|
;;;169            err = MicoFlashRead( MICO_PARTITION_OTA_TEMP , &update_data_offset, data , ( ota_partition_info->partition_length )%SizePerRW );
000080  89a8              LDRH     r0,[r5,#0xc]
000082  f3c0030b          UBFX     r3,r0,#0,#12
;;;170            require_noerr(err, exit);
000086  e000              B        |L2.138|
                  |L2.136|
;;;171          }
;;;172          else{
;;;173            err = MicoFlashRead( MICO_PARTITION_OTA_TEMP, &update_data_offset, data , SizePerRW);
000088  464b              MOV      r3,r9
                  |L2.138|
00008a  4a55              LDR      r2,|L2.480|
00008c  4669              MOV      r1,sp
00008e  2003              MOVS     r0,#3
000090  f7fffffe          BL       MicoFlashRead
000094  0004              MOVS     r4,r0
000096  d10a              BNE      |L2.174|
000098  4951              LDR      r1,|L2.480|
00009a  464a              MOV      r2,r9                 ;154
                  |L2.156|
;;;174            require_noerr(err, exit);
;;;175          }
;;;176          
;;;177          for(j=0; j<SizePerRW; j++){
;;;178            if(data[j] != 0xFF){
00009c  5c0b              LDRB     r3,[r1,r0]
00009e  2bff              CMP      r3,#0xff
0000a0  d17e              BNE      |L2.416|
0000a2  1c40              ADDS     r0,r0,#1
0000a4  4290              CMP      r0,r2                 ;177
0000a6  d3f9              BCC      |L2.156|
0000a8  1c76              ADDS     r6,r6,#1              ;177
                  |L2.170|
0000aa  42be              CMP      r6,r7                 ;167
0000ac  d9e7              BLS      |L2.126|
                  |L2.174|
0000ae  e090              B        |L2.466|
                  |L2.176|
;;;179              update_log("Update data need to be erased");
;;;180              err = MicoFlashDisableSecurity( MICO_PARTITION_OTA_TEMP, 0x0, ota_partition_info->partition_length );
;;;181              require_noerr(err, exit);
;;;182              err = MicoFlashErase( MICO_PARTITION_OTA_TEMP, 0x0, ota_partition_info->partition_length );
;;;183              require_noerr(err, exit);
;;;184              goto exit;
;;;185            }
;;;186          }
;;;187        }
;;;188        goto exit;
;;;189      }
;;;190    
;;;191      dest_partition_info = MicoFlashGetInfo( dest_partition );
0000b0  f99d0028          LDRSB    r0,[sp,#0x28]
0000b4  f7fffffe          BL       MicoFlashGetInfo
0000b8  4607              MOV      r7,r0
;;;192      require_action( dest_partition_info->partition_owner != MICO_FLASH_NONE, exit, err = kUnsupportedErr );
0000ba  7800              LDRB     r0,[r0,#0]
0000bc  2803              CMP      r0,#3
0000be  d00c              BEQ      |L2.218|
;;;193      
;;;194      update_log("Write OTA data to partition: %s, length %d", 
;;;195        dest_partition_info->partition_description, updateLog.length);
;;;196      
;;;197      dest_offset = 0x0;
;;;198      update_data_offset = 0x0;
;;;199      
;;;200      err = MicoFlashDisableSecurity( dest_partition, 0x0, dest_partition_info->partition_length );
0000c0  f8cdb000          STR      r11,[sp,#0]
0000c4  f8cdb00c          STR      r11,[sp,#0xc]         ;198
0000c8  2100              MOVS     r1,#0
0000ca  f99d0028          LDRSB    r0,[sp,#0x28]
0000ce  68fa              LDR      r2,[r7,#0xc]
0000d0  f7fffffe          BL       MicoFlashDisableSecurity
0000d4  0004              MOVS     r4,r0
;;;201      require_noerr(err, exit);
0000d6  d17c              BNE      |L2.466|
0000d8  e001              B        |L2.222|
                  |L2.218|
0000da  4644              MOV      r4,r8                 ;192
0000dc  e079              B        |L2.466|
                  |L2.222|
;;;202      err = MicoFlashErase( dest_partition, 0x0, dest_partition_info->partition_length );
0000de  2100              MOVS     r1,#0
0000e0  f99d0028          LDRSB    r0,[sp,#0x28]
0000e4  68fa              LDR      r2,[r7,#0xc]
0000e6  f7fffffe          BL       MicoFlashErase
0000ea  0004              MOVS     r4,r0
;;;203      require_noerr(err, exit);
0000ec  d171              BNE      |L2.466|
;;;204      size = (updateLog.length)/SizePerRW;
0000ee  9805              LDR      r0,[sp,#0x14]
;;;205      
;;;206      for(i = 0; i <= size; i++){
0000f0  2700              MOVS     r7,#0
0000f2  ea4f3a10          LSR      r10,r0,#12            ;204
0000f6  e032              B        |L2.350|
                  |L2.248|
;;;207        if( i == size ){
0000f8  d107              BNE      |L2.266|
;;;208          if( (updateLog.length)%SizePerRW )
0000fa  9805              LDR      r0,[sp,#0x14]
0000fc  0500              LSLS     r0,r0,#20
0000fe  d030              BEQ      |L2.354|
;;;209            copyLength = (updateLog.length)%SizePerRW;
000100  9805              LDR      r0,[sp,#0x14]
000102  f3c0000b          UBFX     r0,r0,#0,#12
000106  4680              MOV      r8,r0
000108  e001              B        |L2.270|
                  |L2.266|
;;;210          else
;;;211            break;
;;;212        }else{
;;;213          copyLength = SizePerRW;
00010a  4648              MOV      r0,r9
00010c  46c8              MOV      r8,r9
                  |L2.270|
;;;214        }
;;;215        err = MicoFlashRead( MICO_PARTITION_OTA_TEMP, &update_data_offset, data , copyLength);
00010e  4603              MOV      r3,r0
000110  4a33              LDR      r2,|L2.480|
000112  4669              MOV      r1,sp
000114  2003              MOVS     r0,#3
000116  f7fffffe          BL       MicoFlashRead
00011a  0004              MOVS     r4,r0
;;;216        require_noerr(err, exit);
00011c  d159              BNE      |L2.466|
;;;217        err = MicoFlashWrite( dest_partition, &dest_offset, data, copyLength);
00011e  4643              MOV      r3,r8
000120  4a2f              LDR      r2,|L2.480|
000122  a903              ADD      r1,sp,#0xc
000124  f99d0028          LDRSB    r0,[sp,#0x28]
000128  f7fffffe          BL       MicoFlashWrite
00012c  0004              MOVS     r4,r0
;;;218        require_noerr(err, exit);
00012e  d150              BNE      |L2.466|
;;;219        dest_offset -= copyLength;
000130  9903              LDR      r1,[sp,#0xc]
;;;220        err = MicoFlashRead( dest_partition, &dest_offset, newData , copyLength);
000132  4643              MOV      r3,r8
000134  eba10008          SUB      r0,r1,r8              ;219
000138  9003              STR      r0,[sp,#0xc]
00013a  4a2a              LDR      r2,|L2.484|
00013c  a903              ADD      r1,sp,#0xc
00013e  f99d0028          LDRSB    r0,[sp,#0x28]
000142  f7fffffe          BL       MicoFlashRead
000146  0004              MOVS     r4,r0
;;;221        require_noerr(err, exit);
000148  d143              BNE      |L2.466|
;;;222        err = memcmp(data, newData, copyLength);
00014a  4642              MOV      r2,r8
00014c  4925              LDR      r1,|L2.484|
00014e  4824              LDR      r0,|L2.480|
000150  f7fffffe          BL       memcmp
;;;223        require_noerr_action(err, exit, err = kWriteErr); 
000154  b110              CBZ      r0,|L2.348|
000156  4c21              LDR      r4,|L2.476|
000158  3c0c              SUBS     r4,r4,#0xc
00015a  e03a              B        |L2.466|
                  |L2.348|
00015c  1c7f              ADDS     r7,r7,#1
                  |L2.350|
00015e  4557              CMP      r7,r10                ;206
000160  d9ca              BLS      |L2.248|
                  |L2.354|
;;;224     }
;;;225    
;;;226      update_log("Update start to clear data...");
;;;227        
;;;228      para_offset = 0x0;
;;;229      err = MicoFlashDisableSecurity( MICO_PARTITION_PARAMETER_1, 0x0, para_partition_info->partition_length );
000162  f8cdb008          STR      r11,[sp,#8]
000166  465f              MOV      r7,r11                ;228
000168  f04f0100          MOV      r1,#0
00016c  f04f0005          MOV      r0,#5
000170  68f2              LDR      r2,[r6,#0xc]
000172  f7fffffe          BL       MicoFlashDisableSecurity
000176  0004              MOVS     r4,r0
;;;230      require_noerr(err, exit);
000178  d12b              BNE      |L2.466|
;;;231      err = MicoFlashRead( MICO_PARTITION_PARAMETER_1, &para_offset, paraSaveInRam, para_partition_info->partition_length );
00017a  4a1b              LDR      r2,|L2.488|
00017c  a902              ADD      r1,sp,#8
00017e  2005              MOVS     r0,#5
000180  68f3              LDR      r3,[r6,#0xc]
000182  f7fffffe          BL       MicoFlashRead
000186  0004              MOVS     r4,r0
;;;232      require_noerr(err, exit);
000188  d123              BNE      |L2.466|
;;;233      memset(paraSaveInRam, 0xff, sizeof(boot_table_t));
00018a  22ff              MOVS     r2,#0xff
00018c  2118              MOVS     r1,#0x18
00018e  4816              LDR      r0,|L2.488|
000190  f7fffffe          BL       __aeabi_memset
;;;234      err = MicoFlashErase( MICO_PARTITION_PARAMETER_1, 0x0, para_partition_info->partition_length );
000194  2100              MOVS     r1,#0
000196  2005              MOVS     r0,#5
000198  68f2              LDR      r2,[r6,#0xc]
00019a  f7fffffe          BL       MicoFlashErase
00019e  e000              B        |L2.418|
                  |L2.416|
0001a0  e00a              B        |L2.440|
                  |L2.418|
0001a2  0004              MOVS     r4,r0
;;;235      require_noerr(err, exit);
0001a4  d115              BNE      |L2.466|
;;;236      para_offset = 0x0;
;;;237      err = MicoFlashWrite( MICO_PARTITION_PARAMETER_1, &para_offset, paraSaveInRam, para_partition_info->partition_length );
0001a6  9702              STR      r7,[sp,#8]
0001a8  4a0f              LDR      r2,|L2.488|
0001aa  a902              ADD      r1,sp,#8
0001ac  2005              MOVS     r0,#5
0001ae  68f3              LDR      r3,[r6,#0xc]
0001b0  f7fffffe          BL       MicoFlashWrite
0001b4  0004              MOVS     r4,r0
;;;238      require_noerr(err, exit);
0001b6  d10c              BNE      |L2.466|
                  |L2.440|
;;;239      
;;;240    
;;;241      err = MicoFlashDisableSecurity( MICO_PARTITION_OTA_TEMP, 0x0, ota_partition_info->partition_length );
0001b8  2100              MOVS     r1,#0
0001ba  2003              MOVS     r0,#3
0001bc  68ea              LDR      r2,[r5,#0xc]
0001be  f7fffffe          BL       MicoFlashDisableSecurity
0001c2  0004              MOVS     r4,r0
;;;242      require_noerr(err, exit);  
0001c4  d105              BNE      |L2.466|
;;;243      err = MicoFlashErase( MICO_PARTITION_OTA_TEMP, 0x0, ota_partition_info->partition_length );
0001c6  2100              MOVS     r1,#0
0001c8  2003              MOVS     r0,#3
0001ca  68ea              LDR      r2,[r5,#0xc]
0001cc  f7fffffe          BL       MicoFlashErase
0001d0  4604              MOV      r4,r0
                  |L2.466|
;;;244      require_noerr(err, exit);
;;;245      update_log("Update success");
;;;246      
;;;247    exit:
;;;248      if(err != kNoErr) update_log("Update exit with err = %d", err);
;;;249      return err;
;;;250    }
0001d2  b00b              ADD      sp,sp,#0x2c
0001d4  4620              MOV      r0,r4                 ;249
0001d6  e8bd8ff0          POP      {r4-r11,pc}
;;;251    
                          ENDP

0001da  0000              DCW      0x0000
                  |L2.476|
                          DCD      0xffffe5b1
                  |L2.480|
                          DCD      ||.bss||
                  |L2.484|
                          DCD      ||.bss||+0x1000
                  |L2.488|
                          DCD      ||.bss||+0x2000

                          AREA ||i.updateLogCheck||, CODE, READONLY, ALIGN=1

                  updateLogCheck PROC
;;;97     
;;;98     Log_Status updateLogCheck(boot_table_t *updateLog, mico_partition_t *dest_partition_type)
000000  b570              PUSH     {r4-r6,lr}
;;;99     {
000002  460d              MOV      r5,r1
000004  4604              MOV      r4,r0
;;;100      uint32_t i;
;;;101      
;;;102      for(i=0; i<sizeof(boot_table_t); i++){
000006  2200              MOVS     r2,#0
                  |L3.8|
;;;103        if(*((uint8_t *)updateLog + i) != 0xff)
000008  5ca0              LDRB     r0,[r4,r2]
00000a  28ff              CMP      r0,#0xff
00000c  d102              BNE      |L3.20|
00000e  1c52              ADDS     r2,r2,#1
000010  2a18              CMP      r2,#0x18              ;102
000012  d3f9              BCC      |L3.8|
                  |L3.20|
;;;104          break;
;;;105      }
;;;106      if(i == sizeof(boot_table_t))
000014  2a18              CMP      r2,#0x18
000016  d00c              BEQ      |L3.50|
;;;107        return Log_NotExist;
;;;108    
;;;109      if(updateLog->upgrade_type != 'U')
000018  7c60              LDRB     r0,[r4,#0x11]
00001a  2855              CMP      r0,#0x55
;;;110        return Log_UpdateTagNotExist;
;;;111      
;;;112      if(updateLog->start_address != MicoFlashGetInfo(MICO_PARTITION_OTA_TEMP)->partition_start_addr)
00001c  f04f0003          MOV      r0,#3
000020  d106              BNE      |L3.48|
000022  f7fffffe          BL       MicoFlashGetInfo
000026  6880              LDR      r0,[r0,#8]
000028  6821              LDR      r1,[r4,#0]
00002a  4288              CMP      r0,r1
00002c  d003              BEQ      |L3.54|
;;;113        return Log_StartAddressERROR;
00002e  2006              MOVS     r0,#6
                  |L3.48|
;;;114    
;;;115      if(updateLog->type == 'B')
;;;116        *dest_partition_type = MICO_PARTITION_BOOTLOADER;
;;;117      else if(updateLog->type == 'A')
;;;118        *dest_partition_type = MICO_PARTITION_APPLICATION;
;;;119      else if(updateLog->type == 'D')
;;;120        *dest_partition_type = MICO_PARTITION_RF_FIRMWARE;
;;;121      else 
;;;122        return Log_contentTypeNotExist;
;;;123    
;;;124      if( updateLog->length > MicoFlashGetInfo(*dest_partition_type)->partition_length )
;;;125        return Log_dataLengthOverFlow;
;;;126    
;;;127      if (checkcrc(updateLog->crc, *dest_partition_type, updateLog->length) != kNoErr)
;;;128        return Log_CRCERROR;
;;;129      
;;;130      return Log_NeedUpdate;
;;;131    }
000030  bd70              POP      {r4-r6,pc}
                  |L3.50|
000032  2001              MOVS     r0,#1                 ;107
                  |L3.52|
000034  bd70              POP      {r4-r6,pc}
                  |L3.54|
000036  7c20              LDRB     r0,[r4,#0x10]         ;115
000038  2842              CMP      r0,#0x42              ;115
00003a  d00f              BEQ      |L3.92|
00003c  2841              CMP      r0,#0x41              ;117
00003e  d00f              BEQ      |L3.96|
000040  2844              CMP      r0,#0x44              ;119
000042  f04f0004          MOV      r0,#4                 ;122
000046  d1f5              BNE      |L3.52|
                  |L3.72|
000048  7028              STRB     r0,[r5,#0]            ;120
00004a  b240              SXTB     r0,r0                 ;124
00004c  f7fffffe          BL       MicoFlashGetInfo
000050  68c0              LDR      r0,[r0,#0xc]          ;124
000052  6862              LDR      r2,[r4,#4]            ;124
000054  4290              CMP      r0,r2                 ;124
000056  d205              BCS      |L3.100|
000058  2005              MOVS     r0,#5                 ;125
00005a  bd70              POP      {r4-r6,pc}
                  |L3.92|
00005c  2000              MOVS     r0,#0                 ;116
00005e  e7f3              B        |L3.72|
                  |L3.96|
000060  2001              MOVS     r0,#1                 ;118
000062  e7f1              B        |L3.72|
                  |L3.100|
000064  f9951000          LDRSB    r1,[r5,#0]            ;127
000068  8a60              LDRH     r0,[r4,#0x12]         ;127
00006a  f7fffffe          BL       checkcrc
00006e  b108              CBZ      r0,|L3.116|
000070  2008              MOVS     r0,#8                 ;128
000072  bd70              POP      {r4-r6,pc}
                  |L3.116|
000074  2002              MOVS     r0,#2                 ;130
000076  bd70              POP      {r4-r6,pc}
;;;132    
                          ENDP


                          AREA ||.bss||, DATA, NOINIT, ALIGN=0

                  data
                          %        4096
                  newData
                          %        4096
                  paraSaveInRam
                          %        16384

;*** Start embedded assembler ***

#line 1 "..\\..\\..\\..\\Bootloader\\Update_for_OTA.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___16_Update_for_OTA_c_7b8b87ab____REV16|
#line 114 "..\\..\\..\\..\\Platform\\Cortex-M4\\CMSIS\\core_cmInstr.h"
|__asm___16_Update_for_OTA_c_7b8b87ab____REV16| PROC
#line 115

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___16_Update_for_OTA_c_7b8b87ab____REVSH|
#line 128
|__asm___16_Update_for_OTA_c_7b8b87ab____REVSH| PROC
#line 129

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
