-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathboot_disassembly.txt
6358 lines (6244 loc) · 226 KB
/
boot_disassembly.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
This is partially commented/analysed objdump of lpc1313
NOTES
- LR when entering reset handler is 0x1fff12c7 on lpc1343 (that fits with this lpc1313 dump, so I'm suspecting it's the same boot binary).
- This dump contains USB code. More evidence to support same-bootloader-for-lpc13xx-chips hypothesis.
CRP modes:
- NO_ISP 0x4e697370 no isp, swd enabled
- CRP1 0x12345678 no swd, isp: no read, no write flashsec0, no write
ram<0x10000300
- CRP2 0x87654321 no swd, isp: no read, no write, no go; only erase all
- CRP3 0x43218765 no swd, no isp via PIO0_1
Memory map:
- 0x00000000 flash
- 0x10000000 ram
- 0x1fff0000 boot rom 16kB
- 0x40000000 APB peripherals
- 0x50000000 AHB peripherals
- 0xe0000000 private peripheral bus
bootloader_dump.elf: file format elf32-littlearm
bootloader_dump.elf
architecture: arm, flags 0x00000010:
HAS_SYMS
start address 0x00000000
private flags = 0: [APCS-32] [FPA float format]
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00004000 1fff0000 1fff0000 00000034 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
SYMBOL TABLE:
1fff0000 l d .text 00000000 .text
1fff0000 g .text 00000000 _binary_bootloader_dump_bin_start
1fff4000 g .text 00000000 _binary_bootloader_dump_bin_end
00004000 g *ABS* 00000000 _binary_bootloader_dump_bin_size
Disassembly of section .text:
1fff0000:
1fff0000: 10000ffc # stack
1fff0004: 1fff0105 # reset
1fff0008: 1fff0fa5 # nmi return;
1fff000c: 1fff0fa7 # hardfault while (1) ;
1fff0010: 1fff0fa9 # memmanage while (1) ;
1fff0014: 1fff0fab # busfault while (1) ;
1fff0018: 1fff0fad # usagefault while (1) ;
1fff001c: 00000000
1fff0020: 00000000
1fff0024: 00000000
1fff0028: 00000000
1fff002c: 1fff0faf # svc return;
1fff0030: 1fff0fb1 # debugmon return;
1fff0034: 00000000
1fff0038: 1fff0fb3 # pendsv return;
1fff003c: 1fff0fb5 # systick return;
1fff0040: 00000000 # P0_0 wakeup
1fff0044: 00000000
1fff0048: 00000000
1fff004c: 00000000
1fff0050: 00000000
1fff0054: 00000000
1fff0058: 00000000
1fff005c: 00000000
1fff0060: 00000000
1fff0064: 00000000
1fff0068: 00000000
1fff006c: 00000000
1fff0070: 00000000 # P1_0 wakeup
1fff0074: 00000000
1fff0078: 00000000
1fff007c: 00000000
1fff0080: 00000000
1fff0084: 00000000
1fff0088: 00000000
1fff008c: 00000000
1fff0090: 00000000
1fff0094: 00000000
1fff0098: 1fff2aed # P1_10
1fff009c: 1fff2aed # P1_11
1fff00a0: 00000000 # P2_0 wakeup
1fff00a4: 00000000
1fff00a8: 00000000
1fff00ac: 00000000
1fff00b0: 00000000
1fff00b4: 00000000
1fff00b8: 00000000
1fff00bc: 00000000
1fff00c0: 00000000
1fff00c4: 00000000
1fff00c8: 00000000
1fff00cc: 00000000
1fff00d0: 00000000 # P3_0 wakeup
1fff00d4: 00000000
1fff00d8: 00000000
1fff00dc: 00000000
1fff00e0: 00000000
1fff00e4: 00000000
1fff00e8: 00000000
1fff00ec: 00000000
1fff00f0: 00000000
1fff00f4: 00000000
1fff00f8: 00000000
1fff00fc: 1fff2aed # usb irqhandler
1fff0100: 1fff2aed # usb fiqhandler
1fff0105: <reset_handler>
1fff0104: 4a00 ldr r2, [pc, #0] ; (1fff0108)
1fff0106: 4710 bx r2
1fff0108: 1fff010d
1fff010c: 4a1a ldr r2, [pc, #104] ; (1fff0178) # r2 = 400483f0
1fff010e: 4b1b ldr r3, [pc, #108] ; (1fff017c)
1fff0110: 681b ldr r3, [r3, #0] r3 = CRPaddr
1fff0112: 4d1c ldr r5, [pc, #112] ; (1fff0184)
1fff0114: 682d ldr r5, [r5, #0] r5 = CRP3
1fff0116: 4e1c ldr r6, [pc, #112] ; (1fff0188)
1fff0118: 6836 ldr r6, [r6, #0] r6 = CRP1
1fff011a: 681c ldr r4, [r3, #0] r4 = [CRPaddr]
1fff011c: 42ac cmp r4, r5
1fff011e: d001 beq.n 1fff0124
1fff0120: 42b4 cmp r4, r6
1fff0122: d101 bne.n 1fff0128
# CRP3 handler
1fff0124: 4c16 ldr r4, [pc, #88] ; (1fff0180)
1fff0126: 6824 ldr r4, [r4, #0] # r4 = CRP2
# !CRP3 && !CRP1 handler
1fff0128: 6014 str r4, [r2, #0] [400483f0] = [2fc] (unless CRP1/3, then = CRP2)
1fff012a: 4a0d ldr r2, [pc, #52] ; (1fff0160) # r2 = 4003c000 # flash
# some flash configuration
^[4003c000] |= 0x40
1fff012c: 6813 ldr r3, [r2, #0]
1fff012e: 2440 movs r4, #64 ; 0x40
1fff0130: 4323 orrs r3, r4
1fff0132: 6013 str r3, [r2, #0]
# some weird sp setup
# if ([000005d0] == 3456abcd) sp = [0000043c]-31
1fff0134: 4b0b ldr r3, [pc, #44] ; (1fff0164)
1fff0136: 681a ldr r2, [r3, #0] # r2 = [0000043c]
1fff0138: 4c0b ldr r4, [pc, #44] ; (1fff0168)
1fff013a: 6824 ldr r4, [r4, #0] # r4 = [000005d0]
1fff013c: 4d0b ldr r5, [pc, #44] ; (1fff016c)
1fff013e: 682d ldr r5, [r5, #0] # r5 = [1fff01a0] = 3456abcd
1fff0140: 42ac cmp r4, r5
1fff0142: d001 beq.n 1fff0148
1fff0144: 4a0a ldr r2, [pc, #40] ; (1fff0170)
1fff0146: 6812 ldr r2, [r2, #0] # r2 = 10000fff
1fff0148: 3a1f subs r2, #31
1fff014a: 4695 mov sp, r2 # sp = 10000fe0
1fff014c: 4a09 ldr r2, [pc, #36] ; (1fff0174)
1fff014e: 4710 bx r2 # jump to 1fff12db reset_handler_2
# start_user_code(vect_ptr)
1fff0150: 6801 ldr r1, [r0, #0]
1fff0152: 468d mov sp, r1
1fff0154: 6841 ldr r1, [r0, #4]
1fff0156: 4708 bx r1
1fff0158: 6801 ldr r1, [r0, #0]
1fff015a: 468d mov sp, r1
1fff015c: 6841 ldr r1, [r0, #4]
1fff015e: 4708 bx r1
1fff0160: 4003c000 # flash
1fff0164: 0000043c
1fff0168: 000005d0
1fff016c: 1fff01a0
1fff0170: 1fff019c
1fff0174: 1fff12db
1fff0178: 400483f0 # SYSCONFx, +4 = device_id
1fff017c: 1fff018c # CRP ptr
1fff0180: 1fff0190 # CRP2 ptr
1fff0184: 1fff0194 # CRP3 ptr
1fff0188: 1fff0198 # CRP1 ptr
1fff018c 000002fc # CRP addr
1fff0190 87654321 # CRP2
1fff0194: 43218765 # CRP3
1fff0198: 12345678 # CRP1
1fff019c: 10000fff
1fff01a0: 3456abcd
<cmd_57_reinvoke_isp>
1fff01a4: b510 push {r4, lr}
1fff01a6: 4925 ldr r1, [pc, #148] ; (1fff023c)
1fff01a8: 2000 movs r0, #0
1fff01aa: 6008 str r0, [r1, #0]
1fff01ac: f001 f84f bl 1fff124e <boot_enter_isp>
1fff01b0: bd10 pop {r4, pc}
<cmd_56_compare>
1fff01b2: b5f8 push {r3, r4, r5, r6, r7, lr}
1fff01b4: 460d mov r5, r1
1fff01b6: 4601 mov r1, r0
1fff01b8: 4604 mov r4, r0
1fff01ba: 2000 movs r0, #0
1fff01bc: 2264 movs r2, #100 ; 0x64
1fff01be: 310c adds r1, #12
1fff01c0: 4603 mov r3, r0
1fff01c2: f001 fc42 bl 1fff1a4a
1fff01c6: 6028 str r0, [r5, #0]
1fff01c8: 2800 cmp r0, #0
1fff01ca: d12d bne.n 1fff0228
1fff01cc: 2266 movs r2, #102 ; 0x66
1fff01ce: 1d21 adds r1, r4, #4
1fff01d0: 68e3 ldr r3, [r4, #12]
1fff01d2: f001 fc3a bl 1fff1a4a
1fff01d6: 6028 str r0, [r5, #0]
1fff01d8: 2800 cmp r0, #0
1fff01da: d125 bne.n 1fff0228
1fff01dc: 4621 mov r1, r4
1fff01de: 2266 movs r2, #102 ; 0x66
1fff01e0: 3108 adds r1, #8
1fff01e2: 68e3 ldr r3, [r4, #12]
1fff01e4: f001 fc31 bl 1fff1a4a
1fff01e8: 6028 str r0, [r5, #0]
1fff01ea: 2800 cmp r0, #0
1fff01ec: d11c bne.n 1fff0228
1fff01ee: 2201 movs r2, #1
1fff01f0: 03d2 lsls r2, r2, #15
1fff01f2: 6860 ldr r0, [r4, #4]
1fff01f4: 0093 lsls r3, r2, #2
1fff01f6: 4290 cmp r0, r2
1fff01f8: d200 bcs.n 1fff01fc
1fff01fa: 18c0 adds r0, r0, r3
1fff01fc: 2201 movs r2, #1
1fff01fe: 68a1 ldr r1, [r4, #8]
1fff0200: 03d2 lsls r2, r2, #15
1fff0202: 4291 cmp r1, r2
1fff0204: d200 bcs.n 1fff0208
1fff0206: 18c9 adds r1, r1, r3
1fff0208: 68e2 ldr r2, [r4, #12]
1fff020a: e011 b.n 1fff0230
1fff020c: 680e ldr r6, [r1, #0]
1fff020e: 6807 ldr r7, [r0, #0]
1fff0210: 42be cmp r6, r7
1fff0212: d00a beq.n 1fff022a
1fff0214: 210a movs r1, #10
1fff0216: 6029 str r1, [r5, #0]
1fff0218: 2201 movs r2, #1
1fff021a: 6861 ldr r1, [r4, #4]
1fff021c: 03d2 lsls r2, r2, #15
1fff021e: 4291 cmp r1, r2
1fff0220: d200 bcs.n 1fff0224
1fff0222: 1ac0 subs r0, r0, r3
1fff0224: 1a40 subs r0, r0, r1
1fff0226: 6068 str r0, [r5, #4]
1fff0228: bdf8 pop {r3, r4, r5, r6, r7, pc}
1fff022a: 1d09 adds r1, r1, #4
1fff022c: 1d00 adds r0, r0, #4
1fff022e: 1f12 subs r2, r2, #4
1fff0230: 2a00 cmp r2, #0
1fff0232: d1eb bne.n 1fff020c
1fff0234: 2000 movs r0, #0
1fff0236: 6028 str r0, [r5, #0]
1fff0238: bdf8 pop {r3, r4, r5, r6, r7, pc}
1fff023a: 0000 movs r0, r0
1fff023c: 40048000
^
^# iap2(command[], result[])
^1fff0240: b570 push {r4, r5, r6, lr}
^1fff0242: 6803 ldr r3, [r0, #0] # r3 = iap command
^1fff0244: 2500 movs r5, #0
^1fff0246: 3b32 subs r3, #50 ; 0x32 # remove the offset of
^50 from command
^1fff0248: 4a21 ldr r2, [pc, #132] ; (1fff02d0) # that
^special flash reg, 4003c000/FMC
^1fff024a: 2440 movs r4, #64 ; 0x40
^1fff024c: f002 fd5e bl 1fff2d0c # cmd_jmp_table()
^1fff0250: 09 # num cmds
^1fff0251: 06 # cmd_50_prepare_sector_for_write
^1fff0252: 09 # cmd_51_copy_ram_to_flash
^1fff0253: 0c # cmd_52_erase_sectors
^1fff0254: 0f # cmd_53_blank_check_sectors
^1fff0255: 15 # cmd_54_read_part_id
^1fff0256: 2b # cmd_55_read_boot_code_version
^1fff0257: 12 # cmd_56_compare
^1fff0258: 39 # cmd_57_reinvoke_isp
^1fff0259: 19 # cmd_58_read_uid
^1fff025a: 3c # cmd_invalid
^1fff025b: 00
^
^1fff025c: f000 fa17 bl 1fff068e # cmd_50_prepare_sector_for_write
^1fff0260: bd70 pop {r4, r5, r6, pc}
^1fff0262: f000 f975 bl 1fff0550 # cmd_51_copy_ram_to_flash
^1fff0266: bd70 pop {r4, r5, r6, pc}
^1fff0268: f000 f8ee bl 1fff0448 # cmd_52_erase_sectors
^1fff026c: bd70 pop {r4, r5, r6, pc}
^1fff026e: f000 f853 bl 1fff0318 # cmd_53_blank_check_sectors
^1fff0272: bd70 pop {r4, r5, r6, pc}
^1fff0274: f7ff ff9d bl 1fff01b2 # cmd_56_compare
^1fff0278: bd70 pop {r4, r5, r6, pc}
^
^1fff027a: 4816 ldr r0, [pc, #88] ; (1fff02d4) # cmd_54_read_part_id
^1fff027c: 6b40 ldr r0, [r0, #52] ; 0x34 #
^r0=[400483f4/DEVICE_ID]
^1fff027e: 6048 str r0, [r1, #4]
^1fff0280: bd70 pop {r4, r5, r6, pc}
^
^1fff0282: 600d str r5, [r1, #0] # cmd_58_read_uid
^^[4003c000] |= 0x40
^1fff0284: 6810 ldr r0, [r2, #0]
^1fff0286: 4320 orrs r0, r4
^1fff0288: 6010 str r0, [r2, #0]
^
^1fff028a: 4813 ldr r0, [pc, #76] ; (1fff02d8) # r0 =
^5dc
^1fff028c: 6803 ldr r3, [r0, #0] # r3 = [5dc] = 200
^1fff02d8: 000005dc
^# a bit puzzled since this flash contains - confirm it's really uuid:
^5dc: 00000200
^200: 07070117
^204: 535306e3
^208: 4d114f5c
^20c: f5000006
^
^1fff028e: 681b ldr r3, [r3, #0] # r3 = [200]
^1fff0290: 604b str r3, [r1, #4]
^1fff0292: 6803 ldr r3, [r0, #0]
^1fff0294: 685b ldr r3, [r3, #4]
^1fff0296: 608b str r3, [r1, #8]
^1fff0298: 6803 ldr r3, [r0, #0]
^1fff029a: 689b ldr r3, [r3, #8]
^1fff029c: 60cb str r3, [r1, #12]
^1fff029e: 6800 ldr r0, [r0, #0]
^1fff02a0: 68c0 ldr r0, [r0, #12]
^1fff02a2: 6108 str r0, [r1, #16]
^1fff02a4: e006 b.n 1fff02b4
^
^1fff02a6: 600d str r5, [r1, #0] # cmd_55_read_boot_code_version
^^[4003c000] |= 0x40
^1fff02a8: 6810 ldr r0, [r2, #0]
^1fff02aa: 4320 orrs r0, r4
^1fff02ac: 6010 str r0, [r2, #0]
^
^1fff02ae: 480b ldr r0, [pc, #44] ; (1fff02dc)
^1fff02dc: 00000434
^1fff02b0: 6800 ldr r0, [r0, #0] # return [434]
^1fff02b2: 6048 str r0, [r1, #4]
^
^^[4003c000] &= ~0x40
^1fff02b4: 6810 ldr r0, [r2, #0]
^1fff02b6: 43a0 bics r0, r4
^1fff02b8: 6010 str r0, [r2, #0]
^
^^[4003c000] &= ~0x40
^1fff02ba: 6810 ldr r0, [r2, #0]
^1fff02bc: 43a0 bics r0, r4
^1fff02be: 6010 str r0, [r2, #0]
^
^1fff02c0: bd70 pop {r4, r5, r6, pc}
^
^1fff02c2: f7ff ff6f bl 1fff01a4 # cmd_57_reinvoke_isp
^1fff02c6: bd70 pop {r4, r5, r6, pc}
^
^1fff02c8: 2001 movs r0, #1 # cmd_invalid
^1fff02ca: 6008 str r0, [r1, #0] # just return 1
^1fff02cc: bd70 pop {r4, r5, r6, pc}
^
^1fff02ce: 0000
^1fff02d0: 4003c000 # flash
^1fff02d4: 400483c0
^1fff02d8: 000005dc
^1fff02dc: 00000434
^
^<flash_sector_valid>: # r0 < r1 && both are <= flash_sector_last
^1fff02e0: b530 push {r4, r5, lr}
^1fff02e2: 4af9 ldr r2, [pc, #996] ; (1fff06c8)
^1fff06c8: 4003c000 # flash
^
^[4003c000] |= 0x40
^1fff02e4: 6814 ldr r4, [r2, #0]
^1fff02e6: 2340 movs r3, #64 ; 0x40
^1fff02e8: 431c orrs r4, r3
^1fff02ea: 6014 str r4, [r2, #0]
^
^1fff02ec: 4cf7 ldr r4, [pc, #988] ; (1fff06cc)
^1fff06cc: 00000440 # = 7 (last flash sector?)
^1fff02ee: 6825 ldr r5, [r4, #0]
^1fff02f0: 42a8 cmp r0, r5
^1fff02f2: d801 bhi.n 1fff02f8 # invalid sector
^1fff02f4: 42a9 cmp r1, r5
^1fff02f6: d903 bls.n 1fff0300
^
^[4003c000] &= ~0x40
^1fff02f8: 6810 ldr r0, [r2, #0]
^1fff02fa: 4398 bics r0, r3
^1fff02fc: 6010 str r0, [r2, #0]
^1fff02fe: e004 b.n 1fff030a # invalid sector
^
^[4003c000] &= ~0x40
^1fff0300: 6814 ldr r4, [r2, #0]
^1fff0302: 439c bics r4, r3
^1fff0304: 6014 str r4, [r2, #0]
^
^1fff0306: 4288 cmp r0, r1
^1fff0308: d901 bls.n 1fff030e # OK
^1fff030a: 2007 movs r0, #7 # 7=INVALID_SECTOR
^1fff030c: bd30 pop {r4, r5, pc}
^
^[4003c000] &= ~0x40
^1fff030e: 6810 ldr r0, [r2, #0]
^1fff0310: 4398 bics r0, r3
^1fff0312: 6010 str r0, [r2, #0]
^
^1fff0314: 2000 movs r0, #0
^1fff0316: bd30 pop {r4, r5, pc}
<cmd_53_blank_check_sectors>
1fff0318: b570 push {r4, r5, r6, lr}
1fff031a: 460c mov r4, r1
1fff031c: 4605 mov r5, r0
1fff031e: 6881 ldr r1, [r0, #8]
1fff0320: 6840 ldr r0, [r0, #4]
1fff0322: f7ff ffdd bl 1fff02e0 # <flash_sector_valid>
1fff0326: 6020 str r0, [r4, #0]
1fff0328: 2800 cmp r0, #0
1fff032a: d11d bne.n 1fff0368 # err out
1fff032c: 49e6 ldr r1, [pc, #920] ; (1fff06c8)
^1fff06c8: 4003c000 # flash
^[4003c000] |= 0x40
1fff032e: 6808 ldr r0, [r1, #0]
1fff0330: 2640 movs r6, #64 ; 0x40
1fff0332: 4330 orrs r0, r6
1fff0334: 6008 str r0, [r1, #0]
1fff0336: 6868 ldr r0, [r5, #4] # first sector
1fff0338: 68ab ldr r3, [r5, #8] # last sector
1fff033a: 0082 lsls r2, r0, #2
1fff033c: 48e4 ldr r0, [pc, #912] ; (1fff06d0)
1fff06d0: 00000490 # flash sector 0 start
1fff033e: 4de5 ldr r5, [pc, #916] ; (1fff06d4)
1fff06d4: 00000520 # flash sector 0 end
1fff0340: 009b lsls r3, r3, #2
1fff0342: 5880 ldr r0, [r0, r2] # flash sector x start
1fff0344: 58eb ldr r3, [r5, r3] # flash sector x end
^[4003c000] &= ~0x40
1fff0346: 680d ldr r5, [r1, #0]
1fff0348: 4602 mov r2, r0
1fff034a: 43b5 bics r5, r6
1fff034c: 600d str r5, [r1, #0]
1fff034e: 02f1 lsls r1, r6, #11
1fff0350: e00c b.n 1fff036c
1fff0352: 1845 adds r5, r0, r1
1fff0354: 682d ldr r5, [r5, #0]
1fff0356: 1c6d adds r5, r5, #1
1fff0358: d007 beq.n 1fff036a # data is 0xffffffff,
continue
1fff035a: 2308 movs r3, #8
1fff035c: 1a82 subs r2, r0, r2
1fff035e: 6023 str r3, [r4, #0]
1fff0360: 1840 adds r0, r0, r1
1fff0362: 6062 str r2, [r4, #4]
1fff0364: 6800 ldr r0, [r0, #0]
1fff0366: 60a0 str r0, [r4, #8]
1fff0368: bd70 pop {r4, r5, r6, pc}
1fff036a: 1d00 adds r0, r0, #4
1fff036c: 4298 cmp r0, r3
1fff036e: d3f0 bcc.n 1fff0352
1fff0370: 2000 movs r0, #0
1fff0372: 6020 str r0, [r4, #0]
1fff0374: bd70 pop {r4, r5, r6, pc}
1fff0376: b510 push {r4, lr}
1fff0378: 9c02 ldr r4, [sp, #8]
1fff037a: 6001 str r1, [r0, #0]
1fff037c: 2a00 cmp r2, #0
1fff037e: d004 beq.n 1fff038a
1fff0380: 6013 str r3, [r2, #0]
1fff0382: 6810 ldr r0, [r2, #0]
1fff0384: 4218 tst r0, r3
1fff0386: d1fc bne.n 1fff0382
1fff0388: bd10 pop {r4, pc}
1fff038a: 6820 ldr r0, [r4, #0]
1fff038c: 2800 cmp r0, #0
1fff038e: d0fc beq.n 1fff038a
1fff0390: bd10 pop {r4, pc}
1fff0392: b5f8 push {r3, r4, r5, r6, r7, lr}
1fff0394: 468c mov ip, r1
1fff0396: 49cc ldr r1, [pc, #816] ; (1fff06c8)
^1fff06c8: 4003c000 # flash
1fff0398: 4616 mov r6, r2
1fff039a: 684b ldr r3, [r1, #4]
1fff039c: 2500 movs r5, #0
1fff039e: 2205 movs r2, #5
1fff03a0: 439a bics r2, r3
1fff03a2: d132 bne.n 1fff040a
1fff03a4: 4604 mov r4, r0
1fff03a6: 2740 movs r7, #64 ; 0x40
1fff03a8: e017 b.n 1fff03da
1fff03aa: 2001 movs r0, #1
1fff03ac: 40a0 lsls r0, r4
1fff03ae: 4305 orrs r5, r0
1fff03b0: 48c5 ldr r0, [pc, #788] ; (1fff06c8)
^1fff06c8: 4003c000 # flash
1fff03b2: 6801 ldr r1, [r0, #0]
1fff03b4: 4339 orrs r1, r7
1fff03b6: 6001 str r1, [r0, #0]
1fff03b8: 4ac5 ldr r2, [pc, #788] ; (1fff06d0)
1fff06d0: 00000490
1fff03ba: 00a1 lsls r1, r4, #2
1fff03bc: 5851 ldr r1, [r2, r1]
1fff03be: 2201 movs r2, #1
1fff03c0: 0452 lsls r2, r2, #17
1fff03c2: 1889 adds r1, r1, r2
1fff03c4: 6802 ldr r2, [r0, #0]
1fff03c6: 43ba bics r2, r7
1fff03c8: 6002 str r2, [r0, #0]
1fff03ca: 600e str r6, [r1, #0]
1fff03cc: 2200 movs r2, #0
1fff03ce: 49c2 ldr r1, [pc, #776] ; (1fff06d8)
1fff03d0: 4613 mov r3, r2
1fff03d2: 9000 str r0, [sp, #0]
1fff03d4: f7ff ffcf bl 1fff0376
1fff03d8: 1c64 adds r4, r4, #1
1fff03da: 4564 cmp r4, ip
1fff03dc: d9e5 bls.n 1fff03aa
1fff03de: 49ba ldr r1, [pc, #744] ; (1fff06c8)
^1fff06c8: 4003c000 # flash
1fff03e0: 6808 ldr r0, [r1, #0]
1fff03e2: 4338 orrs r0, r7
1fff03e4: 6008 str r0, [r1, #0]
1fff03e6: 48bd ldr r0, [pc, #756] ; (1fff06dc)
1fff03e8: 6800 ldr r0, [r0, #0]
1fff03ea: 383f subs r0, #63 ; 0x3f
1fff03ec: 2e00 cmp r6, #0
1fff03ee: d102 bne.n 1fff03f6
1fff03f0: 6bc2 ldr r2, [r0, #60] ; 0x3c
1fff03f2: 43aa bics r2, r5
1fff03f4: 63c2 str r2, [r0, #60] ; 0x3c
1fff03f6: 1c76 adds r6, r6, #1
1fff03f8: d102 bne.n 1fff0400
1fff03fa: 6bc2 ldr r2, [r0, #60] ; 0x3c
1fff03fc: 432a orrs r2, r5
1fff03fe: 63c2 str r2, [r0, #60] ; 0x3c
1fff0400: 6808 ldr r0, [r1, #0]
1fff0402: 43b8 bics r0, r7
1fff0404: 6008 str r0, [r1, #0]
1fff0406: 2000 movs r0, #0
1fff0408: bdf8 pop {r3, r4, r5, r6, r7, pc}
1fff040a: 200b movs r0, #11
1fff040c: bdf8 pop {r3, r4, r5, r6, r7, pc}
1fff040e: b510 push {r4, lr}
1fff0410: 2200 movs r2, #0
1fff0412: 2401 movs r4, #1
1fff0414: e003 b.n 1fff041e
1fff0416: 4623 mov r3, r4
1fff0418: 4083 lsls r3, r0
1fff041a: 431a orrs r2, r3
1fff041c: 1c40 adds r0, r0, #1
1fff041e: 4288 cmp r0, r1
1fff0420: d9f9 bls.n 1fff0416
1fff0422: 48a9 ldr r0, [pc, #676] ; (1fff06c8)
^1fff06c8: 4003c000 # flash
1fff0424: 6801 ldr r1, [r0, #0]
1fff0426: 2340 movs r3, #64 ; 0x40
1fff0428: 4319 orrs r1, r3
1fff042a: 6001 str r1, [r0, #0]
1fff042c: 49ab ldr r1, [pc, #684] ; (1fff06dc)
1fff042e: 6809 ldr r1, [r1, #0]
1fff0430: 393f subs r1, #63 ; 0x3f
1fff0432: 6bc9 ldr r1, [r1, #60] ; 0x3c
1fff0434: 4011 ands r1, r2
1fff0436: 6802 ldr r2, [r0, #0]
1fff0438: 439a bics r2, r3
1fff043a: 6002 str r2, [r0, #0]
1fff043c: 2900 cmp r1, #0
1fff043e: d101 bne.n 1fff0444
1fff0440: 2000 movs r0, #0
1fff0442: bd10 pop {r4, pc}
1fff0444: 2009 movs r0, #9
1fff0446: bd10 pop {r4, pc}
<cmd_52_erase_sectors>
1fff0448: b5f8 push {r3, r4, r5, r6, r7, lr}
1fff044a: 460e mov r6, r1
1fff044c: 4604 mov r4, r0
1fff044e: 6881 ldr r1, [r0, #8]
1fff0450: 6840 ldr r0, [r0, #4]
1fff0452: f7ff ff45 bl 1fff02e0 # <flash_sector_valid>
1fff0456: 6030 str r0, [r6, #0]
1fff0458: 2800 cmp r0, #0
1fff045a: d15b bne.n 1fff0514
1fff045c: 68a1 ldr r1, [r4, #8]
1fff045e: 6860 ldr r0, [r4, #4]
1fff0460: f7ff ffd5 bl 1fff040e
1fff0464: 6030 str r0, [r6, #0]
1fff0466: 2800 cmp r0, #0
1fff0468: d154 bne.n 1fff0514
1fff046a: 4f97 ldr r7, [pc, #604] ; (1fff06c8)
^1fff06c8: 4003c000 # flash
1fff046c: 6838 ldr r0, [r7, #0]
1fff046e: 2140 movs r1, #64 ; 0x40
1fff0470: 4308 orrs r0, r1
1fff0472: 6038 str r0, [r7, #0]
1fff0474: 499a ldr r1, [pc, #616] ; (1fff06e0)
1fff0476: 68e0 ldr r0, [r4, #12]
1fff0478: 6809 ldr r1, [r1, #0]
1fff047a: f002 fc16 bl 1fff2caa
1fff047e: 61f8 str r0, [r7, #28]
1fff0480: 4998 ldr r1, [pc, #608] ; (1fff06e4)
1fff0482: 68e0 ldr r0, [r4, #12]
1fff0484: 6809 ldr r1, [r1, #0]
1fff0486: 4348 muls r0, r1
1fff0488: 0a40 lsrs r0, r0, #9
1fff048a: 1cc0 adds r0, r0, #3
1fff048c: 2101 movs r1, #1
1fff048e: 03c9 lsls r1, r1, #15
1fff0490: 4308 orrs r0, r1
1fff0492: 60b8 str r0, [r7, #8]
1fff0494: 6865 ldr r5, [r4, #4]
1fff0496: 68a0 ldr r0, [r4, #8]
1fff0498: 4285 cmp r5, r0
1fff049a: d01b beq.n 1fff04d4
1fff049c: e016 b.n 1fff04cc
1fff049e: 6839 ldr r1, [r7, #0]
1fff04a0: 4638 mov r0, r7
1fff04a2: 2340 movs r3, #64 ; 0x40
1fff04a4: 4319 orrs r1, r3
1fff04a6: 6039 str r1, [r7, #0]
1fff04a8: 4a89 ldr r2, [pc, #548] ; (1fff06d0)
1fff06d0: 00000490
1fff04aa: 00a9 lsls r1, r5, #2
1fff04ac: 5851 ldr r1, [r2, r1]
1fff04ae: 02da lsls r2, r3, #11
1fff04b0: 1889 adds r1, r1, r2
1fff04b2: 683a ldr r2, [r7, #0]
1fff04b4: 439a bics r2, r3
1fff04b6: 603a str r2, [r7, #0]
1fff04b8: 2201 movs r2, #1
1fff04ba: 600a str r2, [r1, #0]
1fff04bc: 4986 ldr r1, [pc, #536] ; (1fff06d8)
1fff04be: 2200 movs r2, #0
1fff04c0: 1e89 subs r1, r1, #2
1fff04c2: 4613 mov r3, r2
1fff04c4: 9700 str r7, [sp, #0]
1fff04c6: f7ff ff56 bl 1fff0376
1fff04ca: 1c6d adds r5, r5, #1
1fff04cc: 68a0 ldr r0, [r4, #8]
1fff04ce: 1e40 subs r0, r0, #1
1fff04d0: 42a8 cmp r0, r5
1fff04d2: d2e4 bcs.n 1fff049e
1fff04d4: 6839 ldr r1, [r7, #0]
1fff04d6: 4638 mov r0, r7
1fff04d8: 2340 movs r3, #64 ; 0x40
1fff04da: 4319 orrs r1, r3
1fff04dc: 6039 str r1, [r7, #0]
1fff04de: 68a1 ldr r1, [r4, #8]
1fff04e0: 008a lsls r2, r1, #2
1fff04e2: 497b ldr r1, [pc, #492] ; (1fff06d0)
1fff06d0: 00000490
1fff04e4: 5889 ldr r1, [r1, r2]
1fff04e6: 683a ldr r2, [r7, #0]
1fff04e8: 439a bics r2, r3
1fff04ea: 603a str r2, [r7, #0]
1fff04ec: 2201 movs r2, #1
1fff04ee: 600a str r2, [r1, #0]
1fff04f0: 4a7d ldr r2, [pc, #500] ; (1fff06e8)
1fff04f2: 2107 movs r1, #7
1fff04f4: 6291 str r1, [r2, #40] ; 0x28
1fff04f6: 4a7c ldr r2, [pc, #496] ; (1fff06e8)
1fff04f8: 497c ldr r1, [pc, #496] ; (1fff06ec)
1fff04fa: 3220 adds r2, #32
1fff04fc: 9200 str r2, [sp, #0]
1fff04fe: 2200 movs r2, #0
1fff0500: 4613 mov r3, r2
1fff0502: f7ff ff38 bl 1fff0376
1fff0506: 2200 movs r2, #0
1fff0508: 43d2 mvns r2, r2
1fff050a: 68a1 ldr r1, [r4, #8]
1fff050c: 6860 ldr r0, [r4, #4]
1fff050e: f7ff ff40 bl 1fff0392
1fff0512: 6030 str r0, [r6, #0]
1fff0514: bdf8 pop {r3, r4, r5, r6, r7, pc}
1fff0516: b530 push {r4, r5, lr}
1fff0518: 2501 movs r5, #1
1fff051a: e008 b.n 1fff052e
1fff051c: c910 ldmia r1!, {r4}
1fff051e: c010 stmia r0!, {r4}
1fff0520: 07ac lsls r4, r5, #30
1fff0522: d103 bne.n 1fff052c
1fff0524: e000 b.n 1fff0528
1fff0526: 1c64 adds r4, r4, #1
1fff0528: 4294 cmp r4, r2
1fff052a: d3fc bcc.n 1fff0526
1fff052c: 1c6d adds r5, r5, #1
1fff052e: 429d cmp r5, r3
1fff0530: d9f4 bls.n 1fff051c
1fff0532: bd30 pop {r4, r5, pc}
1fff0534: b500 push {lr}
1fff0536: 4a64 ldr r2, [pc, #400] ; (1fff06c8)
^1fff06c8: 4003c000 # flash
1fff0538: 6853 ldr r3, [r2, #4]
1fff053a: 2205 movs r2, #5
1fff053c: 439a bics r2, r3
1fff053e: d001 beq.n 1fff0544
1fff0540: 200b movs r0, #11
1fff0542: bd00 pop {pc}
1fff0544: 2204 movs r2, #4
1fff0546: 2340 movs r3, #64 ; 0x40
1fff0548: f7ff ffe5 bl 1fff0516
1fff054c: 2000 movs r0, #0
1fff054e: bd00 pop {pc}
<cmd_51_copy_ram_to_flash>
1fff0550: b5f0 push {r4, r5, r6, r7, lr}
1fff0552: b085 sub sp, #20
1fff0554: 4605 mov r5, r0
1fff0556: 6840 ldr r0, [r0, #4]
1fff0558: 9001 str r0, [sp, #4]
1fff055a: 68a8 ldr r0, [r5, #8]
1fff055c: 9002 str r0, [sp, #8]
1fff055e: 68e8 ldr r0, [r5, #12]
1fff0560: 9004 str r0, [sp, #16]
1fff0562: 460e mov r6, r1
1fff0564: 2000 movs r0, #0
1fff0566: 2265 movs r2, #101 ; 0x65
1fff0568: a904 add r1, sp, #16
1fff056a: 4603 mov r3, r0
1fff056c: f001 fa6d bl 1fff1a4a
1fff0570: 6030 str r0, [r6, #0]
1fff0572: 2800 cmp r0, #0
1fff0574: d167 bne.n 1fff0646
1fff0576: 2268 movs r2, #104 ; 0x68
1fff0578: a901 add r1, sp, #4
1fff057a: 9b04 ldr r3, [sp, #16]
1fff057c: f001 fa65 bl 1fff1a4a
1fff0580: 6030 str r0, [r6, #0]
1fff0582: 2800 cmp r0, #0
1fff0584: d15f bne.n 1fff0646
1fff0586: 2267 movs r2, #103 ; 0x67
1fff0588: a902 add r1, sp, #8
1fff058a: 9b04 ldr r3, [sp, #16]
1fff058c: f001 fa5d bl 1fff1a4a
1fff0590: 6030 str r0, [r6, #0]
1fff0592: 2800 cmp r0, #0
1fff0594: d157 bne.n 1fff0646
1fff0596: 9003 str r0, [sp, #12]
1fff0598: 2101 movs r1, #1
1fff059a: 9801 ldr r0, [sp, #4]
1fff059c: 0449 lsls r1, r1, #17
1fff059e: 1840 adds r0, r0, r1
1fff05a0: 4f49 ldr r7, [pc, #292] ; (1fff06c8)
^1fff06c8: 4003c000 # flash
1fff05a2: 9001 str r0, [sp, #4]
1fff05a4: 6838 ldr r0, [r7, #0]
1fff05a6: 2140 movs r1, #64 ; 0x40
1fff05a8: 4308 orrs r0, r1
1fff05aa: 6038 str r0, [r7, #0]
1fff05ac: 2400 movs r4, #0
1fff05ae: 4849 ldr r0, [pc, #292] ; (1fff06d4)
1fff06d4: 00000520
1fff05b0: 4946 ldr r1, [pc, #280] ; (1fff06cc)
1fff05b2: e012 b.n 1fff05da
1fff05b4: 00a3 lsls r3, r4, #2
1fff05b6: 58c3 ldr r3, [r0, r3]
1fff05b8: 686a ldr r2, [r5, #4]
1fff05ba: 429a cmp r2, r3
1fff05bc: d20c bcs.n 1fff05d8
1fff05be: 4611 mov r1, r2
1fff05c0: 68ea ldr r2, [r5, #12]
1fff05c2: 1889 adds r1, r1, r2
1fff05c4: 00a2 lsls r2, r4, #2
1fff05c6: 5880 ldr r0, [r0, r2]
1fff05c8: 1c40 adds r0, r0, #1
1fff05ca: 4281 cmp r1, r0
1fff05cc: d801 bhi.n 1fff05d2
1fff05ce: 9403 str r4, [sp, #12]
1fff05d0: e006 b.n 1fff05e0
1fff05d2: 1c60 adds r0, r4, #1
1fff05d4: 9003 str r0, [sp, #12]
1fff05d6: e003 b.n 1fff05e0
1fff05d8: 1c64 adds r4, r4, #1
1fff05da: 680a ldr r2, [r1, #0]
1fff05dc: 4294 cmp r4, r2
1fff05de: d9e9 bls.n 1fff05b4
1fff05e0: 6838 ldr r0, [r7, #0]
1fff05e2: 2140 movs r1, #64 ; 0x40
1fff05e4: 4388 bics r0, r1
1fff05e6: 6038 str r0, [r7, #0]
1fff05e8: 4620 mov r0, r4
1fff05ea: 9903 ldr r1, [sp, #12]
1fff05ec: f7ff ff0f bl 1fff040e
1fff05f0: 6030 str r0, [r6, #0]
1fff05f2: 2800 cmp r0, #0
1fff05f4: d127 bne.n 1fff0646
1fff05f6: 6838 ldr r0, [r7, #0]
1fff05f8: 2140 movs r1, #64 ; 0x40
1fff05fa: 4308 orrs r0, r1
1fff05fc: 6038 str r0, [r7, #0]
1fff05fe: 4938 ldr r1, [pc, #224] ; (1fff06e0)
1fff0600: 6928 ldr r0, [r5, #16]
1fff0602: 6809 ldr r1, [r1, #0]
1fff0604: f002 fb51 bl 1fff2caa
1fff0608: 61f8 str r0, [r7, #28]
1fff060a: 4939 ldr r1, [pc, #228] ; (1fff06f0)
1fff060c: 6928 ldr r0, [r5, #16]
1fff060e: 6809 ldr r1, [r1, #0]
1fff0610: 4348 muls r0, r1
1fff0612: 0a45 lsrs r5, r0, #9
1fff0614: 1ced adds r5, r5, #3
1fff0616: 2001 movs r0, #1
1fff0618: 03c0 lsls r0, r0, #15
1fff061a: 4305 orrs r5, r0
1fff061c: 6838 ldr r0, [r7, #0]
1fff061e: 2140 movs r1, #64 ; 0x40
1fff0620: 4388 bics r0, r1
1fff0622: 6038 str r0, [r7, #0]
1fff0624: 9804 ldr r0, [sp, #16]
1fff0626: e02a b.n 1fff067e
1fff0628: 2200 movs r2, #0
1fff062a: 4638 mov r0, r7
1fff062c: 2107 movs r1, #7
1fff062e: 4613 mov r3, r2
1fff0630: 9700 str r7, [sp, #0]
1fff0632: f7ff fea0 bl 1fff0376
1fff0636: 9902 ldr r1, [sp, #8]
1fff0638: 9801 ldr r0, [sp, #4]
1fff063a: f7ff ff7b bl 1fff0534
1fff063e: 2800 cmp r0, #0
1fff0640: d003 beq.n 1fff064a
1fff0642: 200b movs r0, #11
1fff0644: 6030 str r0, [r6, #0]
1fff0646: b005 add sp, #20
1fff0648: bdf0 pop {r4, r5, r6, r7, pc}
1fff064a: 4927 ldr r1, [pc, #156] ; (1fff06e8)
1fff064c: 2007 movs r0, #7
1fff064e: 6288 str r0, [r1, #40] ; 0x28
1fff0650: 4638 mov r0, r7
1fff0652: 60bd str r5, [r7, #8]
1fff0654: 4a24 ldr r2, [pc, #144] ; (1fff06e8)
1fff0656: 4925 ldr r1, [pc, #148] ; (1fff06ec)
1fff0658: 3220 adds r2, #32
1fff065a: 9200 str r2, [sp, #0]
1fff065c: 2200 movs r2, #0
1fff065e: 1c89 adds r1, r1, #2
1fff0660: 4613 mov r3, r2
1fff0662: f7ff fe88 bl 1fff0376
1fff0666: 9801 ldr r0, [sp, #4]
1fff0668: 30ff adds r0, #255 ; 0xff
1fff066a: 3001 adds r0, #1
1fff066c: 9001 str r0, [sp, #4]
1fff066e: 9802 ldr r0, [sp, #8]
1fff0670: 30ff adds r0, #255 ; 0xff
1fff0672: 3001 adds r0, #1
1fff0674: 9002 str r0, [sp, #8]
1fff0676: 9804 ldr r0, [sp, #16]
1fff0678: 38ff subs r0, #255 ; 0xff
1fff067a: 3801 subs r0, #1
1fff067c: 9004 str r0, [sp, #16]
1fff067e: 2800 cmp r0, #0
1fff0680: d1d2 bne.n 1fff0628
1fff0682: 1e42 subs r2, r0, #1
1fff0684: 4620 mov r0, r4
1fff0686: 9903 ldr r1, [sp, #12]
1fff0688: f7ff fe83 bl 1fff0392
1fff068c: e7db b.n 1fff0646
<cmd_50_prepare_sector_for_write>
1fff068e: b570 push {r4, r5, r6, lr}
1fff0690: 460e mov r6, r1
1fff0692: 4604 mov r4, r0
1fff0694: 6881 ldr r1, [r0, #8]
1fff0696: 6840 ldr r0, [r0, #4]
1fff0698: f7ff fe22 bl 1fff02e0 # <flash_sector_valid>
1fff069c: 6030 str r0, [r6, #0]
1fff069e: 2800 cmp r0, #0
1fff06a0: d110 bne.n 1fff06c4
1fff06a2: 4d09 ldr r5, [pc, #36] ; (1fff06c8)
^1fff06c8: 4003c000 # flash
1fff06a4: 69e8 ldr r0, [r5, #28]
1fff06a6: 2800 cmp r0, #0
1fff06a8: d101 bne.n 1fff06ae
1fff06aa: 2040 movs r0, #64 ; 0x40
1fff06ac: 61e8 str r0, [r5, #28]
1fff06ae: 2200 movs r2, #0
1fff06b0: 68a1 ldr r1, [r4, #8]
1fff06b2: 6860 ldr r0, [r4, #4]
1fff06b4: f7ff fe6d bl 1fff0392
1fff06b8: 6030 str r0, [r6, #0]
1fff06ba: 69e8 ldr r0, [r5, #28]
1fff06bc: 2840 cmp r0, #64 ; 0x40
1fff06be: d101 bne.n 1fff06c4
1fff06c0: 2000 movs r0, #0
1fff06c2: 61e8 str r0, [r5, #28]
1fff06c4: bd70 pop {r4, r5, r6, pc}
1fff06c8: 4003c000 # flash
1fff06cc: 00000440
1fff06d0: 00000490
1fff06d4: 00000520
1fff06d8: 00008087
1fff06dc: 0000043c
1fff06e0: 00000454
1fff06e4: 00000450
1fff06e8: 4003cfc0
1fff06ec: 00001081
1fff06f0: 0000044c
1fff06f4: b510 push {r4, lr}
1fff06f6: 4822 ldr r0, [pc, #136] ; (1fff0780)
1fff06f8: 6800 ldr r0, [r0, #0]
1fff06fa: 6841 ldr r1, [r0, #4]
1fff06fc: 4821 ldr r0, [pc, #132] ; (1fff0784)
1fff06fe: 78c0 ldrb r0, [r0, #3]
1fff0700: 2801 cmp r0, #1
1fff0702: d005 beq.n 1fff0710
1fff0704: 2802 cmp r0, #2
1fff0706: d001 beq.n 1fff070c
1fff0708: 2803 cmp r0, #3
1fff070a: d105 bne.n 1fff0718
1fff070c: 2000 movs r0, #0
1fff070e: bd10 pop {r4, pc}
1fff0710: 690a ldr r2, [r1, #16]
1fff0712: 2140 movs r1, #64 ; 0x40
1fff0714: 481c ldr r0, [pc, #112] ; (1fff0788)
1fff0716: 4790 blx r2
1fff0718: 2001 movs r0, #1
1fff071a: bd10 pop {r4, pc}
1fff071c: b510 push {r4, lr}
1fff071e: 4818 ldr r0, [pc, #96] ; (1fff0780)
1fff0720: 6800 ldr r0, [r0, #0]
1fff0722: 6841 ldr r1, [r0, #4]
1fff0724: 4817 ldr r0, [pc, #92] ; (1fff0784)
1fff0726: 78c0 ldrb r0, [r0, #3]
1fff0728: 2801 cmp r0, #1
1fff072a: d003 beq.n 1fff0734
1fff072c: 2802 cmp r0, #2
1fff072e: d003 beq.n 1fff0738
1fff0730: 2803 cmp r0, #3
1fff0732: d105 bne.n 1fff0740
1fff0734: 2000 movs r0, #0
1fff0736: bd10 pop {r4, pc}
1fff0738: 694a ldr r2, [r1, #20]
1fff073a: 2140 movs r1, #64 ; 0x40
1fff073c: 4812 ldr r0, [pc, #72] ; (1fff0788)
1fff073e: 4790 blx r2
1fff0740: 2001 movs r0, #1
1fff0742: bd10 pop {r4, pc}
1fff0744: 480f ldr r0, [pc, #60] ; (1fff0784)
1fff0746: 4911 ldr r1, [pc, #68] ; (1fff078c)
1fff0748: 7880 ldrb r0, [r0, #2]
1fff074a: 5c08 ldrb r0, [r1, r0]
1fff074c: 490e ldr r1, [pc, #56] ; (1fff0788)
1fff074e: 7008 strb r0, [r1, #0]
1fff0750: 2001 movs r0, #1
1fff0752: 4770 bx lr
1fff0754: 480b ldr r0, [pc, #44] ; (1fff0784)
1fff0756: 4a0d ldr r2, [pc, #52] ; (1fff078c)
1fff0758: 78c1 ldrb r1, [r0, #3]
1fff075a: 7880 ldrb r0, [r0, #2]
1fff075c: 5411 strb r1, [r2, r0]
1fff075e: 2001 movs r0, #1
1fff0760: 4770 bx lr
1fff0762: 480a ldr r0, [pc, #40] ; (1fff078c)
1fff0764: 4908 ldr r1, [pc, #32] ; (1fff0788)
1fff0766: 1e40 subs r0, r0, #1
1fff0768: 7800 ldrb r0, [r0, #0]
1fff076a: 7008 strb r0, [r1, #0]
1fff076c: 2001 movs r0, #1
1fff076e: 4770 bx lr
1fff0770: 4804 ldr r0, [pc, #16] ; (1fff0784)
1fff0772: 4906 ldr r1, [pc, #24] ; (1fff078c)
1fff0774: 7880 ldrb r0, [r0, #2]
1fff0776: 1e49 subs r1, r1, #1
1fff0778: 7008 strb r0, [r1, #0]
1fff077a: 2001 movs r0, #1
1fff077c: 4770 bx lr
1fff077e: 0000
1fff0780: 1000007c
1fff0784: 10000088
1fff0788: 1000013c
1fff078c: 10000051
<isp_cmd_Twhatisthismagic>:
1fff0790: b57f push {r0, r1, r2, r3, r4, r5, r6, lr}
1fff0792: 4dff ldr r5, [pc, #1020] ; (1fff0b90)
1fff0b90: 10000248
1fff0794: 2264 movs r2, #100 ; 0x64
1fff0796: 68a8 ldr r0, [r5, #8] # r0 = [0x10000250]
1fff0798: 4669 mov r1, sp
1fff079a: 9b00 ldr r3, [sp, #0]
1fff079c: f001 f955 bl 1fff1a4a
1fff07a0: 0604 lsls r4, r0, #24
1fff07a2: 0e24 lsrs r4, r4, #24
1fff07a4: d11d bne.n 1fff07e2
1fff07a6: 6868 ldr r0, [r5, #4]
1fff07a8: 2267 movs r2, #103 ; 0x67
1fff07aa: a903 add r1, sp, #12