SD_CARD_SPI.elf: file format elf32-littlearm Sections: Idx Name Size VMA LMA File off Algn 0 .isr_vector 0000013c 08000000 08000000 00010000 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 1 .text 00007914 0800013c 0800013c 0001013c 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .rodata 000005a8 08007a50 08007a50 00017a50 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .ARM.extab 00000000 08007ff8 08007ff8 00020088 2**0 CONTENTS 4 .ARM 00000008 08007ff8 08007ff8 00017ff8 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 5 .preinit_array 00000000 08008000 08008000 00020088 2**0 CONTENTS, ALLOC, LOAD, DATA 6 .init_array 00000004 08008000 08008000 00018000 2**2 CONTENTS, ALLOC, LOAD, DATA 7 .fini_array 00000004 08008004 08008004 00018004 2**2 CONTENTS, ALLOC, LOAD, DATA 8 .data 00000088 20000000 08008008 00020000 2**2 CONTENTS, ALLOC, LOAD, DATA 9 .bss 000044cc 20000088 08008090 00020088 2**2 ALLOC 10 ._user_heap_stack 00000604 20004554 08008090 00024554 2**0 ALLOC 11 .ARM.attributes 00000029 00000000 00000000 00020088 2**0 CONTENTS, READONLY 12 .debug_info 000113b4 00000000 00000000 000200b1 2**0 CONTENTS, READONLY, DEBUGGING 13 .debug_abbrev 00002754 00000000 00000000 00031465 2**0 CONTENTS, READONLY, DEBUGGING 14 .debug_aranges 00000cd8 00000000 00000000 00033bc0 2**3 CONTENTS, READONLY, DEBUGGING 15 .debug_ranges 00000ba0 00000000 00000000 00034898 2**3 CONTENTS, READONLY, DEBUGGING 16 .debug_macro 0001807c 00000000 00000000 00035438 2**0 CONTENTS, READONLY, DEBUGGING 17 .debug_line 0000cbe7 00000000 00000000 0004d4b4 2**0 CONTENTS, READONLY, DEBUGGING 18 .debug_str 0008e5ed 00000000 00000000 0005a09b 2**0 CONTENTS, READONLY, DEBUGGING 19 .comment 0000007b 00000000 00000000 000e8688 2**0 CONTENTS, READONLY 20 .debug_frame 0000375c 00000000 00000000 000e8704 2**2 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: 0800013c <__do_global_dtors_aux>: 800013c: b510 push {r4, lr} 800013e: 4c05 ldr r4, [pc, #20] ; (8000154 <__do_global_dtors_aux+0x18>) 8000140: 7823 ldrb r3, [r4, #0] 8000142: b933 cbnz r3, 8000152 <__do_global_dtors_aux+0x16> 8000144: 4b04 ldr r3, [pc, #16] ; (8000158 <__do_global_dtors_aux+0x1c>) 8000146: b113 cbz r3, 800014e <__do_global_dtors_aux+0x12> 8000148: 4804 ldr r0, [pc, #16] ; (800015c <__do_global_dtors_aux+0x20>) 800014a: f3af 8000 nop.w 800014e: 2301 movs r3, #1 8000150: 7023 strb r3, [r4, #0] 8000152: bd10 pop {r4, pc} 8000154: 20000088 .word 0x20000088 8000158: 00000000 .word 0x00000000 800015c: 08007a38 .word 0x08007a38 08000160 : 8000160: b508 push {r3, lr} 8000162: 4b03 ldr r3, [pc, #12] ; (8000170 ) 8000164: b11b cbz r3, 800016e 8000166: 4903 ldr r1, [pc, #12] ; (8000174 ) 8000168: 4803 ldr r0, [pc, #12] ; (8000178 ) 800016a: f3af 8000 nop.w 800016e: bd08 pop {r3, pc} 8000170: 00000000 .word 0x00000000 8000174: 2000008c .word 0x2000008c 8000178: 08007a38 .word 0x08007a38 0800017c : 800017c: 4603 mov r3, r0 800017e: f813 2b01 ldrb.w r2, [r3], #1 8000182: 2a00 cmp r2, #0 8000184: d1fb bne.n 800017e 8000186: 1a18 subs r0, r3, r0 8000188: 3801 subs r0, #1 800018a: 4770 bx lr 0800018c <__aeabi_uldivmod>: 800018c: b953 cbnz r3, 80001a4 <__aeabi_uldivmod+0x18> 800018e: b94a cbnz r2, 80001a4 <__aeabi_uldivmod+0x18> 8000190: 2900 cmp r1, #0 8000192: bf08 it eq 8000194: 2800 cmpeq r0, #0 8000196: bf1c itt ne 8000198: f04f 31ff movne.w r1, #4294967295 800019c: f04f 30ff movne.w r0, #4294967295 80001a0: f000 b974 b.w 800048c <__aeabi_idiv0> 80001a4: f1ad 0c08 sub.w ip, sp, #8 80001a8: e96d ce04 strd ip, lr, [sp, #-16]! 80001ac: f000 f806 bl 80001bc <__udivmoddi4> 80001b0: f8dd e004 ldr.w lr, [sp, #4] 80001b4: e9dd 2302 ldrd r2, r3, [sp, #8] 80001b8: b004 add sp, #16 80001ba: 4770 bx lr 080001bc <__udivmoddi4>: 80001bc: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr} 80001c0: 468c mov ip, r1 80001c2: 4604 mov r4, r0 80001c4: 9e08 ldr r6, [sp, #32] 80001c6: 2b00 cmp r3, #0 80001c8: d14b bne.n 8000262 <__udivmoddi4+0xa6> 80001ca: 428a cmp r2, r1 80001cc: 4615 mov r5, r2 80001ce: d967 bls.n 80002a0 <__udivmoddi4+0xe4> 80001d0: fab2 f282 clz r2, r2 80001d4: b14a cbz r2, 80001ea <__udivmoddi4+0x2e> 80001d6: f1c2 0720 rsb r7, r2, #32 80001da: fa01 f302 lsl.w r3, r1, r2 80001de: fa20 f707 lsr.w r7, r0, r7 80001e2: 4095 lsls r5, r2 80001e4: ea47 0c03 orr.w ip, r7, r3 80001e8: 4094 lsls r4, r2 80001ea: ea4f 4e15 mov.w lr, r5, lsr #16 80001ee: fbbc f7fe udiv r7, ip, lr 80001f2: fa1f f885 uxth.w r8, r5 80001f6: fb0e c317 mls r3, lr, r7, ip 80001fa: fb07 f908 mul.w r9, r7, r8 80001fe: 0c21 lsrs r1, r4, #16 8000200: ea41 4303 orr.w r3, r1, r3, lsl #16 8000204: 4599 cmp r9, r3 8000206: d909 bls.n 800021c <__udivmoddi4+0x60> 8000208: 18eb adds r3, r5, r3 800020a: f107 31ff add.w r1, r7, #4294967295 800020e: f080 811c bcs.w 800044a <__udivmoddi4+0x28e> 8000212: 4599 cmp r9, r3 8000214: f240 8119 bls.w 800044a <__udivmoddi4+0x28e> 8000218: 3f02 subs r7, #2 800021a: 442b add r3, r5 800021c: eba3 0309 sub.w r3, r3, r9 8000220: fbb3 f0fe udiv r0, r3, lr 8000224: fb0e 3310 mls r3, lr, r0, r3 8000228: fb00 f108 mul.w r1, r0, r8 800022c: b2a4 uxth r4, r4 800022e: ea44 4403 orr.w r4, r4, r3, lsl #16 8000232: 42a1 cmp r1, r4 8000234: d909 bls.n 800024a <__udivmoddi4+0x8e> 8000236: 192c adds r4, r5, r4 8000238: f100 33ff add.w r3, r0, #4294967295 800023c: f080 8107 bcs.w 800044e <__udivmoddi4+0x292> 8000240: 42a1 cmp r1, r4 8000242: f240 8104 bls.w 800044e <__udivmoddi4+0x292> 8000246: 3802 subs r0, #2 8000248: 442c add r4, r5 800024a: ea40 4007 orr.w r0, r0, r7, lsl #16 800024e: 2700 movs r7, #0 8000250: 1a64 subs r4, r4, r1 8000252: b11e cbz r6, 800025c <__udivmoddi4+0xa0> 8000254: 2300 movs r3, #0 8000256: 40d4 lsrs r4, r2 8000258: e9c6 4300 strd r4, r3, [r6] 800025c: 4639 mov r1, r7 800025e: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc} 8000262: 428b cmp r3, r1 8000264: d909 bls.n 800027a <__udivmoddi4+0xbe> 8000266: 2e00 cmp r6, #0 8000268: f000 80ec beq.w 8000444 <__udivmoddi4+0x288> 800026c: 2700 movs r7, #0 800026e: e9c6 0100 strd r0, r1, [r6] 8000272: 4638 mov r0, r7 8000274: 4639 mov r1, r7 8000276: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc} 800027a: fab3 f783 clz r7, r3 800027e: 2f00 cmp r7, #0 8000280: d148 bne.n 8000314 <__udivmoddi4+0x158> 8000282: 428b cmp r3, r1 8000284: d302 bcc.n 800028c <__udivmoddi4+0xd0> 8000286: 4282 cmp r2, r0 8000288: f200 80fb bhi.w 8000482 <__udivmoddi4+0x2c6> 800028c: 1a84 subs r4, r0, r2 800028e: eb61 0303 sbc.w r3, r1, r3 8000292: 2001 movs r0, #1 8000294: 469c mov ip, r3 8000296: 2e00 cmp r6, #0 8000298: d0e0 beq.n 800025c <__udivmoddi4+0xa0> 800029a: e9c6 4c00 strd r4, ip, [r6] 800029e: e7dd b.n 800025c <__udivmoddi4+0xa0> 80002a0: b902 cbnz r2, 80002a4 <__udivmoddi4+0xe8> 80002a2: deff udf #255 ; 0xff 80002a4: fab2 f282 clz r2, r2 80002a8: 2a00 cmp r2, #0 80002aa: f040 808f bne.w 80003cc <__udivmoddi4+0x210> 80002ae: 2701 movs r7, #1 80002b0: 1b49 subs r1, r1, r5 80002b2: ea4f 4815 mov.w r8, r5, lsr #16 80002b6: fa1f f985 uxth.w r9, r5 80002ba: fbb1 fef8 udiv lr, r1, r8 80002be: fb08 111e mls r1, r8, lr, r1 80002c2: fb09 f00e mul.w r0, r9, lr 80002c6: ea4f 4c14 mov.w ip, r4, lsr #16 80002ca: ea4c 4301 orr.w r3, ip, r1, lsl #16 80002ce: 4298 cmp r0, r3 80002d0: d907 bls.n 80002e2 <__udivmoddi4+0x126> 80002d2: 18eb adds r3, r5, r3 80002d4: f10e 31ff add.w r1, lr, #4294967295 80002d8: d202 bcs.n 80002e0 <__udivmoddi4+0x124> 80002da: 4298 cmp r0, r3 80002dc: f200 80cd bhi.w 800047a <__udivmoddi4+0x2be> 80002e0: 468e mov lr, r1 80002e2: 1a1b subs r3, r3, r0 80002e4: fbb3 f0f8 udiv r0, r3, r8 80002e8: fb08 3310 mls r3, r8, r0, r3 80002ec: fb09 f900 mul.w r9, r9, r0 80002f0: b2a4 uxth r4, r4 80002f2: ea44 4403 orr.w r4, r4, r3, lsl #16 80002f6: 45a1 cmp r9, r4 80002f8: d907 bls.n 800030a <__udivmoddi4+0x14e> 80002fa: 192c adds r4, r5, r4 80002fc: f100 33ff add.w r3, r0, #4294967295 8000300: d202 bcs.n 8000308 <__udivmoddi4+0x14c> 8000302: 45a1 cmp r9, r4 8000304: f200 80b6 bhi.w 8000474 <__udivmoddi4+0x2b8> 8000308: 4618 mov r0, r3 800030a: eba4 0409 sub.w r4, r4, r9 800030e: ea40 400e orr.w r0, r0, lr, lsl #16 8000312: e79e b.n 8000252 <__udivmoddi4+0x96> 8000314: f1c7 0520 rsb r5, r7, #32 8000318: 40bb lsls r3, r7 800031a: fa22 fc05 lsr.w ip, r2, r5 800031e: ea4c 0c03 orr.w ip, ip, r3 8000322: fa21 f405 lsr.w r4, r1, r5 8000326: ea4f 4e1c mov.w lr, ip, lsr #16 800032a: fbb4 f9fe udiv r9, r4, lr 800032e: fa1f f88c uxth.w r8, ip 8000332: fb0e 4419 mls r4, lr, r9, r4 8000336: fa20 f305 lsr.w r3, r0, r5 800033a: 40b9 lsls r1, r7 800033c: fb09 fa08 mul.w sl, r9, r8 8000340: 4319 orrs r1, r3 8000342: 0c0b lsrs r3, r1, #16 8000344: ea43 4404 orr.w r4, r3, r4, lsl #16 8000348: 45a2 cmp sl, r4 800034a: fa02 f207 lsl.w r2, r2, r7 800034e: fa00 f307 lsl.w r3, r0, r7 8000352: d90b bls.n 800036c <__udivmoddi4+0x1b0> 8000354: eb1c 0404 adds.w r4, ip, r4 8000358: f109 30ff add.w r0, r9, #4294967295 800035c: f080 8088 bcs.w 8000470 <__udivmoddi4+0x2b4> 8000360: 45a2 cmp sl, r4 8000362: f240 8085 bls.w 8000470 <__udivmoddi4+0x2b4> 8000366: f1a9 0902 sub.w r9, r9, #2 800036a: 4464 add r4, ip 800036c: eba4 040a sub.w r4, r4, sl 8000370: fbb4 f0fe udiv r0, r4, lr 8000374: fb0e 4410 mls r4, lr, r0, r4 8000378: fb00 fa08 mul.w sl, r0, r8 800037c: b289 uxth r1, r1 800037e: ea41 4404 orr.w r4, r1, r4, lsl #16 8000382: 45a2 cmp sl, r4 8000384: d908 bls.n 8000398 <__udivmoddi4+0x1dc> 8000386: eb1c 0404 adds.w r4, ip, r4 800038a: f100 31ff add.w r1, r0, #4294967295 800038e: d26b bcs.n 8000468 <__udivmoddi4+0x2ac> 8000390: 45a2 cmp sl, r4 8000392: d969 bls.n 8000468 <__udivmoddi4+0x2ac> 8000394: 3802 subs r0, #2 8000396: 4464 add r4, ip 8000398: ea40 4009 orr.w r0, r0, r9, lsl #16 800039c: fba0 8902 umull r8, r9, r0, r2 80003a0: eba4 040a sub.w r4, r4, sl 80003a4: 454c cmp r4, r9 80003a6: 4641 mov r1, r8 80003a8: 46ce mov lr, r9 80003aa: d354 bcc.n 8000456 <__udivmoddi4+0x29a> 80003ac: d051 beq.n 8000452 <__udivmoddi4+0x296> 80003ae: 2e00 cmp r6, #0 80003b0: d069 beq.n 8000486 <__udivmoddi4+0x2ca> 80003b2: 1a5a subs r2, r3, r1 80003b4: eb64 040e sbc.w r4, r4, lr 80003b8: fa04 f505 lsl.w r5, r4, r5 80003bc: fa22 f307 lsr.w r3, r2, r7 80003c0: 40fc lsrs r4, r7 80003c2: 431d orrs r5, r3 80003c4: e9c6 5400 strd r5, r4, [r6] 80003c8: 2700 movs r7, #0 80003ca: e747 b.n 800025c <__udivmoddi4+0xa0> 80003cc: 4095 lsls r5, r2 80003ce: f1c2 0320 rsb r3, r2, #32 80003d2: fa21 f003 lsr.w r0, r1, r3 80003d6: ea4f 4815 mov.w r8, r5, lsr #16 80003da: fbb0 f7f8 udiv r7, r0, r8 80003de: fa1f f985 uxth.w r9, r5 80003e2: fb08 0017 mls r0, r8, r7, r0 80003e6: fa24 f303 lsr.w r3, r4, r3 80003ea: 4091 lsls r1, r2 80003ec: fb07 fc09 mul.w ip, r7, r9 80003f0: 430b orrs r3, r1 80003f2: 0c19 lsrs r1, r3, #16 80003f4: ea41 4100 orr.w r1, r1, r0, lsl #16 80003f8: 458c cmp ip, r1 80003fa: fa04 f402 lsl.w r4, r4, r2 80003fe: d907 bls.n 8000410 <__udivmoddi4+0x254> 8000400: 1869 adds r1, r5, r1 8000402: f107 30ff add.w r0, r7, #4294967295 8000406: d231 bcs.n 800046c <__udivmoddi4+0x2b0> 8000408: 458c cmp ip, r1 800040a: d92f bls.n 800046c <__udivmoddi4+0x2b0> 800040c: 3f02 subs r7, #2 800040e: 4429 add r1, r5 8000410: eba1 010c sub.w r1, r1, ip 8000414: fbb1 f0f8 udiv r0, r1, r8 8000418: fb08 1c10 mls ip, r8, r0, r1 800041c: fb00 fe09 mul.w lr, r0, r9 8000420: b299 uxth r1, r3 8000422: ea41 410c orr.w r1, r1, ip, lsl #16 8000426: 458e cmp lr, r1 8000428: d907 bls.n 800043a <__udivmoddi4+0x27e> 800042a: 1869 adds r1, r5, r1 800042c: f100 33ff add.w r3, r0, #4294967295 8000430: d218 bcs.n 8000464 <__udivmoddi4+0x2a8> 8000432: 458e cmp lr, r1 8000434: d916 bls.n 8000464 <__udivmoddi4+0x2a8> 8000436: 3802 subs r0, #2 8000438: 4429 add r1, r5 800043a: eba1 010e sub.w r1, r1, lr 800043e: ea40 4707 orr.w r7, r0, r7, lsl #16 8000442: e73a b.n 80002ba <__udivmoddi4+0xfe> 8000444: 4637 mov r7, r6 8000446: 4630 mov r0, r6 8000448: e708 b.n 800025c <__udivmoddi4+0xa0> 800044a: 460f mov r7, r1 800044c: e6e6 b.n 800021c <__udivmoddi4+0x60> 800044e: 4618 mov r0, r3 8000450: e6fb b.n 800024a <__udivmoddi4+0x8e> 8000452: 4543 cmp r3, r8 8000454: d2ab bcs.n 80003ae <__udivmoddi4+0x1f2> 8000456: ebb8 0102 subs.w r1, r8, r2 800045a: eb69 020c sbc.w r2, r9, ip 800045e: 3801 subs r0, #1 8000460: 4696 mov lr, r2 8000462: e7a4 b.n 80003ae <__udivmoddi4+0x1f2> 8000464: 4618 mov r0, r3 8000466: e7e8 b.n 800043a <__udivmoddi4+0x27e> 8000468: 4608 mov r0, r1 800046a: e795 b.n 8000398 <__udivmoddi4+0x1dc> 800046c: 4607 mov r7, r0 800046e: e7cf b.n 8000410 <__udivmoddi4+0x254> 8000470: 4681 mov r9, r0 8000472: e77b b.n 800036c <__udivmoddi4+0x1b0> 8000474: 3802 subs r0, #2 8000476: 442c add r4, r5 8000478: e747 b.n 800030a <__udivmoddi4+0x14e> 800047a: f1ae 0e02 sub.w lr, lr, #2 800047e: 442b add r3, r5 8000480: e72f b.n 80002e2 <__udivmoddi4+0x126> 8000482: 4638 mov r0, r7 8000484: e707 b.n 8000296 <__udivmoddi4+0xda> 8000486: 4637 mov r7, r6 8000488: e6e8 b.n 800025c <__udivmoddi4+0xa0> 800048a: bf00 nop 0800048c <__aeabi_idiv0>: 800048c: 4770 bx lr 800048e: bf00 nop 08000490 /* make idle state */ args[0] = CMD0; /* CMD0:GO_IDLE_STATE */ 80005e4: 2340 movs r3, #64 ; 0x40 80005e6: 703b strb r3, [r7, #0] args[1] = 0; 80005e8: 2300 movs r3, #0 80005ea: 707b strb r3, [r7, #1] args[2] = 0; 80005ec: 2300 movs r3, #0 80005ee: 70bb strb r3, [r7, #2] args[3] = 0; 80005f0: 2300 movs r3, #0 80005f2: 70fb strb r3, [r7, #3] args[4] = 0; 80005f4: 2300 movs r3, #0 80005f6: 713b strb r3, [r7, #4] args[5] = 0x95; /* CRC */ 80005f8: 2395 movs r3, #149 ; 0x95 80005fa: 717b strb r3, [r7, #5] SPI_TxBuffer(args, sizeof(args)); 80005fc: 463b mov r3, r7 80005fe: 2106 movs r1, #6 8000600: 4618 mov r0, r3 8000602: f7ff ff7b bl 80004fc /* wait response */ while ((SPI_RxByte() != 0x01) && cnt) 8000606: e002 b.n 800060e { cnt--; 8000608: 68fb ldr r3, [r7, #12] 800060a: 3b01 subs r3, #1 800060c: 60fb str r3, [r7, #12] while ((SPI_RxByte() != 0x01) && cnt) 800060e: f7ff ff8f bl 8000530 8000612: 4603 mov r3, r0 8000614: 2b01 cmp r3, #1 8000616: d002 beq.n 800061e 8000618: 68fb ldr r3, [r7, #12] 800061a: 2b00 cmp r3, #0 800061c: d1f4 bne.n 8000608 } DESELECT(); 800061e: f7ff ff45 bl 80004ac SPI_TxByte(0XFF); 8000622: 20ff movs r0, #255 ; 0xff 8000624: f7ff ff50 bl 80004c8 PowerFlag = 1; 8000628: 4b03 ldr r3, [pc, #12] ; (8000638 ) 800062a: 2201 movs r2, #1 800062c: 701a strb r2, [r3, #0] } 800062e: bf00 nop 8000630: 3710 adds r7, #16 8000632: 46bd mov sp, r7 8000634: bd80 pop {r7, pc} 8000636: bf00 nop 8000638: 200000a5 .word 0x200000a5 0800063c : /* power off */ static void SD_PowerOff(void) { 800063c: b480 push {r7} 800063e: af00 add r7, sp, #0 PowerFlag = 0; 8000640: 4b03 ldr r3, [pc, #12] ; (8000650 ) 8000642: 2200 movs r2, #0 8000644: 701a strb r2, [r3, #0] } 8000646: bf00 nop 8000648: 46bd mov sp, r7 800064a: bc80 pop {r7} 800064c: 4770 bx lr 800064e: bf00 nop 8000650: 200000a5 .word 0x200000a5 08000654 : /* check power flag */ static uint8_t SD_CheckPower(void) { 8000654: b480 push {r7} 8000656: af00 add r7, sp, #0 return PowerFlag; 8000658: 4b02 ldr r3, [pc, #8] ; (8000664 ) 800065a: 781b ldrb r3, [r3, #0] } 800065c: 4618 mov r0, r3 800065e: 46bd mov sp, r7 8000660: bc80 pop {r7} 8000662: 4770 bx lr 8000664: 200000a5 .word 0x200000a5 08000668 : /* receive data block */ static bool SD_RxDataBlock(BYTE *buff, UINT len) { 8000668: b580 push {r7, lr} 800066a: b084 sub sp, #16 800066c: af00 add r7, sp, #0 800066e: 6078 str r0, [r7, #4] 8000670: 6039 str r1, [r7, #0] uint8_t token; /* timeout 200ms */ Timer1 = 200; 8000672: 4b13 ldr r3, [pc, #76] ; (80006c0 ) 8000674: 22c8 movs r2, #200 ; 0xc8 8000676: 801a strh r2, [r3, #0] /* loop until receive a response or timeout */ do { token = SPI_RxByte(); 8000678: f7ff ff5a bl 8000530 800067c: 4603 mov r3, r0 800067e: 73fb strb r3, [r7, #15] } while((token == 0xFF) && Timer1); 8000680: 7bfb ldrb r3, [r7, #15] 8000682: 2bff cmp r3, #255 ; 0xff 8000684: d103 bne.n 800068e 8000686: 4b0e ldr r3, [pc, #56] ; (80006c0 ) 8000688: 881b ldrh r3, [r3, #0] 800068a: 2b00 cmp r3, #0 800068c: d1f4 bne.n 8000678 /* invalid response */ if(token != 0xFE) return FALSE; 800068e: 7bfb ldrb r3, [r7, #15] 8000690: 2bfe cmp r3, #254 ; 0xfe 8000692: d001 beq.n 8000698 8000694: 2300 movs r3, #0 8000696: e00f b.n 80006b8 /* receive data */ do { SPI_RxBytePtr(buff++); 8000698: 687b ldr r3, [r7, #4] 800069a: 1c5a adds r2, r3, #1 800069c: 607a str r2, [r7, #4] 800069e: 4618 mov r0, r3 80006a0: f7ff ff62 bl 8000568 } while(len--); 80006a4: 683b ldr r3, [r7, #0] 80006a6: 1e5a subs r2, r3, #1 80006a8: 603a str r2, [r7, #0] 80006aa: 2b00 cmp r3, #0 80006ac: d1f4 bne.n 8000698 /* discard CRC */ SPI_RxByte(); 80006ae: f7ff ff3f bl 8000530 SPI_RxByte(); 80006b2: f7ff ff3d bl 8000530 return TRUE; 80006b6: 2301 movs r3, #1 } 80006b8: 4618 mov r0, r3 80006ba: 3710 adds r7, #16 80006bc: 46bd mov sp, r7 80006be: bd80 pop {r7, pc} 80006c0: 200002ea .word 0x200002ea 080006c4 : /* transmit data block */ #if _USE_WRITE == 1 static bool SD_TxDataBlock(const uint8_t *buff, BYTE token) { 80006c4: b580 push {r7, lr} 80006c6: b084 sub sp, #16 80006c8: af00 add r7, sp, #0 80006ca: 6078 str r0, [r7, #4] 80006cc: 460b mov r3, r1 80006ce: 70fb strb r3, [r7, #3] uint8_t resp; uint8_t i = 0; 80006d0: 2300 movs r3, #0 80006d2: 73bb strb r3, [r7, #14] /* wait SD ready */ if (SD_ReadyWait() != 0xFF) return FALSE; 80006d4: f7ff ff56 bl 8000584 80006d8: 4603 mov r3, r0 80006da: 2bff cmp r3, #255 ; 0xff 80006dc: d001 beq.n 80006e2 80006de: 2300 movs r3, #0 80006e0: e02f b.n 8000742 /* transmit token */ SPI_TxByte(token); 80006e2: 78fb ldrb r3, [r7, #3] 80006e4: 4618 mov r0, r3 80006e6: f7ff feef bl 80004c8 /* if it's not STOP token, transmit data */ if (token != 0xFD) 80006ea: 78fb ldrb r3, [r7, #3] 80006ec: 2bfd cmp r3, #253 ; 0xfd 80006ee: d020 beq.n 8000732 { SPI_TxBuffer((uint8_t*)buff, 512); 80006f0: f44f 7100 mov.w r1, #512 ; 0x200 80006f4: 6878 ldr r0, [r7, #4] 80006f6: f7ff ff01 bl 80004fc /* discard CRC */ SPI_RxByte(); 80006fa: f7ff ff19 bl 8000530 SPI_RxByte(); 80006fe: f7ff ff17 bl 8000530 /* receive response */ while (i <= 64) 8000702: e00b b.n 800071c { resp = SPI_RxByte(); 8000704: f7ff ff14 bl 8000530 8000708: 4603 mov r3, r0 800070a: 73fb strb r3, [r7, #15] /* transmit 0x05 accepted */ if ((resp & 0x1F) == 0x05) break; 800070c: 7bfb ldrb r3, [r7, #15] 800070e: f003 031f and.w r3, r3, #31 8000712: 2b05 cmp r3, #5 8000714: d006 beq.n 8000724 i++; 8000716: 7bbb ldrb r3, [r7, #14] 8000718: 3301 adds r3, #1 800071a: 73bb strb r3, [r7, #14] while (i <= 64) 800071c: 7bbb ldrb r3, [r7, #14] 800071e: 2b40 cmp r3, #64 ; 0x40 8000720: d9f0 bls.n 8000704 8000722: e000 b.n 8000726 if ((resp & 0x1F) == 0x05) break; 8000724: bf00 nop } /* recv buffer clear */ while (SPI_RxByte() == 0); 8000726: bf00 nop 8000728: f7ff ff02 bl 8000530 800072c: 4603 mov r3, r0 800072e: 2b00 cmp r3, #0 8000730: d0fa beq.n 8000728 } /* transmit 0x05 accepted */ if ((resp & 0x1F) == 0x05) return TRUE; 8000732: 7bfb ldrb r3, [r7, #15] 8000734: f003 031f and.w r3, r3, #31 8000738: 2b05 cmp r3, #5 800073a: d101 bne.n 8000740 800073c: 2301 movs r3, #1 800073e: e000 b.n 8000742 return FALSE; 8000740: 2300 movs r3, #0 } 8000742: 4618 mov r0, r3 8000744: 3710 adds r7, #16 8000746: 46bd mov sp, r7 8000748: bd80 pop {r7, pc} 0800074a : #endif /* _USE_WRITE */ /* transmit command */ static BYTE SD_SendCmd(BYTE cmd, uint32_t arg) { 800074a: b580 push {r7, lr} 800074c: b084 sub sp, #16 800074e: af00 add r7, sp, #0 8000750: 4603 mov r3, r0 8000752: 6039 str r1, [r7, #0] 8000754: 71fb strb r3, [r7, #7] uint8_t crc, res; /* wait SD ready */ if (SD_ReadyWait() != 0xFF) return 0xFF; 8000756: f7ff ff15 bl 8000584 800075a: 4603 mov r3, r0 800075c: 2bff cmp r3, #255 ; 0xff 800075e: d001 beq.n 8000764 8000760: 23ff movs r3, #255 ; 0xff 8000762: e042 b.n 80007ea /* transmit command */ SPI_TxByte(cmd); /* Command */ 8000764: 79fb ldrb r3, [r7, #7] 8000766: 4618 mov r0, r3 8000768: f7ff feae bl 80004c8 SPI_TxByte((uint8_t)(arg >> 24)); /* Argument[31..24] */ 800076c: 683b ldr r3, [r7, #0] 800076e: 0e1b lsrs r3, r3, #24 8000770: b2db uxtb r3, r3 8000772: 4618 mov r0, r3 8000774: f7ff fea8 bl 80004c8 SPI_TxByte((uint8_t)(arg >> 16)); /* Argument[23..16] */ 8000778: 683b ldr r3, [r7, #0] 800077a: 0c1b lsrs r3, r3, #16 800077c: b2db uxtb r3, r3 800077e: 4618 mov r0, r3 8000780: f7ff fea2 bl 80004c8 SPI_TxByte((uint8_t)(arg >> 8)); /* Argument[15..8] */ 8000784: 683b ldr r3, [r7, #0] 8000786: 0a1b lsrs r3, r3, #8 8000788: b2db uxtb r3, r3 800078a: 4618 mov r0, r3 800078c: f7ff fe9c bl 80004c8 SPI_TxByte((uint8_t)arg); /* Argument[7..0] */ 8000790: 683b ldr r3, [r7, #0] 8000792: b2db uxtb r3, r3 8000794: 4618 mov r0, r3 8000796: f7ff fe97 bl 80004c8 /* prepare CRC */ if(cmd == CMD0) crc = 0x95; /* CRC for CMD0(0) */ 800079a: 79fb ldrb r3, [r7, #7] 800079c: 2b40 cmp r3, #64 ; 0x40 800079e: d102 bne.n 80007a6 80007a0: 2395 movs r3, #149 ; 0x95 80007a2: 73fb strb r3, [r7, #15] 80007a4: e007 b.n 80007b6 else if(cmd == CMD8) crc = 0x87; /* CRC for CMD8(0x1AA) */ 80007a6: 79fb ldrb r3, [r7, #7] 80007a8: 2b48 cmp r3, #72 ; 0x48 80007aa: d102 bne.n 80007b2 80007ac: 2387 movs r3, #135 ; 0x87 80007ae: 73fb strb r3, [r7, #15] 80007b0: e001 b.n 80007b6 else crc = 1; 80007b2: 2301 movs r3, #1 80007b4: 73fb strb r3, [r7, #15] /* transmit CRC */ SPI_TxByte(crc); 80007b6: 7bfb ldrb r3, [r7, #15] 80007b8: 4618 mov r0, r3 80007ba: f7ff fe85 bl 80004c8 /* Skip a stuff byte when STOP_TRANSMISSION */ if (cmd == CMD12) SPI_RxByte(); 80007be: 79fb ldrb r3, [r7, #7] 80007c0: 2b4c cmp r3, #76 ; 0x4c 80007c2: d101 bne.n 80007c8 80007c4: f7ff feb4 bl 8000530 /* receive response */ uint8_t n = 10; 80007c8: 230a movs r3, #10 80007ca: 73bb strb r3, [r7, #14] do { res = SPI_RxByte(); 80007cc: f7ff feb0 bl 8000530 80007d0: 4603 mov r3, r0 80007d2: 737b strb r3, [r7, #13] } while ((res & 0x80) && --n); 80007d4: f997 300d ldrsb.w r3, [r7, #13] 80007d8: 2b00 cmp r3, #0 80007da: da05 bge.n 80007e8 80007dc: 7bbb ldrb r3, [r7, #14] 80007de: 3b01 subs r3, #1 80007e0: 73bb strb r3, [r7, #14] 80007e2: 7bbb ldrb r3, [r7, #14] 80007e4: 2b00 cmp r3, #0 80007e6: d1f1 bne.n 80007cc return res; 80007e8: 7b7b ldrb r3, [r7, #13] } 80007ea: 4618 mov r0, r3 80007ec: 3710 adds r7, #16 80007ee: 46bd mov sp, r7 80007f0: bd80 pop {r7, pc} ... 080007f4 : * user_diskio.c functions **************************************/ /* initialize SD */ DSTATUS SD_disk_initialize(BYTE drv) { 80007f4: b590 push {r4, r7, lr} 80007f6: b085 sub sp, #20 80007f8: af00 add r7, sp, #0 80007fa: 4603 mov r3, r0 80007fc: 71fb strb r3, [r7, #7] uint8_t n, type, ocr[4]; /* single drive, drv should be 0 */ if(drv) return STA_NOINIT; 80007fe: 79fb ldrb r3, [r7, #7] 8000800: 2b00 cmp r3, #0 8000802: d001 beq.n 8000808 8000804: 2301 movs r3, #1 8000806: e0d1 b.n 80009ac /* no disk */ if(Stat & STA_NODISK) return Stat; 8000808: 4b6a ldr r3, [pc, #424] ; (80009b4 ) 800080a: 781b ldrb r3, [r3, #0] 800080c: b2db uxtb r3, r3 800080e: f003 0302 and.w r3, r3, #2 8000812: 2b00 cmp r3, #0 8000814: d003 beq.n 800081e 8000816: 4b67 ldr r3, [pc, #412] ; (80009b4 ) 8000818: 781b ldrb r3, [r3, #0] 800081a: b2db uxtb r3, r3 800081c: e0c6 b.n 80009ac /* power on */ SD_PowerOn(); 800081e: f7ff fecb bl 80005b8 /* slave select */ SELECT(); 8000822: f7ff fe35 bl 8000490 if (count == 1) 8000a30: 683b ldr r3, [r7, #0] 8000a32: 2b01 cmp r3, #1 8000a34: d111 bne.n 8000a5a { /* READ_SINGLE_BLOCK */ if ((SD_SendCmd(CMD17, sector) == 0) && SD_RxDataBlock(buff, 512)) count = 0; 8000a36: 6879 ldr r1, [r7, #4] 8000a38: 2051 movs r0, #81 ; 0x51 8000a3a: f7ff fe86 bl 800074a 8000a3e: 4603 mov r3, r0 8000a40: 2b00 cmp r3, #0 8000a42: d129 bne.n 8000a98 8000a44: f44f 7100 mov.w r1, #512 ; 0x200 8000a48: 68b8 ldr r0, [r7, #8] 8000a4a: f7ff fe0d bl 8000668 8000a4e: 4603 mov r3, r0 8000a50: 2b00 cmp r3, #0 8000a52: d021 beq.n 8000a98 8000a54: 2300 movs r3, #0 8000a56: 603b str r3, [r7, #0] 8000a58: e01e b.n 8000a98 } else { /* READ_MULTIPLE_BLOCK */ if (SD_SendCmd(CMD18, sector) == 0) 8000a5a: 6879 ldr r1, [r7, #4] 8000a5c: 2052 movs r0, #82 ; 0x52 8000a5e: f7ff fe74 bl 800074a 8000a62: 4603 mov r3, r0 8000a64: 2b00 cmp r3, #0 8000a66: d117 bne.n 8000a98 { do { if (!SD_RxDataBlock(buff, 512)) break; 8000a68: f44f 7100 mov.w r1, #512 ; 0x200 8000a6c: 68b8 ldr r0, [r7, #8] 8000a6e: f7ff fdfb bl 8000668 8000a72: 4603 mov r3, r0 8000a74: 2b00 cmp r3, #0 8000a76: d00a beq.n 8000a8e buff += 512; 8000a78: 68bb ldr r3, [r7, #8] 8000a7a: f503 7300 add.w r3, r3, #512 ; 0x200 8000a7e: 60bb str r3, [r7, #8] } while (--count); 8000a80: 683b ldr r3, [r7, #0] 8000a82: 3b01 subs r3, #1 8000a84: 603b str r3, [r7, #0] 8000a86: 683b ldr r3, [r7, #0] 8000a88: 2b00 cmp r3, #0 8000a8a: d1ed bne.n 8000a68 8000a8c: e000 b.n 8000a90 if (!SD_RxDataBlock(buff, 512)) break; 8000a8e: bf00 nop /* STOP_TRANSMISSION */ SD_SendCmd(CMD12, 0); 8000a90: 2100 movs r1, #0 8000a92: 204c movs r0, #76 ; 0x4c 8000a94: f7ff fe59 bl 800074a } } /* Idle */ DESELECT(); 8000a98: f7ff fd08 bl 80004ac SPI_RxByte(); 8000a9c: f7ff fd48 bl 8000530 return count ? RES_ERROR : RES_OK; 8000aa0: 683b ldr r3, [r7, #0] 8000aa2: 2b00 cmp r3, #0 8000aa4: bf14 ite ne 8000aa6: 2301 movne r3, #1 8000aa8: 2300 moveq r3, #0 8000aaa: b2db uxtb r3, r3 } 8000aac: 4618 mov r0, r3 8000aae: 3710 adds r7, #16 8000ab0: 46bd mov sp, r7 8000ab2: bd80 pop {r7, pc} 8000ab4: 20000000 .word 0x20000000 8000ab8: 200000a4 .word 0x200000a4 08000abc : /* write sector */ #if _USE_WRITE == 1 DRESULT SD_disk_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count) { 8000abc: b580 push {r7, lr} 8000abe: b084 sub sp, #16 8000ac0: af00 add r7, sp, #0 8000ac2: 60b9 str r1, [r7, #8] 8000ac4: 607a str r2, [r7, #4] 8000ac6: 603b str r3, [r7, #0] 8000ac8: 4603 mov r3, r0 8000aca: 73fb strb r3, [r7, #15] /* pdrv should be 0 */ if (pdrv || !count) return RES_PARERR; 8000acc: 7bfb ldrb r3, [r7, #15] 8000ace: 2b00 cmp r3, #0 8000ad0: d102 bne.n 8000ad8 8000ad2: 683b ldr r3, [r7, #0] 8000ad4: 2b00 cmp r3, #0 8000ad6: d101 bne.n 8000adc 8000ad8: 2304 movs r3, #4 8000ada: e06b b.n 8000bb4 /* no disk */ if (Stat & STA_NOINIT) return RES_NOTRDY; 8000adc: 4b37 ldr r3, [pc, #220] ; (8000bbc ) 8000ade: 781b ldrb r3, [r3, #0] 8000ae0: b2db uxtb r3, r3 8000ae2: f003 0301 and.w r3, r3, #1 8000ae6: 2b00 cmp r3, #0 8000ae8: d001 beq.n 8000aee 8000aea: 2303 movs r3, #3 8000aec: e062 b.n 8000bb4 /* write protection */ if (Stat & STA_PROTECT) return RES_WRPRT; 8000aee: 4b33 ldr r3, [pc, #204] ; (8000bbc ) 8000af0: 781b ldrb r3, [r3, #0] 8000af2: b2db uxtb r3, r3 8000af4: f003 0304 and.w r3, r3, #4 8000af8: 2b00 cmp r3, #0 8000afa: d001 beq.n 8000b00 8000afc: 2302 movs r3, #2 8000afe: e059 b.n 8000bb4 /* convert to byte address */ if (!(CardType & CT_SD2)) sector *= 512; 8000b00: 4b2f ldr r3, [pc, #188] ; (8000bc0 ) 8000b02: 781b ldrb r3, [r3, #0] 8000b04: f003 0304 and.w r3, r3, #4 8000b08: 2b00 cmp r3, #0 8000b0a: d102 bne.n 8000b12 8000b0c: 687b ldr r3, [r7, #4] 8000b0e: 025b lsls r3, r3, #9 8000b10: 607b str r3, [r7, #4] SELECT(); 8000b12: f7ff fcbd bl 8000490 switch (ctrl) 8000c48: 79bb ldrb r3, [r7, #6] 8000c4a: 2b0d cmp r3, #13 8000c4c: f200 80cc bhi.w 8000de8 8000c50: a201 add r2, pc, #4 ; (adr r2, 8000c58 ) 8000c52: f852 f023 ldr.w pc, [r2, r3, lsl #2] 8000c56: bf00 nop 8000c58: 08000d53 .word 0x08000d53 8000c5c: 08000c91 .word 0x08000c91 8000c60: 08000d43 .word 0x08000d43 8000c64: 08000de9 .word 0x08000de9 8000c68: 08000de9 .word 0x08000de9 8000c6c: 08000de9 .word 0x08000de9 8000c70: 08000de9 .word 0x08000de9 8000c74: 08000de9 .word 0x08000de9 8000c78: 08000de9 .word 0x08000de9 8000c7c: 08000de9 .word 0x08000de9 8000c80: 08000de9 .word 0x08000de9 8000c84: 08000d65 .word 0x08000d65 8000c88: 08000d89 .word 0x08000d89 8000c8c: 08000dad .word 0x08000dad { case GET_SECTOR_COUNT: /* SEND_CSD */ if ((SD_SendCmd(CMD9, 0) == 0) && SD_RxDataBlock(csd, 16)) 8000c90: 2100 movs r1, #0 8000c92: 2049 movs r0, #73 ; 0x49 8000c94: f7ff fd59 bl 800074a 8000c98: 4603 mov r3, r0 8000c9a: 2b00 cmp r3, #0 8000c9c: f040 80a8 bne.w 8000df0 8000ca0: f107 030c add.w r3, r7, #12 8000ca4: 2110 movs r1, #16 8000ca6: 4618 mov r0, r3 8000ca8: f7ff fcde bl 8000668 8000cac: 4603 mov r3, r0 8000cae: 2b00 cmp r3, #0 8000cb0: f000 809e beq.w 8000df0 { if ((csd[0] >> 6) == 1) 8000cb4: 7b3b ldrb r3, [r7, #12] 8000cb6: 099b lsrs r3, r3, #6 8000cb8: b2db uxtb r3, r3 8000cba: 2b01 cmp r3, #1 8000cbc: d10e bne.n 8000cdc { /* SDC V2 */ csize = csd[9] + ((WORD) csd[8] << 8) + 1; 8000cbe: 7d7b ldrb r3, [r7, #21] 8000cc0: b29a uxth r2, r3 8000cc2: 7d3b ldrb r3, [r7, #20] 8000cc4: b29b uxth r3, r3 8000cc6: 021b lsls r3, r3, #8 8000cc8: b29b uxth r3, r3 8000cca: 4413 add r3, r2 8000ccc: b29b uxth r3, r3 8000cce: 3301 adds r3, #1 8000cd0: 83fb strh r3, [r7, #30] *(DWORD*) buff = (DWORD) csize << 10; 8000cd2: 8bfb ldrh r3, [r7, #30] 8000cd4: 029a lsls r2, r3, #10 8000cd6: 683b ldr r3, [r7, #0] 8000cd8: 601a str r2, [r3, #0] 8000cda: e02e b.n 8000d3a } else { /* MMC or SDC V1 */ n = (csd[5] & 15) + ((csd[10] & 128) >> 7) + ((csd[9] & 3) << 1) + 2; 8000cdc: 7c7b ldrb r3, [r7, #17] 8000cde: f003 030f and.w r3, r3, #15 8000ce2: b2da uxtb r2, r3 8000ce4: 7dbb ldrb r3, [r7, #22] 8000ce6: 09db lsrs r3, r3, #7 8000ce8: b2db uxtb r3, r3 8000cea: 4413 add r3, r2 8000cec: b2da uxtb r2, r3 8000cee: 7d7b ldrb r3, [r7, #21] 8000cf0: 005b lsls r3, r3, #1 8000cf2: b2db uxtb r3, r3 8000cf4: f003 0306 and.w r3, r3, #6 8000cf8: b2db uxtb r3, r3 8000cfa: 4413 add r3, r2 8000cfc: b2db uxtb r3, r3 8000cfe: 3302 adds r3, #2 8000d00: f887 3026 strb.w r3, [r7, #38] ; 0x26 csize = (csd[8] >> 6) + ((WORD) csd[7] << 2) + ((WORD) (csd[6] & 3) << 10) + 1; 8000d04: 7d3b ldrb r3, [r7, #20] 8000d06: 099b lsrs r3, r3, #6 8000d08: b2db uxtb r3, r3 8000d0a: b29a uxth r2, r3 8000d0c: 7cfb ldrb r3, [r7, #19] 8000d0e: b29b uxth r3, r3 8000d10: 009b lsls r3, r3, #2 8000d12: b29b uxth r3, r3 8000d14: 4413 add r3, r2 8000d16: b29a uxth r2, r3 8000d18: 7cbb ldrb r3, [r7, #18] 8000d1a: 029b lsls r3, r3, #10 8000d1c: b29b uxth r3, r3 8000d1e: f403 6340 and.w r3, r3, #3072 ; 0xc00 8000d22: b29b uxth r3, r3 8000d24: 4413 add r3, r2 8000d26: b29b uxth r3, r3 8000d28: 3301 adds r3, #1 8000d2a: 83fb strh r3, [r7, #30] *(DWORD*) buff = (DWORD) csize << (n - 9); 8000d2c: 8bfa ldrh r2, [r7, #30] 8000d2e: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 8000d32: 3b09 subs r3, #9 8000d34: 409a lsls r2, r3 8000d36: 683b ldr r3, [r7, #0] 8000d38: 601a str r2, [r3, #0] } res = RES_OK; 8000d3a: 2300 movs r3, #0 8000d3c: f887 3027 strb.w r3, [r7, #39] ; 0x27 } break; 8000d40: e056 b.n 8000df0 case GET_SECTOR_SIZE: *(WORD*) buff = 512; 8000d42: 683b ldr r3, [r7, #0] 8000d44: f44f 7200 mov.w r2, #512 ; 0x200 8000d48: 801a strh r2, [r3, #0] res = RES_OK; 8000d4a: 2300 movs r3, #0 8000d4c: f887 3027 strb.w r3, [r7, #39] ; 0x27 break; 8000d50: e055 b.n 8000dfe case CTRL_SYNC: if (SD_ReadyWait() == 0xFF) res = RES_OK; 8000d52: f7ff fc17 bl 8000584 8000d56: 4603 mov r3, r0 8000d58: 2bff cmp r3, #255 ; 0xff 8000d5a: d14b bne.n 8000df4 8000d5c: 2300 movs r3, #0 8000d5e: f887 3027 strb.w r3, [r7, #39] ; 0x27 break; 8000d62: e047 b.n 8000df4 case MMC_GET_CSD: /* SEND_CSD */ if (SD_SendCmd(CMD9, 0) == 0 && SD_RxDataBlock(ptr, 16)) res = RES_OK; 8000d64: 2100 movs r1, #0 8000d66: 2049 movs r0, #73 ; 0x49 8000d68: f7ff fcef bl 800074a 8000d6c: 4603 mov r3, r0 8000d6e: 2b00 cmp r3, #0 8000d70: d142 bne.n 8000df8 8000d72: 2110 movs r1, #16 8000d74: 6a38 ldr r0, [r7, #32] 8000d76: f7ff fc77 bl 8000668 8000d7a: 4603 mov r3, r0 8000d7c: 2b00 cmp r3, #0 8000d7e: d03b beq.n 8000df8 8000d80: 2300 movs r3, #0 8000d82: f887 3027 strb.w r3, [r7, #39] ; 0x27 break; 8000d86: e037 b.n 8000df8 case MMC_GET_CID: /* SEND_CID */ if (SD_SendCmd(CMD10, 0) == 0 && SD_RxDataBlock(ptr, 16)) res = RES_OK; 8000d88: 2100 movs r1, #0 8000d8a: 204a movs r0, #74 ; 0x4a 8000d8c: f7ff fcdd bl 800074a 8000d90: 4603 mov r3, r0 8000d92: 2b00 cmp r3, #0 8000d94: d132 bne.n 8000dfc 8000d96: 2110 movs r1, #16 8000d98: 6a38 ldr r0, [r7, #32] 8000d9a: f7ff fc65 bl 8000668 8000d9e: 4603 mov r3, r0 8000da0: 2b00 cmp r3, #0 8000da2: d02b beq.n 8000dfc 8000da4: 2300 movs r3, #0 8000da6: f887 3027 strb.w r3, [r7, #39] ; 0x27 break; 8000daa: e027 b.n 8000dfc case MMC_GET_OCR: /* READ_OCR */ if (SD_SendCmd(CMD58, 0) == 0) 8000dac: 2100 movs r1, #0 8000dae: 207a movs r0, #122 ; 0x7a 8000db0: f7ff fccb bl 800074a 8000db4: 4603 mov r3, r0 8000db6: 2b00 cmp r3, #0 8000db8: d116 bne.n 8000de8 { for (n = 0; n < 4; n++) 8000dba: 2300 movs r3, #0 8000dbc: f887 3026 strb.w r3, [r7, #38] ; 0x26 8000dc0: e00b b.n 8000dda { *ptr++ = SPI_RxByte(); 8000dc2: 6a3c ldr r4, [r7, #32] 8000dc4: 1c63 adds r3, r4, #1 8000dc6: 623b str r3, [r7, #32] 8000dc8: f7ff fbb2 bl 8000530 8000dcc: 4603 mov r3, r0 8000dce: 7023 strb r3, [r4, #0] for (n = 0; n < 4; n++) 8000dd0: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 8000dd4: 3301 adds r3, #1 8000dd6: f887 3026 strb.w r3, [r7, #38] ; 0x26 8000dda: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 8000dde: 2b03 cmp r3, #3 8000de0: d9ef bls.n 8000dc2 } res = RES_OK; 8000de2: 2300 movs r3, #0 8000de4: f887 3027 strb.w r3, [r7, #39] ; 0x27 } default: res = RES_PARERR; 8000de8: 2304 movs r3, #4 8000dea: f887 3027 strb.w r3, [r7, #39] ; 0x27 8000dee: e006 b.n 8000dfe break; 8000df0: bf00 nop 8000df2: e004 b.n 8000dfe break; 8000df4: bf00 nop 8000df6: e002 b.n 8000dfe break; 8000df8: bf00 nop 8000dfa: e000 b.n 8000dfe break; 8000dfc: bf00 nop } DESELECT(); 8000dfe: f7ff fb55 bl 80004ac SPI_RxByte(); 8000e02: f7ff fb95 bl 8000530 } return res; 8000e06: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 } 8000e0a: 4618 mov r0, r3 8000e0c: 372c adds r7, #44 ; 0x2c 8000e0e: 46bd mov sp, r7 8000e10: bd90 pop {r4, r7, pc} 8000e12: bf00 nop 8000e14: 20000000 .word 0x20000000 08000e18 : /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ // sending to UART void transmit_uart(char *string){ 8000e18: b580 push {r7, lr} 8000e1a: b084 sub sp, #16 8000e1c: af00 add r7, sp, #0 8000e1e: 6078 str r0, [r7, #4] uint8_t len = strlen(string); 8000e20: 6878 ldr r0, [r7, #4] 8000e22: f7ff f9ab bl 800017c 8000e26: 4603 mov r3, r0 8000e28: 73fb strb r3, [r7, #15] HAL_UART_Transmit(&huart2, (uint8_t*) string, len, 200); 8000e2a: 7bfb ldrb r3, [r7, #15] 8000e2c: b29a uxth r2, r3 8000e2e: 23c8 movs r3, #200 ; 0xc8 8000e30: 6879 ldr r1, [r7, #4] 8000e32: 4803 ldr r0, [pc, #12] ; (8000e40 ) 8000e34: f002 fd91 bl 800395a } 8000e38: bf00 nop 8000e3a: 3710 adds r7, #16 8000e3c: 46bd mov sp, r7 8000e3e: bd80 pop {r7, pc} 8000e40: 200013f8 .word 0x200013f8 08000e44
: /** * @brief The application entry point. * @retval int */ int main(void) { 8000e44: b580 push {r7, lr} 8000e46: b08e sub sp, #56 ; 0x38 8000e48: af00 add r7, sp, #0 /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); 8000e4a: f000 fc22 bl 8001692 /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); 8000e4e: f000 f907 bl 8001060 /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); 8000e52: f000 fa0d bl 8001270 MX_USART2_UART_Init(); 8000e56: f000 f9e1 bl 800121c MX_SPI1_Init(); 8000e5a: f000 f9a9 bl 80011b0 MX_FATFS_Init(); 8000e5e: f002 ff43 bl 8003ce8 MX_ADC_Init(); 8000e62: f000 f94b bl 80010fc /* USER CODE BEGIN 2 */ fres = f_mount(&fs, "", 0); 8000e66: 2200 movs r2, #0 8000e68: 4967 ldr r1, [pc, #412] ; (8001008 ) 8000e6a: 4868 ldr r0, [pc, #416] ; (800100c ) 8000e6c: f005 f96a bl 8006144 8000e70: 4603 mov r3, r0 8000e72: 461a mov r2, r3 8000e74: 4b66 ldr r3, [pc, #408] ; (8001010 ) 8000e76: 701a strb r2, [r3, #0] if (fres == FR_OK) { 8000e78: 4b65 ldr r3, [pc, #404] ; (8001010 ) 8000e7a: 781b ldrb r3, [r3, #0] 8000e7c: 2b00 cmp r3, #0 8000e7e: d103 bne.n 8000e88 transmit_uart("SD card is mounted successfully!\r\n"); 8000e80: 4864 ldr r0, [pc, #400] ; (8001014 ) 8000e82: f7ff ffc9 bl 8000e18 8000e86: e006 b.n 8000e96 } else if (fres != FR_OK) { 8000e88: 4b61 ldr r3, [pc, #388] ; (8001010 ) 8000e8a: 781b ldrb r3, [r3, #0] 8000e8c: 2b00 cmp r3, #0 8000e8e: d002 beq.n 8000e96 transmit_uart("SD card is not mounted!\r\n"); 8000e90: 4861 ldr r0, [pc, #388] ; (8001018 ) 8000e92: f7ff ffc1 bl 8000e18 transmit_uart("SD card is unmounted!\r\n"); } else if (fres != FR_OK) { transmit_uart("SD card was not unmounted!\r\n"); }*/ int day = 12; 8000e96: 230c movs r3, #12 8000e98: 637b str r3, [r7, #52] ; 0x34 int month = 2; 8000e9a: 2302 movs r3, #2 8000e9c: 633b str r3, [r7, #48] ; 0x30 int year = 21; 8000e9e: 2315 movs r3, #21 8000ea0: 62fb str r3, [r7, #44] ; 0x2c char str_month[20]; char str_year[20]; sprintf(txtVar, "%ld", day); 8000ea2: 6b7a ldr r2, [r7, #52] ; 0x34 8000ea4: 495d ldr r1, [pc, #372] ; (800101c ) 8000ea6: 485e ldr r0, [pc, #376] ; (8001020 ) 8000ea8: f006 f9a4 bl 80071f4 sprintf(str_month, "%ld", month); 8000eac: f107 0318 add.w r3, r7, #24 8000eb0: 6b3a ldr r2, [r7, #48] ; 0x30 8000eb2: 495a ldr r1, [pc, #360] ; (800101c ) 8000eb4: 4618 mov r0, r3 8000eb6: f006 f99d bl 80071f4 sprintf(str_year, "%ld", year); 8000eba: 1d3b adds r3, r7, #4 8000ebc: 6afa ldr r2, [r7, #44] ; 0x2c 8000ebe: 4957 ldr r1, [pc, #348] ; (800101c ) 8000ec0: 4618 mov r0, r3 8000ec2: f006 f997 bl 80071f4 strcat(txtVar, "."); 8000ec6: 4856 ldr r0, [pc, #344] ; (8001020 ) 8000ec8: f7ff f958 bl 800017c 8000ecc: 4603 mov r3, r0 8000ece: 461a mov r2, r3 8000ed0: 4b53 ldr r3, [pc, #332] ; (8001020 ) 8000ed2: 4413 add r3, r2 8000ed4: 4953 ldr r1, [pc, #332] ; (8001024 ) 8000ed6: 461a mov r2, r3 8000ed8: 460b mov r3, r1 8000eda: 881b ldrh r3, [r3, #0] 8000edc: 8013 strh r3, [r2, #0] strcat(str_month, "."); 8000ede: f107 0318 add.w r3, r7, #24 8000ee2: 4618 mov r0, r3 8000ee4: f7ff f94a bl 800017c 8000ee8: 4603 mov r3, r0 8000eea: 461a mov r2, r3 8000eec: f107 0318 add.w r3, r7, #24 8000ef0: 4413 add r3, r2 8000ef2: 494c ldr r1, [pc, #304] ; (8001024 ) 8000ef4: 461a mov r2, r3 8000ef6: 460b mov r3, r1 8000ef8: 881b ldrh r3, [r3, #0] 8000efa: 8013 strh r3, [r2, #0] strcat(str_year, "_"); 8000efc: 1d3b adds r3, r7, #4 8000efe: 4618 mov r0, r3 8000f00: f7ff f93c bl 800017c 8000f04: 4603 mov r3, r0 8000f06: 461a mov r2, r3 8000f08: 1d3b adds r3, r7, #4 8000f0a: 4413 add r3, r2 8000f0c: 4946 ldr r1, [pc, #280] ; (8001028 ) 8000f0e: 461a mov r2, r3 8000f10: 460b mov r3, r1 8000f12: 881b ldrh r3, [r3, #0] 8000f14: 8013 strh r3, [r2, #0] strcat(txtVar, str_month); 8000f16: f107 0318 add.w r3, r7, #24 8000f1a: 4619 mov r1, r3 8000f1c: 4840 ldr r0, [pc, #256] ; (8001020 ) 8000f1e: f006 f989 bl 8007234 strcat(txtVar, str_year); 8000f22: 1d3b adds r3, r7, #4 8000f24: 4619 mov r1, r3 8000f26: 483e ldr r0, [pc, #248] ; (8001020 ) 8000f28: f006 f984 bl 8007234 strcat(txtVar, "Values.txt"); 8000f2c: 483c ldr r0, [pc, #240] ; (8001020 ) 8000f2e: f7ff f925 bl 800017c 8000f32: 4603 mov r3, r0 8000f34: 461a mov r2, r3 8000f36: 4b3a ldr r3, [pc, #232] ; (8001020 ) 8000f38: 4413 add r3, r2 8000f3a: 493c ldr r1, [pc, #240] ; (800102c ) 8000f3c: 461a mov r2, r3 8000f3e: 460b mov r3, r1 8000f40: cb03 ldmia r3!, {r0, r1} 8000f42: 6010 str r0, [r2, #0] 8000f44: 6051 str r1, [r2, #4] 8000f46: 8819 ldrh r1, [r3, #0] 8000f48: 789b ldrb r3, [r3, #2] 8000f4a: 8111 strh r1, [r2, #8] 8000f4c: 7293 strb r3, [r2, #10] /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ HAL_Delay(5000); 8000f4e: f241 3088 movw r0, #5000 ; 0x1388 8000f52: f000 fc0d bl 8001770 // Start ADC Conversion HAL_ADC_Start(&hadc); 8000f56: 4836 ldr r0, [pc, #216] ; (8001030 ) 8000f58: f000 fd72 bl 8001a40 // Poll ADC1 Perihperal & TimeOut = 1mSec HAL_ADC_PollForConversion(&hadc, 1); 8000f5c: 2101 movs r1, #1 8000f5e: 4834 ldr r0, [pc, #208] ; (8001030 ) 8000f60: f000 fdce bl 8001b00 // Read The ADC Conversion Result AD_RES = HAL_ADC_GetValue(&hadc); 8000f64: 4832 ldr r0, [pc, #200] ; (8001030 ) 8000f66: f000 fe54 bl 8001c12 8000f6a: 4603 mov r3, r0 8000f6c: b29a uxth r2, r3 8000f6e: 4b31 ldr r3, [pc, #196] ; (8001034 ) 8000f70: 801a strh r2, [r3, #0] num++; 8000f72: 4b31 ldr r3, [pc, #196] ; (8001038 ) 8000f74: 681b ldr r3, [r3, #0] 8000f76: 3301 adds r3, #1 8000f78: 4a2f ldr r2, [pc, #188] ; (8001038 ) 8000f7a: 6013 str r3, [r2, #0] // FA_OPEN_APPEND opens file if it exists and if not then creates it, // the pointer is set at the end of the file for appending fres = f_open(&fil, txtVar, FA_OPEN_APPEND | FA_WRITE | FA_READ); 8000f7c: 2233 movs r2, #51 ; 0x33 8000f7e: 4928 ldr r1, [pc, #160] ; (8001020 ) 8000f80: 482e ldr r0, [pc, #184] ; (800103c ) 8000f82: f005 f925 bl 80061d0 8000f86: 4603 mov r3, r0 8000f88: 461a mov r2, r3 8000f8a: 4b21 ldr r3, [pc, #132] ; (8001010 ) 8000f8c: 701a strb r2, [r3, #0] if (fres == FR_OK) { 8000f8e: 4b20 ldr r3, [pc, #128] ; (8001010 ) 8000f90: 781b ldrb r3, [r3, #0] 8000f92: 2b00 cmp r3, #0 8000f94: d103 bne.n 8000f9e transmit_uart("File opened.\r\n"); 8000f96: 482a ldr r0, [pc, #168] ; (8001040 ) 8000f98: f7ff ff3e bl 8000e18 8000f9c: e006 b.n 8000fac } else if (fres != FR_OK) { 8000f9e: 4b1c ldr r3, [pc, #112] ; (8001010 ) 8000fa0: 781b ldrb r3, [r3, #0] 8000fa2: 2b00 cmp r3, #0 8000fa4: d002 beq.n 8000fac transmit_uart("File was not opened!\r\n"); 8000fa6: 4827 ldr r0, [pc, #156] ; (8001044 ) 8000fa8: f7ff ff36 bl 8000e18 } f_puts("ADC_value_", &fil); 8000fac: 4923 ldr r1, [pc, #140] ; (800103c ) 8000fae: 4826 ldr r0, [pc, #152] ; (8001048 ) 8000fb0: f005 fd8d bl 8006ace f_printf(&fil, "%d", num); 8000fb4: 4b20 ldr r3, [pc, #128] ; (8001038 ) 8000fb6: 681b ldr r3, [r3, #0] 8000fb8: 461a mov r2, r3 8000fba: 4924 ldr r1, [pc, #144] ; (800104c ) 8000fbc: 481f ldr r0, [pc, #124] ; (800103c ) 8000fbe: f005 fdab bl 8006b18 f_puts(" = ", &fil); 8000fc2: 491e ldr r1, [pc, #120] ; (800103c ) 8000fc4: 4822 ldr r0, [pc, #136] ; (8001050 ) 8000fc6: f005 fd82 bl 8006ace f_printf(&fil, "%d\n", AD_RES); 8000fca: 4b1a ldr r3, [pc, #104] ; (8001034 ) 8000fcc: 881b ldrh r3, [r3, #0] 8000fce: 461a mov r2, r3 8000fd0: 4920 ldr r1, [pc, #128] ; (8001054 ) 8000fd2: 481a ldr r0, [pc, #104] ; (800103c ) 8000fd4: f005 fda0 bl 8006b18 /* Close file */ fres = f_close(&fil); 8000fd8: 4818 ldr r0, [pc, #96] ; (800103c ) 8000fda: f005 fcd7 bl 800698c 8000fde: 4603 mov r3, r0 8000fe0: 461a mov r2, r3 8000fe2: 4b0b ldr r3, [pc, #44] ; (8001010 ) 8000fe4: 701a strb r2, [r3, #0] if (fres == FR_OK) { 8000fe6: 4b0a ldr r3, [pc, #40] ; (8001010 ) 8000fe8: 781b ldrb r3, [r3, #0] 8000fea: 2b00 cmp r3, #0 8000fec: d103 bne.n 8000ff6 transmit_uart("File is closed.\r\n"); 8000fee: 481a ldr r0, [pc, #104] ; (8001058 ) 8000ff0: f7ff ff12 bl 8000e18 8000ff4: e7ab b.n 8000f4e } else if (fres != FR_OK) { 8000ff6: 4b06 ldr r3, [pc, #24] ; (8001010 ) 8000ff8: 781b ldrb r3, [r3, #0] 8000ffa: 2b00 cmp r3, #0 8000ffc: d0a7 beq.n 8000f4e transmit_uart("File was not closed.\r\n"); 8000ffe: 4817 ldr r0, [pc, #92] ; (800105c ) 8001000: f7ff ff0a bl 8000e18 HAL_Delay(5000); 8001004: e7a3 b.n 8000f4e 8001006: bf00 nop 8001008: 08007a50 .word 0x08007a50 800100c: 200002f4 .word 0x200002f4 8001010: 20001438 .word 0x20001438 8001014: 08007a54 .word 0x08007a54 8001018: 08007a78 .word 0x08007a78 800101c: 08007a94 .word 0x08007a94 8001020: 2000143c .word 0x2000143c 8001024: 08007a98 .word 0x08007a98 8001028: 08007a9c .word 0x08007a9c 800102c: 08007aa0 .word 0x08007aa0 8001030: 20001458 .word 0x20001458 8001034: 200002f0 .word 0x200002f0 8001038: 20001394 .word 0x20001394 800103c: 200014ac .word 0x200014ac 8001040: 08007aac .word 0x08007aac 8001044: 08007abc .word 0x08007abc 8001048: 08007ad4 .word 0x08007ad4 800104c: 08007ae0 .word 0x08007ae0 8001050: 08007ae4 .word 0x08007ae4 8001054: 08007ae8 .word 0x08007ae8 8001058: 08007aec .word 0x08007aec 800105c: 08007b00 .word 0x08007b00 08001060 : /** * @brief System Clock Configuration * @retval None */ void SystemClock_Config(void) { 8001060: b580 push {r7, lr} 8001062: b092 sub sp, #72 ; 0x48 8001064: af00 add r7, sp, #0 RCC_OscInitTypeDef RCC_OscInitStruct = {0}; 8001066: f107 0314 add.w r3, r7, #20 800106a: 2234 movs r2, #52 ; 0x34 800106c: 2100 movs r1, #0 800106e: 4618 mov r0, r3 8001070: f006 f8b8 bl 80071e4 RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; 8001074: 463b mov r3, r7 8001076: 2200 movs r2, #0 8001078: 601a str r2, [r3, #0] 800107a: 605a str r2, [r3, #4] 800107c: 609a str r2, [r3, #8] 800107e: 60da str r2, [r3, #12] 8001080: 611a str r2, [r3, #16] /** Configure the main internal regulator output voltage */ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); 8001082: 4b1d ldr r3, [pc, #116] ; (80010f8 ) 8001084: 681b ldr r3, [r3, #0] 8001086: f423 53c0 bic.w r3, r3, #6144 ; 0x1800 800108a: 4a1b ldr r2, [pc, #108] ; (80010f8 ) 800108c: f443 6300 orr.w r3, r3, #2048 ; 0x800 8001090: 6013 str r3, [r2, #0] /** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDef structure. */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; 8001092: 2302 movs r3, #2 8001094: 617b str r3, [r7, #20] RCC_OscInitStruct.HSIState = RCC_HSI_ON; 8001096: 2301 movs r3, #1 8001098: 623b str r3, [r7, #32] RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; 800109a: 2310 movs r3, #16 800109c: 627b str r3, [r7, #36] ; 0x24 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; 800109e: 2302 movs r3, #2 80010a0: 63bb str r3, [r7, #56] ; 0x38 RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; 80010a2: 2300 movs r3, #0 80010a4: 63fb str r3, [r7, #60] ; 0x3c RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6; 80010a6: f44f 2300 mov.w r3, #524288 ; 0x80000 80010aa: 643b str r3, [r7, #64] ; 0x40 RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3; 80010ac: f44f 0300 mov.w r3, #8388608 ; 0x800000 80010b0: 647b str r3, [r7, #68] ; 0x44 if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) 80010b2: f107 0314 add.w r3, r7, #20 80010b6: 4618 mov r0, r3 80010b8: f001 fa10 bl 80024dc 80010bc: 4603 mov r3, r0 80010be: 2b00 cmp r3, #0 80010c0: d001 beq.n 80010c6 { Error_Handler(); 80010c2: f000 f93d bl 8001340 } /** Initializes the CPU, AHB and APB buses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK 80010c6: 230f movs r3, #15 80010c8: 603b str r3, [r7, #0] |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; 80010ca: 2303 movs r3, #3 80010cc: 607b str r3, [r7, #4] RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; 80010ce: 2300 movs r3, #0 80010d0: 60bb str r3, [r7, #8] RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; 80010d2: 2300 movs r3, #0 80010d4: 60fb str r3, [r7, #12] RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; 80010d6: 2300 movs r3, #0 80010d8: 613b str r3, [r7, #16] if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) 80010da: 463b mov r3, r7 80010dc: 2101 movs r1, #1 80010de: 4618 mov r0, r3 80010e0: f001 fd2c bl 8002b3c 80010e4: 4603 mov r3, r0 80010e6: 2b00 cmp r3, #0 80010e8: d001 beq.n 80010ee { Error_Handler(); 80010ea: f000 f929 bl 8001340 } } 80010ee: bf00 nop 80010f0: 3748 adds r7, #72 ; 0x48 80010f2: 46bd mov sp, r7 80010f4: bd80 pop {r7, pc} 80010f6: bf00 nop 80010f8: 40007000 .word 0x40007000 080010fc : * @brief ADC Initialization Function * @param None * @retval None */ static void MX_ADC_Init(void) { 80010fc: b580 push {r7, lr} 80010fe: b084 sub sp, #16 8001100: af00 add r7, sp, #0 /* USER CODE BEGIN ADC_Init 0 */ /* USER CODE END ADC_Init 0 */ ADC_ChannelConfTypeDef sConfig = {0}; 8001102: 1d3b adds r3, r7, #4 8001104: 2200 movs r2, #0 8001106: 601a str r2, [r3, #0] 8001108: 605a str r2, [r3, #4] 800110a: 609a str r2, [r3, #8] /* USER CODE BEGIN ADC_Init 1 */ /* USER CODE END ADC_Init 1 */ /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) */ hadc.Instance = ADC1; 800110c: 4b26 ldr r3, [pc, #152] ; (80011a8 ) 800110e: 4a27 ldr r2, [pc, #156] ; (80011ac ) 8001110: 601a str r2, [r3, #0] hadc.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; 8001112: 4b25 ldr r3, [pc, #148] ; (80011a8 ) 8001114: 2200 movs r2, #0 8001116: 605a str r2, [r3, #4] hadc.Init.Resolution = ADC_RESOLUTION_12B; 8001118: 4b23 ldr r3, [pc, #140] ; (80011a8 ) 800111a: 2200 movs r2, #0 800111c: 609a str r2, [r3, #8] hadc.Init.DataAlign = ADC_DATAALIGN_RIGHT; 800111e: 4b22 ldr r3, [pc, #136] ; (80011a8 ) 8001120: 2200 movs r2, #0 8001122: 60da str r2, [r3, #12] hadc.Init.ScanConvMode = ADC_SCAN_DISABLE; 8001124: 4b20 ldr r3, [pc, #128] ; (80011a8 ) 8001126: 2200 movs r2, #0 8001128: 611a str r2, [r3, #16] hadc.Init.EOCSelection = ADC_EOC_SINGLE_CONV; 800112a: 4b1f ldr r3, [pc, #124] ; (80011a8 ) 800112c: f44f 6280 mov.w r2, #1024 ; 0x400 8001130: 615a str r2, [r3, #20] hadc.Init.LowPowerAutoWait = ADC_AUTOWAIT_DISABLE; 8001132: 4b1d ldr r3, [pc, #116] ; (80011a8 ) 8001134: 2200 movs r2, #0 8001136: 619a str r2, [r3, #24] hadc.Init.LowPowerAutoPowerOff = ADC_AUTOPOWEROFF_DISABLE; 8001138: 4b1b ldr r3, [pc, #108] ; (80011a8 ) 800113a: 2200 movs r2, #0 800113c: 61da str r2, [r3, #28] hadc.Init.ChannelsBank = ADC_CHANNELS_BANK_A; 800113e: 4b1a ldr r3, [pc, #104] ; (80011a8 ) 8001140: 2200 movs r2, #0 8001142: 621a str r2, [r3, #32] hadc.Init.ContinuousConvMode = DISABLE; 8001144: 4b18 ldr r3, [pc, #96] ; (80011a8 ) 8001146: 2200 movs r2, #0 8001148: f883 2024 strb.w r2, [r3, #36] ; 0x24 hadc.Init.NbrOfConversion = 1; 800114c: 4b16 ldr r3, [pc, #88] ; (80011a8 ) 800114e: 2201 movs r2, #1 8001150: 629a str r2, [r3, #40] ; 0x28 hadc.Init.DiscontinuousConvMode = DISABLE; 8001152: 4b15 ldr r3, [pc, #84] ; (80011a8 ) 8001154: 2200 movs r2, #0 8001156: f883 202c strb.w r2, [r3, #44] ; 0x2c hadc.Init.ExternalTrigConv = ADC_SOFTWARE_START; 800115a: 4b13 ldr r3, [pc, #76] ; (80011a8 ) 800115c: 2210 movs r2, #16 800115e: 635a str r2, [r3, #52] ; 0x34 hadc.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; 8001160: 4b11 ldr r3, [pc, #68] ; (80011a8 ) 8001162: 2200 movs r2, #0 8001164: 639a str r2, [r3, #56] ; 0x38 hadc.Init.DMAContinuousRequests = DISABLE; 8001166: 4b10 ldr r3, [pc, #64] ; (80011a8 ) 8001168: 2200 movs r2, #0 800116a: f883 203c strb.w r2, [r3, #60] ; 0x3c if (HAL_ADC_Init(&hadc) != HAL_OK) 800116e: 480e ldr r0, [pc, #56] ; (80011a8 ) 8001170: f000 fb20 bl 80017b4 8001174: 4603 mov r3, r0 8001176: 2b00 cmp r3, #0 8001178: d001 beq.n 800117e { Error_Handler(); 800117a: f000 f8e1 bl 8001340 } /** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. */ sConfig.Channel = ADC_CHANNEL_0; 800117e: 2300 movs r3, #0 8001180: 607b str r3, [r7, #4] sConfig.Rank = ADC_REGULAR_RANK_1; 8001182: 2301 movs r3, #1 8001184: 60bb str r3, [r7, #8] sConfig.SamplingTime = ADC_SAMPLETIME_384CYCLES; 8001186: 2307 movs r3, #7 8001188: 60fb str r3, [r7, #12] if (HAL_ADC_ConfigChannel(&hadc, &sConfig) != HAL_OK) 800118a: 1d3b adds r3, r7, #4 800118c: 4619 mov r1, r3 800118e: 4806 ldr r0, [pc, #24] ; (80011a8 ) 8001190: f000 fd4c bl 8001c2c 8001194: 4603 mov r3, r0 8001196: 2b00 cmp r3, #0 8001198: d001 beq.n 800119e { Error_Handler(); 800119a: f000 f8d1 bl 8001340 } /* USER CODE BEGIN ADC_Init 2 */ /* USER CODE END ADC_Init 2 */ } 800119e: bf00 nop 80011a0: 3710 adds r7, #16 80011a2: 46bd mov sp, r7 80011a4: bd80 pop {r7, pc} 80011a6: bf00 nop 80011a8: 20001458 .word 0x20001458 80011ac: 40012400 .word 0x40012400 080011b0 : * @brief SPI1 Initialization Function * @param None * @retval None */ static void MX_SPI1_Init(void) { 80011b0: b580 push {r7, lr} 80011b2: af00 add r7, sp, #0 /* USER CODE BEGIN SPI1_Init 1 */ /* USER CODE END SPI1_Init 1 */ /* SPI1 parameter configuration*/ hspi1.Instance = SPI1; 80011b4: 4b17 ldr r3, [pc, #92] ; (8001214 ) 80011b6: 4a18 ldr r2, [pc, #96] ; (8001218 ) 80011b8: 601a str r2, [r3, #0] hspi1.Init.Mode = SPI_MODE_MASTER; 80011ba: 4b16 ldr r3, [pc, #88] ; (8001214 ) 80011bc: f44f 7282 mov.w r2, #260 ; 0x104 80011c0: 605a str r2, [r3, #4] hspi1.Init.Direction = SPI_DIRECTION_2LINES; 80011c2: 4b14 ldr r3, [pc, #80] ; (8001214 ) 80011c4: 2200 movs r2, #0 80011c6: 609a str r2, [r3, #8] hspi1.Init.DataSize = SPI_DATASIZE_8BIT; 80011c8: 4b12 ldr r3, [pc, #72] ; (8001214 ) 80011ca: 2200 movs r2, #0 80011cc: 60da str r2, [r3, #12] hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; 80011ce: 4b11 ldr r3, [pc, #68] ; (8001214 ) 80011d0: 2200 movs r2, #0 80011d2: 611a str r2, [r3, #16] hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; 80011d4: 4b0f ldr r3, [pc, #60] ; (8001214 ) 80011d6: 2200 movs r2, #0 80011d8: 615a str r2, [r3, #20] hspi1.Init.NSS = SPI_NSS_SOFT; 80011da: 4b0e ldr r3, [pc, #56] ; (8001214 ) 80011dc: f44f 7200 mov.w r2, #512 ; 0x200 80011e0: 619a str r2, [r3, #24] hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4; 80011e2: 4b0c ldr r3, [pc, #48] ; (8001214 ) 80011e4: 2208 movs r2, #8 80011e6: 61da str r2, [r3, #28] hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; 80011e8: 4b0a ldr r3, [pc, #40] ; (8001214 ) 80011ea: 2200 movs r2, #0 80011ec: 621a str r2, [r3, #32] hspi1.Init.TIMode = SPI_TIMODE_DISABLE; 80011ee: 4b09 ldr r3, [pc, #36] ; (8001214 ) 80011f0: 2200 movs r2, #0 80011f2: 625a str r2, [r3, #36] ; 0x24 hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; 80011f4: 4b07 ldr r3, [pc, #28] ; (8001214 ) 80011f6: 2200 movs r2, #0 80011f8: 629a str r2, [r3, #40] ; 0x28 hspi1.Init.CRCPolynomial = 10; 80011fa: 4b06 ldr r3, [pc, #24] ; (8001214 ) 80011fc: 220a movs r2, #10 80011fe: 62da str r2, [r3, #44] ; 0x2c if (HAL_SPI_Init(&hspi1) != HAL_OK) 8001200: 4804 ldr r0, [pc, #16] ; (8001214 ) 8001202: f001 ff2b bl 800305c 8001206: 4603 mov r3, r0 8001208: 2b00 cmp r3, #0 800120a: d001 beq.n 8001210 { Error_Handler(); 800120c: f000 f898 bl 8001340 } /* USER CODE BEGIN SPI1_Init 2 */ /* USER CODE END SPI1_Init 2 */ } 8001210: bf00 nop 8001212: bd80 pop {r7, pc} 8001214: 200013a0 .word 0x200013a0 8001218: 40013000 .word 0x40013000 0800121c : * @brief USART2 Initialization Function * @param None * @retval None */ static void MX_USART2_UART_Init(void) { 800121c: b580 push {r7, lr} 800121e: af00 add r7, sp, #0 /* USER CODE END USART2_Init 0 */ /* USER CODE BEGIN USART2_Init 1 */ /* USER CODE END USART2_Init 1 */ huart2.Instance = USART2; 8001220: 4b11 ldr r3, [pc, #68] ; (8001268 ) 8001222: 4a12 ldr r2, [pc, #72] ; (800126c ) 8001224: 601a str r2, [r3, #0] huart2.Init.BaudRate = 115200; 8001226: 4b10 ldr r3, [pc, #64] ; (8001268 ) 8001228: f44f 32e1 mov.w r2, #115200 ; 0x1c200 800122c: 605a str r2, [r3, #4] huart2.Init.WordLength = UART_WORDLENGTH_8B; 800122e: 4b0e ldr r3, [pc, #56] ; (8001268 ) 8001230: 2200 movs r2, #0 8001232: 609a str r2, [r3, #8] huart2.Init.StopBits = UART_STOPBITS_1; 8001234: 4b0c ldr r3, [pc, #48] ; (8001268 ) 8001236: 2200 movs r2, #0 8001238: 60da str r2, [r3, #12] huart2.Init.Parity = UART_PARITY_NONE; 800123a: 4b0b ldr r3, [pc, #44] ; (8001268 ) 800123c: 2200 movs r2, #0 800123e: 611a str r2, [r3, #16] huart2.Init.Mode = UART_MODE_TX_RX; 8001240: 4b09 ldr r3, [pc, #36] ; (8001268 ) 8001242: 220c movs r2, #12 8001244: 615a str r2, [r3, #20] huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; 8001246: 4b08 ldr r3, [pc, #32] ; (8001268 ) 8001248: 2200 movs r2, #0 800124a: 619a str r2, [r3, #24] huart2.Init.OverSampling = UART_OVERSAMPLING_16; 800124c: 4b06 ldr r3, [pc, #24] ; (8001268 ) 800124e: 2200 movs r2, #0 8001250: 61da str r2, [r3, #28] if (HAL_UART_Init(&huart2) != HAL_OK) 8001252: 4805 ldr r0, [pc, #20] ; (8001268 ) 8001254: f002 fb34 bl 80038c0 8001258: 4603 mov r3, r0 800125a: 2b00 cmp r3, #0 800125c: d001 beq.n 8001262 { Error_Handler(); 800125e: f000 f86f bl 8001340 } /* USER CODE BEGIN USART2_Init 2 */ /* USER CODE END USART2_Init 2 */ } 8001262: bf00 nop 8001264: bd80 pop {r7, pc} 8001266: bf00 nop 8001268: 200013f8 .word 0x200013f8 800126c: 40004400 .word 0x40004400 08001270 : * @brief GPIO Initialization Function * @param None * @retval None */ static void MX_GPIO_Init(void) { 8001270: b580 push {r7, lr} 8001272: b08a sub sp, #40 ; 0x28 8001274: af00 add r7, sp, #0 GPIO_InitTypeDef GPIO_InitStruct = {0}; 8001276: f107 0314 add.w r3, r7, #20 800127a: 2200 movs r2, #0 800127c: 601a str r2, [r3, #0] 800127e: 605a str r2, [r3, #4] 8001280: 609a str r2, [r3, #8] 8001282: 60da str r2, [r3, #12] 8001284: 611a str r2, [r3, #16] /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); 8001286: 4b2a ldr r3, [pc, #168] ; (8001330 ) 8001288: 69db ldr r3, [r3, #28] 800128a: 4a29 ldr r2, [pc, #164] ; (8001330 ) 800128c: f043 0304 orr.w r3, r3, #4 8001290: 61d3 str r3, [r2, #28] 8001292: 4b27 ldr r3, [pc, #156] ; (8001330 ) 8001294: 69db ldr r3, [r3, #28] 8001296: f003 0304 and.w r3, r3, #4 800129a: 613b str r3, [r7, #16] 800129c: 693b ldr r3, [r7, #16] __HAL_RCC_GPIOH_CLK_ENABLE(); 800129e: 4b24 ldr r3, [pc, #144] ; (8001330 ) 80012a0: 69db ldr r3, [r3, #28] 80012a2: 4a23 ldr r2, [pc, #140] ; (8001330 ) 80012a4: f043 0320 orr.w r3, r3, #32 80012a8: 61d3 str r3, [r2, #28] 80012aa: 4b21 ldr r3, [pc, #132] ; (8001330 ) 80012ac: 69db ldr r3, [r3, #28] 80012ae: f003 0320 and.w r3, r3, #32 80012b2: 60fb str r3, [r7, #12] 80012b4: 68fb ldr r3, [r7, #12] __HAL_RCC_GPIOA_CLK_ENABLE(); 80012b6: 4b1e ldr r3, [pc, #120] ; (8001330 ) 80012b8: 69db ldr r3, [r3, #28] 80012ba: 4a1d ldr r2, [pc, #116] ; (8001330 ) 80012bc: f043 0301 orr.w r3, r3, #1 80012c0: 61d3 str r3, [r2, #28] 80012c2: 4b1b ldr r3, [pc, #108] ; (8001330 ) 80012c4: 69db ldr r3, [r3, #28] 80012c6: f003 0301 and.w r3, r3, #1 80012ca: 60bb str r3, [r7, #8] 80012cc: 68bb ldr r3, [r7, #8] __HAL_RCC_GPIOB_CLK_ENABLE(); 80012ce: 4b18 ldr r3, [pc, #96] ; (8001330 ) 80012d0: 69db ldr r3, [r3, #28] 80012d2: 4a17 ldr r2, [pc, #92] ; (8001330 ) 80012d4: f043 0302 orr.w r3, r3, #2 80012d8: 61d3 str r3, [r2, #28] 80012da: 4b15 ldr r3, [pc, #84] ; (8001330 ) 80012dc: 69db ldr r3, [r3, #28] 80012de: f003 0302 and.w r3, r3, #2 80012e2: 607b str r3, [r7, #4] 80012e4: 687b ldr r3, [r7, #4] /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET); 80012e6: 2201 movs r2, #1 80012e8: 2140 movs r1, #64 ; 0x40 80012ea: 4812 ldr r0, [pc, #72] ; (8001334 ) 80012ec: f001 f8de bl 80024ac /*Configure GPIO pin : B1_Pin */ GPIO_InitStruct.Pin = B1_Pin; 80012f0: f44f 5300 mov.w r3, #8192 ; 0x2000 80012f4: 617b str r3, [r7, #20] GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; 80012f6: 4b10 ldr r3, [pc, #64] ; (8001338 ) 80012f8: 61bb str r3, [r7, #24] GPIO_InitStruct.Pull = GPIO_NOPULL; 80012fa: 2300 movs r3, #0 80012fc: 61fb str r3, [r7, #28] HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct); 80012fe: f107 0314 add.w r3, r7, #20 8001302: 4619 mov r1, r3 8001304: 480d ldr r0, [pc, #52] ; (800133c ) 8001306: f000 ff43 bl 8002190 /*Configure GPIO pin : PB6 */ GPIO_InitStruct.Pin = GPIO_PIN_6; 800130a: 2340 movs r3, #64 ; 0x40 800130c: 617b str r3, [r7, #20] GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 800130e: 2301 movs r3, #1 8001310: 61bb str r3, [r7, #24] GPIO_InitStruct.Pull = GPIO_NOPULL; 8001312: 2300 movs r3, #0 8001314: 61fb str r3, [r7, #28] GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; 8001316: 2302 movs r3, #2 8001318: 623b str r3, [r7, #32] HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); 800131a: f107 0314 add.w r3, r7, #20 800131e: 4619 mov r1, r3 8001320: 4804 ldr r0, [pc, #16] ; (8001334 ) 8001322: f000 ff35 bl 8002190 } 8001326: bf00 nop 8001328: 3728 adds r7, #40 ; 0x28 800132a: 46bd mov sp, r7 800132c: bd80 pop {r7, pc} 800132e: bf00 nop 8001330: 40023800 .word 0x40023800 8001334: 40020400 .word 0x40020400 8001338: 10110000 .word 0x10110000 800133c: 40020800 .word 0x40020800 08001340 : /** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { 8001340: b480 push {r7} 8001342: af00 add r7, sp, #0 /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ /* USER CODE END Error_Handler_Debug */ } 8001344: bf00 nop 8001346: 46bd mov sp, r7 8001348: bc80 pop {r7} 800134a: 4770 bx lr 0800134c : /* USER CODE END 0 */ /** * Initializes the Global MSP. */ void HAL_MspInit(void) { 800134c: b580 push {r7, lr} 800134e: b084 sub sp, #16 8001350: af00 add r7, sp, #0 /* USER CODE BEGIN MspInit 0 */ /* USER CODE END MspInit 0 */ __HAL_RCC_COMP_CLK_ENABLE(); 8001352: 4b15 ldr r3, [pc, #84] ; (80013a8 ) 8001354: 6a5b ldr r3, [r3, #36] ; 0x24 8001356: 4a14 ldr r2, [pc, #80] ; (80013a8 ) 8001358: f043 4300 orr.w r3, r3, #2147483648 ; 0x80000000 800135c: 6253 str r3, [r2, #36] ; 0x24 800135e: 4b12 ldr r3, [pc, #72] ; (80013a8 ) 8001360: 6a5b ldr r3, [r3, #36] ; 0x24 8001362: f003 4300 and.w r3, r3, #2147483648 ; 0x80000000 8001366: 60fb str r3, [r7, #12] 8001368: 68fb ldr r3, [r7, #12] __HAL_RCC_SYSCFG_CLK_ENABLE(); 800136a: 4b0f ldr r3, [pc, #60] ; (80013a8 ) 800136c: 6a1b ldr r3, [r3, #32] 800136e: 4a0e ldr r2, [pc, #56] ; (80013a8 ) 8001370: f043 0301 orr.w r3, r3, #1 8001374: 6213 str r3, [r2, #32] 8001376: 4b0c ldr r3, [pc, #48] ; (80013a8 ) 8001378: 6a1b ldr r3, [r3, #32] 800137a: f003 0301 and.w r3, r3, #1 800137e: 60bb str r3, [r7, #8] 8001380: 68bb ldr r3, [r7, #8] __HAL_RCC_PWR_CLK_ENABLE(); 8001382: 4b09 ldr r3, [pc, #36] ; (80013a8 ) 8001384: 6a5b ldr r3, [r3, #36] ; 0x24 8001386: 4a08 ldr r2, [pc, #32] ; (80013a8 ) 8001388: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000 800138c: 6253 str r3, [r2, #36] ; 0x24 800138e: 4b06 ldr r3, [pc, #24] ; (80013a8 ) 8001390: 6a5b ldr r3, [r3, #36] ; 0x24 8001392: f003 5380 and.w r3, r3, #268435456 ; 0x10000000 8001396: 607b str r3, [r7, #4] 8001398: 687b ldr r3, [r7, #4] HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0); 800139a: 2007 movs r0, #7 800139c: f000 feb8 bl 8002110 /* System interrupt init*/ /* USER CODE BEGIN MspInit 1 */ /* USER CODE END MspInit 1 */ } 80013a0: bf00 nop 80013a2: 3710 adds r7, #16 80013a4: 46bd mov sp, r7 80013a6: bd80 pop {r7, pc} 80013a8: 40023800 .word 0x40023800 080013ac : * This function configures the hardware resources used in this example * @param hadc: ADC handle pointer * @retval None */ void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc) { 80013ac: b580 push {r7, lr} 80013ae: b08a sub sp, #40 ; 0x28 80013b0: af00 add r7, sp, #0 80013b2: 6078 str r0, [r7, #4] GPIO_InitTypeDef GPIO_InitStruct = {0}; 80013b4: f107 0314 add.w r3, r7, #20 80013b8: 2200 movs r2, #0 80013ba: 601a str r2, [r3, #0] 80013bc: 605a str r2, [r3, #4] 80013be: 609a str r2, [r3, #8] 80013c0: 60da str r2, [r3, #12] 80013c2: 611a str r2, [r3, #16] if(hadc->Instance==ADC1) 80013c4: 687b ldr r3, [r7, #4] 80013c6: 681b ldr r3, [r3, #0] 80013c8: 4a15 ldr r2, [pc, #84] ; (8001420 ) 80013ca: 4293 cmp r3, r2 80013cc: d123 bne.n 8001416 { /* USER CODE BEGIN ADC1_MspInit 0 */ /* USER CODE END ADC1_MspInit 0 */ /* Peripheral clock enable */ __HAL_RCC_ADC1_CLK_ENABLE(); 80013ce: 4b15 ldr r3, [pc, #84] ; (8001424 ) 80013d0: 6a1b ldr r3, [r3, #32] 80013d2: 4a14 ldr r2, [pc, #80] ; (8001424 ) 80013d4: f443 7300 orr.w r3, r3, #512 ; 0x200 80013d8: 6213 str r3, [r2, #32] 80013da: 4b12 ldr r3, [pc, #72] ; (8001424 ) 80013dc: 6a1b ldr r3, [r3, #32] 80013de: f403 7300 and.w r3, r3, #512 ; 0x200 80013e2: 613b str r3, [r7, #16] 80013e4: 693b ldr r3, [r7, #16] __HAL_RCC_GPIOA_CLK_ENABLE(); 80013e6: 4b0f ldr r3, [pc, #60] ; (8001424 ) 80013e8: 69db ldr r3, [r3, #28] 80013ea: 4a0e ldr r2, [pc, #56] ; (8001424 ) 80013ec: f043 0301 orr.w r3, r3, #1 80013f0: 61d3 str r3, [r2, #28] 80013f2: 4b0c ldr r3, [pc, #48] ; (8001424 ) 80013f4: 69db ldr r3, [r3, #28] 80013f6: f003 0301 and.w r3, r3, #1 80013fa: 60fb str r3, [r7, #12] 80013fc: 68fb ldr r3, [r7, #12] /**ADC GPIO Configuration PA0-WKUP1 ------> ADC_IN0 */ GPIO_InitStruct.Pin = GPIO_PIN_0; 80013fe: 2301 movs r3, #1 8001400: 617b str r3, [r7, #20] GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 8001402: 2303 movs r3, #3 8001404: 61bb str r3, [r7, #24] GPIO_InitStruct.Pull = GPIO_NOPULL; 8001406: 2300 movs r3, #0 8001408: 61fb str r3, [r7, #28] HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 800140a: f107 0314 add.w r3, r7, #20 800140e: 4619 mov r1, r3 8001410: 4805 ldr r0, [pc, #20] ; (8001428 ) 8001412: f000 febd bl 8002190 /* USER CODE BEGIN ADC1_MspInit 1 */ /* USER CODE END ADC1_MspInit 1 */ } } 8001416: bf00 nop 8001418: 3728 adds r7, #40 ; 0x28 800141a: 46bd mov sp, r7 800141c: bd80 pop {r7, pc} 800141e: bf00 nop 8001420: 40012400 .word 0x40012400 8001424: 40023800 .word 0x40023800 8001428: 40020000 .word 0x40020000 0800142c : * This function configures the hardware resources used in this example * @param hspi: SPI handle pointer * @retval None */ void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi) { 800142c: b580 push {r7, lr} 800142e: b08a sub sp, #40 ; 0x28 8001430: af00 add r7, sp, #0 8001432: 6078 str r0, [r7, #4] GPIO_InitTypeDef GPIO_InitStruct = {0}; 8001434: f107 0314 add.w r3, r7, #20 8001438: 2200 movs r2, #0 800143a: 601a str r2, [r3, #0] 800143c: 605a str r2, [r3, #4] 800143e: 609a str r2, [r3, #8] 8001440: 60da str r2, [r3, #12] 8001442: 611a str r2, [r3, #16] if(hspi->Instance==SPI1) 8001444: 687b ldr r3, [r7, #4] 8001446: 681b ldr r3, [r3, #0] 8001448: 4a17 ldr r2, [pc, #92] ; (80014a8 ) 800144a: 4293 cmp r3, r2 800144c: d127 bne.n 800149e { /* USER CODE BEGIN SPI1_MspInit 0 */ /* USER CODE END SPI1_MspInit 0 */ /* Peripheral clock enable */ __HAL_RCC_SPI1_CLK_ENABLE(); 800144e: 4b17 ldr r3, [pc, #92] ; (80014ac ) 8001450: 6a1b ldr r3, [r3, #32] 8001452: 4a16 ldr r2, [pc, #88] ; (80014ac ) 8001454: f443 5380 orr.w r3, r3, #4096 ; 0x1000 8001458: 6213 str r3, [r2, #32] 800145a: 4b14 ldr r3, [pc, #80] ; (80014ac ) 800145c: 6a1b ldr r3, [r3, #32] 800145e: f403 5380 and.w r3, r3, #4096 ; 0x1000 8001462: 613b str r3, [r7, #16] 8001464: 693b ldr r3, [r7, #16] __HAL_RCC_GPIOA_CLK_ENABLE(); 8001466: 4b11 ldr r3, [pc, #68] ; (80014ac ) 8001468: 69db ldr r3, [r3, #28] 800146a: 4a10 ldr r2, [pc, #64] ; (80014ac ) 800146c: f043 0301 orr.w r3, r3, #1 8001470: 61d3 str r3, [r2, #28] 8001472: 4b0e ldr r3, [pc, #56] ; (80014ac ) 8001474: 69db ldr r3, [r3, #28] 8001476: f003 0301 and.w r3, r3, #1 800147a: 60fb str r3, [r7, #12] 800147c: 68fb ldr r3, [r7, #12] /**SPI1 GPIO Configuration PA5 ------> SPI1_SCK PA6 ------> SPI1_MISO PA7 ------> SPI1_MOSI */ GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7; 800147e: 23e0 movs r3, #224 ; 0xe0 8001480: 617b str r3, [r7, #20] GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 8001482: 2302 movs r3, #2 8001484: 61bb str r3, [r7, #24] GPIO_InitStruct.Pull = GPIO_NOPULL; 8001486: 2300 movs r3, #0 8001488: 61fb str r3, [r7, #28] GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; 800148a: 2303 movs r3, #3 800148c: 623b str r3, [r7, #32] GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; 800148e: 2305 movs r3, #5 8001490: 627b str r3, [r7, #36] ; 0x24 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 8001492: f107 0314 add.w r3, r7, #20 8001496: 4619 mov r1, r3 8001498: 4805 ldr r0, [pc, #20] ; (80014b0 ) 800149a: f000 fe79 bl 8002190 /* USER CODE BEGIN SPI1_MspInit 1 */ /* USER CODE END SPI1_MspInit 1 */ } } 800149e: bf00 nop 80014a0: 3728 adds r7, #40 ; 0x28 80014a2: 46bd mov sp, r7 80014a4: bd80 pop {r7, pc} 80014a6: bf00 nop 80014a8: 40013000 .word 0x40013000 80014ac: 40023800 .word 0x40023800 80014b0: 40020000 .word 0x40020000 080014b4 : * This function configures the hardware resources used in this example * @param huart: UART handle pointer * @retval None */ void HAL_UART_MspInit(UART_HandleTypeDef* huart) { 80014b4: b580 push {r7, lr} 80014b6: b08a sub sp, #40 ; 0x28 80014b8: af00 add r7, sp, #0 80014ba: 6078 str r0, [r7, #4] GPIO_InitTypeDef GPIO_InitStruct = {0}; 80014bc: f107 0314 add.w r3, r7, #20 80014c0: 2200 movs r2, #0 80014c2: 601a str r2, [r3, #0] 80014c4: 605a str r2, [r3, #4] 80014c6: 609a str r2, [r3, #8] 80014c8: 60da str r2, [r3, #12] 80014ca: 611a str r2, [r3, #16] if(huart->Instance==USART2) 80014cc: 687b ldr r3, [r7, #4] 80014ce: 681b ldr r3, [r3, #0] 80014d0: 4a17 ldr r2, [pc, #92] ; (8001530 ) 80014d2: 4293 cmp r3, r2 80014d4: d127 bne.n 8001526 { /* USER CODE BEGIN USART2_MspInit 0 */ /* USER CODE END USART2_MspInit 0 */ /* Peripheral clock enable */ __HAL_RCC_USART2_CLK_ENABLE(); 80014d6: 4b17 ldr r3, [pc, #92] ; (8001534 ) 80014d8: 6a5b ldr r3, [r3, #36] ; 0x24 80014da: 4a16 ldr r2, [pc, #88] ; (8001534 ) 80014dc: f443 3300 orr.w r3, r3, #131072 ; 0x20000 80014e0: 6253 str r3, [r2, #36] ; 0x24 80014e2: 4b14 ldr r3, [pc, #80] ; (8001534 ) 80014e4: 6a5b ldr r3, [r3, #36] ; 0x24 80014e6: f403 3300 and.w r3, r3, #131072 ; 0x20000 80014ea: 613b str r3, [r7, #16] 80014ec: 693b ldr r3, [r7, #16] __HAL_RCC_GPIOA_CLK_ENABLE(); 80014ee: 4b11 ldr r3, [pc, #68] ; (8001534 ) 80014f0: 69db ldr r3, [r3, #28] 80014f2: 4a10 ldr r2, [pc, #64] ; (8001534 ) 80014f4: f043 0301 orr.w r3, r3, #1 80014f8: 61d3 str r3, [r2, #28] 80014fa: 4b0e ldr r3, [pc, #56] ; (8001534 ) 80014fc: 69db ldr r3, [r3, #28] 80014fe: f003 0301 and.w r3, r3, #1 8001502: 60fb str r3, [r7, #12] 8001504: 68fb ldr r3, [r7, #12] /**USART2 GPIO Configuration PA2 ------> USART2_TX PA3 ------> USART2_RX */ GPIO_InitStruct.Pin = USART_TX_Pin|USART_RX_Pin; 8001506: 230c movs r3, #12 8001508: 617b str r3, [r7, #20] GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 800150a: 2302 movs r3, #2 800150c: 61bb str r3, [r7, #24] GPIO_InitStruct.Pull = GPIO_NOPULL; 800150e: 2300 movs r3, #0 8001510: 61fb str r3, [r7, #28] GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; 8001512: 2303 movs r3, #3 8001514: 623b str r3, [r7, #32] GPIO_InitStruct.Alternate = GPIO_AF7_USART2; 8001516: 2307 movs r3, #7 8001518: 627b str r3, [r7, #36] ; 0x24 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 800151a: f107 0314 add.w r3, r7, #20 800151e: 4619 mov r1, r3 8001520: 4805 ldr r0, [pc, #20] ; (8001538 ) 8001522: f000 fe35 bl 8002190 /* USER CODE BEGIN USART2_MspInit 1 */ /* USER CODE END USART2_MspInit 1 */ } } 8001526: bf00 nop 8001528: 3728 adds r7, #40 ; 0x28 800152a: 46bd mov sp, r7 800152c: bd80 pop {r7, pc} 800152e: bf00 nop 8001530: 40004400 .word 0x40004400 8001534: 40023800 .word 0x40023800 8001538: 40020000 .word 0x40020000 0800153c : /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. */ void NMI_Handler(void) { 800153c: b480 push {r7} 800153e: af00 add r7, sp, #0 /* USER CODE END NonMaskableInt_IRQn 0 */ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ /* USER CODE END NonMaskableInt_IRQn 1 */ } 8001540: bf00 nop 8001542: 46bd mov sp, r7 8001544: bc80 pop {r7} 8001546: 4770 bx lr 08001548 : /** * @brief This function handles Hard fault interrupt. */ void HardFault_Handler(void) { 8001548: b480 push {r7} 800154a: af00 add r7, sp, #0 /* USER CODE BEGIN HardFault_IRQn 0 */ /* USER CODE END HardFault_IRQn 0 */ while (1) 800154c: e7fe b.n 800154c 0800154e : /** * @brief This function handles Memory management fault. */ void MemManage_Handler(void) { 800154e: b480 push {r7} 8001550: af00 add r7, sp, #0 /* USER CODE BEGIN MemoryManagement_IRQn 0 */ /* USER CODE END MemoryManagement_IRQn 0 */ while (1) 8001552: e7fe b.n 8001552 08001554 : /** * @brief This function handles Pre-fetch fault, memory access fault. */ void BusFault_Handler(void) { 8001554: b480 push {r7} 8001556: af00 add r7, sp, #0 /* USER CODE BEGIN BusFault_IRQn 0 */ /* USER CODE END BusFault_IRQn 0 */ while (1) 8001558: e7fe b.n 8001558 0800155a : /** * @brief This function handles Undefined instruction or illegal state. */ void UsageFault_Handler(void) { 800155a: b480 push {r7} 800155c: af00 add r7, sp, #0 /* USER CODE BEGIN UsageFault_IRQn 0 */ /* USER CODE END UsageFault_IRQn 0 */ while (1) 800155e: e7fe b.n 800155e 08001560 : /** * @brief This function handles System service call via SWI instruction. */ void SVC_Handler(void) { 8001560: b480 push {r7} 8001562: af00 add r7, sp, #0 /* USER CODE END SVC_IRQn 0 */ /* USER CODE BEGIN SVC_IRQn 1 */ /* USER CODE END SVC_IRQn 1 */ } 8001564: bf00 nop 8001566: 46bd mov sp, r7 8001568: bc80 pop {r7} 800156a: 4770 bx lr 0800156c : /** * @brief This function handles Debug monitor. */ void DebugMon_Handler(void) { 800156c: b480 push {r7} 800156e: af00 add r7, sp, #0 /* USER CODE END DebugMonitor_IRQn 0 */ /* USER CODE BEGIN DebugMonitor_IRQn 1 */ /* USER CODE END DebugMonitor_IRQn 1 */ } 8001570: bf00 nop 8001572: 46bd mov sp, r7 8001574: bc80 pop {r7} 8001576: 4770 bx lr 08001578 : /** * @brief This function handles Pendable request for system service. */ void PendSV_Handler(void) { 8001578: b480 push {r7} 800157a: af00 add r7, sp, #0 /* USER CODE END PendSV_IRQn 0 */ /* USER CODE BEGIN PendSV_IRQn 1 */ /* USER CODE END PendSV_IRQn 1 */ } 800157c: bf00 nop 800157e: 46bd mov sp, r7 8001580: bc80 pop {r7} 8001582: 4770 bx lr 08001584 : /** * @brief This function handles System tick timer. */ void SysTick_Handler(void) { 8001584: b580 push {r7, lr} 8001586: af00 add r7, sp, #0 /* USER CODE BEGIN SysTick_IRQn 0 */ if (Timer1 > 0){ 8001588: 4b0c ldr r3, [pc, #48] ; (80015bc ) 800158a: 881b ldrh r3, [r3, #0] 800158c: 2b00 cmp r3, #0 800158e: d005 beq.n 800159c Timer1--; 8001590: 4b0a ldr r3, [pc, #40] ; (80015bc ) 8001592: 881b ldrh r3, [r3, #0] 8001594: 3b01 subs r3, #1 8001596: b29a uxth r2, r3 8001598: 4b08 ldr r3, [pc, #32] ; (80015bc ) 800159a: 801a strh r2, [r3, #0] } if (Timer2 > 0){ 800159c: 4b08 ldr r3, [pc, #32] ; (80015c0 ) 800159e: 881b ldrh r3, [r3, #0] 80015a0: 2b00 cmp r3, #0 80015a2: d005 beq.n 80015b0 Timer2--; 80015a4: 4b06 ldr r3, [pc, #24] ; (80015c0 ) 80015a6: 881b ldrh r3, [r3, #0] 80015a8: 3b01 subs r3, #1 80015aa: b29a uxth r2, r3 80015ac: 4b04 ldr r3, [pc, #16] ; (80015c0 ) 80015ae: 801a strh r2, [r3, #0] } /* USER CODE END SysTick_IRQn 0 */ HAL_IncTick(); 80015b0: f000 f8c2 bl 8001738 /* USER CODE BEGIN SysTick_IRQn 1 */ HAL_SYSTICK_IRQHandler(); 80015b4: f000 fddf bl 8002176 /* USER CODE END SysTick_IRQn 1 */ } 80015b8: bf00 nop 80015ba: bd80 pop {r7, pc} 80015bc: 200002ea .word 0x200002ea 80015c0: 200002e8 .word 0x200002e8 080015c4 <_sbrk>: * * @param incr Memory size * @return Pointer to allocated memory */ void *_sbrk(ptrdiff_t incr) { 80015c4: b580 push {r7, lr} 80015c6: b086 sub sp, #24 80015c8: af00 add r7, sp, #0 80015ca: 6078 str r0, [r7, #4] extern uint8_t _end; /* Symbol defined in the linker script */ extern uint8_t _estack; /* Symbol defined in the linker script */ extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */ const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size; 80015cc: 4a14 ldr r2, [pc, #80] ; (8001620 <_sbrk+0x5c>) 80015ce: 4b15 ldr r3, [pc, #84] ; (8001624 <_sbrk+0x60>) 80015d0: 1ad3 subs r3, r2, r3 80015d2: 617b str r3, [r7, #20] const uint8_t *max_heap = (uint8_t *)stack_limit; 80015d4: 697b ldr r3, [r7, #20] 80015d6: 613b str r3, [r7, #16] uint8_t *prev_heap_end; /* Initalize heap end at first call */ if (NULL == __sbrk_heap_end) 80015d8: 4b13 ldr r3, [pc, #76] ; (8001628 <_sbrk+0x64>) 80015da: 681b ldr r3, [r3, #0] 80015dc: 2b00 cmp r3, #0 80015de: d102 bne.n 80015e6 <_sbrk+0x22> { __sbrk_heap_end = &_end; 80015e0: 4b11 ldr r3, [pc, #68] ; (8001628 <_sbrk+0x64>) 80015e2: 4a12 ldr r2, [pc, #72] ; (800162c <_sbrk+0x68>) 80015e4: 601a str r2, [r3, #0] } /* Protect heap from growing into the reserved MSP stack */ if (__sbrk_heap_end + incr > max_heap) 80015e6: 4b10 ldr r3, [pc, #64] ; (8001628 <_sbrk+0x64>) 80015e8: 681a ldr r2, [r3, #0] 80015ea: 687b ldr r3, [r7, #4] 80015ec: 4413 add r3, r2 80015ee: 693a ldr r2, [r7, #16] 80015f0: 429a cmp r2, r3 80015f2: d207 bcs.n 8001604 <_sbrk+0x40> { errno = ENOMEM; 80015f4: f005 fdcc bl 8007190 <__errno> 80015f8: 4602 mov r2, r0 80015fa: 230c movs r3, #12 80015fc: 6013 str r3, [r2, #0] return (void *)-1; 80015fe: f04f 33ff mov.w r3, #4294967295 8001602: e009 b.n 8001618 <_sbrk+0x54> } prev_heap_end = __sbrk_heap_end; 8001604: 4b08 ldr r3, [pc, #32] ; (8001628 <_sbrk+0x64>) 8001606: 681b ldr r3, [r3, #0] 8001608: 60fb str r3, [r7, #12] __sbrk_heap_end += incr; 800160a: 4b07 ldr r3, [pc, #28] ; (8001628 <_sbrk+0x64>) 800160c: 681a ldr r2, [r3, #0] 800160e: 687b ldr r3, [r7, #4] 8001610: 4413 add r3, r2 8001612: 4a05 ldr r2, [pc, #20] ; (8001628 <_sbrk+0x64>) 8001614: 6013 str r3, [r2, #0] return (void *)prev_heap_end; 8001616: 68fb ldr r3, [r7, #12] } 8001618: 4618 mov r0, r3 800161a: 3718 adds r7, #24 800161c: 46bd mov sp, r7 800161e: bd80 pop {r7, pc} 8001620: 20014000 .word 0x20014000 8001624: 00000400 .word 0x00000400 8001628: 200000a8 .word 0x200000a8 800162c: 20004558 .word 0x20004558 08001630 : * SystemCoreClock variable. * @param None * @retval None */ void SystemInit (void) { 8001630: b480 push {r7} 8001632: af00 add r7, sp, #0 #endif /* DATA_IN_ExtSRAM */ #ifdef VECT_TAB_SRAM SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */ #else SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */ 8001634: 4b03 ldr r3, [pc, #12] ; (8001644 ) 8001636: f04f 6200 mov.w r2, #134217728 ; 0x8000000 800163a: 609a str r2, [r3, #8] #endif } 800163c: bf00 nop 800163e: 46bd mov sp, r7 8001640: bc80 pop {r7} 8001642: 4770 bx lr 8001644: e000ed00 .word 0xe000ed00 08001648 : .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: /* Copy the data segment initializers from flash to SRAM */ movs r1, #0 8001648: 2100 movs r1, #0 b LoopCopyDataInit 800164a: e003 b.n 8001654 0800164c : CopyDataInit: ldr r3, =_sidata 800164c: 4b0b ldr r3, [pc, #44] ; (800167c ) ldr r3, [r3, r1] 800164e: 585b ldr r3, [r3, r1] str r3, [r0, r1] 8001650: 5043 str r3, [r0, r1] adds r1, r1, #4 8001652: 3104 adds r1, #4 08001654 : LoopCopyDataInit: ldr r0, =_sdata 8001654: 480a ldr r0, [pc, #40] ; (8001680 ) ldr r3, =_edata 8001656: 4b0b ldr r3, [pc, #44] ; (8001684 ) adds r2, r0, r1 8001658: 1842 adds r2, r0, r1 cmp r2, r3 800165a: 429a cmp r2, r3 bcc CopyDataInit 800165c: d3f6 bcc.n 800164c ldr r2, =_sbss 800165e: 4a0a ldr r2, [pc, #40] ; (8001688 ) b LoopFillZerobss 8001660: e002 b.n 8001668 08001662 : /* Zero fill the bss segment. */ FillZerobss: movs r3, #0 8001662: 2300 movs r3, #0 str r3, [r2], #4 8001664: f842 3b04 str.w r3, [r2], #4 08001668 : LoopFillZerobss: ldr r3, = _ebss 8001668: 4b08 ldr r3, [pc, #32] ; (800168c ) cmp r2, r3 800166a: 429a cmp r2, r3 bcc FillZerobss 800166c: d3f9 bcc.n 8001662 /* Call the clock system intitialization function.*/ bl SystemInit 800166e: f7ff ffdf bl 8001630 /* Call static constructors */ bl __libc_init_array 8001672: f005 fd93 bl 800719c <__libc_init_array> /* Call the application's entry point.*/ bl main 8001676: f7ff fbe5 bl 8000e44
bx lr 800167a: 4770 bx lr ldr r3, =_sidata 800167c: 08008008 .word 0x08008008 ldr r0, =_sdata 8001680: 20000000 .word 0x20000000 ldr r3, =_edata 8001684: 20000088 .word 0x20000088 ldr r2, =_sbss 8001688: 20000088 .word 0x20000088 ldr r3, = _ebss 800168c: 20004554 .word 0x20004554 08001690 : * @retval : None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop 8001690: e7fe b.n 8001690 08001692 : * In the default implementation,Systick is used as source of time base. * the tick variable is incremented each 1ms in its ISR. * @retval HAL status */ HAL_StatusTypeDef HAL_Init(void) { 8001692: b580 push {r7, lr} 8001694: b082 sub sp, #8 8001696: af00 add r7, sp, #0 HAL_StatusTypeDef status = HAL_OK; 8001698: 2300 movs r3, #0 800169a: 71fb strb r3, [r7, #7] #if (PREFETCH_ENABLE != 0) __HAL_FLASH_PREFETCH_BUFFER_ENABLE(); #endif /* PREFETCH_ENABLE */ /* Set Interrupt Group Priority */ HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); 800169c: 2003 movs r0, #3 800169e: f000 fd37 bl 8002110 /* Use systick as time base source and configure 1ms tick (default clock after Reset is MSI) */ if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK) 80016a2: 2000 movs r0, #0 80016a4: f000 f80e bl 80016c4 80016a8: 4603 mov r3, r0 80016aa: 2b00 cmp r3, #0 80016ac: d002 beq.n 80016b4 { status = HAL_ERROR; 80016ae: 2301 movs r3, #1 80016b0: 71fb strb r3, [r7, #7] 80016b2: e001 b.n 80016b8 } else { /* Init the low level hardware */ HAL_MspInit(); 80016b4: f7ff fe4a bl 800134c } /* Return function status */ return status; 80016b8: 79fb ldrb r3, [r7, #7] } 80016ba: 4618 mov r0, r3 80016bc: 3708 adds r7, #8 80016be: 46bd mov sp, r7 80016c0: bd80 pop {r7, pc} ... 080016c4 : * implementation in user file. * @param TickPriority Tick interrupt priority. * @retval HAL status */ __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) { 80016c4: b580 push {r7, lr} 80016c6: b084 sub sp, #16 80016c8: af00 add r7, sp, #0 80016ca: 6078 str r0, [r7, #4] HAL_StatusTypeDef status = HAL_OK; 80016cc: 2300 movs r3, #0 80016ce: 73fb strb r3, [r7, #15] if (uwTickFreq != 0U) 80016d0: 4b16 ldr r3, [pc, #88] ; (800172c ) 80016d2: 681b ldr r3, [r3, #0] 80016d4: 2b00 cmp r3, #0 80016d6: d022 beq.n 800171e { /*Configure the SysTick to have interrupt in 1ms time basis*/ if (HAL_SYSTICK_Config(SystemCoreClock / (1000U / uwTickFreq)) == 0U) 80016d8: 4b15 ldr r3, [pc, #84] ; (8001730 ) 80016da: 681a ldr r2, [r3, #0] 80016dc: 4b13 ldr r3, [pc, #76] ; (800172c ) 80016de: 681b ldr r3, [r3, #0] 80016e0: f44f 717a mov.w r1, #1000 ; 0x3e8 80016e4: fbb1 f3f3 udiv r3, r1, r3 80016e8: fbb2 f3f3 udiv r3, r2, r3 80016ec: 4618 mov r0, r3 80016ee: f000 fd36 bl 800215e 80016f2: 4603 mov r3, r0 80016f4: 2b00 cmp r3, #0 80016f6: d10f bne.n 8001718 { /* Configure the SysTick IRQ priority */ if (TickPriority < (1UL << __NVIC_PRIO_BITS)) 80016f8: 687b ldr r3, [r7, #4] 80016fa: 2b0f cmp r3, #15 80016fc: d809 bhi.n 8001712 { HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority, 0U); 80016fe: 2200 movs r2, #0 8001700: 6879 ldr r1, [r7, #4] 8001702: f04f 30ff mov.w r0, #4294967295 8001706: f000 fd0e bl 8002126 uwTickPrio = TickPriority; 800170a: 4a0a ldr r2, [pc, #40] ; (8001734 ) 800170c: 687b ldr r3, [r7, #4] 800170e: 6013 str r3, [r2, #0] 8001710: e007 b.n 8001722 } else { status = HAL_ERROR; 8001712: 2301 movs r3, #1 8001714: 73fb strb r3, [r7, #15] 8001716: e004 b.n 8001722 } } else { status = HAL_ERROR; 8001718: 2301 movs r3, #1 800171a: 73fb strb r3, [r7, #15] 800171c: e001 b.n 8001722 } } else { status = HAL_ERROR; 800171e: 2301 movs r3, #1 8001720: 73fb strb r3, [r7, #15] } /* Return function status */ return status; 8001722: 7bfb ldrb r3, [r7, #15] } 8001724: 4618 mov r0, r3 8001726: 3710 adds r7, #16 8001728: 46bd mov sp, r7 800172a: bd80 pop {r7, pc} 800172c: 2000000c .word 0x2000000c 8001730: 20000004 .word 0x20000004 8001734: 20000008 .word 0x20000008 08001738 : * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. * @retval None */ __weak void HAL_IncTick(void) { 8001738: b480 push {r7} 800173a: af00 add r7, sp, #0 uwTick += uwTickFreq; 800173c: 4b05 ldr r3, [pc, #20] ; (8001754 ) 800173e: 681a ldr r2, [r3, #0] 8001740: 4b05 ldr r3, [pc, #20] ; (8001758 ) 8001742: 681b ldr r3, [r3, #0] 8001744: 4413 add r3, r2 8001746: 4a03 ldr r2, [pc, #12] ; (8001754 ) 8001748: 6013 str r3, [r2, #0] } 800174a: bf00 nop 800174c: 46bd mov sp, r7 800174e: bc80 pop {r7} 8001750: 4770 bx lr 8001752: bf00 nop 8001754: 200024dc .word 0x200024dc 8001758: 2000000c .word 0x2000000c 0800175c : * @note This function is declared as __weak to be overwritten in case of other * implementations in user file. * @retval tick value */ __weak uint32_t HAL_GetTick(void) { 800175c: b480 push {r7} 800175e: af00 add r7, sp, #0 return uwTick; 8001760: 4b02 ldr r3, [pc, #8] ; (800176c ) 8001762: 681b ldr r3, [r3, #0] } 8001764: 4618 mov r0, r3 8001766: 46bd mov sp, r7 8001768: bc80 pop {r7} 800176a: 4770 bx lr 800176c: 200024dc .word 0x200024dc 08001770 : * implementations in user file. * @param Delay specifies the delay time length, in milliseconds. * @retval None */ __weak void HAL_Delay(uint32_t Delay) { 8001770: b580 push {r7, lr} 8001772: b084 sub sp, #16 8001774: af00 add r7, sp, #0 8001776: 6078 str r0, [r7, #4] uint32_t tickstart = HAL_GetTick(); 8001778: f7ff fff0 bl 800175c 800177c: 60b8 str r0, [r7, #8] uint32_t wait = Delay; 800177e: 687b ldr r3, [r7, #4] 8001780: 60fb str r3, [r7, #12] /* Add a period to guaranty minimum wait */ if (wait < HAL_MAX_DELAY) 8001782: 68fb ldr r3, [r7, #12] 8001784: f1b3 3fff cmp.w r3, #4294967295 8001788: d004 beq.n 8001794 { wait += (uint32_t)(uwTickFreq); 800178a: 4b09 ldr r3, [pc, #36] ; (80017b0 ) 800178c: 681b ldr r3, [r3, #0] 800178e: 68fa ldr r2, [r7, #12] 8001790: 4413 add r3, r2 8001792: 60fb str r3, [r7, #12] } while((HAL_GetTick() - tickstart) < wait) 8001794: bf00 nop 8001796: f7ff ffe1 bl 800175c 800179a: 4602 mov r2, r0 800179c: 68bb ldr r3, [r7, #8] 800179e: 1ad3 subs r3, r2, r3 80017a0: 68fa ldr r2, [r7, #12] 80017a2: 429a cmp r2, r3 80017a4: d8f7 bhi.n 8001796 { } } 80017a6: bf00 nop 80017a8: 3710 adds r7, #16 80017aa: 46bd mov sp, r7 80017ac: bd80 pop {r7, pc} 80017ae: bf00 nop 80017b0: 2000000c .word 0x2000000c 080017b4 : * of structure "ADC_InitTypeDef". * @param hadc ADC handle * @retval HAL status */ HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc) { 80017b4: b580 push {r7, lr} 80017b6: b08e sub sp, #56 ; 0x38 80017b8: af00 add r7, sp, #0 80017ba: 6078 str r0, [r7, #4] HAL_StatusTypeDef tmp_hal_status = HAL_OK; 80017bc: 2300 movs r3, #0 80017be: f887 3037 strb.w r3, [r7, #55] ; 0x37 uint32_t tmp_cr1 = 0; 80017c2: 2300 movs r3, #0 80017c4: 633b str r3, [r7, #48] ; 0x30 uint32_t tmp_cr2 = 0; 80017c6: 2300 movs r3, #0 80017c8: 62fb str r3, [r7, #44] ; 0x2c /* Check ADC handle */ if(hadc == NULL) 80017ca: 687b ldr r3, [r7, #4] 80017cc: 2b00 cmp r3, #0 80017ce: d101 bne.n 80017d4 { return HAL_ERROR; 80017d0: 2301 movs r3, #1 80017d2: e127 b.n 8001a24 assert_param(IS_ADC_CHANNELSBANK(hadc->Init.ChannelsBank)); assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); assert_param(IS_ADC_EXTTRIG(hadc->Init.ExternalTrigConv)); assert_param(IS_FUNCTIONAL_STATE(hadc->Init.DMAContinuousRequests)); if(hadc->Init.ScanConvMode != ADC_SCAN_DISABLE) 80017d4: 687b ldr r3, [r7, #4] 80017d6: 691b ldr r3, [r3, #16] 80017d8: 2b00 cmp r3, #0 /* Refer to header of this file for more details on clock enabling */ /* procedure. */ /* Actions performed only if ADC is coming from state reset: */ /* - Initialization of ADC MSP */ if (hadc->State == HAL_ADC_STATE_RESET) 80017da: 687b ldr r3, [r7, #4] 80017dc: 6cdb ldr r3, [r3, #76] ; 0x4c 80017de: 2b00 cmp r3, #0 80017e0: d115 bne.n 800180e { /* Initialize ADC error code */ ADC_CLEAR_ERRORCODE(hadc); 80017e2: 687b ldr r3, [r7, #4] 80017e4: 2200 movs r2, #0 80017e6: 651a str r2, [r3, #80] ; 0x50 /* Allocate lock resource and initialize it */ hadc->Lock = HAL_UNLOCKED; 80017e8: 687b ldr r3, [r7, #4] 80017ea: 2200 movs r2, #0 80017ec: f883 2048 strb.w r2, [r3, #72] ; 0x48 /* Enable SYSCFG clock to control the routing Interface (RI) */ __HAL_RCC_SYSCFG_CLK_ENABLE(); 80017f0: 4b8e ldr r3, [pc, #568] ; (8001a2c ) 80017f2: 6a1b ldr r3, [r3, #32] 80017f4: 4a8d ldr r2, [pc, #564] ; (8001a2c ) 80017f6: f043 0301 orr.w r3, r3, #1 80017fa: 6213 str r3, [r2, #32] 80017fc: 4b8b ldr r3, [pc, #556] ; (8001a2c ) 80017fe: 6a1b ldr r3, [r3, #32] 8001800: f003 0301 and.w r3, r3, #1 8001804: 60bb str r3, [r7, #8] 8001806: 68bb ldr r3, [r7, #8] /* Init the low level hardware */ hadc->MspInitCallback(hadc); #else /* Init the low level hardware */ HAL_ADC_MspInit(hadc); 8001808: 6878 ldr r0, [r7, #4] 800180a: f7ff fdcf bl 80013ac #endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ } /* Configuration of ADC parameters if previous preliminary actions are */ /* correctly completed. */ if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL)) 800180e: 687b ldr r3, [r7, #4] 8001810: 6cdb ldr r3, [r3, #76] ; 0x4c 8001812: f003 0310 and.w r3, r3, #16 8001816: 2b00 cmp r3, #0 8001818: f040 80ff bne.w 8001a1a { /* Set ADC state */ ADC_STATE_CLR_SET(hadc->State, 800181c: 687b ldr r3, [r7, #4] 800181e: 6cdb ldr r3, [r3, #76] ; 0x4c 8001820: f423 5388 bic.w r3, r3, #4352 ; 0x1100 8001824: f023 0302 bic.w r3, r3, #2 8001828: f043 0202 orr.w r2, r3, #2 800182c: 687b ldr r3, [r7, #4] 800182e: 64da str r2, [r3, #76] ; 0x4c /* Set ADC parameters */ /* Configuration of common ADC clock: clock source HSI with selectable */ /* prescaler */ MODIFY_REG(ADC->CCR , 8001830: 4b7f ldr r3, [pc, #508] ; (8001a30 ) 8001832: 685b ldr r3, [r3, #4] 8001834: f423 3240 bic.w r2, r3, #196608 ; 0x30000 8001838: 687b ldr r3, [r7, #4] 800183a: 685b ldr r3, [r3, #4] 800183c: 497c ldr r1, [pc, #496] ; (8001a30 ) 800183e: 4313 orrs r3, r2 8001840: 604b str r3, [r1, #4] /* - external trigger polarity */ /* - End of conversion selection */ /* - DMA continuous request */ /* - Channels bank (Banks availability depends on devices categories) */ /* - continuous conversion mode */ tmp_cr2 |= (hadc->Init.DataAlign | 8001842: 687b ldr r3, [r7, #4] 8001844: 68da ldr r2, [r3, #12] hadc->Init.EOCSelection | 8001846: 687b ldr r3, [r7, #4] 8001848: 695b ldr r3, [r3, #20] tmp_cr2 |= (hadc->Init.DataAlign | 800184a: 431a orrs r2, r3 ADC_CR2_DMACONTREQ((uint32_t)hadc->Init.DMAContinuousRequests) | 800184c: 687b ldr r3, [r7, #4] 800184e: f893 303c ldrb.w r3, [r3, #60] ; 0x3c 8001852: 4619 mov r1, r3 8001854: f44f 7300 mov.w r3, #512 ; 0x200 8001858: 623b str r3, [r7, #32] uint32_t result; #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); 800185a: 6a3b ldr r3, [r7, #32] 800185c: fa93 f3a3 rbit r3, r3 8001860: 61fb str r3, [r7, #28] result |= value & 1U; s--; } result <<= s; /* shift when v's highest bits are zero */ #endif return result; 8001862: 69fb ldr r3, [r7, #28] 8001864: fab3 f383 clz r3, r3 8001868: b2db uxtb r3, r3 800186a: fa01 f303 lsl.w r3, r1, r3 hadc->Init.EOCSelection | 800186e: 431a orrs r2, r3 hadc->Init.ChannelsBank | 8001870: 687b ldr r3, [r7, #4] 8001872: 6a1b ldr r3, [r3, #32] ADC_CR2_DMACONTREQ((uint32_t)hadc->Init.DMAContinuousRequests) | 8001874: 431a orrs r2, r3 ADC_CR2_CONTINUOUS((uint32_t)hadc->Init.ContinuousConvMode) ); 8001876: 687b ldr r3, [r7, #4] 8001878: f893 3024 ldrb.w r3, [r3, #36] ; 0x24 800187c: 4619 mov r1, r3 800187e: 2302 movs r3, #2 8001880: 62bb str r3, [r7, #40] ; 0x28 __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); 8001882: 6abb ldr r3, [r7, #40] ; 0x28 8001884: fa93 f3a3 rbit r3, r3 8001888: 627b str r3, [r7, #36] ; 0x24 return result; 800188a: 6a7b ldr r3, [r7, #36] ; 0x24 800188c: fab3 f383 clz r3, r3 8001890: b2db uxtb r3, r3 8001892: fa01 f303 lsl.w r3, r1, r3 hadc->Init.ChannelsBank | 8001896: 4313 orrs r3, r2 tmp_cr2 |= (hadc->Init.DataAlign | 8001898: 6afa ldr r2, [r7, #44] ; 0x2c 800189a: 4313 orrs r3, r2 800189c: 62fb str r3, [r7, #44] ; 0x2c /* Enable external trigger if trigger selection is different of software */ /* start. */ /* Note: This configuration keeps the hardware feature of parameter */ /* ExternalTrigConvEdge "trigger edge none" equivalent to */ /* software start. */ if (hadc->Init.ExternalTrigConv != ADC_SOFTWARE_START) 800189e: 687b ldr r3, [r7, #4] 80018a0: 6b5b ldr r3, [r3, #52] ; 0x34 80018a2: 2b10 cmp r3, #16 80018a4: d007 beq.n 80018b6 { tmp_cr2 |= ( hadc->Init.ExternalTrigConv | 80018a6: 687b ldr r3, [r7, #4] 80018a8: 6b5a ldr r2, [r3, #52] ; 0x34 hadc->Init.ExternalTrigConvEdge ); 80018aa: 687b ldr r3, [r7, #4] 80018ac: 6b9b ldr r3, [r3, #56] ; 0x38 tmp_cr2 |= ( hadc->Init.ExternalTrigConv | 80018ae: 4313 orrs r3, r2 80018b0: 6afa ldr r2, [r7, #44] ; 0x2c 80018b2: 4313 orrs r3, r2 80018b4: 62fb str r3, [r7, #44] ; 0x2c /* - resolution */ /* - auto power off (LowPowerAutoPowerOff mode) */ /* - scan mode */ /* - discontinuous mode disable/enable */ /* - discontinuous mode number of conversions */ if ((ADC_IS_ENABLE(hadc) == RESET)) 80018b6: 687b ldr r3, [r7, #4] 80018b8: 681b ldr r3, [r3, #0] 80018ba: 681b ldr r3, [r3, #0] 80018bc: f003 0340 and.w r3, r3, #64 ; 0x40 80018c0: 2b40 cmp r3, #64 ; 0x40 80018c2: d04f beq.n 8001964 { tmp_cr2 |= hadc->Init.LowPowerAutoWait; 80018c4: 687b ldr r3, [r7, #4] 80018c6: 699b ldr r3, [r3, #24] 80018c8: 6afa ldr r2, [r7, #44] ; 0x2c 80018ca: 4313 orrs r3, r2 80018cc: 62fb str r3, [r7, #44] ; 0x2c tmp_cr1 |= (hadc->Init.Resolution | 80018ce: 687b ldr r3, [r7, #4] 80018d0: 689a ldr r2, [r3, #8] hadc->Init.LowPowerAutoPowerOff | 80018d2: 687b ldr r3, [r7, #4] 80018d4: 69db ldr r3, [r3, #28] tmp_cr1 |= (hadc->Init.Resolution | 80018d6: 4313 orrs r3, r2 ADC_CR1_SCAN_SET(hadc->Init.ScanConvMode) ); 80018d8: 687a ldr r2, [r7, #4] 80018da: 6912 ldr r2, [r2, #16] 80018dc: f5b2 7f80 cmp.w r2, #256 ; 0x100 80018e0: d003 beq.n 80018ea 80018e2: 687a ldr r2, [r7, #4] 80018e4: 6912 ldr r2, [r2, #16] 80018e6: 2a01 cmp r2, #1 80018e8: d102 bne.n 80018f0 80018ea: f44f 7280 mov.w r2, #256 ; 0x100 80018ee: e000 b.n 80018f2 80018f0: 2200 movs r2, #0 hadc->Init.LowPowerAutoPowerOff | 80018f2: 4313 orrs r3, r2 tmp_cr1 |= (hadc->Init.Resolution | 80018f4: 6b3a ldr r2, [r7, #48] ; 0x30 80018f6: 4313 orrs r3, r2 80018f8: 633b str r3, [r7, #48] ; 0x30 /* Enable discontinuous mode only if continuous mode is disabled */ /* Note: If parameter "Init.ScanConvMode" is set to disable, parameter */ /* discontinuous is set anyway, but has no effect on ADC HW. */ if (hadc->Init.DiscontinuousConvMode == ENABLE) 80018fa: 687b ldr r3, [r7, #4] 80018fc: f893 302c ldrb.w r3, [r3, #44] ; 0x2c 8001900: 2b01 cmp r3, #1 8001902: d125 bne.n 8001950 { if (hadc->Init.ContinuousConvMode == DISABLE) 8001904: 687b ldr r3, [r7, #4] 8001906: f893 3024 ldrb.w r3, [r3, #36] ; 0x24 800190a: 2b00 cmp r3, #0 800190c: d114 bne.n 8001938 { /* Enable the selected ADC regular discontinuous mode */ /* Set the number of channels to be converted in discontinuous mode */ SET_BIT(tmp_cr1, ADC_CR1_DISCEN | 800190e: 687b ldr r3, [r7, #4] 8001910: 6b1b ldr r3, [r3, #48] ; 0x30 8001912: 3b01 subs r3, #1 8001914: f44f 4260 mov.w r2, #57344 ; 0xe000 8001918: 61ba str r2, [r7, #24] __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); 800191a: 69ba ldr r2, [r7, #24] 800191c: fa92 f2a2 rbit r2, r2 8001920: 617a str r2, [r7, #20] return result; 8001922: 697a ldr r2, [r7, #20] 8001924: fab2 f282 clz r2, r2 8001928: b2d2 uxtb r2, r2 800192a: 4093 lsls r3, r2 800192c: f443 6300 orr.w r3, r3, #2048 ; 0x800 8001930: 6b3a ldr r2, [r7, #48] ; 0x30 8001932: 4313 orrs r3, r2 8001934: 633b str r3, [r7, #48] ; 0x30 8001936: e00b b.n 8001950 { /* ADC regular group settings continuous and sequencer discontinuous*/ /* cannot be enabled simultaneously. */ /* Update ADC state machine to error */ SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); 8001938: 687b ldr r3, [r7, #4] 800193a: 6cdb ldr r3, [r3, #76] ; 0x4c 800193c: f043 0220 orr.w r2, r3, #32 8001940: 687b ldr r3, [r7, #4] 8001942: 64da str r2, [r3, #76] ; 0x4c /* Set ADC error code to ADC IP internal error */ SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); 8001944: 687b ldr r3, [r7, #4] 8001946: 6d1b ldr r3, [r3, #80] ; 0x50 8001948: f043 0201 orr.w r2, r3, #1 800194c: 687b ldr r3, [r7, #4] 800194e: 651a str r2, [r3, #80] ; 0x50 } } /* Update ADC configuration register CR1 with previous settings */ MODIFY_REG(hadc->Instance->CR1, 8001950: 687b ldr r3, [r7, #4] 8001952: 681b ldr r3, [r3, #0] 8001954: 685a ldr r2, [r3, #4] 8001956: 4b37 ldr r3, [pc, #220] ; (8001a34 ) 8001958: 4013 ands r3, r2 800195a: 687a ldr r2, [r7, #4] 800195c: 6812 ldr r2, [r2, #0] 800195e: 6b39 ldr r1, [r7, #48] ; 0x30 8001960: 430b orrs r3, r1 8001962: 6053 str r3, [r2, #4] ADC_CR1_SCAN , tmp_cr1 ); } /* Update ADC configuration register CR2 with previous settings */ MODIFY_REG(hadc->Instance->CR2 , 8001964: 687b ldr r3, [r7, #4] 8001966: 681b ldr r3, [r3, #0] 8001968: 689a ldr r2, [r3, #8] 800196a: 4b33 ldr r3, [pc, #204] ; (8001a38 ) 800196c: 4013 ands r3, r2 800196e: 687a ldr r2, [r7, #4] 8001970: 6812 ldr r2, [r2, #0] 8001972: 6af9 ldr r1, [r7, #44] ; 0x2c 8001974: 430b orrs r3, r1 8001976: 6093 str r3, [r2, #8] /* Note: Scan mode is present by hardware on this device and, if */ /* disabled, discards automatically nb of conversions. Anyway, nb of */ /* conversions is forced to 0x00 for alignment over all STM32 devices. */ /* - if scan mode is enabled, regular channels sequence length is set to */ /* parameter "NbrOfConversion" */ if (ADC_CR1_SCAN_SET(hadc->Init.ScanConvMode) == ADC_SCAN_ENABLE) 8001978: 687b ldr r3, [r7, #4] 800197a: 691b ldr r3, [r3, #16] 800197c: f5b3 7f80 cmp.w r3, #256 ; 0x100 8001980: d003 beq.n 800198a 8001982: 687b ldr r3, [r7, #4] 8001984: 691b ldr r3, [r3, #16] 8001986: 2b01 cmp r3, #1 8001988: d119 bne.n 80019be { MODIFY_REG(hadc->Instance->SQR1 , 800198a: 687b ldr r3, [r7, #4] 800198c: 681b ldr r3, [r3, #0] 800198e: 6b1b ldr r3, [r3, #48] ; 0x30 8001990: f023 71f8 bic.w r1, r3, #32505856 ; 0x1f00000 8001994: 687b ldr r3, [r7, #4] 8001996: 6a9b ldr r3, [r3, #40] ; 0x28 8001998: 3b01 subs r3, #1 800199a: f04f 72f8 mov.w r2, #32505856 ; 0x1f00000 800199e: 613a str r2, [r7, #16] __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); 80019a0: 693a ldr r2, [r7, #16] 80019a2: fa92 f2a2 rbit r2, r2 80019a6: 60fa str r2, [r7, #12] return result; 80019a8: 68fa ldr r2, [r7, #12] 80019aa: fab2 f282 clz r2, r2 80019ae: b2d2 uxtb r2, r2 80019b0: fa03 f202 lsl.w r2, r3, r2 80019b4: 687b ldr r3, [r7, #4] 80019b6: 681b ldr r3, [r3, #0] 80019b8: 430a orrs r2, r1 80019ba: 631a str r2, [r3, #48] ; 0x30 80019bc: e007 b.n 80019ce ADC_SQR1_L , ADC_SQR1_L_SHIFT(hadc->Init.NbrOfConversion) ); } else { MODIFY_REG(hadc->Instance->SQR1, 80019be: 687b ldr r3, [r7, #4] 80019c0: 681b ldr r3, [r3, #0] 80019c2: 6b1a ldr r2, [r3, #48] ; 0x30 80019c4: 687b ldr r3, [r7, #4] 80019c6: 681b ldr r3, [r3, #0] 80019c8: f022 72f8 bic.w r2, r2, #32505856 ; 0x1f00000 80019cc: 631a str r2, [r3, #48] ; 0x30 /* Check back that ADC registers have effectively been configured to */ /* ensure of no potential problem of ADC core IP clocking. */ /* Check through register CR2 (excluding execution control bits ADON, */ /* JSWSTART, SWSTART and injected trigger bits JEXTEN and JEXTSEL). */ if ((READ_REG(hadc->Instance->CR2) & ~(ADC_CR2_ADON | 80019ce: 687b ldr r3, [r7, #4] 80019d0: 681b ldr r3, [r3, #0] 80019d2: 689a ldr r2, [r3, #8] 80019d4: 4b19 ldr r3, [pc, #100] ; (8001a3c ) 80019d6: 4013 ands r3, r2 80019d8: 6afa ldr r2, [r7, #44] ; 0x2c 80019da: 429a cmp r2, r3 80019dc: d10b bne.n 80019f6 ADC_CR2_SWSTART | ADC_CR2_JSWSTART | ADC_CR2_JEXTEN | ADC_CR2_JEXTSEL )) == tmp_cr2) { /* Set ADC error code to none */ ADC_CLEAR_ERRORCODE(hadc); 80019de: 687b ldr r3, [r7, #4] 80019e0: 2200 movs r2, #0 80019e2: 651a str r2, [r3, #80] ; 0x50 /* Set the ADC state */ ADC_STATE_CLR_SET(hadc->State, 80019e4: 687b ldr r3, [r7, #4] 80019e6: 6cdb ldr r3, [r3, #76] ; 0x4c 80019e8: f023 0303 bic.w r3, r3, #3 80019ec: f043 0201 orr.w r2, r3, #1 80019f0: 687b ldr r3, [r7, #4] 80019f2: 64da str r2, [r3, #76] ; 0x4c 80019f4: e014 b.n 8001a20 HAL_ADC_STATE_READY); } else { /* Update ADC state machine to error */ ADC_STATE_CLR_SET(hadc->State, 80019f6: 687b ldr r3, [r7, #4] 80019f8: 6cdb ldr r3, [r3, #76] ; 0x4c 80019fa: f023 0312 bic.w r3, r3, #18 80019fe: f043 0210 orr.w r2, r3, #16 8001a02: 687b ldr r3, [r7, #4] 8001a04: 64da str r2, [r3, #76] ; 0x4c HAL_ADC_STATE_BUSY_INTERNAL, HAL_ADC_STATE_ERROR_INTERNAL); /* Set ADC error code to ADC IP internal error */ SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); 8001a06: 687b ldr r3, [r7, #4] 8001a08: 6d1b ldr r3, [r3, #80] ; 0x50 8001a0a: f043 0201 orr.w r2, r3, #1 8001a0e: 687b ldr r3, [r7, #4] 8001a10: 651a str r2, [r3, #80] ; 0x50 tmp_hal_status = HAL_ERROR; 8001a12: 2301 movs r3, #1 8001a14: f887 3037 strb.w r3, [r7, #55] ; 0x37 8001a18: e002 b.n 8001a20 } } else { tmp_hal_status = HAL_ERROR; 8001a1a: 2301 movs r3, #1 8001a1c: f887 3037 strb.w r3, [r7, #55] ; 0x37 } /* Return function status */ return tmp_hal_status; 8001a20: f897 3037 ldrb.w r3, [r7, #55] ; 0x37 } 8001a24: 4618 mov r0, r3 8001a26: 3738 adds r7, #56 ; 0x38 8001a28: 46bd mov sp, r7 8001a2a: bd80 pop {r7, pc} 8001a2c: 40023800 .word 0x40023800 8001a30: 40012700 .word 0x40012700 8001a34: fcfc16ff .word 0xfcfc16ff 8001a38: c0fff189 .word 0xc0fff189 8001a3c: bf80fffe .word 0xbf80fffe 08001a40 : * Interruptions enabled in this function: None. * @param hadc ADC handle * @retval HAL status */ HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc) { 8001a40: b580 push {r7, lr} 8001a42: b084 sub sp, #16 8001a44: af00 add r7, sp, #0 8001a46: 6078 str r0, [r7, #4] HAL_StatusTypeDef tmp_hal_status = HAL_OK; 8001a48: 2300 movs r3, #0 8001a4a: 73fb strb r3, [r7, #15] /* Check the parameters */ assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); /* Process locked */ __HAL_LOCK(hadc); 8001a4c: 687b ldr r3, [r7, #4] 8001a4e: f893 3048 ldrb.w r3, [r3, #72] ; 0x48 8001a52: 2b01 cmp r3, #1 8001a54: d101 bne.n 8001a5a 8001a56: 2302 movs r3, #2 8001a58: e04e b.n 8001af8 8001a5a: 687b ldr r3, [r7, #4] 8001a5c: 2201 movs r2, #1 8001a5e: f883 2048 strb.w r2, [r3, #72] ; 0x48 /* Enable the ADC peripheral */ tmp_hal_status = ADC_Enable(hadc); 8001a62: 6878 ldr r0, [r7, #4] 8001a64: f000 fa4e bl 8001f04 8001a68: 4603 mov r3, r0 8001a6a: 73fb strb r3, [r7, #15] /* Start conversion if ADC is effectively enabled */ if (tmp_hal_status == HAL_OK) 8001a6c: 7bfb ldrb r3, [r7, #15] 8001a6e: 2b00 cmp r3, #0 8001a70: d141 bne.n 8001af6 { /* Set ADC state */ /* - Clear state bitfield related to regular group conversion results */ /* - Set state bitfield related to regular group operation */ ADC_STATE_CLR_SET(hadc->State, 8001a72: 687b ldr r3, [r7, #4] 8001a74: 6cdb ldr r3, [r3, #76] ; 0x4c 8001a76: f423 63e0 bic.w r3, r3, #1792 ; 0x700 8001a7a: f023 0301 bic.w r3, r3, #1 8001a7e: f443 7280 orr.w r2, r3, #256 ; 0x100 8001a82: 687b ldr r3, [r7, #4] 8001a84: 64da str r2, [r3, #76] ; 0x4c HAL_ADC_STATE_READY | HAL_ADC_STATE_REG_EOC | HAL_ADC_STATE_REG_OVR, HAL_ADC_STATE_REG_BUSY); /* If conversions on group regular are also triggering group injected, */ /* update ADC state. */ if (READ_BIT(hadc->Instance->CR1, ADC_CR1_JAUTO) != RESET) 8001a86: 687b ldr r3, [r7, #4] 8001a88: 681b ldr r3, [r3, #0] 8001a8a: 685b ldr r3, [r3, #4] 8001a8c: f403 6380 and.w r3, r3, #1024 ; 0x400 8001a90: 2b00 cmp r3, #0 8001a92: d007 beq.n 8001aa4 { ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); 8001a94: 687b ldr r3, [r7, #4] 8001a96: 6cdb ldr r3, [r3, #76] ; 0x4c 8001a98: f423 5340 bic.w r3, r3, #12288 ; 0x3000 8001a9c: f443 5280 orr.w r2, r3, #4096 ; 0x1000 8001aa0: 687b ldr r3, [r7, #4] 8001aa2: 64da str r2, [r3, #76] ; 0x4c } /* State machine update: Check if an injected conversion is ongoing */ if (HAL_IS_BIT_SET(hadc->State, HAL_ADC_STATE_INJ_BUSY)) 8001aa4: 687b ldr r3, [r7, #4] 8001aa6: 6cdb ldr r3, [r3, #76] ; 0x4c 8001aa8: f403 5380 and.w r3, r3, #4096 ; 0x1000 8001aac: f5b3 5f80 cmp.w r3, #4096 ; 0x1000 8001ab0: d106 bne.n 8001ac0 { /* Reset ADC error code fields related to conversions on group regular */ CLEAR_BIT(hadc->ErrorCode, (HAL_ADC_ERROR_OVR | HAL_ADC_ERROR_DMA)); 8001ab2: 687b ldr r3, [r7, #4] 8001ab4: 6d1b ldr r3, [r3, #80] ; 0x50 8001ab6: f023 0206 bic.w r2, r3, #6 8001aba: 687b ldr r3, [r7, #4] 8001abc: 651a str r2, [r3, #80] ; 0x50 8001abe: e002 b.n 8001ac6 } else { /* Reset ADC all error code fields */ ADC_CLEAR_ERRORCODE(hadc); 8001ac0: 687b ldr r3, [r7, #4] 8001ac2: 2200 movs r2, #0 8001ac4: 651a str r2, [r3, #80] ; 0x50 } /* Process unlocked */ /* Unlock before starting ADC conversions: in case of potential */ /* interruption, to let the process to ADC IRQ Handler. */ __HAL_UNLOCK(hadc); 8001ac6: 687b ldr r3, [r7, #4] 8001ac8: 2200 movs r2, #0 8001aca: f883 2048 strb.w r2, [r3, #72] ; 0x48 /* Clear regular group conversion flag and overrun flag */ /* (To ensure of no unknown state from potential previous ADC operations) */ __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_EOC | ADC_FLAG_OVR); 8001ace: 687b ldr r3, [r7, #4] 8001ad0: 681b ldr r3, [r3, #0] 8001ad2: f06f 0222 mvn.w r2, #34 ; 0x22 8001ad6: 601a str r2, [r3, #0] /* Enable conversion of regular group. */ /* If software start has been selected, conversion starts immediately. */ /* If external trigger has been selected, conversion will start at next */ /* trigger event. */ if (ADC_IS_SOFTWARE_START_REGULAR(hadc)) 8001ad8: 687b ldr r3, [r7, #4] 8001ada: 681b ldr r3, [r3, #0] 8001adc: 689b ldr r3, [r3, #8] 8001ade: f003 5340 and.w r3, r3, #805306368 ; 0x30000000 8001ae2: 2b00 cmp r3, #0 8001ae4: d107 bne.n 8001af6 { /* Start ADC conversion on regular group */ SET_BIT(hadc->Instance->CR2, ADC_CR2_SWSTART); 8001ae6: 687b ldr r3, [r7, #4] 8001ae8: 681b ldr r3, [r3, #0] 8001aea: 689a ldr r2, [r3, #8] 8001aec: 687b ldr r3, [r7, #4] 8001aee: 681b ldr r3, [r3, #0] 8001af0: f042 4280 orr.w r2, r2, #1073741824 ; 0x40000000 8001af4: 609a str r2, [r3, #8] } } /* Return function status */ return tmp_hal_status; 8001af6: 7bfb ldrb r3, [r7, #15] } 8001af8: 4618 mov r0, r3 8001afa: 3710 adds r7, #16 8001afc: 46bd mov sp, r7 8001afe: bd80 pop {r7, pc} 08001b00 : * @param hadc ADC handle * @param Timeout Timeout value in millisecond. * @retval HAL status */ HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout) { 8001b00: b580 push {r7, lr} 8001b02: b084 sub sp, #16 8001b04: af00 add r7, sp, #0 8001b06: 6078 str r0, [r7, #4] 8001b08: 6039 str r1, [r7, #0] uint32_t tickstart = 0; 8001b0a: 2300 movs r3, #0 8001b0c: 60fb str r3, [r7, #12] /* each conversion: */ /* Particular case is ADC configured in DMA mode and ADC sequencer with */ /* several ranks and polling for end of each conversion. */ /* For code simplicity sake, this particular case is generalized to */ /* ADC configured in DMA mode and and polling for end of each conversion. */ if (HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_EOCS) && 8001b0e: 687b ldr r3, [r7, #4] 8001b10: 681b ldr r3, [r3, #0] 8001b12: 689b ldr r3, [r3, #8] 8001b14: f403 6380 and.w r3, r3, #1024 ; 0x400 8001b18: f5b3 6f80 cmp.w r3, #1024 ; 0x400 8001b1c: d113 bne.n 8001b46 HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_DMA) ) 8001b1e: 687b ldr r3, [r7, #4] 8001b20: 681b ldr r3, [r3, #0] 8001b22: 689b ldr r3, [r3, #8] 8001b24: f403 7380 and.w r3, r3, #256 ; 0x100 if (HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_EOCS) && 8001b28: f5b3 7f80 cmp.w r3, #256 ; 0x100 8001b2c: d10b bne.n 8001b46 { /* Update ADC state machine to error */ SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); 8001b2e: 687b ldr r3, [r7, #4] 8001b30: 6cdb ldr r3, [r3, #76] ; 0x4c 8001b32: f043 0220 orr.w r2, r3, #32 8001b36: 687b ldr r3, [r7, #4] 8001b38: 64da str r2, [r3, #76] ; 0x4c /* Process unlocked */ __HAL_UNLOCK(hadc); 8001b3a: 687b ldr r3, [r7, #4] 8001b3c: 2200 movs r2, #0 8001b3e: f883 2048 strb.w r2, [r3, #72] ; 0x48 return HAL_ERROR; 8001b42: 2301 movs r3, #1 8001b44: e061 b.n 8001c0a } /* Get tick count */ tickstart = HAL_GetTick(); 8001b46: f7ff fe09 bl 800175c 8001b4a: 60f8 str r0, [r7, #12] /* Wait until End of Conversion flag is raised */ while(HAL_IS_BIT_CLR(hadc->Instance->SR, ADC_FLAG_EOC)) 8001b4c: e01a b.n 8001b84 { /* Check if timeout is disabled (set to infinite wait) */ if(Timeout != HAL_MAX_DELAY) 8001b4e: 683b ldr r3, [r7, #0] 8001b50: f1b3 3fff cmp.w r3, #4294967295 8001b54: d016 beq.n 8001b84 { if((Timeout == 0) || ((HAL_GetTick() - tickstart ) > Timeout)) 8001b56: 683b ldr r3, [r7, #0] 8001b58: 2b00 cmp r3, #0 8001b5a: d007 beq.n 8001b6c 8001b5c: f7ff fdfe bl 800175c 8001b60: 4602 mov r2, r0 8001b62: 68fb ldr r3, [r7, #12] 8001b64: 1ad3 subs r3, r2, r3 8001b66: 683a ldr r2, [r7, #0] 8001b68: 429a cmp r2, r3 8001b6a: d20b bcs.n 8001b84 { /* Update ADC state machine to timeout */ SET_BIT(hadc->State, HAL_ADC_STATE_TIMEOUT); 8001b6c: 687b ldr r3, [r7, #4] 8001b6e: 6cdb ldr r3, [r3, #76] ; 0x4c 8001b70: f043 0204 orr.w r2, r3, #4 8001b74: 687b ldr r3, [r7, #4] 8001b76: 64da str r2, [r3, #76] ; 0x4c /* Process unlocked */ __HAL_UNLOCK(hadc); 8001b78: 687b ldr r3, [r7, #4] 8001b7a: 2200 movs r2, #0 8001b7c: f883 2048 strb.w r2, [r3, #72] ; 0x48 return HAL_TIMEOUT; 8001b80: 2303 movs r3, #3 8001b82: e042 b.n 8001c0a while(HAL_IS_BIT_CLR(hadc->Instance->SR, ADC_FLAG_EOC)) 8001b84: 687b ldr r3, [r7, #4] 8001b86: 681b ldr r3, [r3, #0] 8001b88: 681b ldr r3, [r3, #0] 8001b8a: f003 0302 and.w r3, r3, #2 8001b8e: 2b00 cmp r3, #0 8001b90: d0dd beq.n 8001b4e } /* Clear end of conversion flag of regular group if low power feature */ /* "Auto Wait" is disabled, to not interfere with this feature until data */ /* register is read using function HAL_ADC_GetValue(). */ if (hadc->Init.LowPowerAutoWait == DISABLE) 8001b92: 687b ldr r3, [r7, #4] 8001b94: 699b ldr r3, [r3, #24] 8001b96: 2b00 cmp r3, #0 8001b98: d104 bne.n 8001ba4 { /* Clear regular group conversion flag */ __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_STRT | ADC_FLAG_EOC); 8001b9a: 687b ldr r3, [r7, #4] 8001b9c: 681b ldr r3, [r3, #0] 8001b9e: f06f 0212 mvn.w r2, #18 8001ba2: 601a str r2, [r3, #0] } /* Update ADC state machine */ SET_BIT(hadc->State, HAL_ADC_STATE_REG_EOC); 8001ba4: 687b ldr r3, [r7, #4] 8001ba6: 6cdb ldr r3, [r3, #76] ; 0x4c 8001ba8: f443 7200 orr.w r2, r3, #512 ; 0x200 8001bac: 687b ldr r3, [r7, #4] 8001bae: 64da str r2, [r3, #76] ; 0x4c /* by external trigger, continuous mode or scan sequence on going. */ /* Note: On STM32L1, there is no independent flag of end of sequence. */ /* The test of scan sequence on going is done either with scan */ /* sequence disabled or with end of conversion flag set to */ /* of end of sequence. */ if(ADC_IS_SOFTWARE_START_REGULAR(hadc) && 8001bb0: 687b ldr r3, [r7, #4] 8001bb2: 681b ldr r3, [r3, #0] 8001bb4: 689b ldr r3, [r3, #8] 8001bb6: f003 5340 and.w r3, r3, #805306368 ; 0x30000000 8001bba: 2b00 cmp r3, #0 8001bbc: d124 bne.n 8001c08 (hadc->Init.ContinuousConvMode == DISABLE) && 8001bbe: 687b ldr r3, [r7, #4] 8001bc0: f893 3024 ldrb.w r3, [r3, #36] ; 0x24 if(ADC_IS_SOFTWARE_START_REGULAR(hadc) && 8001bc4: 2b00 cmp r3, #0 8001bc6: d11f bne.n 8001c08 (HAL_IS_BIT_CLR(hadc->Instance->SQR1, ADC_SQR1_L) || 8001bc8: 687b ldr r3, [r7, #4] 8001bca: 681b ldr r3, [r3, #0] 8001bcc: 6b1b ldr r3, [r3, #48] ; 0x30 8001bce: f003 73f8 and.w r3, r3, #32505856 ; 0x1f00000 (hadc->Init.ContinuousConvMode == DISABLE) && 8001bd2: 2b00 cmp r3, #0 8001bd4: d006 beq.n 8001be4 HAL_IS_BIT_CLR(hadc->Instance->CR2, ADC_CR2_EOCS) ) ) 8001bd6: 687b ldr r3, [r7, #4] 8001bd8: 681b ldr r3, [r3, #0] 8001bda: 689b ldr r3, [r3, #8] 8001bdc: f403 6380 and.w r3, r3, #1024 ; 0x400 (HAL_IS_BIT_CLR(hadc->Instance->SQR1, ADC_SQR1_L) || 8001be0: 2b00 cmp r3, #0 8001be2: d111 bne.n 8001c08 { /* Set ADC state */ CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY); 8001be4: 687b ldr r3, [r7, #4] 8001be6: 6cdb ldr r3, [r3, #76] ; 0x4c 8001be8: f423 7280 bic.w r2, r3, #256 ; 0x100 8001bec: 687b ldr r3, [r7, #4] 8001bee: 64da str r2, [r3, #76] ; 0x4c if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_INJ_BUSY)) 8001bf0: 687b ldr r3, [r7, #4] 8001bf2: 6cdb ldr r3, [r3, #76] ; 0x4c 8001bf4: f403 5380 and.w r3, r3, #4096 ; 0x1000 8001bf8: 2b00 cmp r3, #0 8001bfa: d105 bne.n 8001c08 { SET_BIT(hadc->State, HAL_ADC_STATE_READY); 8001bfc: 687b ldr r3, [r7, #4] 8001bfe: 6cdb ldr r3, [r3, #76] ; 0x4c 8001c00: f043 0201 orr.w r2, r3, #1 8001c04: 687b ldr r3, [r7, #4] 8001c06: 64da str r2, [r3, #76] ; 0x4c } } /* Return ADC state */ return HAL_OK; 8001c08: 2300 movs r3, #0 } 8001c0a: 4618 mov r0, r3 8001c0c: 3710 adds r7, #16 8001c0e: 46bd mov sp, r7 8001c10: bd80 pop {r7, pc} 08001c12 : * or @ref __HAL_ADC_CLEAR_FLAG(&hadc, ADC_FLAG_EOS). * @param hadc ADC handle * @retval ADC group regular conversion data */ uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc) { 8001c12: b480 push {r7} 8001c14: b083 sub sp, #12 8001c16: af00 add r7, sp, #0 8001c18: 6078 str r0, [r7, #4] /* Note: EOC flag is not cleared here by software because automatically */ /* cleared by hardware when reading register DR. */ /* Return ADC converted value */ return hadc->Instance->DR; 8001c1a: 687b ldr r3, [r7, #4] 8001c1c: 681b ldr r3, [r3, #0] 8001c1e: 6d9b ldr r3, [r3, #88] ; 0x58 } 8001c20: 4618 mov r0, r3 8001c22: 370c adds r7, #12 8001c24: 46bd mov sp, r7 8001c26: bc80 pop {r7} 8001c28: 4770 bx lr ... 08001c2c : * @param hadc ADC handle * @param sConfig Structure of ADC channel for regular group. * @retval HAL status */ HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig) { 8001c2c: b480 push {r7} 8001c2e: b085 sub sp, #20 8001c30: af00 add r7, sp, #0 8001c32: 6078 str r0, [r7, #4] 8001c34: 6039 str r1, [r7, #0] HAL_StatusTypeDef tmp_hal_status = HAL_OK; 8001c36: 2300 movs r3, #0 8001c38: 73fb strb r3, [r7, #15] __IO uint32_t wait_loop_index = 0; 8001c3a: 2300 movs r3, #0 8001c3c: 60bb str r3, [r7, #8] assert_param(IS_ADC_CHANNEL(sConfig->Channel)); assert_param(IS_ADC_REGULAR_RANK(sConfig->Rank)); assert_param(IS_ADC_SAMPLE_TIME(sConfig->SamplingTime)); /* Process locked */ __HAL_LOCK(hadc); 8001c3e: 687b ldr r3, [r7, #4] 8001c40: f893 3048 ldrb.w r3, [r3, #72] ; 0x48 8001c44: 2b01 cmp r3, #1 8001c46: d101 bne.n 8001c4c 8001c48: 2302 movs r3, #2 8001c4a: e14f b.n 8001eec 8001c4c: 687b ldr r3, [r7, #4] 8001c4e: 2201 movs r2, #1 8001c50: f883 2048 strb.w r2, [r3, #72] ; 0x48 /* Regular sequence configuration */ /* For Rank 1 to 6 */ if (sConfig->Rank < 7) 8001c54: 683b ldr r3, [r7, #0] 8001c56: 685b ldr r3, [r3, #4] 8001c58: 2b06 cmp r3, #6 8001c5a: d81c bhi.n 8001c96 { MODIFY_REG(hadc->Instance->SQR5, 8001c5c: 687b ldr r3, [r7, #4] 8001c5e: 681b ldr r3, [r3, #0] 8001c60: 6c19 ldr r1, [r3, #64] ; 0x40 8001c62: 683b ldr r3, [r7, #0] 8001c64: 685a ldr r2, [r3, #4] 8001c66: 4613 mov r3, r2 8001c68: 009b lsls r3, r3, #2 8001c6a: 4413 add r3, r2 8001c6c: 3b05 subs r3, #5 8001c6e: 221f movs r2, #31 8001c70: fa02 f303 lsl.w r3, r2, r3 8001c74: 43db mvns r3, r3 8001c76: 4019 ands r1, r3 8001c78: 683b ldr r3, [r7, #0] 8001c7a: 6818 ldr r0, [r3, #0] 8001c7c: 683b ldr r3, [r7, #0] 8001c7e: 685a ldr r2, [r3, #4] 8001c80: 4613 mov r3, r2 8001c82: 009b lsls r3, r3, #2 8001c84: 4413 add r3, r2 8001c86: 3b05 subs r3, #5 8001c88: fa00 f203 lsl.w r2, r0, r3 8001c8c: 687b ldr r3, [r7, #4] 8001c8e: 681b ldr r3, [r3, #0] 8001c90: 430a orrs r2, r1 8001c92: 641a str r2, [r3, #64] ; 0x40 8001c94: e07e b.n 8001d94 ADC_SQR5_RK(ADC_SQR5_SQ1, sConfig->Rank), ADC_SQR5_RK(sConfig->Channel, sConfig->Rank) ); } /* For Rank 7 to 12 */ else if (sConfig->Rank < 13) 8001c96: 683b ldr r3, [r7, #0] 8001c98: 685b ldr r3, [r3, #4] 8001c9a: 2b0c cmp r3, #12 8001c9c: d81c bhi.n 8001cd8 { MODIFY_REG(hadc->Instance->SQR4, 8001c9e: 687b ldr r3, [r7, #4] 8001ca0: 681b ldr r3, [r3, #0] 8001ca2: 6bd9 ldr r1, [r3, #60] ; 0x3c 8001ca4: 683b ldr r3, [r7, #0] 8001ca6: 685a ldr r2, [r3, #4] 8001ca8: 4613 mov r3, r2 8001caa: 009b lsls r3, r3, #2 8001cac: 4413 add r3, r2 8001cae: 3b23 subs r3, #35 ; 0x23 8001cb0: 221f movs r2, #31 8001cb2: fa02 f303 lsl.w r3, r2, r3 8001cb6: 43db mvns r3, r3 8001cb8: 4019 ands r1, r3 8001cba: 683b ldr r3, [r7, #0] 8001cbc: 6818 ldr r0, [r3, #0] 8001cbe: 683b ldr r3, [r7, #0] 8001cc0: 685a ldr r2, [r3, #4] 8001cc2: 4613 mov r3, r2 8001cc4: 009b lsls r3, r3, #2 8001cc6: 4413 add r3, r2 8001cc8: 3b23 subs r3, #35 ; 0x23 8001cca: fa00 f203 lsl.w r2, r0, r3 8001cce: 687b ldr r3, [r7, #4] 8001cd0: 681b ldr r3, [r3, #0] 8001cd2: 430a orrs r2, r1 8001cd4: 63da str r2, [r3, #60] ; 0x3c 8001cd6: e05d b.n 8001d94 ADC_SQR4_RK(ADC_SQR4_SQ7, sConfig->Rank), ADC_SQR4_RK(sConfig->Channel, sConfig->Rank) ); } /* For Rank 13 to 18 */ else if (sConfig->Rank < 19) 8001cd8: 683b ldr r3, [r7, #0] 8001cda: 685b ldr r3, [r3, #4] 8001cdc: 2b12 cmp r3, #18 8001cde: d81c bhi.n 8001d1a { MODIFY_REG(hadc->Instance->SQR3, 8001ce0: 687b ldr r3, [r7, #4] 8001ce2: 681b ldr r3, [r3, #0] 8001ce4: 6b99 ldr r1, [r3, #56] ; 0x38 8001ce6: 683b ldr r3, [r7, #0] 8001ce8: 685a ldr r2, [r3, #4] 8001cea: 4613 mov r3, r2 8001cec: 009b lsls r3, r3, #2 8001cee: 4413 add r3, r2 8001cf0: 3b41 subs r3, #65 ; 0x41 8001cf2: 221f movs r2, #31 8001cf4: fa02 f303 lsl.w r3, r2, r3 8001cf8: 43db mvns r3, r3 8001cfa: 4019 ands r1, r3 8001cfc: 683b ldr r3, [r7, #0] 8001cfe: 6818 ldr r0, [r3, #0] 8001d00: 683b ldr r3, [r7, #0] 8001d02: 685a ldr r2, [r3, #4] 8001d04: 4613 mov r3, r2 8001d06: 009b lsls r3, r3, #2 8001d08: 4413 add r3, r2 8001d0a: 3b41 subs r3, #65 ; 0x41 8001d0c: fa00 f203 lsl.w r2, r0, r3 8001d10: 687b ldr r3, [r7, #4] 8001d12: 681b ldr r3, [r3, #0] 8001d14: 430a orrs r2, r1 8001d16: 639a str r2, [r3, #56] ; 0x38 8001d18: e03c b.n 8001d94 ADC_SQR3_RK(ADC_SQR3_SQ13, sConfig->Rank), ADC_SQR3_RK(sConfig->Channel, sConfig->Rank) ); } /* For Rank 19 to 24 */ else if (sConfig->Rank < 25) 8001d1a: 683b ldr r3, [r7, #0] 8001d1c: 685b ldr r3, [r3, #4] 8001d1e: 2b18 cmp r3, #24 8001d20: d81c bhi.n 8001d5c { MODIFY_REG(hadc->Instance->SQR2, 8001d22: 687b ldr r3, [r7, #4] 8001d24: 681b ldr r3, [r3, #0] 8001d26: 6b59 ldr r1, [r3, #52] ; 0x34 8001d28: 683b ldr r3, [r7, #0] 8001d2a: 685a ldr r2, [r3, #4] 8001d2c: 4613 mov r3, r2 8001d2e: 009b lsls r3, r3, #2 8001d30: 4413 add r3, r2 8001d32: 3b5f subs r3, #95 ; 0x5f 8001d34: 221f movs r2, #31 8001d36: fa02 f303 lsl.w r3, r2, r3 8001d3a: 43db mvns r3, r3 8001d3c: 4019 ands r1, r3 8001d3e: 683b ldr r3, [r7, #0] 8001d40: 6818 ldr r0, [r3, #0] 8001d42: 683b ldr r3, [r7, #0] 8001d44: 685a ldr r2, [r3, #4] 8001d46: 4613 mov r3, r2 8001d48: 009b lsls r3, r3, #2 8001d4a: 4413 add r3, r2 8001d4c: 3b5f subs r3, #95 ; 0x5f 8001d4e: fa00 f203 lsl.w r2, r0, r3 8001d52: 687b ldr r3, [r7, #4] 8001d54: 681b ldr r3, [r3, #0] 8001d56: 430a orrs r2, r1 8001d58: 635a str r2, [r3, #52] ; 0x34 8001d5a: e01b b.n 8001d94 ADC_SQR2_RK(sConfig->Channel, sConfig->Rank) ); } /* For Rank 25 to 28 */ else { MODIFY_REG(hadc->Instance->SQR1, 8001d5c: 687b ldr r3, [r7, #4] 8001d5e: 681b ldr r3, [r3, #0] 8001d60: 6b19 ldr r1, [r3, #48] ; 0x30 8001d62: 683b ldr r3, [r7, #0] 8001d64: 685a ldr r2, [r3, #4] 8001d66: 4613 mov r3, r2 8001d68: 009b lsls r3, r3, #2 8001d6a: 4413 add r3, r2 8001d6c: 3b7d subs r3, #125 ; 0x7d 8001d6e: 221f movs r2, #31 8001d70: fa02 f303 lsl.w r3, r2, r3 8001d74: 43db mvns r3, r3 8001d76: 4019 ands r1, r3 8001d78: 683b ldr r3, [r7, #0] 8001d7a: 6818 ldr r0, [r3, #0] 8001d7c: 683b ldr r3, [r7, #0] 8001d7e: 685a ldr r2, [r3, #4] 8001d80: 4613 mov r3, r2 8001d82: 009b lsls r3, r3, #2 8001d84: 4413 add r3, r2 8001d86: 3b7d subs r3, #125 ; 0x7d 8001d88: fa00 f203 lsl.w r2, r0, r3 8001d8c: 687b ldr r3, [r7, #4] 8001d8e: 681b ldr r3, [r3, #0] 8001d90: 430a orrs r2, r1 8001d92: 631a str r2, [r3, #48] ; 0x30 } /* Channel sampling time configuration */ /* For channels 0 to 9 */ if (sConfig->Channel < ADC_CHANNEL_10) 8001d94: 683b ldr r3, [r7, #0] 8001d96: 681b ldr r3, [r3, #0] 8001d98: 2b09 cmp r3, #9 8001d9a: d81a bhi.n 8001dd2 { MODIFY_REG(hadc->Instance->SMPR3, 8001d9c: 687b ldr r3, [r7, #4] 8001d9e: 681b ldr r3, [r3, #0] 8001da0: 6959 ldr r1, [r3, #20] 8001da2: 683b ldr r3, [r7, #0] 8001da4: 681a ldr r2, [r3, #0] 8001da6: 4613 mov r3, r2 8001da8: 005b lsls r3, r3, #1 8001daa: 4413 add r3, r2 8001dac: 2207 movs r2, #7 8001dae: fa02 f303 lsl.w r3, r2, r3 8001db2: 43db mvns r3, r3 8001db4: 4019 ands r1, r3 8001db6: 683b ldr r3, [r7, #0] 8001db8: 6898 ldr r0, [r3, #8] 8001dba: 683b ldr r3, [r7, #0] 8001dbc: 681a ldr r2, [r3, #0] 8001dbe: 4613 mov r3, r2 8001dc0: 005b lsls r3, r3, #1 8001dc2: 4413 add r3, r2 8001dc4: fa00 f203 lsl.w r2, r0, r3 8001dc8: 687b ldr r3, [r7, #4] 8001dca: 681b ldr r3, [r3, #0] 8001dcc: 430a orrs r2, r1 8001dce: 615a str r2, [r3, #20] 8001dd0: e05d b.n 8001e8e ADC_SMPR3(ADC_SMPR3_SMP0, sConfig->Channel), ADC_SMPR3(sConfig->SamplingTime, sConfig->Channel) ); } /* For channels 10 to 19 */ else if (sConfig->Channel < ADC_CHANNEL_20) 8001dd2: 683b ldr r3, [r7, #0] 8001dd4: 681b ldr r3, [r3, #0] 8001dd6: 2b13 cmp r3, #19 8001dd8: d81c bhi.n 8001e14 { MODIFY_REG(hadc->Instance->SMPR2, 8001dda: 687b ldr r3, [r7, #4] 8001ddc: 681b ldr r3, [r3, #0] 8001dde: 6919 ldr r1, [r3, #16] 8001de0: 683b ldr r3, [r7, #0] 8001de2: 681a ldr r2, [r3, #0] 8001de4: 4613 mov r3, r2 8001de6: 005b lsls r3, r3, #1 8001de8: 4413 add r3, r2 8001dea: 3b1e subs r3, #30 8001dec: 2207 movs r2, #7 8001dee: fa02 f303 lsl.w r3, r2, r3 8001df2: 43db mvns r3, r3 8001df4: 4019 ands r1, r3 8001df6: 683b ldr r3, [r7, #0] 8001df8: 6898 ldr r0, [r3, #8] 8001dfa: 683b ldr r3, [r7, #0] 8001dfc: 681a ldr r2, [r3, #0] 8001dfe: 4613 mov r3, r2 8001e00: 005b lsls r3, r3, #1 8001e02: 4413 add r3, r2 8001e04: 3b1e subs r3, #30 8001e06: fa00 f203 lsl.w r2, r0, r3 8001e0a: 687b ldr r3, [r7, #4] 8001e0c: 681b ldr r3, [r3, #0] 8001e0e: 430a orrs r2, r1 8001e10: 611a str r2, [r3, #16] 8001e12: e03c b.n 8001e8e ADC_SMPR2(ADC_SMPR2_SMP10, sConfig->Channel), ADC_SMPR2(sConfig->SamplingTime, sConfig->Channel) ); } /* For channels 20 to 26 for devices Cat.1, Cat.2, Cat.3 */ /* For channels 20 to 29 for devices Cat4, Cat.5 */ else if (sConfig->Channel <= ADC_SMPR1_CHANNEL_MAX) 8001e14: 683b ldr r3, [r7, #0] 8001e16: 681b ldr r3, [r3, #0] 8001e18: 2b1d cmp r3, #29 8001e1a: d81c bhi.n 8001e56 { MODIFY_REG(hadc->Instance->SMPR1, 8001e1c: 687b ldr r3, [r7, #4] 8001e1e: 681b ldr r3, [r3, #0] 8001e20: 68d9 ldr r1, [r3, #12] 8001e22: 683b ldr r3, [r7, #0] 8001e24: 681a ldr r2, [r3, #0] 8001e26: 4613 mov r3, r2 8001e28: 005b lsls r3, r3, #1 8001e2a: 4413 add r3, r2 8001e2c: 3b3c subs r3, #60 ; 0x3c 8001e2e: 2207 movs r2, #7 8001e30: fa02 f303 lsl.w r3, r2, r3 8001e34: 43db mvns r3, r3 8001e36: 4019 ands r1, r3 8001e38: 683b ldr r3, [r7, #0] 8001e3a: 6898 ldr r0, [r3, #8] 8001e3c: 683b ldr r3, [r7, #0] 8001e3e: 681a ldr r2, [r3, #0] 8001e40: 4613 mov r3, r2 8001e42: 005b lsls r3, r3, #1 8001e44: 4413 add r3, r2 8001e46: 3b3c subs r3, #60 ; 0x3c 8001e48: fa00 f203 lsl.w r2, r0, r3 8001e4c: 687b ldr r3, [r7, #4] 8001e4e: 681b ldr r3, [r3, #0] 8001e50: 430a orrs r2, r1 8001e52: 60da str r2, [r3, #12] 8001e54: e01b b.n 8001e8e ADC_SMPR1(sConfig->SamplingTime, sConfig->Channel) ); } /* For channels 30 to 31 for devices Cat4, Cat.5 */ else { ADC_SMPR0_CHANNEL_SET(hadc, sConfig->SamplingTime, sConfig->Channel); 8001e56: 687b ldr r3, [r7, #4] 8001e58: 681b ldr r3, [r3, #0] 8001e5a: 6dd9 ldr r1, [r3, #92] ; 0x5c 8001e5c: 683b ldr r3, [r7, #0] 8001e5e: 681a ldr r2, [r3, #0] 8001e60: 4613 mov r3, r2 8001e62: 005b lsls r3, r3, #1 8001e64: 4413 add r3, r2 8001e66: 3b5a subs r3, #90 ; 0x5a 8001e68: 2207 movs r2, #7 8001e6a: fa02 f303 lsl.w r3, r2, r3 8001e6e: 43db mvns r3, r3 8001e70: 4019 ands r1, r3 8001e72: 683b ldr r3, [r7, #0] 8001e74: 6898 ldr r0, [r3, #8] 8001e76: 683b ldr r3, [r7, #0] 8001e78: 681a ldr r2, [r3, #0] 8001e7a: 4613 mov r3, r2 8001e7c: 005b lsls r3, r3, #1 8001e7e: 4413 add r3, r2 8001e80: 3b5a subs r3, #90 ; 0x5a 8001e82: fa00 f203 lsl.w r2, r0, r3 8001e86: 687b ldr r3, [r7, #4] 8001e88: 681b ldr r3, [r3, #0] 8001e8a: 430a orrs r2, r1 8001e8c: 65da str r2, [r3, #92] ; 0x5c } /* If ADC1 Channel_16 or Channel_17 is selected, enable Temperature sensor */ /* and VREFINT measurement path. */ if ((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR) || 8001e8e: 683b ldr r3, [r7, #0] 8001e90: 681b ldr r3, [r3, #0] 8001e92: 2b10 cmp r3, #16 8001e94: d003 beq.n 8001e9e (sConfig->Channel == ADC_CHANNEL_VREFINT) ) 8001e96: 683b ldr r3, [r7, #0] 8001e98: 681b ldr r3, [r3, #0] if ((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR) || 8001e9a: 2b11 cmp r3, #17 8001e9c: d121 bne.n 8001ee2 { if (READ_BIT(ADC->CCR, ADC_CCR_TSVREFE) == RESET) 8001e9e: 4b16 ldr r3, [pc, #88] ; (8001ef8 ) 8001ea0: 685b ldr r3, [r3, #4] 8001ea2: f403 0300 and.w r3, r3, #8388608 ; 0x800000 8001ea6: 2b00 cmp r3, #0 8001ea8: d11b bne.n 8001ee2 { SET_BIT(ADC->CCR, ADC_CCR_TSVREFE); 8001eaa: 4b13 ldr r3, [pc, #76] ; (8001ef8 ) 8001eac: 685b ldr r3, [r3, #4] 8001eae: 4a12 ldr r2, [pc, #72] ; (8001ef8 ) 8001eb0: f443 0300 orr.w r3, r3, #8388608 ; 0x800000 8001eb4: 6053 str r3, [r2, #4] if ((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR)) 8001eb6: 683b ldr r3, [r7, #0] 8001eb8: 681b ldr r3, [r3, #0] 8001eba: 2b10 cmp r3, #16 8001ebc: d111 bne.n 8001ee2 { /* Delay for temperature sensor stabilization time */ /* Compute number of CPU cycles to wait for */ wait_loop_index = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000)); 8001ebe: 4b0f ldr r3, [pc, #60] ; (8001efc ) 8001ec0: 681b ldr r3, [r3, #0] 8001ec2: 4a0f ldr r2, [pc, #60] ; (8001f00 ) 8001ec4: fba2 2303 umull r2, r3, r2, r3 8001ec8: 0c9a lsrs r2, r3, #18 8001eca: 4613 mov r3, r2 8001ecc: 009b lsls r3, r3, #2 8001ece: 4413 add r3, r2 8001ed0: 005b lsls r3, r3, #1 8001ed2: 60bb str r3, [r7, #8] while(wait_loop_index != 0) 8001ed4: e002 b.n 8001edc { wait_loop_index--; 8001ed6: 68bb ldr r3, [r7, #8] 8001ed8: 3b01 subs r3, #1 8001eda: 60bb str r3, [r7, #8] while(wait_loop_index != 0) 8001edc: 68bb ldr r3, [r7, #8] 8001ede: 2b00 cmp r3, #0 8001ee0: d1f9 bne.n 8001ed6 } } } /* Process unlocked */ __HAL_UNLOCK(hadc); 8001ee2: 687b ldr r3, [r7, #4] 8001ee4: 2200 movs r2, #0 8001ee6: f883 2048 strb.w r2, [r3, #72] ; 0x48 /* Return function status */ return tmp_hal_status; 8001eea: 7bfb ldrb r3, [r7, #15] } 8001eec: 4618 mov r0, r3 8001eee: 3714 adds r7, #20 8001ef0: 46bd mov sp, r7 8001ef2: bc80 pop {r7} 8001ef4: 4770 bx lr 8001ef6: bf00 nop 8001ef8: 40012700 .word 0x40012700 8001efc: 20000004 .word 0x20000004 8001f00: 431bde83 .word 0x431bde83 08001f04 : * "if (hadc->Init.LowPowerAutoPowerOff != ENABLE)". * @param hadc ADC handle * @retval HAL status. */ HAL_StatusTypeDef ADC_Enable(ADC_HandleTypeDef* hadc) { 8001f04: b580 push {r7, lr} 8001f06: b084 sub sp, #16 8001f08: af00 add r7, sp, #0 8001f0a: 6078 str r0, [r7, #4] uint32_t tickstart = 0; 8001f0c: 2300 movs r3, #0 8001f0e: 60fb str r3, [r7, #12] __IO uint32_t wait_loop_index = 0; 8001f10: 2300 movs r3, #0 8001f12: 60bb str r3, [r7, #8] /* ADC enable and wait for ADC ready (in case of ADC is disabled or */ /* enabling phase not yet completed: flag ADC ready not yet set). */ /* Timeout implemented to not be stuck if ADC cannot be enabled (possible */ /* causes: ADC clock not running, ...). */ if (ADC_IS_ENABLE(hadc) == RESET) 8001f14: 687b ldr r3, [r7, #4] 8001f16: 681b ldr r3, [r3, #0] 8001f18: 681b ldr r3, [r3, #0] 8001f1a: f003 0340 and.w r3, r3, #64 ; 0x40 8001f1e: 2b40 cmp r3, #64 ; 0x40 8001f20: d03c beq.n 8001f9c { /* Enable the Peripheral */ __HAL_ADC_ENABLE(hadc); 8001f22: 687b ldr r3, [r7, #4] 8001f24: 681b ldr r3, [r3, #0] 8001f26: 689a ldr r2, [r3, #8] 8001f28: 687b ldr r3, [r7, #4] 8001f2a: 681b ldr r3, [r3, #0] 8001f2c: f042 0201 orr.w r2, r2, #1 8001f30: 609a str r2, [r3, #8] /* Delay for ADC stabilization time */ /* Compute number of CPU cycles to wait for */ wait_loop_index = (ADC_STAB_DELAY_US * (SystemCoreClock / 1000000)); 8001f32: 4b1d ldr r3, [pc, #116] ; (8001fa8 ) 8001f34: 681b ldr r3, [r3, #0] 8001f36: 4a1d ldr r2, [pc, #116] ; (8001fac ) 8001f38: fba2 2303 umull r2, r3, r2, r3 8001f3c: 0c9a lsrs r2, r3, #18 8001f3e: 4613 mov r3, r2 8001f40: 005b lsls r3, r3, #1 8001f42: 4413 add r3, r2 8001f44: 60bb str r3, [r7, #8] while(wait_loop_index != 0) 8001f46: e002 b.n 8001f4e { wait_loop_index--; 8001f48: 68bb ldr r3, [r7, #8] 8001f4a: 3b01 subs r3, #1 8001f4c: 60bb str r3, [r7, #8] while(wait_loop_index != 0) 8001f4e: 68bb ldr r3, [r7, #8] 8001f50: 2b00 cmp r3, #0 8001f52: d1f9 bne.n 8001f48 } /* Get tick count */ tickstart = HAL_GetTick(); 8001f54: f7ff fc02 bl 800175c 8001f58: 60f8 str r0, [r7, #12] /* Wait for ADC effectively enabled */ while(ADC_IS_ENABLE(hadc) == RESET) 8001f5a: e018 b.n 8001f8e { if((HAL_GetTick() - tickstart ) > ADC_ENABLE_TIMEOUT) 8001f5c: f7ff fbfe bl 800175c 8001f60: 4602 mov r2, r0 8001f62: 68fb ldr r3, [r7, #12] 8001f64: 1ad3 subs r3, r2, r3 8001f66: 2b02 cmp r3, #2 8001f68: d911 bls.n 8001f8e { /* Update ADC state machine to error */ SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); 8001f6a: 687b ldr r3, [r7, #4] 8001f6c: 6cdb ldr r3, [r3, #76] ; 0x4c 8001f6e: f043 0210 orr.w r2, r3, #16 8001f72: 687b ldr r3, [r7, #4] 8001f74: 64da str r2, [r3, #76] ; 0x4c /* Set ADC error code to ADC IP internal error */ SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); 8001f76: 687b ldr r3, [r7, #4] 8001f78: 6d1b ldr r3, [r3, #80] ; 0x50 8001f7a: f043 0201 orr.w r2, r3, #1 8001f7e: 687b ldr r3, [r7, #4] 8001f80: 651a str r2, [r3, #80] ; 0x50 /* Process unlocked */ __HAL_UNLOCK(hadc); 8001f82: 687b ldr r3, [r7, #4] 8001f84: 2200 movs r2, #0 8001f86: f883 2048 strb.w r2, [r3, #72] ; 0x48 return HAL_ERROR; 8001f8a: 2301 movs r3, #1 8001f8c: e007 b.n 8001f9e while(ADC_IS_ENABLE(hadc) == RESET) 8001f8e: 687b ldr r3, [r7, #4] 8001f90: 681b ldr r3, [r3, #0] 8001f92: 681b ldr r3, [r3, #0] 8001f94: f003 0340 and.w r3, r3, #64 ; 0x40 8001f98: 2b40 cmp r3, #64 ; 0x40 8001f9a: d1df bne.n 8001f5c } } } /* Return HAL status */ return HAL_OK; 8001f9c: 2300 movs r3, #0 } 8001f9e: 4618 mov r0, r3 8001fa0: 3710 adds r7, #16 8001fa2: 46bd mov sp, r7 8001fa4: bd80 pop {r7, pc} 8001fa6: bf00 nop 8001fa8: 20000004 .word 0x20000004 8001fac: 431bde83 .word 0x431bde83 08001fb0 <__NVIC_SetPriorityGrouping>: In case of a conflict between priority grouping and available priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. \param [in] PriorityGroup Priority grouping field. */ __STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { 8001fb0: b480 push {r7} 8001fb2: b085 sub sp, #20 8001fb4: af00 add r7, sp, #0 8001fb6: 6078 str r0, [r7, #4] uint32_t reg_value; uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ 8001fb8: 687b ldr r3, [r7, #4] 8001fba: f003 0307 and.w r3, r3, #7 8001fbe: 60fb str r3, [r7, #12] reg_value = SCB->AIRCR; /* read old register configuration */ 8001fc0: 4b0c ldr r3, [pc, #48] ; (8001ff4 <__NVIC_SetPriorityGrouping+0x44>) 8001fc2: 68db ldr r3, [r3, #12] 8001fc4: 60bb str r3, [r7, #8] reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ 8001fc6: 68ba ldr r2, [r7, #8] 8001fc8: f64f 03ff movw r3, #63743 ; 0xf8ff 8001fcc: 4013 ands r3, r2 8001fce: 60bb str r3, [r7, #8] reg_value = (reg_value | ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ 8001fd0: 68fb ldr r3, [r7, #12] 8001fd2: 021a lsls r2, r3, #8 ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | 8001fd4: 68bb ldr r3, [r7, #8] 8001fd6: 4313 orrs r3, r2 reg_value = (reg_value | 8001fd8: f043 63bf orr.w r3, r3, #100139008 ; 0x5f80000 8001fdc: f443 3300 orr.w r3, r3, #131072 ; 0x20000 8001fe0: 60bb str r3, [r7, #8] SCB->AIRCR = reg_value; 8001fe2: 4a04 ldr r2, [pc, #16] ; (8001ff4 <__NVIC_SetPriorityGrouping+0x44>) 8001fe4: 68bb ldr r3, [r7, #8] 8001fe6: 60d3 str r3, [r2, #12] } 8001fe8: bf00 nop 8001fea: 3714 adds r7, #20 8001fec: 46bd mov sp, r7 8001fee: bc80 pop {r7} 8001ff0: 4770 bx lr 8001ff2: bf00 nop 8001ff4: e000ed00 .word 0xe000ed00 08001ff8 <__NVIC_GetPriorityGrouping>: \brief Get Priority Grouping \details Reads the priority grouping field from the NVIC Interrupt Controller. \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). */ __STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) { 8001ff8: b480 push {r7} 8001ffa: af00 add r7, sp, #0 return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); 8001ffc: 4b04 ldr r3, [pc, #16] ; (8002010 <__NVIC_GetPriorityGrouping+0x18>) 8001ffe: 68db ldr r3, [r3, #12] 8002000: 0a1b lsrs r3, r3, #8 8002002: f003 0307 and.w r3, r3, #7 } 8002006: 4618 mov r0, r3 8002008: 46bd mov sp, r7 800200a: bc80 pop {r7} 800200c: 4770 bx lr 800200e: bf00 nop 8002010: e000ed00 .word 0xe000ed00 08002014 <__NVIC_SetPriority>: \param [in] IRQn Interrupt number. \param [in] priority Priority to set. \note The priority cannot be set for every processor exception. */ __STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) { 8002014: b480 push {r7} 8002016: b083 sub sp, #12 8002018: af00 add r7, sp, #0 800201a: 4603 mov r3, r0 800201c: 6039 str r1, [r7, #0] 800201e: 71fb strb r3, [r7, #7] if ((int32_t)(IRQn) >= 0) 8002020: f997 3007 ldrsb.w r3, [r7, #7] 8002024: 2b00 cmp r3, #0 8002026: db0a blt.n 800203e <__NVIC_SetPriority+0x2a> { NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); 8002028: 683b ldr r3, [r7, #0] 800202a: b2da uxtb r2, r3 800202c: 490c ldr r1, [pc, #48] ; (8002060 <__NVIC_SetPriority+0x4c>) 800202e: f997 3007 ldrsb.w r3, [r7, #7] 8002032: 0112 lsls r2, r2, #4 8002034: b2d2 uxtb r2, r2 8002036: 440b add r3, r1 8002038: f883 2300 strb.w r2, [r3, #768] ; 0x300 } else { SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); } } 800203c: e00a b.n 8002054 <__NVIC_SetPriority+0x40> SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); 800203e: 683b ldr r3, [r7, #0] 8002040: b2da uxtb r2, r3 8002042: 4908 ldr r1, [pc, #32] ; (8002064 <__NVIC_SetPriority+0x50>) 8002044: 79fb ldrb r3, [r7, #7] 8002046: f003 030f and.w r3, r3, #15 800204a: 3b04 subs r3, #4 800204c: 0112 lsls r2, r2, #4 800204e: b2d2 uxtb r2, r2 8002050: 440b add r3, r1 8002052: 761a strb r2, [r3, #24] } 8002054: bf00 nop 8002056: 370c adds r7, #12 8002058: 46bd mov sp, r7 800205a: bc80 pop {r7} 800205c: 4770 bx lr 800205e: bf00 nop 8002060: e000e100 .word 0xe000e100 8002064: e000ed00 .word 0xe000ed00 08002068 : \param [in] PreemptPriority Preemptive priority value (starting from 0). \param [in] SubPriority Subpriority value (starting from 0). \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). */ __STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) { 8002068: b480 push {r7} 800206a: b089 sub sp, #36 ; 0x24 800206c: af00 add r7, sp, #0 800206e: 60f8 str r0, [r7, #12] 8002070: 60b9 str r1, [r7, #8] 8002072: 607a str r2, [r7, #4] uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ 8002074: 68fb ldr r3, [r7, #12] 8002076: f003 0307 and.w r3, r3, #7 800207a: 61fb str r3, [r7, #28] uint32_t PreemptPriorityBits; uint32_t SubPriorityBits; PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); 800207c: 69fb ldr r3, [r7, #28] 800207e: f1c3 0307 rsb r3, r3, #7 8002082: 2b04 cmp r3, #4 8002084: bf28 it cs 8002086: 2304 movcs r3, #4 8002088: 61bb str r3, [r7, #24] SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); 800208a: 69fb ldr r3, [r7, #28] 800208c: 3304 adds r3, #4 800208e: 2b06 cmp r3, #6 8002090: d902 bls.n 8002098 8002092: 69fb ldr r3, [r7, #28] 8002094: 3b03 subs r3, #3 8002096: e000 b.n 800209a 8002098: 2300 movs r3, #0 800209a: 617b str r3, [r7, #20] return ( ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | 800209c: f04f 32ff mov.w r2, #4294967295 80020a0: 69bb ldr r3, [r7, #24] 80020a2: fa02 f303 lsl.w r3, r2, r3 80020a6: 43da mvns r2, r3 80020a8: 68bb ldr r3, [r7, #8] 80020aa: 401a ands r2, r3 80020ac: 697b ldr r3, [r7, #20] 80020ae: 409a lsls r2, r3 ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) 80020b0: f04f 31ff mov.w r1, #4294967295 80020b4: 697b ldr r3, [r7, #20] 80020b6: fa01 f303 lsl.w r3, r1, r3 80020ba: 43d9 mvns r1, r3 80020bc: 687b ldr r3, [r7, #4] 80020be: 400b ands r3, r1 ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | 80020c0: 4313 orrs r3, r2 ); } 80020c2: 4618 mov r0, r3 80020c4: 3724 adds r7, #36 ; 0x24 80020c6: 46bd mov sp, r7 80020c8: bc80 pop {r7} 80020ca: 4770 bx lr 080020cc : \note When the variable __Vendor_SysTickConfig is set to 1, then the function SysTick_Config is not included. In this case, the file device.h must contain a vendor-specific implementation of this function. */ __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) { 80020cc: b580 push {r7, lr} 80020ce: b082 sub sp, #8 80020d0: af00 add r7, sp, #0 80020d2: 6078 str r0, [r7, #4] if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) 80020d4: 687b ldr r3, [r7, #4] 80020d6: 3b01 subs r3, #1 80020d8: f1b3 7f80 cmp.w r3, #16777216 ; 0x1000000 80020dc: d301 bcc.n 80020e2 { return (1UL); /* Reload value impossible */ 80020de: 2301 movs r3, #1 80020e0: e00f b.n 8002102 } SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ 80020e2: 4a0a ldr r2, [pc, #40] ; (800210c ) 80020e4: 687b ldr r3, [r7, #4] 80020e6: 3b01 subs r3, #1 80020e8: 6053 str r3, [r2, #4] NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ 80020ea: 210f movs r1, #15 80020ec: f04f 30ff mov.w r0, #4294967295 80020f0: f7ff ff90 bl 8002014 <__NVIC_SetPriority> SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ 80020f4: 4b05 ldr r3, [pc, #20] ; (800210c ) 80020f6: 2200 movs r2, #0 80020f8: 609a str r2, [r3, #8] SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | 80020fa: 4b04 ldr r3, [pc, #16] ; (800210c ) 80020fc: 2207 movs r2, #7 80020fe: 601a str r2, [r3, #0] SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ return (0UL); /* Function successful */ 8002100: 2300 movs r3, #0 } 8002102: 4618 mov r0, r3 8002104: 3708 adds r7, #8 8002106: 46bd mov sp, r7 8002108: bd80 pop {r7, pc} 800210a: bf00 nop 800210c: e000e010 .word 0xe000e010 08002110 : * @note When the NVIC_PriorityGroup_0 is selected, IRQ pre-emption is no more possible. * The pending IRQ priority will be managed only by the subpriority. * @retval None */ void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { 8002110: b580 push {r7, lr} 8002112: b082 sub sp, #8 8002114: af00 add r7, sp, #0 8002116: 6078 str r0, [r7, #4] /* Check the parameters */ assert_param(IS_NVIC_PRIORITY_GROUP(PriorityGroup)); /* Set the PRIGROUP[10:8] bits according to the PriorityGroup parameter value */ NVIC_SetPriorityGrouping(PriorityGroup); 8002118: 6878 ldr r0, [r7, #4] 800211a: f7ff ff49 bl 8001fb0 <__NVIC_SetPriorityGrouping> } 800211e: bf00 nop 8002120: 3708 adds r7, #8 8002122: 46bd mov sp, r7 8002124: bd80 pop {r7, pc} 08002126 : * This parameter can be a value between 0 and 15 * A lower priority value indicates a higher priority. * @retval None */ void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority) { 8002126: b580 push {r7, lr} 8002128: b086 sub sp, #24 800212a: af00 add r7, sp, #0 800212c: 4603 mov r3, r0 800212e: 60b9 str r1, [r7, #8] 8002130: 607a str r2, [r7, #4] 8002132: 73fb strb r3, [r7, #15] uint32_t prioritygroup = 0x00; 8002134: 2300 movs r3, #0 8002136: 617b str r3, [r7, #20] /* Check the parameters */ assert_param(IS_NVIC_SUB_PRIORITY(SubPriority)); assert_param(IS_NVIC_PREEMPTION_PRIORITY(PreemptPriority)); prioritygroup = NVIC_GetPriorityGrouping(); 8002138: f7ff ff5e bl 8001ff8 <__NVIC_GetPriorityGrouping> 800213c: 6178 str r0, [r7, #20] NVIC_SetPriority(IRQn, NVIC_EncodePriority(prioritygroup, PreemptPriority, SubPriority)); 800213e: 687a ldr r2, [r7, #4] 8002140: 68b9 ldr r1, [r7, #8] 8002142: 6978 ldr r0, [r7, #20] 8002144: f7ff ff90 bl 8002068 8002148: 4602 mov r2, r0 800214a: f997 300f ldrsb.w r3, [r7, #15] 800214e: 4611 mov r1, r2 8002150: 4618 mov r0, r3 8002152: f7ff ff5f bl 8002014 <__NVIC_SetPriority> } 8002156: bf00 nop 8002158: 3718 adds r7, #24 800215a: 46bd mov sp, r7 800215c: bd80 pop {r7, pc} 0800215e : * @param TicksNumb Specifies the ticks Number of ticks between two interrupts. * @retval status: - 0 Function succeeded. * - 1 Function failed. */ uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb) { 800215e: b580 push {r7, lr} 8002160: b082 sub sp, #8 8002162: af00 add r7, sp, #0 8002164: 6078 str r0, [r7, #4] return SysTick_Config(TicksNumb); 8002166: 6878 ldr r0, [r7, #4] 8002168: f7ff ffb0 bl 80020cc 800216c: 4603 mov r3, r0 } 800216e: 4618 mov r0, r3 8002170: 3708 adds r7, #8 8002172: 46bd mov sp, r7 8002174: bd80 pop {r7, pc} 08002176 : /** * @brief This function handles SYSTICK interrupt request. * @retval None */ void HAL_SYSTICK_IRQHandler(void) { 8002176: b580 push {r7, lr} 8002178: af00 add r7, sp, #0 HAL_SYSTICK_Callback(); 800217a: f000 f802 bl 8002182 } 800217e: bf00 nop 8002180: bd80 pop {r7, pc} 08002182 : /** * @brief SYSTICK callback. * @retval None */ __weak void HAL_SYSTICK_Callback(void) { 8002182: b480 push {r7} 8002184: af00 add r7, sp, #0 /* NOTE : This function Should not be modified, when the callback is needed, the HAL_SYSTICK_Callback could be implemented in the user file */ } 8002186: bf00 nop 8002188: 46bd mov sp, r7 800218a: bc80 pop {r7} 800218c: 4770 bx lr ... 08002190 : * @param GPIO_Init pointer to a GPIO_InitTypeDef structure that contains * the configuration information for the specified GPIO peripheral. * @retval None */ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) { 8002190: b480 push {r7} 8002192: b087 sub sp, #28 8002194: af00 add r7, sp, #0 8002196: 6078 str r0, [r7, #4] 8002198: 6039 str r1, [r7, #0] uint32_t position = 0x00; 800219a: 2300 movs r3, #0 800219c: 617b str r3, [r7, #20] uint32_t iocurrent = 0x00; 800219e: 2300 movs r3, #0 80021a0: 60fb str r3, [r7, #12] uint32_t temp = 0x00; 80021a2: 2300 movs r3, #0 80021a4: 613b str r3, [r7, #16] assert_param(IS_GPIO_PIN(GPIO_Init->Pin)); assert_param(IS_GPIO_MODE(GPIO_Init->Mode)); assert_param(IS_GPIO_PULL(GPIO_Init->Pull)); /* Configure the port pins */ while (((GPIO_Init->Pin) >> position) != 0) 80021a6: e160 b.n 800246a { /* Get current io position */ iocurrent = (GPIO_Init->Pin) & (1U << position); 80021a8: 683b ldr r3, [r7, #0] 80021aa: 681a ldr r2, [r3, #0] 80021ac: 2101 movs r1, #1 80021ae: 697b ldr r3, [r7, #20] 80021b0: fa01 f303 lsl.w r3, r1, r3 80021b4: 4013 ands r3, r2 80021b6: 60fb str r3, [r7, #12] if (iocurrent) 80021b8: 68fb ldr r3, [r7, #12] 80021ba: 2b00 cmp r3, #0 80021bc: f000 8152 beq.w 8002464 { /*--------------------- GPIO Mode Configuration ------------------------*/ /* In case of Output or Alternate function mode selection */ if ((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) || 80021c0: 683b ldr r3, [r7, #0] 80021c2: 685b ldr r3, [r3, #4] 80021c4: 2b01 cmp r3, #1 80021c6: d00b beq.n 80021e0 80021c8: 683b ldr r3, [r7, #0] 80021ca: 685b ldr r3, [r3, #4] 80021cc: 2b02 cmp r3, #2 80021ce: d007 beq.n 80021e0 (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) 80021d0: 683b ldr r3, [r7, #0] 80021d2: 685b ldr r3, [r3, #4] if ((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) || 80021d4: 2b11 cmp r3, #17 80021d6: d003 beq.n 80021e0 (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) 80021d8: 683b ldr r3, [r7, #0] 80021da: 685b ldr r3, [r3, #4] 80021dc: 2b12 cmp r3, #18 80021de: d130 bne.n 8002242 { /* Check the Speed parameter */ assert_param(IS_GPIO_SPEED(GPIO_Init->Speed)); /* Configure the IO Speed */ temp = GPIOx->OSPEEDR; 80021e0: 687b ldr r3, [r7, #4] 80021e2: 689b ldr r3, [r3, #8] 80021e4: 613b str r3, [r7, #16] CLEAR_BIT(temp, GPIO_OSPEEDER_OSPEEDR0 << (position * 2)); 80021e6: 697b ldr r3, [r7, #20] 80021e8: 005b lsls r3, r3, #1 80021ea: 2203 movs r2, #3 80021ec: fa02 f303 lsl.w r3, r2, r3 80021f0: 43db mvns r3, r3 80021f2: 693a ldr r2, [r7, #16] 80021f4: 4013 ands r3, r2 80021f6: 613b str r3, [r7, #16] SET_BIT(temp, GPIO_Init->Speed << (position * 2)); 80021f8: 683b ldr r3, [r7, #0] 80021fa: 68da ldr r2, [r3, #12] 80021fc: 697b ldr r3, [r7, #20] 80021fe: 005b lsls r3, r3, #1 8002200: fa02 f303 lsl.w r3, r2, r3 8002204: 693a ldr r2, [r7, #16] 8002206: 4313 orrs r3, r2 8002208: 613b str r3, [r7, #16] GPIOx->OSPEEDR = temp; 800220a: 687b ldr r3, [r7, #4] 800220c: 693a ldr r2, [r7, #16] 800220e: 609a str r2, [r3, #8] /* Configure the IO Output Type */ temp = GPIOx->OTYPER; 8002210: 687b ldr r3, [r7, #4] 8002212: 685b ldr r3, [r3, #4] 8002214: 613b str r3, [r7, #16] CLEAR_BIT(temp, GPIO_OTYPER_OT_0 << position) ; 8002216: 2201 movs r2, #1 8002218: 697b ldr r3, [r7, #20] 800221a: fa02 f303 lsl.w r3, r2, r3 800221e: 43db mvns r3, r3 8002220: 693a ldr r2, [r7, #16] 8002222: 4013 ands r3, r2 8002224: 613b str r3, [r7, #16] SET_BIT(temp, ((GPIO_Init->Mode & GPIO_OUTPUT_TYPE) >> 4) << position); 8002226: 683b ldr r3, [r7, #0] 8002228: 685b ldr r3, [r3, #4] 800222a: 091b lsrs r3, r3, #4 800222c: f003 0201 and.w r2, r3, #1 8002230: 697b ldr r3, [r7, #20] 8002232: fa02 f303 lsl.w r3, r2, r3 8002236: 693a ldr r2, [r7, #16] 8002238: 4313 orrs r3, r2 800223a: 613b str r3, [r7, #16] GPIOx->OTYPER = temp; 800223c: 687b ldr r3, [r7, #4] 800223e: 693a ldr r2, [r7, #16] 8002240: 605a str r2, [r3, #4] } /* Activate the Pull-up or Pull down resistor for the current IO */ temp = GPIOx->PUPDR; 8002242: 687b ldr r3, [r7, #4] 8002244: 68db ldr r3, [r3, #12] 8002246: 613b str r3, [r7, #16] CLEAR_BIT(temp, GPIO_PUPDR_PUPDR0 << (position * 2)); 8002248: 697b ldr r3, [r7, #20] 800224a: 005b lsls r3, r3, #1 800224c: 2203 movs r2, #3 800224e: fa02 f303 lsl.w r3, r2, r3 8002252: 43db mvns r3, r3 8002254: 693a ldr r2, [r7, #16] 8002256: 4013 ands r3, r2 8002258: 613b str r3, [r7, #16] SET_BIT(temp, (GPIO_Init->Pull) << (position * 2)); 800225a: 683b ldr r3, [r7, #0] 800225c: 689a ldr r2, [r3, #8] 800225e: 697b ldr r3, [r7, #20] 8002260: 005b lsls r3, r3, #1 8002262: fa02 f303 lsl.w r3, r2, r3 8002266: 693a ldr r2, [r7, #16] 8002268: 4313 orrs r3, r2 800226a: 613b str r3, [r7, #16] GPIOx->PUPDR = temp; 800226c: 687b ldr r3, [r7, #4] 800226e: 693a ldr r2, [r7, #16] 8002270: 60da str r2, [r3, #12] /* In case of Alternate function mode selection */ if ((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) 8002272: 683b ldr r3, [r7, #0] 8002274: 685b ldr r3, [r3, #4] 8002276: 2b02 cmp r3, #2 8002278: d003 beq.n 8002282 800227a: 683b ldr r3, [r7, #0] 800227c: 685b ldr r3, [r3, #4] 800227e: 2b12 cmp r3, #18 8002280: d123 bne.n 80022ca assert_param(IS_GPIO_AF_INSTANCE(GPIOx)); assert_param(IS_GPIO_AF(GPIO_Init->Alternate)); /* Configure Alternate function mapped with the current IO */ /* Identify AFRL or AFRH register based on IO position*/ temp = GPIOx->AFR[position >> 3]; 8002282: 697b ldr r3, [r7, #20] 8002284: 08da lsrs r2, r3, #3 8002286: 687b ldr r3, [r7, #4] 8002288: 3208 adds r2, #8 800228a: f853 3022 ldr.w r3, [r3, r2, lsl #2] 800228e: 613b str r3, [r7, #16] CLEAR_BIT(temp, 0xFU << ((uint32_t)(position & 0x07U) * 4)); 8002290: 697b ldr r3, [r7, #20] 8002292: f003 0307 and.w r3, r3, #7 8002296: 009b lsls r3, r3, #2 8002298: 220f movs r2, #15 800229a: fa02 f303 lsl.w r3, r2, r3 800229e: 43db mvns r3, r3 80022a0: 693a ldr r2, [r7, #16] 80022a2: 4013 ands r3, r2 80022a4: 613b str r3, [r7, #16] SET_BIT(temp, (uint32_t)(GPIO_Init->Alternate) << (((uint32_t)position & 0x07U) * 4)); 80022a6: 683b ldr r3, [r7, #0] 80022a8: 691a ldr r2, [r3, #16] 80022aa: 697b ldr r3, [r7, #20] 80022ac: f003 0307 and.w r3, r3, #7 80022b0: 009b lsls r3, r3, #2 80022b2: fa02 f303 lsl.w r3, r2, r3 80022b6: 693a ldr r2, [r7, #16] 80022b8: 4313 orrs r3, r2 80022ba: 613b str r3, [r7, #16] GPIOx->AFR[position >> 3] = temp; 80022bc: 697b ldr r3, [r7, #20] 80022be: 08da lsrs r2, r3, #3 80022c0: 687b ldr r3, [r7, #4] 80022c2: 3208 adds r2, #8 80022c4: 6939 ldr r1, [r7, #16] 80022c6: f843 1022 str.w r1, [r3, r2, lsl #2] } /* Configure IO Direction mode (Input, Output, Alternate or Analog) */ temp = GPIOx->MODER; 80022ca: 687b ldr r3, [r7, #4] 80022cc: 681b ldr r3, [r3, #0] 80022ce: 613b str r3, [r7, #16] CLEAR_BIT(temp, GPIO_MODER_MODER0 << (position * 2)); 80022d0: 697b ldr r3, [r7, #20] 80022d2: 005b lsls r3, r3, #1 80022d4: 2203 movs r2, #3 80022d6: fa02 f303 lsl.w r3, r2, r3 80022da: 43db mvns r3, r3 80022dc: 693a ldr r2, [r7, #16] 80022de: 4013 ands r3, r2 80022e0: 613b str r3, [r7, #16] SET_BIT(temp, (GPIO_Init->Mode & GPIO_MODE) << (position * 2)); 80022e2: 683b ldr r3, [r7, #0] 80022e4: 685b ldr r3, [r3, #4] 80022e6: f003 0203 and.w r2, r3, #3 80022ea: 697b ldr r3, [r7, #20] 80022ec: 005b lsls r3, r3, #1 80022ee: fa02 f303 lsl.w r3, r2, r3 80022f2: 693a ldr r2, [r7, #16] 80022f4: 4313 orrs r3, r2 80022f6: 613b str r3, [r7, #16] GPIOx->MODER = temp; 80022f8: 687b ldr r3, [r7, #4] 80022fa: 693a ldr r2, [r7, #16] 80022fc: 601a str r2, [r3, #0] /*--------------------- EXTI Mode Configuration ------------------------*/ /* Configure the External Interrupt or event for the current IO */ if ((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE) 80022fe: 683b ldr r3, [r7, #0] 8002300: 685b ldr r3, [r3, #4] 8002302: f003 5380 and.w r3, r3, #268435456 ; 0x10000000 8002306: 2b00 cmp r3, #0 8002308: f000 80ac beq.w 8002464 { /* Enable SYSCFG Clock */ __HAL_RCC_SYSCFG_CLK_ENABLE(); 800230c: 4b5d ldr r3, [pc, #372] ; (8002484 ) 800230e: 6a1b ldr r3, [r3, #32] 8002310: 4a5c ldr r2, [pc, #368] ; (8002484 ) 8002312: f043 0301 orr.w r3, r3, #1 8002316: 6213 str r3, [r2, #32] 8002318: 4b5a ldr r3, [pc, #360] ; (8002484 ) 800231a: 6a1b ldr r3, [r3, #32] 800231c: f003 0301 and.w r3, r3, #1 8002320: 60bb str r3, [r7, #8] 8002322: 68bb ldr r3, [r7, #8] temp = SYSCFG->EXTICR[position >> 2]; 8002324: 4a58 ldr r2, [pc, #352] ; (8002488 ) 8002326: 697b ldr r3, [r7, #20] 8002328: 089b lsrs r3, r3, #2 800232a: 3302 adds r3, #2 800232c: f852 3023 ldr.w r3, [r2, r3, lsl #2] 8002330: 613b str r3, [r7, #16] CLEAR_BIT(temp, (0x0FU) << (4 * (position & 0x03))); 8002332: 697b ldr r3, [r7, #20] 8002334: f003 0303 and.w r3, r3, #3 8002338: 009b lsls r3, r3, #2 800233a: 220f movs r2, #15 800233c: fa02 f303 lsl.w r3, r2, r3 8002340: 43db mvns r3, r3 8002342: 693a ldr r2, [r7, #16] 8002344: 4013 ands r3, r2 8002346: 613b str r3, [r7, #16] SET_BIT(temp, (GPIO_GET_INDEX(GPIOx)) << (4 * (position & 0x03))); 8002348: 687b ldr r3, [r7, #4] 800234a: 4a50 ldr r2, [pc, #320] ; (800248c ) 800234c: 4293 cmp r3, r2 800234e: d025 beq.n 800239c 8002350: 687b ldr r3, [r7, #4] 8002352: 4a4f ldr r2, [pc, #316] ; (8002490 ) 8002354: 4293 cmp r3, r2 8002356: d01f beq.n 8002398 8002358: 687b ldr r3, [r7, #4] 800235a: 4a4e ldr r2, [pc, #312] ; (8002494 ) 800235c: 4293 cmp r3, r2 800235e: d019 beq.n 8002394 8002360: 687b ldr r3, [r7, #4] 8002362: 4a4d ldr r2, [pc, #308] ; (8002498 ) 8002364: 4293 cmp r3, r2 8002366: d013 beq.n 8002390 8002368: 687b ldr r3, [r7, #4] 800236a: 4a4c ldr r2, [pc, #304] ; (800249c ) 800236c: 4293 cmp r3, r2 800236e: d00d beq.n 800238c 8002370: 687b ldr r3, [r7, #4] 8002372: 4a4b ldr r2, [pc, #300] ; (80024a0 ) 8002374: 4293 cmp r3, r2 8002376: d007 beq.n 8002388 8002378: 687b ldr r3, [r7, #4] 800237a: 4a4a ldr r2, [pc, #296] ; (80024a4 ) 800237c: 4293 cmp r3, r2 800237e: d101 bne.n 8002384 8002380: 2306 movs r3, #6 8002382: e00c b.n 800239e 8002384: 2307 movs r3, #7 8002386: e00a b.n 800239e 8002388: 2305 movs r3, #5 800238a: e008 b.n 800239e 800238c: 2304 movs r3, #4 800238e: e006 b.n 800239e 8002390: 2303 movs r3, #3 8002392: e004 b.n 800239e 8002394: 2302 movs r3, #2 8002396: e002 b.n 800239e 8002398: 2301 movs r3, #1 800239a: e000 b.n 800239e 800239c: 2300 movs r3, #0 800239e: 697a ldr r2, [r7, #20] 80023a0: f002 0203 and.w r2, r2, #3 80023a4: 0092 lsls r2, r2, #2 80023a6: 4093 lsls r3, r2 80023a8: 693a ldr r2, [r7, #16] 80023aa: 4313 orrs r3, r2 80023ac: 613b str r3, [r7, #16] SYSCFG->EXTICR[position >> 2] = temp; 80023ae: 4936 ldr r1, [pc, #216] ; (8002488 ) 80023b0: 697b ldr r3, [r7, #20] 80023b2: 089b lsrs r3, r3, #2 80023b4: 3302 adds r3, #2 80023b6: 693a ldr r2, [r7, #16] 80023b8: f841 2023 str.w r2, [r1, r3, lsl #2] /* Clear EXTI line configuration */ temp = EXTI->IMR; 80023bc: 4b3a ldr r3, [pc, #232] ; (80024a8 ) 80023be: 681b ldr r3, [r3, #0] 80023c0: 613b str r3, [r7, #16] CLEAR_BIT(temp, (uint32_t)iocurrent); 80023c2: 68fb ldr r3, [r7, #12] 80023c4: 43db mvns r3, r3 80023c6: 693a ldr r2, [r7, #16] 80023c8: 4013 ands r3, r2 80023ca: 613b str r3, [r7, #16] if ((GPIO_Init->Mode & GPIO_MODE_IT) == GPIO_MODE_IT) 80023cc: 683b ldr r3, [r7, #0] 80023ce: 685b ldr r3, [r3, #4] 80023d0: f403 3380 and.w r3, r3, #65536 ; 0x10000 80023d4: 2b00 cmp r3, #0 80023d6: d003 beq.n 80023e0 { SET_BIT(temp, iocurrent); 80023d8: 693a ldr r2, [r7, #16] 80023da: 68fb ldr r3, [r7, #12] 80023dc: 4313 orrs r3, r2 80023de: 613b str r3, [r7, #16] } EXTI->IMR = temp; 80023e0: 4a31 ldr r2, [pc, #196] ; (80024a8 ) 80023e2: 693b ldr r3, [r7, #16] 80023e4: 6013 str r3, [r2, #0] temp = EXTI->EMR; 80023e6: 4b30 ldr r3, [pc, #192] ; (80024a8 ) 80023e8: 685b ldr r3, [r3, #4] 80023ea: 613b str r3, [r7, #16] CLEAR_BIT(temp, (uint32_t)iocurrent); 80023ec: 68fb ldr r3, [r7, #12] 80023ee: 43db mvns r3, r3 80023f0: 693a ldr r2, [r7, #16] 80023f2: 4013 ands r3, r2 80023f4: 613b str r3, [r7, #16] if ((GPIO_Init->Mode & GPIO_MODE_EVT) == GPIO_MODE_EVT) 80023f6: 683b ldr r3, [r7, #0] 80023f8: 685b ldr r3, [r3, #4] 80023fa: f403 3300 and.w r3, r3, #131072 ; 0x20000 80023fe: 2b00 cmp r3, #0 8002400: d003 beq.n 800240a { SET_BIT(temp, iocurrent); 8002402: 693a ldr r2, [r7, #16] 8002404: 68fb ldr r3, [r7, #12] 8002406: 4313 orrs r3, r2 8002408: 613b str r3, [r7, #16] } EXTI->EMR = temp; 800240a: 4a27 ldr r2, [pc, #156] ; (80024a8 ) 800240c: 693b ldr r3, [r7, #16] 800240e: 6053 str r3, [r2, #4] /* Clear Rising Falling edge configuration */ temp = EXTI->RTSR; 8002410: 4b25 ldr r3, [pc, #148] ; (80024a8 ) 8002412: 689b ldr r3, [r3, #8] 8002414: 613b str r3, [r7, #16] CLEAR_BIT(temp, (uint32_t)iocurrent); 8002416: 68fb ldr r3, [r7, #12] 8002418: 43db mvns r3, r3 800241a: 693a ldr r2, [r7, #16] 800241c: 4013 ands r3, r2 800241e: 613b str r3, [r7, #16] if ((GPIO_Init->Mode & RISING_EDGE) == RISING_EDGE) 8002420: 683b ldr r3, [r7, #0] 8002422: 685b ldr r3, [r3, #4] 8002424: f403 1380 and.w r3, r3, #1048576 ; 0x100000 8002428: 2b00 cmp r3, #0 800242a: d003 beq.n 8002434 { SET_BIT(temp, iocurrent); 800242c: 693a ldr r2, [r7, #16] 800242e: 68fb ldr r3, [r7, #12] 8002430: 4313 orrs r3, r2 8002432: 613b str r3, [r7, #16] } EXTI->RTSR = temp; 8002434: 4a1c ldr r2, [pc, #112] ; (80024a8 ) 8002436: 693b ldr r3, [r7, #16] 8002438: 6093 str r3, [r2, #8] temp = EXTI->FTSR; 800243a: 4b1b ldr r3, [pc, #108] ; (80024a8 ) 800243c: 68db ldr r3, [r3, #12] 800243e: 613b str r3, [r7, #16] CLEAR_BIT(temp, (uint32_t)iocurrent); 8002440: 68fb ldr r3, [r7, #12] 8002442: 43db mvns r3, r3 8002444: 693a ldr r2, [r7, #16] 8002446: 4013 ands r3, r2 8002448: 613b str r3, [r7, #16] if ((GPIO_Init->Mode & FALLING_EDGE) == FALLING_EDGE) 800244a: 683b ldr r3, [r7, #0] 800244c: 685b ldr r3, [r3, #4] 800244e: f403 1300 and.w r3, r3, #2097152 ; 0x200000 8002452: 2b00 cmp r3, #0 8002454: d003 beq.n 800245e { SET_BIT(temp, iocurrent); 8002456: 693a ldr r2, [r7, #16] 8002458: 68fb ldr r3, [r7, #12] 800245a: 4313 orrs r3, r2 800245c: 613b str r3, [r7, #16] } EXTI->FTSR = temp; 800245e: 4a12 ldr r2, [pc, #72] ; (80024a8 ) 8002460: 693b ldr r3, [r7, #16] 8002462: 60d3 str r3, [r2, #12] } } position++; 8002464: 697b ldr r3, [r7, #20] 8002466: 3301 adds r3, #1 8002468: 617b str r3, [r7, #20] while (((GPIO_Init->Pin) >> position) != 0) 800246a: 683b ldr r3, [r7, #0] 800246c: 681a ldr r2, [r3, #0] 800246e: 697b ldr r3, [r7, #20] 8002470: fa22 f303 lsr.w r3, r2, r3 8002474: 2b00 cmp r3, #0 8002476: f47f ae97 bne.w 80021a8 } } 800247a: bf00 nop 800247c: 371c adds r7, #28 800247e: 46bd mov sp, r7 8002480: bc80 pop {r7} 8002482: 4770 bx lr 8002484: 40023800 .word 0x40023800 8002488: 40010000 .word 0x40010000 800248c: 40020000 .word 0x40020000 8002490: 40020400 .word 0x40020400 8002494: 40020800 .word 0x40020800 8002498: 40020c00 .word 0x40020c00 800249c: 40021000 .word 0x40021000 80024a0: 40021400 .word 0x40021400 80024a4: 40021800 .word 0x40021800 80024a8: 40010400 .word 0x40010400 080024ac : * @arg GPIO_PIN_RESET: to clear the port pin * @arg GPIO_PIN_SET: to set the port pin * @retval None */ void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState) { 80024ac: b480 push {r7} 80024ae: b083 sub sp, #12 80024b0: af00 add r7, sp, #0 80024b2: 6078 str r0, [r7, #4] 80024b4: 460b mov r3, r1 80024b6: 807b strh r3, [r7, #2] 80024b8: 4613 mov r3, r2 80024ba: 707b strb r3, [r7, #1] /* Check the parameters */ assert_param(IS_GPIO_PIN(GPIO_Pin)); assert_param(IS_GPIO_PIN_ACTION(PinState)); if (PinState != GPIO_PIN_RESET) 80024bc: 787b ldrb r3, [r7, #1] 80024be: 2b00 cmp r3, #0 80024c0: d003 beq.n 80024ca { GPIOx->BSRR = (uint32_t)GPIO_Pin; 80024c2: 887a ldrh r2, [r7, #2] 80024c4: 687b ldr r3, [r7, #4] 80024c6: 619a str r2, [r3, #24] } else { GPIOx->BSRR = (uint32_t)GPIO_Pin << 16 ; } } 80024c8: e003 b.n 80024d2 GPIOx->BSRR = (uint32_t)GPIO_Pin << 16 ; 80024ca: 887b ldrh r3, [r7, #2] 80024cc: 041a lsls r2, r3, #16 80024ce: 687b ldr r3, [r7, #4] 80024d0: 619a str r2, [r3, #24] } 80024d2: bf00 nop 80024d4: 370c adds r7, #12 80024d6: 46bd mov sp, r7 80024d8: bc80 pop {r7} 80024da: 4770 bx lr 080024dc : * supported by this macro. User should request a transition to HSE Off * first and then HSE On or HSE Bypass. * @retval HAL status */ HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) { 80024dc: b580 push {r7, lr} 80024de: b088 sub sp, #32 80024e0: af00 add r7, sp, #0 80024e2: 6078 str r0, [r7, #4] uint32_t tickstart; HAL_StatusTypeDef status; uint32_t sysclk_source, pll_config; /* Check the parameters */ if(RCC_OscInitStruct == NULL) 80024e4: 687b ldr r3, [r7, #4] 80024e6: 2b00 cmp r3, #0 80024e8: d101 bne.n 80024ee { return HAL_ERROR; 80024ea: 2301 movs r3, #1 80024ec: e31d b.n 8002b2a } assert_param(IS_RCC_OSCILLATORTYPE(RCC_OscInitStruct->OscillatorType)); sysclk_source = __HAL_RCC_GET_SYSCLK_SOURCE(); 80024ee: 4b94 ldr r3, [pc, #592] ; (8002740 ) 80024f0: 689b ldr r3, [r3, #8] 80024f2: f003 030c and.w r3, r3, #12 80024f6: 61bb str r3, [r7, #24] pll_config = __HAL_RCC_GET_PLL_OSCSOURCE(); 80024f8: 4b91 ldr r3, [pc, #580] ; (8002740 ) 80024fa: 689b ldr r3, [r3, #8] 80024fc: f403 3380 and.w r3, r3, #65536 ; 0x10000 8002500: 617b str r3, [r7, #20] /*------------------------------- HSE Configuration ------------------------*/ if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) 8002502: 687b ldr r3, [r7, #4] 8002504: 681b ldr r3, [r3, #0] 8002506: f003 0301 and.w r3, r3, #1 800250a: 2b00 cmp r3, #0 800250c: d07b beq.n 8002606 { /* Check the parameters */ assert_param(IS_RCC_HSE(RCC_OscInitStruct->HSEState)); /* When the HSE is used as system clock or clock source for PLL in these cases it is not allowed to be disabled */ if((sysclk_source == RCC_SYSCLKSOURCE_STATUS_HSE) 800250e: 69bb ldr r3, [r7, #24] 8002510: 2b08 cmp r3, #8 8002512: d006 beq.n 8002522 || ((sysclk_source == RCC_SYSCLKSOURCE_STATUS_PLLCLK) && (pll_config == RCC_PLLSOURCE_HSE))) 8002514: 69bb ldr r3, [r7, #24] 8002516: 2b0c cmp r3, #12 8002518: d10f bne.n 800253a 800251a: 697b ldr r3, [r7, #20] 800251c: f5b3 3f80 cmp.w r3, #65536 ; 0x10000 8002520: d10b bne.n 800253a { if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != 0U) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF)) 8002522: 4b87 ldr r3, [pc, #540] ; (8002740 ) 8002524: 681b ldr r3, [r3, #0] 8002526: f403 3300 and.w r3, r3, #131072 ; 0x20000 800252a: 2b00 cmp r3, #0 800252c: d06a beq.n 8002604 800252e: 687b ldr r3, [r7, #4] 8002530: 685b ldr r3, [r3, #4] 8002532: 2b00 cmp r3, #0 8002534: d166 bne.n 8002604 { return HAL_ERROR; 8002536: 2301 movs r3, #1 8002538: e2f7 b.n 8002b2a } } else { /* Set the new HSE configuration ---------------------------------------*/ __HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState); 800253a: 687b ldr r3, [r7, #4] 800253c: 685b ldr r3, [r3, #4] 800253e: 2b01 cmp r3, #1 8002540: d106 bne.n 8002550 8002542: 4b7f ldr r3, [pc, #508] ; (8002740 ) 8002544: 681b ldr r3, [r3, #0] 8002546: 4a7e ldr r2, [pc, #504] ; (8002740 ) 8002548: f443 3380 orr.w r3, r3, #65536 ; 0x10000 800254c: 6013 str r3, [r2, #0] 800254e: e02d b.n 80025ac 8002550: 687b ldr r3, [r7, #4] 8002552: 685b ldr r3, [r3, #4] 8002554: 2b00 cmp r3, #0 8002556: d10c bne.n 8002572 8002558: 4b79 ldr r3, [pc, #484] ; (8002740 ) 800255a: 681b ldr r3, [r3, #0] 800255c: 4a78 ldr r2, [pc, #480] ; (8002740 ) 800255e: f423 3380 bic.w r3, r3, #65536 ; 0x10000 8002562: 6013 str r3, [r2, #0] 8002564: 4b76 ldr r3, [pc, #472] ; (8002740 ) 8002566: 681b ldr r3, [r3, #0] 8002568: 4a75 ldr r2, [pc, #468] ; (8002740 ) 800256a: f423 2380 bic.w r3, r3, #262144 ; 0x40000 800256e: 6013 str r3, [r2, #0] 8002570: e01c b.n 80025ac 8002572: 687b ldr r3, [r7, #4] 8002574: 685b ldr r3, [r3, #4] 8002576: 2b05 cmp r3, #5 8002578: d10c bne.n 8002594 800257a: 4b71 ldr r3, [pc, #452] ; (8002740 ) 800257c: 681b ldr r3, [r3, #0] 800257e: 4a70 ldr r2, [pc, #448] ; (8002740 ) 8002580: f443 2380 orr.w r3, r3, #262144 ; 0x40000 8002584: 6013 str r3, [r2, #0] 8002586: 4b6e ldr r3, [pc, #440] ; (8002740 ) 8002588: 681b ldr r3, [r3, #0] 800258a: 4a6d ldr r2, [pc, #436] ; (8002740 ) 800258c: f443 3380 orr.w r3, r3, #65536 ; 0x10000 8002590: 6013 str r3, [r2, #0] 8002592: e00b b.n 80025ac 8002594: 4b6a ldr r3, [pc, #424] ; (8002740 ) 8002596: 681b ldr r3, [r3, #0] 8002598: 4a69 ldr r2, [pc, #420] ; (8002740 ) 800259a: f423 3380 bic.w r3, r3, #65536 ; 0x10000 800259e: 6013 str r3, [r2, #0] 80025a0: 4b67 ldr r3, [pc, #412] ; (8002740 ) 80025a2: 681b ldr r3, [r3, #0] 80025a4: 4a66 ldr r2, [pc, #408] ; (8002740 ) 80025a6: f423 2380 bic.w r3, r3, #262144 ; 0x40000 80025aa: 6013 str r3, [r2, #0] /* Check the HSE State */ if(RCC_OscInitStruct->HSEState != RCC_HSE_OFF) 80025ac: 687b ldr r3, [r7, #4] 80025ae: 685b ldr r3, [r3, #4] 80025b0: 2b00 cmp r3, #0 80025b2: d013 beq.n 80025dc { /* Get Start Tick */ tickstart = HAL_GetTick(); 80025b4: f7ff f8d2 bl 800175c 80025b8: 6138 str r0, [r7, #16] /* Wait till HSE is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == 0U) 80025ba: e008 b.n 80025ce { if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE) 80025bc: f7ff f8ce bl 800175c 80025c0: 4602 mov r2, r0 80025c2: 693b ldr r3, [r7, #16] 80025c4: 1ad3 subs r3, r2, r3 80025c6: 2b64 cmp r3, #100 ; 0x64 80025c8: d901 bls.n 80025ce { return HAL_TIMEOUT; 80025ca: 2303 movs r3, #3 80025cc: e2ad b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == 0U) 80025ce: 4b5c ldr r3, [pc, #368] ; (8002740 ) 80025d0: 681b ldr r3, [r3, #0] 80025d2: f403 3300 and.w r3, r3, #131072 ; 0x20000 80025d6: 2b00 cmp r3, #0 80025d8: d0f0 beq.n 80025bc 80025da: e014 b.n 8002606 } } else { /* Get Start Tick */ tickstart = HAL_GetTick(); 80025dc: f7ff f8be bl 800175c 80025e0: 6138 str r0, [r7, #16] /* Wait till HSE is disabled */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != 0U) 80025e2: e008 b.n 80025f6 { if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE) 80025e4: f7ff f8ba bl 800175c 80025e8: 4602 mov r2, r0 80025ea: 693b ldr r3, [r7, #16] 80025ec: 1ad3 subs r3, r2, r3 80025ee: 2b64 cmp r3, #100 ; 0x64 80025f0: d901 bls.n 80025f6 { return HAL_TIMEOUT; 80025f2: 2303 movs r3, #3 80025f4: e299 b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != 0U) 80025f6: 4b52 ldr r3, [pc, #328] ; (8002740 ) 80025f8: 681b ldr r3, [r3, #0] 80025fa: f403 3300 and.w r3, r3, #131072 ; 0x20000 80025fe: 2b00 cmp r3, #0 8002600: d1f0 bne.n 80025e4 8002602: e000 b.n 8002606 if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != 0U) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF)) 8002604: bf00 nop } } } } /*----------------------------- HSI Configuration --------------------------*/ if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) 8002606: 687b ldr r3, [r7, #4] 8002608: 681b ldr r3, [r3, #0] 800260a: f003 0302 and.w r3, r3, #2 800260e: 2b00 cmp r3, #0 8002610: d05a beq.n 80026c8 /* Check the parameters */ assert_param(IS_RCC_HSI(RCC_OscInitStruct->HSIState)); assert_param(IS_RCC_CALIBRATION_VALUE(RCC_OscInitStruct->HSICalibrationValue)); /* Check if HSI is used as system clock or as PLL source when PLL is selected as system clock */ if((sysclk_source == RCC_SYSCLKSOURCE_STATUS_HSI) 8002612: 69bb ldr r3, [r7, #24] 8002614: 2b04 cmp r3, #4 8002616: d005 beq.n 8002624 || ((sysclk_source == RCC_SYSCLKSOURCE_STATUS_PLLCLK) && (pll_config == RCC_PLLSOURCE_HSI))) 8002618: 69bb ldr r3, [r7, #24] 800261a: 2b0c cmp r3, #12 800261c: d119 bne.n 8002652 800261e: 697b ldr r3, [r7, #20] 8002620: 2b00 cmp r3, #0 8002622: d116 bne.n 8002652 { /* When HSI is used as system clock it will not disabled */ if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != 0U) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON)) 8002624: 4b46 ldr r3, [pc, #280] ; (8002740 ) 8002626: 681b ldr r3, [r3, #0] 8002628: f003 0302 and.w r3, r3, #2 800262c: 2b00 cmp r3, #0 800262e: d005 beq.n 800263c 8002630: 687b ldr r3, [r7, #4] 8002632: 68db ldr r3, [r3, #12] 8002634: 2b01 cmp r3, #1 8002636: d001 beq.n 800263c { return HAL_ERROR; 8002638: 2301 movs r3, #1 800263a: e276 b.n 8002b2a } /* Otherwise, just the calibration is allowed */ else { /* Adjusts the Internal High Speed oscillator (HSI) calibration value.*/ __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue); 800263c: 4b40 ldr r3, [pc, #256] ; (8002740 ) 800263e: 685b ldr r3, [r3, #4] 8002640: f423 52f8 bic.w r2, r3, #7936 ; 0x1f00 8002644: 687b ldr r3, [r7, #4] 8002646: 691b ldr r3, [r3, #16] 8002648: 021b lsls r3, r3, #8 800264a: 493d ldr r1, [pc, #244] ; (8002740 ) 800264c: 4313 orrs r3, r2 800264e: 604b str r3, [r1, #4] if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != 0U) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON)) 8002650: e03a b.n 80026c8 } } else { /* Check the HSI State */ if(RCC_OscInitStruct->HSIState != RCC_HSI_OFF) 8002652: 687b ldr r3, [r7, #4] 8002654: 68db ldr r3, [r3, #12] 8002656: 2b00 cmp r3, #0 8002658: d020 beq.n 800269c { /* Enable the Internal High Speed oscillator (HSI). */ __HAL_RCC_HSI_ENABLE(); 800265a: 4b3a ldr r3, [pc, #232] ; (8002744 ) 800265c: 2201 movs r2, #1 800265e: 601a str r2, [r3, #0] /* Get Start Tick */ tickstart = HAL_GetTick(); 8002660: f7ff f87c bl 800175c 8002664: 6138 str r0, [r7, #16] /* Wait till HSI is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == 0U) 8002666: e008 b.n 800267a { if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE) 8002668: f7ff f878 bl 800175c 800266c: 4602 mov r2, r0 800266e: 693b ldr r3, [r7, #16] 8002670: 1ad3 subs r3, r2, r3 8002672: 2b02 cmp r3, #2 8002674: d901 bls.n 800267a { return HAL_TIMEOUT; 8002676: 2303 movs r3, #3 8002678: e257 b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == 0U) 800267a: 4b31 ldr r3, [pc, #196] ; (8002740 ) 800267c: 681b ldr r3, [r3, #0] 800267e: f003 0302 and.w r3, r3, #2 8002682: 2b00 cmp r3, #0 8002684: d0f0 beq.n 8002668 } } /* Adjusts the Internal High Speed oscillator (HSI) calibration value.*/ __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue); 8002686: 4b2e ldr r3, [pc, #184] ; (8002740 ) 8002688: 685b ldr r3, [r3, #4] 800268a: f423 52f8 bic.w r2, r3, #7936 ; 0x1f00 800268e: 687b ldr r3, [r7, #4] 8002690: 691b ldr r3, [r3, #16] 8002692: 021b lsls r3, r3, #8 8002694: 492a ldr r1, [pc, #168] ; (8002740 ) 8002696: 4313 orrs r3, r2 8002698: 604b str r3, [r1, #4] 800269a: e015 b.n 80026c8 } else { /* Disable the Internal High Speed oscillator (HSI). */ __HAL_RCC_HSI_DISABLE(); 800269c: 4b29 ldr r3, [pc, #164] ; (8002744 ) 800269e: 2200 movs r2, #0 80026a0: 601a str r2, [r3, #0] /* Get Start Tick */ tickstart = HAL_GetTick(); 80026a2: f7ff f85b bl 800175c 80026a6: 6138 str r0, [r7, #16] /* Wait till HSI is disabled */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != 0U) 80026a8: e008 b.n 80026bc { if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE) 80026aa: f7ff f857 bl 800175c 80026ae: 4602 mov r2, r0 80026b0: 693b ldr r3, [r7, #16] 80026b2: 1ad3 subs r3, r2, r3 80026b4: 2b02 cmp r3, #2 80026b6: d901 bls.n 80026bc { return HAL_TIMEOUT; 80026b8: 2303 movs r3, #3 80026ba: e236 b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != 0U) 80026bc: 4b20 ldr r3, [pc, #128] ; (8002740 ) 80026be: 681b ldr r3, [r3, #0] 80026c0: f003 0302 and.w r3, r3, #2 80026c4: 2b00 cmp r3, #0 80026c6: d1f0 bne.n 80026aa } } } } /*----------------------------- MSI Configuration --------------------------*/ if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_MSI) == RCC_OSCILLATORTYPE_MSI) 80026c8: 687b ldr r3, [r7, #4] 80026ca: 681b ldr r3, [r3, #0] 80026cc: f003 0310 and.w r3, r3, #16 80026d0: 2b00 cmp r3, #0 80026d2: f000 80b8 beq.w 8002846 { /* When the MSI is used as system clock it will not be disabled */ if(sysclk_source == RCC_CFGR_SWS_MSI) 80026d6: 69bb ldr r3, [r7, #24] 80026d8: 2b00 cmp r3, #0 80026da: d170 bne.n 80027be { if((__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) != 0U) && (RCC_OscInitStruct->MSIState == RCC_MSI_OFF)) 80026dc: 4b18 ldr r3, [pc, #96] ; (8002740 ) 80026de: 681b ldr r3, [r3, #0] 80026e0: f403 7300 and.w r3, r3, #512 ; 0x200 80026e4: 2b00 cmp r3, #0 80026e6: d005 beq.n 80026f4 80026e8: 687b ldr r3, [r7, #4] 80026ea: 699b ldr r3, [r3, #24] 80026ec: 2b00 cmp r3, #0 80026ee: d101 bne.n 80026f4 { return HAL_ERROR; 80026f0: 2301 movs r3, #1 80026f2: e21a b.n 8002b2a assert_param(IS_RCC_MSI_CLOCK_RANGE(RCC_OscInitStruct->MSIClockRange)); /* To correctly read data from FLASH memory, the number of wait states (LATENCY) must be correctly programmed according to the frequency of the CPU clock (HCLK) and the supply voltage of the device. */ if(RCC_OscInitStruct->MSIClockRange > __HAL_RCC_GET_MSI_RANGE()) 80026f4: 687b ldr r3, [r7, #4] 80026f6: 6a1a ldr r2, [r3, #32] 80026f8: 4b11 ldr r3, [pc, #68] ; (8002740 ) 80026fa: 685b ldr r3, [r3, #4] 80026fc: f403 4360 and.w r3, r3, #57344 ; 0xe000 8002700: 429a cmp r2, r3 8002702: d921 bls.n 8002748 { /* First increase number of wait states update if necessary */ if(RCC_SetFlashLatencyFromMSIRange(RCC_OscInitStruct->MSIClockRange) != HAL_OK) 8002704: 687b ldr r3, [r7, #4] 8002706: 6a1b ldr r3, [r3, #32] 8002708: 4618 mov r0, r3 800270a: f000 fc47 bl 8002f9c 800270e: 4603 mov r3, r0 8002710: 2b00 cmp r3, #0 8002712: d001 beq.n 8002718 { return HAL_ERROR; 8002714: 2301 movs r3, #1 8002716: e208 b.n 8002b2a } /* Selects the Multiple Speed oscillator (MSI) clock range .*/ __HAL_RCC_MSI_RANGE_CONFIG(RCC_OscInitStruct->MSIClockRange); 8002718: 4b09 ldr r3, [pc, #36] ; (8002740 ) 800271a: 685b ldr r3, [r3, #4] 800271c: f423 4260 bic.w r2, r3, #57344 ; 0xe000 8002720: 687b ldr r3, [r7, #4] 8002722: 6a1b ldr r3, [r3, #32] 8002724: 4906 ldr r1, [pc, #24] ; (8002740 ) 8002726: 4313 orrs r3, r2 8002728: 604b str r3, [r1, #4] /* Adjusts the Multiple Speed oscillator (MSI) calibration value.*/ __HAL_RCC_MSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->MSICalibrationValue); 800272a: 4b05 ldr r3, [pc, #20] ; (8002740 ) 800272c: 685b ldr r3, [r3, #4] 800272e: f023 427f bic.w r2, r3, #4278190080 ; 0xff000000 8002732: 687b ldr r3, [r7, #4] 8002734: 69db ldr r3, [r3, #28] 8002736: 061b lsls r3, r3, #24 8002738: 4901 ldr r1, [pc, #4] ; (8002740 ) 800273a: 4313 orrs r3, r2 800273c: 604b str r3, [r1, #4] 800273e: e020 b.n 8002782 8002740: 40023800 .word 0x40023800 8002744: 42470000 .word 0x42470000 } else { /* Else, keep current flash latency while decreasing applies */ /* Selects the Multiple Speed oscillator (MSI) clock range .*/ __HAL_RCC_MSI_RANGE_CONFIG(RCC_OscInitStruct->MSIClockRange); 8002748: 4ba4 ldr r3, [pc, #656] ; (80029dc ) 800274a: 685b ldr r3, [r3, #4] 800274c: f423 4260 bic.w r2, r3, #57344 ; 0xe000 8002750: 687b ldr r3, [r7, #4] 8002752: 6a1b ldr r3, [r3, #32] 8002754: 49a1 ldr r1, [pc, #644] ; (80029dc ) 8002756: 4313 orrs r3, r2 8002758: 604b str r3, [r1, #4] /* Adjusts the Multiple Speed oscillator (MSI) calibration value.*/ __HAL_RCC_MSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->MSICalibrationValue); 800275a: 4ba0 ldr r3, [pc, #640] ; (80029dc ) 800275c: 685b ldr r3, [r3, #4] 800275e: f023 427f bic.w r2, r3, #4278190080 ; 0xff000000 8002762: 687b ldr r3, [r7, #4] 8002764: 69db ldr r3, [r3, #28] 8002766: 061b lsls r3, r3, #24 8002768: 499c ldr r1, [pc, #624] ; (80029dc ) 800276a: 4313 orrs r3, r2 800276c: 604b str r3, [r1, #4] /* Decrease number of wait states update if necessary */ if(RCC_SetFlashLatencyFromMSIRange(RCC_OscInitStruct->MSIClockRange) != HAL_OK) 800276e: 687b ldr r3, [r7, #4] 8002770: 6a1b ldr r3, [r3, #32] 8002772: 4618 mov r0, r3 8002774: f000 fc12 bl 8002f9c 8002778: 4603 mov r3, r0 800277a: 2b00 cmp r3, #0 800277c: d001 beq.n 8002782 { return HAL_ERROR; 800277e: 2301 movs r3, #1 8002780: e1d3 b.n 8002b2a } } /* Update the SystemCoreClock global variable */ SystemCoreClock = (32768U * (1UL << ((RCC_OscInitStruct->MSIClockRange >> RCC_ICSCR_MSIRANGE_Pos) + 1U))) 8002782: 687b ldr r3, [r7, #4] 8002784: 6a1b ldr r3, [r3, #32] 8002786: 0b5b lsrs r3, r3, #13 8002788: 3301 adds r3, #1 800278a: f44f 4200 mov.w r2, #32768 ; 0x8000 800278e: fa02 f303 lsl.w r3, r2, r3 >> AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)]; 8002792: 4a92 ldr r2, [pc, #584] ; (80029dc ) 8002794: 6892 ldr r2, [r2, #8] 8002796: 0912 lsrs r2, r2, #4 8002798: f002 020f and.w r2, r2, #15 800279c: 4990 ldr r1, [pc, #576] ; (80029e0 ) 800279e: 5c8a ldrb r2, [r1, r2] 80027a0: 40d3 lsrs r3, r2 SystemCoreClock = (32768U * (1UL << ((RCC_OscInitStruct->MSIClockRange >> RCC_ICSCR_MSIRANGE_Pos) + 1U))) 80027a2: 4a90 ldr r2, [pc, #576] ; (80029e4 ) 80027a4: 6013 str r3, [r2, #0] /* Configure the source of time base considering new system clocks settings*/ status = HAL_InitTick(uwTickPrio); 80027a6: 4b90 ldr r3, [pc, #576] ; (80029e8 ) 80027a8: 681b ldr r3, [r3, #0] 80027aa: 4618 mov r0, r3 80027ac: f7fe ff8a bl 80016c4 80027b0: 4603 mov r3, r0 80027b2: 73fb strb r3, [r7, #15] if(status != HAL_OK) 80027b4: 7bfb ldrb r3, [r7, #15] 80027b6: 2b00 cmp r3, #0 80027b8: d045 beq.n 8002846 { return status; 80027ba: 7bfb ldrb r3, [r7, #15] 80027bc: e1b5 b.n 8002b2a { /* Check MSI State */ assert_param(IS_RCC_MSI(RCC_OscInitStruct->MSIState)); /* Check the MSI State */ if(RCC_OscInitStruct->MSIState != RCC_MSI_OFF) 80027be: 687b ldr r3, [r7, #4] 80027c0: 699b ldr r3, [r3, #24] 80027c2: 2b00 cmp r3, #0 80027c4: d029 beq.n 800281a { /* Enable the Multi Speed oscillator (MSI). */ __HAL_RCC_MSI_ENABLE(); 80027c6: 4b89 ldr r3, [pc, #548] ; (80029ec ) 80027c8: 2201 movs r2, #1 80027ca: 601a str r2, [r3, #0] /* Get Start Tick */ tickstart = HAL_GetTick(); 80027cc: f7fe ffc6 bl 800175c 80027d0: 6138 str r0, [r7, #16] /* Wait till MSI is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) == 0U) 80027d2: e008 b.n 80027e6 { if((HAL_GetTick() - tickstart) > MSI_TIMEOUT_VALUE) 80027d4: f7fe ffc2 bl 800175c 80027d8: 4602 mov r2, r0 80027da: 693b ldr r3, [r7, #16] 80027dc: 1ad3 subs r3, r2, r3 80027de: 2b02 cmp r3, #2 80027e0: d901 bls.n 80027e6 { return HAL_TIMEOUT; 80027e2: 2303 movs r3, #3 80027e4: e1a1 b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) == 0U) 80027e6: 4b7d ldr r3, [pc, #500] ; (80029dc ) 80027e8: 681b ldr r3, [r3, #0] 80027ea: f403 7300 and.w r3, r3, #512 ; 0x200 80027ee: 2b00 cmp r3, #0 80027f0: d0f0 beq.n 80027d4 /* Check MSICalibrationValue and MSIClockRange input parameters */ assert_param(IS_RCC_MSICALIBRATION_VALUE(RCC_OscInitStruct->MSICalibrationValue)); assert_param(IS_RCC_MSI_CLOCK_RANGE(RCC_OscInitStruct->MSIClockRange)); /* Selects the Multiple Speed oscillator (MSI) clock range .*/ __HAL_RCC_MSI_RANGE_CONFIG(RCC_OscInitStruct->MSIClockRange); 80027f2: 4b7a ldr r3, [pc, #488] ; (80029dc ) 80027f4: 685b ldr r3, [r3, #4] 80027f6: f423 4260 bic.w r2, r3, #57344 ; 0xe000 80027fa: 687b ldr r3, [r7, #4] 80027fc: 6a1b ldr r3, [r3, #32] 80027fe: 4977 ldr r1, [pc, #476] ; (80029dc ) 8002800: 4313 orrs r3, r2 8002802: 604b str r3, [r1, #4] /* Adjusts the Multiple Speed oscillator (MSI) calibration value.*/ __HAL_RCC_MSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->MSICalibrationValue); 8002804: 4b75 ldr r3, [pc, #468] ; (80029dc ) 8002806: 685b ldr r3, [r3, #4] 8002808: f023 427f bic.w r2, r3, #4278190080 ; 0xff000000 800280c: 687b ldr r3, [r7, #4] 800280e: 69db ldr r3, [r3, #28] 8002810: 061b lsls r3, r3, #24 8002812: 4972 ldr r1, [pc, #456] ; (80029dc ) 8002814: 4313 orrs r3, r2 8002816: 604b str r3, [r1, #4] 8002818: e015 b.n 8002846 } else { /* Disable the Multi Speed oscillator (MSI). */ __HAL_RCC_MSI_DISABLE(); 800281a: 4b74 ldr r3, [pc, #464] ; (80029ec ) 800281c: 2200 movs r2, #0 800281e: 601a str r2, [r3, #0] /* Get Start Tick */ tickstart = HAL_GetTick(); 8002820: f7fe ff9c bl 800175c 8002824: 6138 str r0, [r7, #16] /* Wait till MSI is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) != 0U) 8002826: e008 b.n 800283a { if((HAL_GetTick() - tickstart) > MSI_TIMEOUT_VALUE) 8002828: f7fe ff98 bl 800175c 800282c: 4602 mov r2, r0 800282e: 693b ldr r3, [r7, #16] 8002830: 1ad3 subs r3, r2, r3 8002832: 2b02 cmp r3, #2 8002834: d901 bls.n 800283a { return HAL_TIMEOUT; 8002836: 2303 movs r3, #3 8002838: e177 b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) != 0U) 800283a: 4b68 ldr r3, [pc, #416] ; (80029dc ) 800283c: 681b ldr r3, [r3, #0] 800283e: f403 7300 and.w r3, r3, #512 ; 0x200 8002842: 2b00 cmp r3, #0 8002844: d1f0 bne.n 8002828 } } } } /*------------------------------ LSI Configuration -------------------------*/ if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) 8002846: 687b ldr r3, [r7, #4] 8002848: 681b ldr r3, [r3, #0] 800284a: f003 0308 and.w r3, r3, #8 800284e: 2b00 cmp r3, #0 8002850: d030 beq.n 80028b4 { /* Check the parameters */ assert_param(IS_RCC_LSI(RCC_OscInitStruct->LSIState)); /* Check the LSI State */ if(RCC_OscInitStruct->LSIState != RCC_LSI_OFF) 8002852: 687b ldr r3, [r7, #4] 8002854: 695b ldr r3, [r3, #20] 8002856: 2b00 cmp r3, #0 8002858: d016 beq.n 8002888 { /* Enable the Internal Low Speed oscillator (LSI). */ __HAL_RCC_LSI_ENABLE(); 800285a: 4b65 ldr r3, [pc, #404] ; (80029f0 ) 800285c: 2201 movs r2, #1 800285e: 601a str r2, [r3, #0] /* Get Start Tick */ tickstart = HAL_GetTick(); 8002860: f7fe ff7c bl 800175c 8002864: 6138 str r0, [r7, #16] /* Wait till LSI is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) == 0U) 8002866: e008 b.n 800287a { if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE) 8002868: f7fe ff78 bl 800175c 800286c: 4602 mov r2, r0 800286e: 693b ldr r3, [r7, #16] 8002870: 1ad3 subs r3, r2, r3 8002872: 2b02 cmp r3, #2 8002874: d901 bls.n 800287a { return HAL_TIMEOUT; 8002876: 2303 movs r3, #3 8002878: e157 b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) == 0U) 800287a: 4b58 ldr r3, [pc, #352] ; (80029dc ) 800287c: 6b5b ldr r3, [r3, #52] ; 0x34 800287e: f003 0302 and.w r3, r3, #2 8002882: 2b00 cmp r3, #0 8002884: d0f0 beq.n 8002868 8002886: e015 b.n 80028b4 } } else { /* Disable the Internal Low Speed oscillator (LSI). */ __HAL_RCC_LSI_DISABLE(); 8002888: 4b59 ldr r3, [pc, #356] ; (80029f0 ) 800288a: 2200 movs r2, #0 800288c: 601a str r2, [r3, #0] /* Get Start Tick */ tickstart = HAL_GetTick(); 800288e: f7fe ff65 bl 800175c 8002892: 6138 str r0, [r7, #16] /* Wait till LSI is disabled */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) != 0U) 8002894: e008 b.n 80028a8 { if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE) 8002896: f7fe ff61 bl 800175c 800289a: 4602 mov r2, r0 800289c: 693b ldr r3, [r7, #16] 800289e: 1ad3 subs r3, r2, r3 80028a0: 2b02 cmp r3, #2 80028a2: d901 bls.n 80028a8 { return HAL_TIMEOUT; 80028a4: 2303 movs r3, #3 80028a6: e140 b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) != 0U) 80028a8: 4b4c ldr r3, [pc, #304] ; (80029dc ) 80028aa: 6b5b ldr r3, [r3, #52] ; 0x34 80028ac: f003 0302 and.w r3, r3, #2 80028b0: 2b00 cmp r3, #0 80028b2: d1f0 bne.n 8002896 } } } } /*------------------------------ LSE Configuration -------------------------*/ if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE) 80028b4: 687b ldr r3, [r7, #4] 80028b6: 681b ldr r3, [r3, #0] 80028b8: f003 0304 and.w r3, r3, #4 80028bc: 2b00 cmp r3, #0 80028be: f000 80b5 beq.w 8002a2c { FlagStatus pwrclkchanged = RESET; 80028c2: 2300 movs r3, #0 80028c4: 77fb strb r3, [r7, #31] /* Check the parameters */ assert_param(IS_RCC_LSE(RCC_OscInitStruct->LSEState)); /* Update LSE configuration in Backup Domain control register */ /* Requires to enable write access to Backup Domain of necessary */ if(__HAL_RCC_PWR_IS_CLK_DISABLED()) 80028c6: 4b45 ldr r3, [pc, #276] ; (80029dc ) 80028c8: 6a5b ldr r3, [r3, #36] ; 0x24 80028ca: f003 5380 and.w r3, r3, #268435456 ; 0x10000000 80028ce: 2b00 cmp r3, #0 80028d0: d10d bne.n 80028ee { __HAL_RCC_PWR_CLK_ENABLE(); 80028d2: 4b42 ldr r3, [pc, #264] ; (80029dc ) 80028d4: 6a5b ldr r3, [r3, #36] ; 0x24 80028d6: 4a41 ldr r2, [pc, #260] ; (80029dc ) 80028d8: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000 80028dc: 6253 str r3, [r2, #36] ; 0x24 80028de: 4b3f ldr r3, [pc, #252] ; (80029dc ) 80028e0: 6a5b ldr r3, [r3, #36] ; 0x24 80028e2: f003 5380 and.w r3, r3, #268435456 ; 0x10000000 80028e6: 60bb str r3, [r7, #8] 80028e8: 68bb ldr r3, [r7, #8] pwrclkchanged = SET; 80028ea: 2301 movs r3, #1 80028ec: 77fb strb r3, [r7, #31] } if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) 80028ee: 4b41 ldr r3, [pc, #260] ; (80029f4 ) 80028f0: 681b ldr r3, [r3, #0] 80028f2: f403 7380 and.w r3, r3, #256 ; 0x100 80028f6: 2b00 cmp r3, #0 80028f8: d118 bne.n 800292c { /* Enable write access to Backup domain */ SET_BIT(PWR->CR, PWR_CR_DBP); 80028fa: 4b3e ldr r3, [pc, #248] ; (80029f4 ) 80028fc: 681b ldr r3, [r3, #0] 80028fe: 4a3d ldr r2, [pc, #244] ; (80029f4 ) 8002900: f443 7380 orr.w r3, r3, #256 ; 0x100 8002904: 6013 str r3, [r2, #0] /* Wait for Backup domain Write protection disable */ tickstart = HAL_GetTick(); 8002906: f7fe ff29 bl 800175c 800290a: 6138 str r0, [r7, #16] while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) 800290c: e008 b.n 8002920 { if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE) 800290e: f7fe ff25 bl 800175c 8002912: 4602 mov r2, r0 8002914: 693b ldr r3, [r7, #16] 8002916: 1ad3 subs r3, r2, r3 8002918: 2b64 cmp r3, #100 ; 0x64 800291a: d901 bls.n 8002920 { return HAL_TIMEOUT; 800291c: 2303 movs r3, #3 800291e: e104 b.n 8002b2a while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) 8002920: 4b34 ldr r3, [pc, #208] ; (80029f4 ) 8002922: 681b ldr r3, [r3, #0] 8002924: f403 7380 and.w r3, r3, #256 ; 0x100 8002928: 2b00 cmp r3, #0 800292a: d0f0 beq.n 800290e } } } /* Set the new LSE configuration -----------------------------------------*/ __HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState); 800292c: 687b ldr r3, [r7, #4] 800292e: 689b ldr r3, [r3, #8] 8002930: 2b01 cmp r3, #1 8002932: d106 bne.n 8002942 8002934: 4b29 ldr r3, [pc, #164] ; (80029dc ) 8002936: 6b5b ldr r3, [r3, #52] ; 0x34 8002938: 4a28 ldr r2, [pc, #160] ; (80029dc ) 800293a: f443 7380 orr.w r3, r3, #256 ; 0x100 800293e: 6353 str r3, [r2, #52] ; 0x34 8002940: e02d b.n 800299e 8002942: 687b ldr r3, [r7, #4] 8002944: 689b ldr r3, [r3, #8] 8002946: 2b00 cmp r3, #0 8002948: d10c bne.n 8002964 800294a: 4b24 ldr r3, [pc, #144] ; (80029dc ) 800294c: 6b5b ldr r3, [r3, #52] ; 0x34 800294e: 4a23 ldr r2, [pc, #140] ; (80029dc ) 8002950: f423 7380 bic.w r3, r3, #256 ; 0x100 8002954: 6353 str r3, [r2, #52] ; 0x34 8002956: 4b21 ldr r3, [pc, #132] ; (80029dc ) 8002958: 6b5b ldr r3, [r3, #52] ; 0x34 800295a: 4a20 ldr r2, [pc, #128] ; (80029dc ) 800295c: f423 6380 bic.w r3, r3, #1024 ; 0x400 8002960: 6353 str r3, [r2, #52] ; 0x34 8002962: e01c b.n 800299e 8002964: 687b ldr r3, [r7, #4] 8002966: 689b ldr r3, [r3, #8] 8002968: 2b05 cmp r3, #5 800296a: d10c bne.n 8002986 800296c: 4b1b ldr r3, [pc, #108] ; (80029dc ) 800296e: 6b5b ldr r3, [r3, #52] ; 0x34 8002970: 4a1a ldr r2, [pc, #104] ; (80029dc ) 8002972: f443 6380 orr.w r3, r3, #1024 ; 0x400 8002976: 6353 str r3, [r2, #52] ; 0x34 8002978: 4b18 ldr r3, [pc, #96] ; (80029dc ) 800297a: 6b5b ldr r3, [r3, #52] ; 0x34 800297c: 4a17 ldr r2, [pc, #92] ; (80029dc ) 800297e: f443 7380 orr.w r3, r3, #256 ; 0x100 8002982: 6353 str r3, [r2, #52] ; 0x34 8002984: e00b b.n 800299e 8002986: 4b15 ldr r3, [pc, #84] ; (80029dc ) 8002988: 6b5b ldr r3, [r3, #52] ; 0x34 800298a: 4a14 ldr r2, [pc, #80] ; (80029dc ) 800298c: f423 7380 bic.w r3, r3, #256 ; 0x100 8002990: 6353 str r3, [r2, #52] ; 0x34 8002992: 4b12 ldr r3, [pc, #72] ; (80029dc ) 8002994: 6b5b ldr r3, [r3, #52] ; 0x34 8002996: 4a11 ldr r2, [pc, #68] ; (80029dc ) 8002998: f423 6380 bic.w r3, r3, #1024 ; 0x400 800299c: 6353 str r3, [r2, #52] ; 0x34 /* Check the LSE State */ if(RCC_OscInitStruct->LSEState != RCC_LSE_OFF) 800299e: 687b ldr r3, [r7, #4] 80029a0: 689b ldr r3, [r3, #8] 80029a2: 2b00 cmp r3, #0 80029a4: d015 beq.n 80029d2 { /* Get Start Tick */ tickstart = HAL_GetTick(); 80029a6: f7fe fed9 bl 800175c 80029aa: 6138 str r0, [r7, #16] /* Wait till LSE is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == 0U) 80029ac: e00a b.n 80029c4 { if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) 80029ae: f7fe fed5 bl 800175c 80029b2: 4602 mov r2, r0 80029b4: 693b ldr r3, [r7, #16] 80029b6: 1ad3 subs r3, r2, r3 80029b8: f241 3288 movw r2, #5000 ; 0x1388 80029bc: 4293 cmp r3, r2 80029be: d901 bls.n 80029c4 { return HAL_TIMEOUT; 80029c0: 2303 movs r3, #3 80029c2: e0b2 b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == 0U) 80029c4: 4b05 ldr r3, [pc, #20] ; (80029dc ) 80029c6: 6b5b ldr r3, [r3, #52] ; 0x34 80029c8: f403 7300 and.w r3, r3, #512 ; 0x200 80029cc: 2b00 cmp r3, #0 80029ce: d0ee beq.n 80029ae 80029d0: e023 b.n 8002a1a } } else { /* Get Start Tick */ tickstart = HAL_GetTick(); 80029d2: f7fe fec3 bl 800175c 80029d6: 6138 str r0, [r7, #16] /* Wait till LSE is disabled */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != 0U) 80029d8: e019 b.n 8002a0e 80029da: bf00 nop 80029dc: 40023800 .word 0x40023800 80029e0: 08007b6c .word 0x08007b6c 80029e4: 20000004 .word 0x20000004 80029e8: 20000008 .word 0x20000008 80029ec: 42470020 .word 0x42470020 80029f0: 42470680 .word 0x42470680 80029f4: 40007000 .word 0x40007000 { if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) 80029f8: f7fe feb0 bl 800175c 80029fc: 4602 mov r2, r0 80029fe: 693b ldr r3, [r7, #16] 8002a00: 1ad3 subs r3, r2, r3 8002a02: f241 3288 movw r2, #5000 ; 0x1388 8002a06: 4293 cmp r3, r2 8002a08: d901 bls.n 8002a0e { return HAL_TIMEOUT; 8002a0a: 2303 movs r3, #3 8002a0c: e08d b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != 0U) 8002a0e: 4b49 ldr r3, [pc, #292] ; (8002b34 ) 8002a10: 6b5b ldr r3, [r3, #52] ; 0x34 8002a12: f403 7300 and.w r3, r3, #512 ; 0x200 8002a16: 2b00 cmp r3, #0 8002a18: d1ee bne.n 80029f8 } } } /* Require to disable power clock if necessary */ if(pwrclkchanged == SET) 8002a1a: 7ffb ldrb r3, [r7, #31] 8002a1c: 2b01 cmp r3, #1 8002a1e: d105 bne.n 8002a2c { __HAL_RCC_PWR_CLK_DISABLE(); 8002a20: 4b44 ldr r3, [pc, #272] ; (8002b34 ) 8002a22: 6a5b ldr r3, [r3, #36] ; 0x24 8002a24: 4a43 ldr r2, [pc, #268] ; (8002b34 ) 8002a26: f023 5380 bic.w r3, r3, #268435456 ; 0x10000000 8002a2a: 6253 str r3, [r2, #36] ; 0x24 } /*-------------------------------- PLL Configuration -----------------------*/ /* Check the parameters */ assert_param(IS_RCC_PLL(RCC_OscInitStruct->PLL.PLLState)); if ((RCC_OscInitStruct->PLL.PLLState) != RCC_PLL_NONE) 8002a2c: 687b ldr r3, [r7, #4] 8002a2e: 6a5b ldr r3, [r3, #36] ; 0x24 8002a30: 2b00 cmp r3, #0 8002a32: d079 beq.n 8002b28 { /* Check if the PLL is used as system clock or not */ if(sysclk_source != RCC_SYSCLKSOURCE_STATUS_PLLCLK) 8002a34: 69bb ldr r3, [r7, #24] 8002a36: 2b0c cmp r3, #12 8002a38: d056 beq.n 8002ae8 { if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_ON) 8002a3a: 687b ldr r3, [r7, #4] 8002a3c: 6a5b ldr r3, [r3, #36] ; 0x24 8002a3e: 2b02 cmp r3, #2 8002a40: d13b bne.n 8002aba assert_param(IS_RCC_PLLSOURCE(RCC_OscInitStruct->PLL.PLLSource)); assert_param(IS_RCC_PLL_MUL(RCC_OscInitStruct->PLL.PLLMUL)); assert_param(IS_RCC_PLL_DIV(RCC_OscInitStruct->PLL.PLLDIV)); /* Disable the main PLL. */ __HAL_RCC_PLL_DISABLE(); 8002a42: 4b3d ldr r3, [pc, #244] ; (8002b38 ) 8002a44: 2200 movs r2, #0 8002a46: 601a str r2, [r3, #0] /* Get Start Tick */ tickstart = HAL_GetTick(); 8002a48: f7fe fe88 bl 800175c 8002a4c: 6138 str r0, [r7, #16] /* Wait till PLL is disabled */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != 0U) 8002a4e: e008 b.n 8002a62 { if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) 8002a50: f7fe fe84 bl 800175c 8002a54: 4602 mov r2, r0 8002a56: 693b ldr r3, [r7, #16] 8002a58: 1ad3 subs r3, r2, r3 8002a5a: 2b02 cmp r3, #2 8002a5c: d901 bls.n 8002a62 { return HAL_TIMEOUT; 8002a5e: 2303 movs r3, #3 8002a60: e063 b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != 0U) 8002a62: 4b34 ldr r3, [pc, #208] ; (8002b34 ) 8002a64: 681b ldr r3, [r3, #0] 8002a66: f003 7300 and.w r3, r3, #33554432 ; 0x2000000 8002a6a: 2b00 cmp r3, #0 8002a6c: d1f0 bne.n 8002a50 } } /* Configure the main PLL clock source, multiplication and division factors. */ __HAL_RCC_PLL_CONFIG(RCC_OscInitStruct->PLL.PLLSource, 8002a6e: 4b31 ldr r3, [pc, #196] ; (8002b34 ) 8002a70: 689b ldr r3, [r3, #8] 8002a72: f423 027d bic.w r2, r3, #16580608 ; 0xfd0000 8002a76: 687b ldr r3, [r7, #4] 8002a78: 6a99 ldr r1, [r3, #40] ; 0x28 8002a7a: 687b ldr r3, [r7, #4] 8002a7c: 6adb ldr r3, [r3, #44] ; 0x2c 8002a7e: 4319 orrs r1, r3 8002a80: 687b ldr r3, [r7, #4] 8002a82: 6b1b ldr r3, [r3, #48] ; 0x30 8002a84: 430b orrs r3, r1 8002a86: 492b ldr r1, [pc, #172] ; (8002b34 ) 8002a88: 4313 orrs r3, r2 8002a8a: 608b str r3, [r1, #8] RCC_OscInitStruct->PLL.PLLMUL, RCC_OscInitStruct->PLL.PLLDIV); /* Enable the main PLL. */ __HAL_RCC_PLL_ENABLE(); 8002a8c: 4b2a ldr r3, [pc, #168] ; (8002b38 ) 8002a8e: 2201 movs r2, #1 8002a90: 601a str r2, [r3, #0] /* Get Start Tick */ tickstart = HAL_GetTick(); 8002a92: f7fe fe63 bl 800175c 8002a96: 6138 str r0, [r7, #16] /* Wait till PLL is ready */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == 0U) 8002a98: e008 b.n 8002aac { if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) 8002a9a: f7fe fe5f bl 800175c 8002a9e: 4602 mov r2, r0 8002aa0: 693b ldr r3, [r7, #16] 8002aa2: 1ad3 subs r3, r2, r3 8002aa4: 2b02 cmp r3, #2 8002aa6: d901 bls.n 8002aac { return HAL_TIMEOUT; 8002aa8: 2303 movs r3, #3 8002aaa: e03e b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == 0U) 8002aac: 4b21 ldr r3, [pc, #132] ; (8002b34 ) 8002aae: 681b ldr r3, [r3, #0] 8002ab0: f003 7300 and.w r3, r3, #33554432 ; 0x2000000 8002ab4: 2b00 cmp r3, #0 8002ab6: d0f0 beq.n 8002a9a 8002ab8: e036 b.n 8002b28 } } else { /* Disable the main PLL. */ __HAL_RCC_PLL_DISABLE(); 8002aba: 4b1f ldr r3, [pc, #124] ; (8002b38 ) 8002abc: 2200 movs r2, #0 8002abe: 601a str r2, [r3, #0] /* Get Start Tick */ tickstart = HAL_GetTick(); 8002ac0: f7fe fe4c bl 800175c 8002ac4: 6138 str r0, [r7, #16] /* Wait till PLL is disabled */ while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != 0U) 8002ac6: e008 b.n 8002ada { if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) 8002ac8: f7fe fe48 bl 800175c 8002acc: 4602 mov r2, r0 8002ace: 693b ldr r3, [r7, #16] 8002ad0: 1ad3 subs r3, r2, r3 8002ad2: 2b02 cmp r3, #2 8002ad4: d901 bls.n 8002ada { return HAL_TIMEOUT; 8002ad6: 2303 movs r3, #3 8002ad8: e027 b.n 8002b2a while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != 0U) 8002ada: 4b16 ldr r3, [pc, #88] ; (8002b34 ) 8002adc: 681b ldr r3, [r3, #0] 8002ade: f003 7300 and.w r3, r3, #33554432 ; 0x2000000 8002ae2: 2b00 cmp r3, #0 8002ae4: d1f0 bne.n 8002ac8 8002ae6: e01f b.n 8002b28 } } else { /* Check if there is a request to disable the PLL used as System clock source */ if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_OFF) 8002ae8: 687b ldr r3, [r7, #4] 8002aea: 6a5b ldr r3, [r3, #36] ; 0x24 8002aec: 2b01 cmp r3, #1 8002aee: d101 bne.n 8002af4 { return HAL_ERROR; 8002af0: 2301 movs r3, #1 8002af2: e01a b.n 8002b2a } else { /* Do not return HAL_ERROR if request repeats the current configuration */ pll_config = RCC->CFGR; 8002af4: 4b0f ldr r3, [pc, #60] ; (8002b34 ) 8002af6: 689b ldr r3, [r3, #8] 8002af8: 617b str r3, [r7, #20] if((READ_BIT(pll_config, RCC_CFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) || 8002afa: 697b ldr r3, [r7, #20] 8002afc: f403 3280 and.w r2, r3, #65536 ; 0x10000 8002b00: 687b ldr r3, [r7, #4] 8002b02: 6a9b ldr r3, [r3, #40] ; 0x28 8002b04: 429a cmp r2, r3 8002b06: d10d bne.n 8002b24 (READ_BIT(pll_config, RCC_CFGR_PLLMUL) != RCC_OscInitStruct->PLL.PLLMUL) || 8002b08: 697b ldr r3, [r7, #20] 8002b0a: f403 1270 and.w r2, r3, #3932160 ; 0x3c0000 8002b0e: 687b ldr r3, [r7, #4] 8002b10: 6adb ldr r3, [r3, #44] ; 0x2c if((READ_BIT(pll_config, RCC_CFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) || 8002b12: 429a cmp r2, r3 8002b14: d106 bne.n 8002b24 (READ_BIT(pll_config, RCC_CFGR_PLLDIV) != RCC_OscInitStruct->PLL.PLLDIV)) 8002b16: 697b ldr r3, [r7, #20] 8002b18: f403 0240 and.w r2, r3, #12582912 ; 0xc00000 8002b1c: 687b ldr r3, [r7, #4] 8002b1e: 6b1b ldr r3, [r3, #48] ; 0x30 (READ_BIT(pll_config, RCC_CFGR_PLLMUL) != RCC_OscInitStruct->PLL.PLLMUL) || 8002b20: 429a cmp r2, r3 8002b22: d001 beq.n 8002b28 { return HAL_ERROR; 8002b24: 2301 movs r3, #1 8002b26: e000 b.n 8002b2a } } } } return HAL_OK; 8002b28: 2300 movs r3, #0 } 8002b2a: 4618 mov r0, r3 8002b2c: 3720 adds r7, #32 8002b2e: 46bd mov sp, r7 8002b30: bd80 pop {r7, pc} 8002b32: bf00 nop 8002b34: 40023800 .word 0x40023800 8002b38: 42470060 .word 0x42470060 08002b3c : * HPRE[3:0] bits to ensure that HCLK not exceed the maximum allowed frequency * (for more details refer to section above "Initialization/de-initialization functions") * @retval HAL status */ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency) { 8002b3c: b580 push {r7, lr} 8002b3e: b084 sub sp, #16 8002b40: af00 add r7, sp, #0 8002b42: 6078 str r0, [r7, #4] 8002b44: 6039 str r1, [r7, #0] uint32_t tickstart; HAL_StatusTypeDef status; /* Check the parameters */ if(RCC_ClkInitStruct == NULL) 8002b46: 687b ldr r3, [r7, #4] 8002b48: 2b00 cmp r3, #0 8002b4a: d101 bne.n 8002b50 { return HAL_ERROR; 8002b4c: 2301 movs r3, #1 8002b4e: e11a b.n 8002d86 /* To correctly read data from FLASH memory, the number of wait states (LATENCY) must be correctly programmed according to the frequency of the CPU clock (HCLK) and the supply voltage of the device. */ /* Increasing the number of wait states because of higher CPU frequency */ if(FLatency > __HAL_FLASH_GET_LATENCY()) 8002b50: 4b8f ldr r3, [pc, #572] ; (8002d90 ) 8002b52: 681b ldr r3, [r3, #0] 8002b54: f003 0301 and.w r3, r3, #1 8002b58: 683a ldr r2, [r7, #0] 8002b5a: 429a cmp r2, r3 8002b5c: d919 bls.n 8002b92 { /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */ __HAL_FLASH_SET_LATENCY(FLatency); 8002b5e: 683b ldr r3, [r7, #0] 8002b60: 2b01 cmp r3, #1 8002b62: d105 bne.n 8002b70 8002b64: 4b8a ldr r3, [pc, #552] ; (8002d90 ) 8002b66: 681b ldr r3, [r3, #0] 8002b68: 4a89 ldr r2, [pc, #548] ; (8002d90 ) 8002b6a: f043 0304 orr.w r3, r3, #4 8002b6e: 6013 str r3, [r2, #0] 8002b70: 4b87 ldr r3, [pc, #540] ; (8002d90 ) 8002b72: 681b ldr r3, [r3, #0] 8002b74: f023 0201 bic.w r2, r3, #1 8002b78: 4985 ldr r1, [pc, #532] ; (8002d90 ) 8002b7a: 683b ldr r3, [r7, #0] 8002b7c: 4313 orrs r3, r2 8002b7e: 600b str r3, [r1, #0] /* Check that the new number of wait states is taken into account to access the Flash memory by reading the FLASH_ACR register */ if(__HAL_FLASH_GET_LATENCY() != FLatency) 8002b80: 4b83 ldr r3, [pc, #524] ; (8002d90 ) 8002b82: 681b ldr r3, [r3, #0] 8002b84: f003 0301 and.w r3, r3, #1 8002b88: 683a ldr r2, [r7, #0] 8002b8a: 429a cmp r2, r3 8002b8c: d001 beq.n 8002b92 { return HAL_ERROR; 8002b8e: 2301 movs r3, #1 8002b90: e0f9 b.n 8002d86 } } /*-------------------------- HCLK Configuration --------------------------*/ if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_HCLK) == RCC_CLOCKTYPE_HCLK) 8002b92: 687b ldr r3, [r7, #4] 8002b94: 681b ldr r3, [r3, #0] 8002b96: f003 0302 and.w r3, r3, #2 8002b9a: 2b00 cmp r3, #0 8002b9c: d008 beq.n 8002bb0 { assert_param(IS_RCC_HCLK(RCC_ClkInitStruct->AHBCLKDivider)); MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, RCC_ClkInitStruct->AHBCLKDivider); 8002b9e: 4b7d ldr r3, [pc, #500] ; (8002d94 ) 8002ba0: 689b ldr r3, [r3, #8] 8002ba2: f023 02f0 bic.w r2, r3, #240 ; 0xf0 8002ba6: 687b ldr r3, [r7, #4] 8002ba8: 689b ldr r3, [r3, #8] 8002baa: 497a ldr r1, [pc, #488] ; (8002d94 ) 8002bac: 4313 orrs r3, r2 8002bae: 608b str r3, [r1, #8] } /*------------------------- SYSCLK Configuration ---------------------------*/ if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_SYSCLK) == RCC_CLOCKTYPE_SYSCLK) 8002bb0: 687b ldr r3, [r7, #4] 8002bb2: 681b ldr r3, [r3, #0] 8002bb4: f003 0301 and.w r3, r3, #1 8002bb8: 2b00 cmp r3, #0 8002bba: f000 808e beq.w 8002cda { assert_param(IS_RCC_SYSCLKSOURCE(RCC_ClkInitStruct->SYSCLKSource)); /* HSE is selected as System Clock Source */ if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSE) 8002bbe: 687b ldr r3, [r7, #4] 8002bc0: 685b ldr r3, [r3, #4] 8002bc2: 2b02 cmp r3, #2 8002bc4: d107 bne.n 8002bd6 { /* Check the HSE ready flag */ if(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == 0U) 8002bc6: 4b73 ldr r3, [pc, #460] ; (8002d94 ) 8002bc8: 681b ldr r3, [r3, #0] 8002bca: f403 3300 and.w r3, r3, #131072 ; 0x20000 8002bce: 2b00 cmp r3, #0 8002bd0: d121 bne.n 8002c16 { return HAL_ERROR; 8002bd2: 2301 movs r3, #1 8002bd4: e0d7 b.n 8002d86 } } /* PLL is selected as System Clock Source */ else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) 8002bd6: 687b ldr r3, [r7, #4] 8002bd8: 685b ldr r3, [r3, #4] 8002bda: 2b03 cmp r3, #3 8002bdc: d107 bne.n 8002bee { /* Check the PLL ready flag */ if(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == 0U) 8002bde: 4b6d ldr r3, [pc, #436] ; (8002d94 ) 8002be0: 681b ldr r3, [r3, #0] 8002be2: f003 7300 and.w r3, r3, #33554432 ; 0x2000000 8002be6: 2b00 cmp r3, #0 8002be8: d115 bne.n 8002c16 { return HAL_ERROR; 8002bea: 2301 movs r3, #1 8002bec: e0cb b.n 8002d86 } } /* HSI is selected as System Clock Source */ else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSI) 8002bee: 687b ldr r3, [r7, #4] 8002bf0: 685b ldr r3, [r3, #4] 8002bf2: 2b01 cmp r3, #1 8002bf4: d107 bne.n 8002c06 { /* Check the HSI ready flag */ if(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == 0U) 8002bf6: 4b67 ldr r3, [pc, #412] ; (8002d94 ) 8002bf8: 681b ldr r3, [r3, #0] 8002bfa: f003 0302 and.w r3, r3, #2 8002bfe: 2b00 cmp r3, #0 8002c00: d109 bne.n 8002c16 { return HAL_ERROR; 8002c02: 2301 movs r3, #1 8002c04: e0bf b.n 8002d86 } /* MSI is selected as System Clock Source */ else { /* Check the MSI ready flag */ if(__HAL_RCC_GET_FLAG(RCC_FLAG_MSIRDY) == 0U) 8002c06: 4b63 ldr r3, [pc, #396] ; (8002d94 ) 8002c08: 681b ldr r3, [r3, #0] 8002c0a: f403 7300 and.w r3, r3, #512 ; 0x200 8002c0e: 2b00 cmp r3, #0 8002c10: d101 bne.n 8002c16 { return HAL_ERROR; 8002c12: 2301 movs r3, #1 8002c14: e0b7 b.n 8002d86 } } __HAL_RCC_SYSCLK_CONFIG(RCC_ClkInitStruct->SYSCLKSource); 8002c16: 4b5f ldr r3, [pc, #380] ; (8002d94 ) 8002c18: 689b ldr r3, [r3, #8] 8002c1a: f023 0203 bic.w r2, r3, #3 8002c1e: 687b ldr r3, [r7, #4] 8002c20: 685b ldr r3, [r3, #4] 8002c22: 495c ldr r1, [pc, #368] ; (8002d94 ) 8002c24: 4313 orrs r3, r2 8002c26: 608b str r3, [r1, #8] /* Get Start Tick */ tickstart = HAL_GetTick(); 8002c28: f7fe fd98 bl 800175c 8002c2c: 60f8 str r0, [r7, #12] if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSE) 8002c2e: 687b ldr r3, [r7, #4] 8002c30: 685b ldr r3, [r3, #4] 8002c32: 2b02 cmp r3, #2 8002c34: d112 bne.n 8002c5c { while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSE) 8002c36: e00a b.n 8002c4e { if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) 8002c38: f7fe fd90 bl 800175c 8002c3c: 4602 mov r2, r0 8002c3e: 68fb ldr r3, [r7, #12] 8002c40: 1ad3 subs r3, r2, r3 8002c42: f241 3288 movw r2, #5000 ; 0x1388 8002c46: 4293 cmp r3, r2 8002c48: d901 bls.n 8002c4e { return HAL_TIMEOUT; 8002c4a: 2303 movs r3, #3 8002c4c: e09b b.n 8002d86 while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSE) 8002c4e: 4b51 ldr r3, [pc, #324] ; (8002d94 ) 8002c50: 689b ldr r3, [r3, #8] 8002c52: f003 030c and.w r3, r3, #12 8002c56: 2b08 cmp r3, #8 8002c58: d1ee bne.n 8002c38 8002c5a: e03e b.n 8002cda } } } else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) 8002c5c: 687b ldr r3, [r7, #4] 8002c5e: 685b ldr r3, [r3, #4] 8002c60: 2b03 cmp r3, #3 8002c62: d112 bne.n 8002c8a { while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLCLK) 8002c64: e00a b.n 8002c7c { if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) 8002c66: f7fe fd79 bl 800175c 8002c6a: 4602 mov r2, r0 8002c6c: 68fb ldr r3, [r7, #12] 8002c6e: 1ad3 subs r3, r2, r3 8002c70: f241 3288 movw r2, #5000 ; 0x1388 8002c74: 4293 cmp r3, r2 8002c76: d901 bls.n 8002c7c { return HAL_TIMEOUT; 8002c78: 2303 movs r3, #3 8002c7a: e084 b.n 8002d86 while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLCLK) 8002c7c: 4b45 ldr r3, [pc, #276] ; (8002d94 ) 8002c7e: 689b ldr r3, [r3, #8] 8002c80: f003 030c and.w r3, r3, #12 8002c84: 2b0c cmp r3, #12 8002c86: d1ee bne.n 8002c66 8002c88: e027 b.n 8002cda } } } else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSI) 8002c8a: 687b ldr r3, [r7, #4] 8002c8c: 685b ldr r3, [r3, #4] 8002c8e: 2b01 cmp r3, #1 8002c90: d11d bne.n 8002cce { while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSI) 8002c92: e00a b.n 8002caa { if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) 8002c94: f7fe fd62 bl 800175c 8002c98: 4602 mov r2, r0 8002c9a: 68fb ldr r3, [r7, #12] 8002c9c: 1ad3 subs r3, r2, r3 8002c9e: f241 3288 movw r2, #5000 ; 0x1388 8002ca2: 4293 cmp r3, r2 8002ca4: d901 bls.n 8002caa { return HAL_TIMEOUT; 8002ca6: 2303 movs r3, #3 8002ca8: e06d b.n 8002d86 while (__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_HSI) 8002caa: 4b3a ldr r3, [pc, #232] ; (8002d94 ) 8002cac: 689b ldr r3, [r3, #8] 8002cae: f003 030c and.w r3, r3, #12 8002cb2: 2b04 cmp r3, #4 8002cb4: d1ee bne.n 8002c94 8002cb6: e010 b.n 8002cda } else { while(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_MSI) { if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) 8002cb8: f7fe fd50 bl 800175c 8002cbc: 4602 mov r2, r0 8002cbe: 68fb ldr r3, [r7, #12] 8002cc0: 1ad3 subs r3, r2, r3 8002cc2: f241 3288 movw r2, #5000 ; 0x1388 8002cc6: 4293 cmp r3, r2 8002cc8: d901 bls.n 8002cce { return HAL_TIMEOUT; 8002cca: 2303 movs r3, #3 8002ccc: e05b b.n 8002d86 while(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_MSI) 8002cce: 4b31 ldr r3, [pc, #196] ; (8002d94 ) 8002cd0: 689b ldr r3, [r3, #8] 8002cd2: f003 030c and.w r3, r3, #12 8002cd6: 2b00 cmp r3, #0 8002cd8: d1ee bne.n 8002cb8 } } } } /* Decreasing the number of wait states because of lower CPU frequency */ if(FLatency < __HAL_FLASH_GET_LATENCY()) 8002cda: 4b2d ldr r3, [pc, #180] ; (8002d90 ) 8002cdc: 681b ldr r3, [r3, #0] 8002cde: f003 0301 and.w r3, r3, #1 8002ce2: 683a ldr r2, [r7, #0] 8002ce4: 429a cmp r2, r3 8002ce6: d219 bcs.n 8002d1c { /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */ __HAL_FLASH_SET_LATENCY(FLatency); 8002ce8: 683b ldr r3, [r7, #0] 8002cea: 2b01 cmp r3, #1 8002cec: d105 bne.n 8002cfa 8002cee: 4b28 ldr r3, [pc, #160] ; (8002d90 ) 8002cf0: 681b ldr r3, [r3, #0] 8002cf2: 4a27 ldr r2, [pc, #156] ; (8002d90 ) 8002cf4: f043 0304 orr.w r3, r3, #4 8002cf8: 6013 str r3, [r2, #0] 8002cfa: 4b25 ldr r3, [pc, #148] ; (8002d90 ) 8002cfc: 681b ldr r3, [r3, #0] 8002cfe: f023 0201 bic.w r2, r3, #1 8002d02: 4923 ldr r1, [pc, #140] ; (8002d90 ) 8002d04: 683b ldr r3, [r7, #0] 8002d06: 4313 orrs r3, r2 8002d08: 600b str r3, [r1, #0] /* Check that the new number of wait states is taken into account to access the Flash memory by reading the FLASH_ACR register */ if(__HAL_FLASH_GET_LATENCY() != FLatency) 8002d0a: 4b21 ldr r3, [pc, #132] ; (8002d90 ) 8002d0c: 681b ldr r3, [r3, #0] 8002d0e: f003 0301 and.w r3, r3, #1 8002d12: 683a ldr r2, [r7, #0] 8002d14: 429a cmp r2, r3 8002d16: d001 beq.n 8002d1c { return HAL_ERROR; 8002d18: 2301 movs r3, #1 8002d1a: e034 b.n 8002d86 } } /*-------------------------- PCLK1 Configuration ---------------------------*/ if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK1) == RCC_CLOCKTYPE_PCLK1) 8002d1c: 687b ldr r3, [r7, #4] 8002d1e: 681b ldr r3, [r3, #0] 8002d20: f003 0304 and.w r3, r3, #4 8002d24: 2b00 cmp r3, #0 8002d26: d008 beq.n 8002d3a { assert_param(IS_RCC_PCLK(RCC_ClkInitStruct->APB1CLKDivider)); MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, RCC_ClkInitStruct->APB1CLKDivider); 8002d28: 4b1a ldr r3, [pc, #104] ; (8002d94 ) 8002d2a: 689b ldr r3, [r3, #8] 8002d2c: f423 62e0 bic.w r2, r3, #1792 ; 0x700 8002d30: 687b ldr r3, [r7, #4] 8002d32: 68db ldr r3, [r3, #12] 8002d34: 4917 ldr r1, [pc, #92] ; (8002d94 ) 8002d36: 4313 orrs r3, r2 8002d38: 608b str r3, [r1, #8] } /*-------------------------- PCLK2 Configuration ---------------------------*/ if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK2) == RCC_CLOCKTYPE_PCLK2) 8002d3a: 687b ldr r3, [r7, #4] 8002d3c: 681b ldr r3, [r3, #0] 8002d3e: f003 0308 and.w r3, r3, #8 8002d42: 2b00 cmp r3, #0 8002d44: d009 beq.n 8002d5a { assert_param(IS_RCC_PCLK(RCC_ClkInitStruct->APB2CLKDivider)); MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, ((RCC_ClkInitStruct->APB2CLKDivider) << 3U)); 8002d46: 4b13 ldr r3, [pc, #76] ; (8002d94 ) 8002d48: 689b ldr r3, [r3, #8] 8002d4a: f423 5260 bic.w r2, r3, #14336 ; 0x3800 8002d4e: 687b ldr r3, [r7, #4] 8002d50: 691b ldr r3, [r3, #16] 8002d52: 00db lsls r3, r3, #3 8002d54: 490f ldr r1, [pc, #60] ; (8002d94 ) 8002d56: 4313 orrs r3, r2 8002d58: 608b str r3, [r1, #8] } /* Update the SystemCoreClock global variable */ SystemCoreClock = HAL_RCC_GetSysClockFreq() >> AHBPrescTable[(RCC->CFGR & RCC_CFGR_HPRE)>> RCC_CFGR_HPRE_Pos]; 8002d5a: f000 f823 bl 8002da4 8002d5e: 4601 mov r1, r0 8002d60: 4b0c ldr r3, [pc, #48] ; (8002d94 ) 8002d62: 689b ldr r3, [r3, #8] 8002d64: 091b lsrs r3, r3, #4 8002d66: f003 030f and.w r3, r3, #15 8002d6a: 4a0b ldr r2, [pc, #44] ; (8002d98 ) 8002d6c: 5cd3 ldrb r3, [r2, r3] 8002d6e: fa21 f303 lsr.w r3, r1, r3 8002d72: 4a0a ldr r2, [pc, #40] ; (8002d9c ) 8002d74: 6013 str r3, [r2, #0] /* Configure the source of time base considering new system clocks settings*/ status = HAL_InitTick(uwTickPrio); 8002d76: 4b0a ldr r3, [pc, #40] ; (8002da0 ) 8002d78: 681b ldr r3, [r3, #0] 8002d7a: 4618 mov r0, r3 8002d7c: f7fe fca2 bl 80016c4 8002d80: 4603 mov r3, r0 8002d82: 72fb strb r3, [r7, #11] return status; 8002d84: 7afb ldrb r3, [r7, #11] } 8002d86: 4618 mov r0, r3 8002d88: 3710 adds r7, #16 8002d8a: 46bd mov sp, r7 8002d8c: bd80 pop {r7, pc} 8002d8e: bf00 nop 8002d90: 40023c00 .word 0x40023c00 8002d94: 40023800 .word 0x40023800 8002d98: 08007b6c .word 0x08007b6c 8002d9c: 20000004 .word 0x20000004 8002da0: 20000008 .word 0x20000008 08002da4 : * right SYSCLK value. Otherwise, any configuration based on this function will be incorrect. * * @retval SYSCLK frequency */ uint32_t HAL_RCC_GetSysClockFreq(void) { 8002da4: b5f0 push {r4, r5, r6, r7, lr} 8002da6: b087 sub sp, #28 8002da8: af00 add r7, sp, #0 uint32_t tmpreg, pllm, plld, pllvco, msiclkrange, sysclockfreq; tmpreg = RCC->CFGR; 8002daa: 4b5f ldr r3, [pc, #380] ; (8002f28 ) 8002dac: 689b ldr r3, [r3, #8] 8002dae: 60fb str r3, [r7, #12] /* Get SYSCLK source -------------------------------------------------------*/ switch (tmpreg & RCC_CFGR_SWS) 8002db0: 68fb ldr r3, [r7, #12] 8002db2: f003 030c and.w r3, r3, #12 8002db6: 2b08 cmp r3, #8 8002db8: d007 beq.n 8002dca 8002dba: 2b0c cmp r3, #12 8002dbc: d008 beq.n 8002dd0 8002dbe: 2b04 cmp r3, #4 8002dc0: f040 809f bne.w 8002f02 { case RCC_SYSCLKSOURCE_STATUS_HSI: /* HSI used as system clock source */ { sysclockfreq = HSI_VALUE; 8002dc4: 4b59 ldr r3, [pc, #356] ; (8002f2c ) 8002dc6: 613b str r3, [r7, #16] break; 8002dc8: e0a9 b.n 8002f1e } case RCC_SYSCLKSOURCE_STATUS_HSE: /* HSE used as system clock */ { sysclockfreq = HSE_VALUE; 8002dca: 4b59 ldr r3, [pc, #356] ; (8002f30 ) 8002dcc: 613b str r3, [r7, #16] break; 8002dce: e0a6 b.n 8002f1e } case RCC_SYSCLKSOURCE_STATUS_PLLCLK: /* PLL used as system clock */ { pllm = PLLMulTable[(uint32_t)(tmpreg & RCC_CFGR_PLLMUL) >> RCC_CFGR_PLLMUL_Pos]; 8002dd0: 68fb ldr r3, [r7, #12] 8002dd2: 0c9b lsrs r3, r3, #18 8002dd4: f003 030f and.w r3, r3, #15 8002dd8: 4a56 ldr r2, [pc, #344] ; (8002f34 ) 8002dda: 5cd3 ldrb r3, [r2, r3] 8002ddc: 60bb str r3, [r7, #8] plld = ((uint32_t)(tmpreg & RCC_CFGR_PLLDIV) >> RCC_CFGR_PLLDIV_Pos) + 1U; 8002dde: 68fb ldr r3, [r7, #12] 8002de0: 0d9b lsrs r3, r3, #22 8002de2: f003 0303 and.w r3, r3, #3 8002de6: 3301 adds r3, #1 8002de8: 607b str r3, [r7, #4] if (__HAL_RCC_GET_PLL_OSCSOURCE() != RCC_PLLSOURCE_HSI) 8002dea: 4b4f ldr r3, [pc, #316] ; (8002f28 ) 8002dec: 689b ldr r3, [r3, #8] 8002dee: f403 3380 and.w r3, r3, #65536 ; 0x10000 8002df2: 2b00 cmp r3, #0 8002df4: d041 beq.n 8002e7a { /* HSE used as PLL clock source */ pllvco = (uint32_t)(((uint64_t)HSE_VALUE * (uint64_t)pllm) / (uint64_t)plld); 8002df6: 68bb ldr r3, [r7, #8] 8002df8: 461d mov r5, r3 8002dfa: f04f 0600 mov.w r6, #0 8002dfe: 4629 mov r1, r5 8002e00: 4632 mov r2, r6 8002e02: f04f 0300 mov.w r3, #0 8002e06: f04f 0400 mov.w r4, #0 8002e0a: 0154 lsls r4, r2, #5 8002e0c: ea44 64d1 orr.w r4, r4, r1, lsr #27 8002e10: 014b lsls r3, r1, #5 8002e12: 4619 mov r1, r3 8002e14: 4622 mov r2, r4 8002e16: 1b49 subs r1, r1, r5 8002e18: eb62 0206 sbc.w r2, r2, r6 8002e1c: f04f 0300 mov.w r3, #0 8002e20: f04f 0400 mov.w r4, #0 8002e24: 0194 lsls r4, r2, #6 8002e26: ea44 6491 orr.w r4, r4, r1, lsr #26 8002e2a: 018b lsls r3, r1, #6 8002e2c: 1a5b subs r3, r3, r1 8002e2e: eb64 0402 sbc.w r4, r4, r2 8002e32: f04f 0100 mov.w r1, #0 8002e36: f04f 0200 mov.w r2, #0 8002e3a: 00e2 lsls r2, r4, #3 8002e3c: ea42 7253 orr.w r2, r2, r3, lsr #29 8002e40: 00d9 lsls r1, r3, #3 8002e42: 460b mov r3, r1 8002e44: 4614 mov r4, r2 8002e46: 195b adds r3, r3, r5 8002e48: eb44 0406 adc.w r4, r4, r6 8002e4c: f04f 0100 mov.w r1, #0 8002e50: f04f 0200 mov.w r2, #0 8002e54: 0262 lsls r2, r4, #9 8002e56: ea42 52d3 orr.w r2, r2, r3, lsr #23 8002e5a: 0259 lsls r1, r3, #9 8002e5c: 460b mov r3, r1 8002e5e: 4614 mov r4, r2 8002e60: 4618 mov r0, r3 8002e62: 4621 mov r1, r4 8002e64: 687b ldr r3, [r7, #4] 8002e66: f04f 0400 mov.w r4, #0 8002e6a: 461a mov r2, r3 8002e6c: 4623 mov r3, r4 8002e6e: f7fd f98d bl 800018c <__aeabi_uldivmod> 8002e72: 4603 mov r3, r0 8002e74: 460c mov r4, r1 8002e76: 617b str r3, [r7, #20] 8002e78: e040 b.n 8002efc } else { /* HSI used as PLL clock source */ pllvco = (uint32_t)(((uint64_t)HSI_VALUE * (uint64_t)pllm) / (uint64_t)plld); 8002e7a: 68bb ldr r3, [r7, #8] 8002e7c: 461d mov r5, r3 8002e7e: f04f 0600 mov.w r6, #0 8002e82: 4629 mov r1, r5 8002e84: 4632 mov r2, r6 8002e86: f04f 0300 mov.w r3, #0 8002e8a: f04f 0400 mov.w r4, #0 8002e8e: 0154 lsls r4, r2, #5 8002e90: ea44 64d1 orr.w r4, r4, r1, lsr #27 8002e94: 014b lsls r3, r1, #5 8002e96: 4619 mov r1, r3 8002e98: 4622 mov r2, r4 8002e9a: 1b49 subs r1, r1, r5 8002e9c: eb62 0206 sbc.w r2, r2, r6 8002ea0: f04f 0300 mov.w r3, #0 8002ea4: f04f 0400 mov.w r4, #0 8002ea8: 0194 lsls r4, r2, #6 8002eaa: ea44 6491 orr.w r4, r4, r1, lsr #26 8002eae: 018b lsls r3, r1, #6 8002eb0: 1a5b subs r3, r3, r1 8002eb2: eb64 0402 sbc.w r4, r4, r2 8002eb6: f04f 0100 mov.w r1, #0 8002eba: f04f 0200 mov.w r2, #0 8002ebe: 00e2 lsls r2, r4, #3 8002ec0: ea42 7253 orr.w r2, r2, r3, lsr #29 8002ec4: 00d9 lsls r1, r3, #3 8002ec6: 460b mov r3, r1 8002ec8: 4614 mov r4, r2 8002eca: 195b adds r3, r3, r5 8002ecc: eb44 0406 adc.w r4, r4, r6 8002ed0: f04f 0100 mov.w r1, #0 8002ed4: f04f 0200 mov.w r2, #0 8002ed8: 02a2 lsls r2, r4, #10 8002eda: ea42 5293 orr.w r2, r2, r3, lsr #22 8002ede: 0299 lsls r1, r3, #10 8002ee0: 460b mov r3, r1 8002ee2: 4614 mov r4, r2 8002ee4: 4618 mov r0, r3 8002ee6: 4621 mov r1, r4 8002ee8: 687b ldr r3, [r7, #4] 8002eea: f04f 0400 mov.w r4, #0 8002eee: 461a mov r2, r3 8002ef0: 4623 mov r3, r4 8002ef2: f7fd f94b bl 800018c <__aeabi_uldivmod> 8002ef6: 4603 mov r3, r0 8002ef8: 460c mov r4, r1 8002efa: 617b str r3, [r7, #20] } sysclockfreq = pllvco; 8002efc: 697b ldr r3, [r7, #20] 8002efe: 613b str r3, [r7, #16] break; 8002f00: e00d b.n 8002f1e } case RCC_SYSCLKSOURCE_STATUS_MSI: /* MSI used as system clock source */ default: /* MSI used as system clock */ { msiclkrange = (RCC->ICSCR & RCC_ICSCR_MSIRANGE ) >> RCC_ICSCR_MSIRANGE_Pos; 8002f02: 4b09 ldr r3, [pc, #36] ; (8002f28 ) 8002f04: 685b ldr r3, [r3, #4] 8002f06: 0b5b lsrs r3, r3, #13 8002f08: f003 0307 and.w r3, r3, #7 8002f0c: 603b str r3, [r7, #0] sysclockfreq = (32768U * (1UL << (msiclkrange + 1U))); 8002f0e: 683b ldr r3, [r7, #0] 8002f10: 3301 adds r3, #1 8002f12: f44f 4200 mov.w r2, #32768 ; 0x8000 8002f16: fa02 f303 lsl.w r3, r2, r3 8002f1a: 613b str r3, [r7, #16] break; 8002f1c: bf00 nop } } return sysclockfreq; 8002f1e: 693b ldr r3, [r7, #16] } 8002f20: 4618 mov r0, r3 8002f22: 371c adds r7, #28 8002f24: 46bd mov sp, r7 8002f26: bdf0 pop {r4, r5, r6, r7, pc} 8002f28: 40023800 .word 0x40023800 8002f2c: 00f42400 .word 0x00f42400 8002f30: 007a1200 .word 0x007a1200 8002f34: 08007b60 .word 0x08007b60 08002f38 : * @note The SystemCoreClock CMSIS variable is used to store System Clock Frequency * and updated within this function * @retval HCLK frequency */ uint32_t HAL_RCC_GetHCLKFreq(void) { 8002f38: b480 push {r7} 8002f3a: af00 add r7, sp, #0 return SystemCoreClock; 8002f3c: 4b02 ldr r3, [pc, #8] ; (8002f48 ) 8002f3e: 681b ldr r3, [r3, #0] } 8002f40: 4618 mov r0, r3 8002f42: 46bd mov sp, r7 8002f44: bc80 pop {r7} 8002f46: 4770 bx lr 8002f48: 20000004 .word 0x20000004 08002f4c : * @note Each time PCLK1 changes, this function must be called to update the * right PCLK1 value. Otherwise, any configuration based on this function will be incorrect. * @retval PCLK1 frequency */ uint32_t HAL_RCC_GetPCLK1Freq(void) { 8002f4c: b580 push {r7, lr} 8002f4e: af00 add r7, sp, #0 /* Get HCLK source and Compute PCLK1 frequency ---------------------------*/ return (HAL_RCC_GetHCLKFreq() >> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE1) >> RCC_CFGR_PPRE1_Pos]); 8002f50: f7ff fff2 bl 8002f38 8002f54: 4601 mov r1, r0 8002f56: 4b05 ldr r3, [pc, #20] ; (8002f6c ) 8002f58: 689b ldr r3, [r3, #8] 8002f5a: 0a1b lsrs r3, r3, #8 8002f5c: f003 0307 and.w r3, r3, #7 8002f60: 4a03 ldr r2, [pc, #12] ; (8002f70 ) 8002f62: 5cd3 ldrb r3, [r2, r3] 8002f64: fa21 f303 lsr.w r3, r1, r3 } 8002f68: 4618 mov r0, r3 8002f6a: bd80 pop {r7, pc} 8002f6c: 40023800 .word 0x40023800 8002f70: 08007b7c .word 0x08007b7c 08002f74 : * @note Each time PCLK2 changes, this function must be called to update the * right PCLK2 value. Otherwise, any configuration based on this function will be incorrect. * @retval PCLK2 frequency */ uint32_t HAL_RCC_GetPCLK2Freq(void) { 8002f74: b580 push {r7, lr} 8002f76: af00 add r7, sp, #0 /* Get HCLK source and Compute PCLK2 frequency ---------------------------*/ return (HAL_RCC_GetHCLKFreq()>> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE2) >> RCC_CFGR_PPRE2_Pos]); 8002f78: f7ff ffde bl 8002f38 8002f7c: 4601 mov r1, r0 8002f7e: 4b05 ldr r3, [pc, #20] ; (8002f94 ) 8002f80: 689b ldr r3, [r3, #8] 8002f82: 0adb lsrs r3, r3, #11 8002f84: f003 0307 and.w r3, r3, #7 8002f88: 4a03 ldr r2, [pc, #12] ; (8002f98 ) 8002f8a: 5cd3 ldrb r3, [r2, r3] 8002f8c: fa21 f303 lsr.w r3, r1, r3 } 8002f90: 4618 mov r0, r3 8002f92: bd80 pop {r7, pc} 8002f94: 40023800 .word 0x40023800 8002f98: 08007b7c .word 0x08007b7c 08002f9c : voltage range * @param MSIrange MSI range value from RCC_MSIRANGE_0 to RCC_MSIRANGE_6 * @retval HAL status */ static HAL_StatusTypeDef RCC_SetFlashLatencyFromMSIRange(uint32_t MSIrange) { 8002f9c: b480 push {r7} 8002f9e: b087 sub sp, #28 8002fa0: af00 add r7, sp, #0 8002fa2: 6078 str r0, [r7, #4] uint32_t vos; uint32_t latency = FLASH_LATENCY_0; /* default value 0WS */ 8002fa4: 2300 movs r3, #0 8002fa6: 613b str r3, [r7, #16] /* HCLK can reach 4 MHz only if AHB prescaler = 1 */ if (READ_BIT(RCC->CFGR, RCC_CFGR_HPRE) == RCC_SYSCLK_DIV1) 8002fa8: 4b29 ldr r3, [pc, #164] ; (8003050 ) 8002faa: 689b ldr r3, [r3, #8] 8002fac: f003 03f0 and.w r3, r3, #240 ; 0xf0 8002fb0: 2b00 cmp r3, #0 8002fb2: d12c bne.n 800300e { if(__HAL_RCC_PWR_IS_CLK_ENABLED()) 8002fb4: 4b26 ldr r3, [pc, #152] ; (8003050 ) 8002fb6: 6a5b ldr r3, [r3, #36] ; 0x24 8002fb8: f003 5380 and.w r3, r3, #268435456 ; 0x10000000 8002fbc: 2b00 cmp r3, #0 8002fbe: d005 beq.n 8002fcc { vos = READ_BIT(PWR->CR, PWR_CR_VOS); 8002fc0: 4b24 ldr r3, [pc, #144] ; (8003054 ) 8002fc2: 681b ldr r3, [r3, #0] 8002fc4: f403 53c0 and.w r3, r3, #6144 ; 0x1800 8002fc8: 617b str r3, [r7, #20] 8002fca: e016 b.n 8002ffa } else { __HAL_RCC_PWR_CLK_ENABLE(); 8002fcc: 4b20 ldr r3, [pc, #128] ; (8003050 ) 8002fce: 6a5b ldr r3, [r3, #36] ; 0x24 8002fd0: 4a1f ldr r2, [pc, #124] ; (8003050 ) 8002fd2: f043 5380 orr.w r3, r3, #268435456 ; 0x10000000 8002fd6: 6253 str r3, [r2, #36] ; 0x24 8002fd8: 4b1d ldr r3, [pc, #116] ; (8003050 ) 8002fda: 6a5b ldr r3, [r3, #36] ; 0x24 8002fdc: f003 5380 and.w r3, r3, #268435456 ; 0x10000000 8002fe0: 60fb str r3, [r7, #12] 8002fe2: 68fb ldr r3, [r7, #12] vos = READ_BIT(PWR->CR, PWR_CR_VOS); 8002fe4: 4b1b ldr r3, [pc, #108] ; (8003054 ) 8002fe6: 681b ldr r3, [r3, #0] 8002fe8: f403 53c0 and.w r3, r3, #6144 ; 0x1800 8002fec: 617b str r3, [r7, #20] __HAL_RCC_PWR_CLK_DISABLE(); 8002fee: 4b18 ldr r3, [pc, #96] ; (8003050 ) 8002ff0: 6a5b ldr r3, [r3, #36] ; 0x24 8002ff2: 4a17 ldr r2, [pc, #92] ; (8003050 ) 8002ff4: f023 5380 bic.w r3, r3, #268435456 ; 0x10000000 8002ff8: 6253 str r3, [r2, #36] ; 0x24 } /* Check if need to set latency 1 only for Range 3 & HCLK = 4MHz */ if((vos == PWR_REGULATOR_VOLTAGE_SCALE3) && (MSIrange == RCC_MSIRANGE_6)) 8002ffa: 697b ldr r3, [r7, #20] 8002ffc: f5b3 5fc0 cmp.w r3, #6144 ; 0x1800 8003000: d105 bne.n 800300e 8003002: 687b ldr r3, [r7, #4] 8003004: f5b3 4f40 cmp.w r3, #49152 ; 0xc000 8003008: d101 bne.n 800300e { latency = FLASH_LATENCY_1; /* 1WS */ 800300a: 2301 movs r3, #1 800300c: 613b str r3, [r7, #16] } } __HAL_FLASH_SET_LATENCY(latency); 800300e: 693b ldr r3, [r7, #16] 8003010: 2b01 cmp r3, #1 8003012: d105 bne.n 8003020 8003014: 4b10 ldr r3, [pc, #64] ; (8003058 ) 8003016: 681b ldr r3, [r3, #0] 8003018: 4a0f ldr r2, [pc, #60] ; (8003058 ) 800301a: f043 0304 orr.w r3, r3, #4 800301e: 6013 str r3, [r2, #0] 8003020: 4b0d ldr r3, [pc, #52] ; (8003058 ) 8003022: 681b ldr r3, [r3, #0] 8003024: f023 0201 bic.w r2, r3, #1 8003028: 490b ldr r1, [pc, #44] ; (8003058 ) 800302a: 693b ldr r3, [r7, #16] 800302c: 4313 orrs r3, r2 800302e: 600b str r3, [r1, #0] /* Check that the new number of wait states is taken into account to access the Flash memory by reading the FLASH_ACR register */ if(__HAL_FLASH_GET_LATENCY() != latency) 8003030: 4b09 ldr r3, [pc, #36] ; (8003058 ) 8003032: 681b ldr r3, [r3, #0] 8003034: f003 0301 and.w r3, r3, #1 8003038: 693a ldr r2, [r7, #16] 800303a: 429a cmp r2, r3 800303c: d001 beq.n 8003042 { return HAL_ERROR; 800303e: 2301 movs r3, #1 8003040: e000 b.n 8003044 } return HAL_OK; 8003042: 2300 movs r3, #0 } 8003044: 4618 mov r0, r3 8003046: 371c adds r7, #28 8003048: 46bd mov sp, r7 800304a: bc80 pop {r7} 800304c: 4770 bx lr 800304e: bf00 nop 8003050: 40023800 .word 0x40023800 8003054: 40007000 .word 0x40007000 8003058: 40023c00 .word 0x40023c00 0800305c : * @param hspi pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi) { 800305c: b580 push {r7, lr} 800305e: b082 sub sp, #8 8003060: af00 add r7, sp, #0 8003062: 6078 str r0, [r7, #4] /* Check the SPI handle allocation */ if (hspi == NULL) 8003064: 687b ldr r3, [r7, #4] 8003066: 2b00 cmp r3, #0 8003068: d101 bne.n 800306e { return HAL_ERROR; 800306a: 2301 movs r3, #1 800306c: e07b b.n 8003166 assert_param(IS_SPI_BAUDRATE_PRESCALER(hspi->Init.BaudRatePrescaler)); assert_param(IS_SPI_FIRST_BIT(hspi->Init.FirstBit)); /* TI mode is not supported on all devices in stm32l1xx serie. TIMode parameter is mandatory equal to SPI_TIMODE_DISABLE if TI mode is not supported */ assert_param(IS_SPI_TIMODE(hspi->Init.TIMode)); if (hspi->Init.TIMode == SPI_TIMODE_DISABLE) 800306e: 687b ldr r3, [r7, #4] 8003070: 6a5b ldr r3, [r3, #36] ; 0x24 8003072: 2b00 cmp r3, #0 8003074: d108 bne.n 8003088 { assert_param(IS_SPI_CPOL(hspi->Init.CLKPolarity)); assert_param(IS_SPI_CPHA(hspi->Init.CLKPhase)); if (hspi->Init.Mode == SPI_MODE_MASTER) 8003076: 687b ldr r3, [r7, #4] 8003078: 685b ldr r3, [r3, #4] 800307a: f5b3 7f82 cmp.w r3, #260 ; 0x104 800307e: d009 beq.n 8003094 assert_param(IS_SPI_BAUDRATE_PRESCALER(hspi->Init.BaudRatePrescaler)); } else { /* Baudrate prescaler not use in Motoraola Slave mode. force to default value */ hspi->Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; 8003080: 687b ldr r3, [r7, #4] 8003082: 2200 movs r2, #0 8003084: 61da str r2, [r3, #28] 8003086: e005 b.n 8003094 else { assert_param(IS_SPI_BAUDRATE_PRESCALER(hspi->Init.BaudRatePrescaler)); /* Force polarity and phase to TI protocaol requirements */ hspi->Init.CLKPolarity = SPI_POLARITY_LOW; 8003088: 687b ldr r3, [r7, #4] 800308a: 2200 movs r2, #0 800308c: 611a str r2, [r3, #16] hspi->Init.CLKPhase = SPI_PHASE_1EDGE; 800308e: 687b ldr r3, [r7, #4] 8003090: 2200 movs r2, #0 8003092: 615a str r2, [r3, #20] if (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) { assert_param(IS_SPI_CRC_POLYNOMIAL(hspi->Init.CRCPolynomial)); } #else hspi->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; 8003094: 687b ldr r3, [r7, #4] 8003096: 2200 movs r2, #0 8003098: 629a str r2, [r3, #40] ; 0x28 #endif /* USE_SPI_CRC */ if (hspi->State == HAL_SPI_STATE_RESET) 800309a: 687b ldr r3, [r7, #4] 800309c: f893 3051 ldrb.w r3, [r3, #81] ; 0x51 80030a0: b2db uxtb r3, r3 80030a2: 2b00 cmp r3, #0 80030a4: d106 bne.n 80030b4 { /* Allocate lock resource and initialize it */ hspi->Lock = HAL_UNLOCKED; 80030a6: 687b ldr r3, [r7, #4] 80030a8: 2200 movs r2, #0 80030aa: f883 2050 strb.w r2, [r3, #80] ; 0x50 /* Init the low level hardware : GPIO, CLOCK, NVIC... */ hspi->MspInitCallback(hspi); #else /* Init the low level hardware : GPIO, CLOCK, NVIC... */ HAL_SPI_MspInit(hspi); 80030ae: 6878 ldr r0, [r7, #4] 80030b0: f7fe f9bc bl 800142c #endif /* USE_HAL_SPI_REGISTER_CALLBACKS */ } hspi->State = HAL_SPI_STATE_BUSY; 80030b4: 687b ldr r3, [r7, #4] 80030b6: 2202 movs r2, #2 80030b8: f883 2051 strb.w r2, [r3, #81] ; 0x51 /* Disable the selected SPI peripheral */ __HAL_SPI_DISABLE(hspi); 80030bc: 687b ldr r3, [r7, #4] 80030be: 681b ldr r3, [r3, #0] 80030c0: 681a ldr r2, [r3, #0] 80030c2: 687b ldr r3, [r7, #4] 80030c4: 681b ldr r3, [r3, #0] 80030c6: f022 0240 bic.w r2, r2, #64 ; 0x40 80030ca: 601a str r2, [r3, #0] /*----------------------- SPIx CR1 & CR2 Configuration ---------------------*/ /* Configure : SPI Mode, Communication Mode, Data size, Clock polarity and phase, NSS management, Communication speed, First bit and CRC calculation state */ WRITE_REG(hspi->Instance->CR1, ((hspi->Init.Mode & (SPI_CR1_MSTR | SPI_CR1_SSI)) | 80030cc: 687b ldr r3, [r7, #4] 80030ce: 685b ldr r3, [r3, #4] 80030d0: f403 7282 and.w r2, r3, #260 ; 0x104 80030d4: 687b ldr r3, [r7, #4] 80030d6: 689b ldr r3, [r3, #8] 80030d8: f403 4304 and.w r3, r3, #33792 ; 0x8400 80030dc: 431a orrs r2, r3 80030de: 687b ldr r3, [r7, #4] 80030e0: 68db ldr r3, [r3, #12] 80030e2: f403 6300 and.w r3, r3, #2048 ; 0x800 80030e6: 431a orrs r2, r3 80030e8: 687b ldr r3, [r7, #4] 80030ea: 691b ldr r3, [r3, #16] 80030ec: f003 0302 and.w r3, r3, #2 80030f0: 431a orrs r2, r3 80030f2: 687b ldr r3, [r7, #4] 80030f4: 695b ldr r3, [r3, #20] 80030f6: f003 0301 and.w r3, r3, #1 80030fa: 431a orrs r2, r3 80030fc: 687b ldr r3, [r7, #4] 80030fe: 699b ldr r3, [r3, #24] 8003100: f403 7300 and.w r3, r3, #512 ; 0x200 8003104: 431a orrs r2, r3 8003106: 687b ldr r3, [r7, #4] 8003108: 69db ldr r3, [r3, #28] 800310a: f003 0338 and.w r3, r3, #56 ; 0x38 800310e: 431a orrs r2, r3 8003110: 687b ldr r3, [r7, #4] 8003112: 6a1b ldr r3, [r3, #32] 8003114: f003 0380 and.w r3, r3, #128 ; 0x80 8003118: ea42 0103 orr.w r1, r2, r3 800311c: 687b ldr r3, [r7, #4] 800311e: 6a9b ldr r3, [r3, #40] ; 0x28 8003120: f403 5200 and.w r2, r3, #8192 ; 0x2000 8003124: 687b ldr r3, [r7, #4] 8003126: 681b ldr r3, [r3, #0] 8003128: 430a orrs r2, r1 800312a: 601a str r2, [r3, #0] (hspi->Init.FirstBit & SPI_CR1_LSBFIRST) | (hspi->Init.CRCCalculation & SPI_CR1_CRCEN))); #if defined(SPI_CR2_FRF) /* Configure : NSS management, TI Mode */ WRITE_REG(hspi->Instance->CR2, (((hspi->Init.NSS >> 16U) & SPI_CR2_SSOE) | (hspi->Init.TIMode & SPI_CR2_FRF))); 800312c: 687b ldr r3, [r7, #4] 800312e: 699b ldr r3, [r3, #24] 8003130: 0c1b lsrs r3, r3, #16 8003132: f003 0104 and.w r1, r3, #4 8003136: 687b ldr r3, [r7, #4] 8003138: 6a5b ldr r3, [r3, #36] ; 0x24 800313a: f003 0210 and.w r2, r3, #16 800313e: 687b ldr r3, [r7, #4] 8003140: 681b ldr r3, [r3, #0] 8003142: 430a orrs r2, r1 8003144: 605a str r2, [r3, #4] } #endif /* USE_SPI_CRC */ #if defined(SPI_I2SCFGR_I2SMOD) /* Activate the SPI mode (Make sure that I2SMOD bit in I2SCFGR register is reset) */ CLEAR_BIT(hspi->Instance->I2SCFGR, SPI_I2SCFGR_I2SMOD); 8003146: 687b ldr r3, [r7, #4] 8003148: 681b ldr r3, [r3, #0] 800314a: 69da ldr r2, [r3, #28] 800314c: 687b ldr r3, [r7, #4] 800314e: 681b ldr r3, [r3, #0] 8003150: f422 6200 bic.w r2, r2, #2048 ; 0x800 8003154: 61da str r2, [r3, #28] #endif /* SPI_I2SCFGR_I2SMOD */ hspi->ErrorCode = HAL_SPI_ERROR_NONE; 8003156: 687b ldr r3, [r7, #4] 8003158: 2200 movs r2, #0 800315a: 655a str r2, [r3, #84] ; 0x54 hspi->State = HAL_SPI_STATE_READY; 800315c: 687b ldr r3, [r7, #4] 800315e: 2201 movs r2, #1 8003160: f883 2051 strb.w r2, [r3, #81] ; 0x51 return HAL_OK; 8003164: 2300 movs r3, #0 } 8003166: 4618 mov r0, r3 8003168: 3708 adds r7, #8 800316a: 46bd mov sp, r7 800316c: bd80 pop {r7, pc} 0800316e : * @param Size amount of data to be sent * @param Timeout Timeout duration * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout) { 800316e: b580 push {r7, lr} 8003170: b088 sub sp, #32 8003172: af00 add r7, sp, #0 8003174: 60f8 str r0, [r7, #12] 8003176: 60b9 str r1, [r7, #8] 8003178: 603b str r3, [r7, #0] 800317a: 4613 mov r3, r2 800317c: 80fb strh r3, [r7, #6] uint32_t tickstart; HAL_StatusTypeDef errorcode = HAL_OK; 800317e: 2300 movs r3, #0 8003180: 77fb strb r3, [r7, #31] /* Check Direction parameter */ assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction)); /* Process Locked */ __HAL_LOCK(hspi); 8003182: 68fb ldr r3, [r7, #12] 8003184: f893 3050 ldrb.w r3, [r3, #80] ; 0x50 8003188: 2b01 cmp r3, #1 800318a: d101 bne.n 8003190 800318c: 2302 movs r3, #2 800318e: e126 b.n 80033de 8003190: 68fb ldr r3, [r7, #12] 8003192: 2201 movs r2, #1 8003194: f883 2050 strb.w r2, [r3, #80] ; 0x50 /* Init tickstart for timeout management*/ tickstart = HAL_GetTick(); 8003198: f7fe fae0 bl 800175c 800319c: 61b8 str r0, [r7, #24] initial_TxXferCount = Size; 800319e: 88fb ldrh r3, [r7, #6] 80031a0: 82fb strh r3, [r7, #22] if (hspi->State != HAL_SPI_STATE_READY) 80031a2: 68fb ldr r3, [r7, #12] 80031a4: f893 3051 ldrb.w r3, [r3, #81] ; 0x51 80031a8: b2db uxtb r3, r3 80031aa: 2b01 cmp r3, #1 80031ac: d002 beq.n 80031b4 { errorcode = HAL_BUSY; 80031ae: 2302 movs r3, #2 80031b0: 77fb strb r3, [r7, #31] goto error; 80031b2: e10b b.n 80033cc } if ((pData == NULL) || (Size == 0U)) 80031b4: 68bb ldr r3, [r7, #8] 80031b6: 2b00 cmp r3, #0 80031b8: d002 beq.n 80031c0 80031ba: 88fb ldrh r3, [r7, #6] 80031bc: 2b00 cmp r3, #0 80031be: d102 bne.n 80031c6 { errorcode = HAL_ERROR; 80031c0: 2301 movs r3, #1 80031c2: 77fb strb r3, [r7, #31] goto error; 80031c4: e102 b.n 80033cc } /* Set the transaction information */ hspi->State = HAL_SPI_STATE_BUSY_TX; 80031c6: 68fb ldr r3, [r7, #12] 80031c8: 2203 movs r2, #3 80031ca: f883 2051 strb.w r2, [r3, #81] ; 0x51 hspi->ErrorCode = HAL_SPI_ERROR_NONE; 80031ce: 68fb ldr r3, [r7, #12] 80031d0: 2200 movs r2, #0 80031d2: 655a str r2, [r3, #84] ; 0x54 hspi->pTxBuffPtr = (uint8_t *)pData; 80031d4: 68fb ldr r3, [r7, #12] 80031d6: 68ba ldr r2, [r7, #8] 80031d8: 631a str r2, [r3, #48] ; 0x30 hspi->TxXferSize = Size; 80031da: 68fb ldr r3, [r7, #12] 80031dc: 88fa ldrh r2, [r7, #6] 80031de: 869a strh r2, [r3, #52] ; 0x34 hspi->TxXferCount = Size; 80031e0: 68fb ldr r3, [r7, #12] 80031e2: 88fa ldrh r2, [r7, #6] 80031e4: 86da strh r2, [r3, #54] ; 0x36 /*Init field not used in handle to zero */ hspi->pRxBuffPtr = (uint8_t *)NULL; 80031e6: 68fb ldr r3, [r7, #12] 80031e8: 2200 movs r2, #0 80031ea: 639a str r2, [r3, #56] ; 0x38 hspi->RxXferSize = 0U; 80031ec: 68fb ldr r3, [r7, #12] 80031ee: 2200 movs r2, #0 80031f0: 879a strh r2, [r3, #60] ; 0x3c hspi->RxXferCount = 0U; 80031f2: 68fb ldr r3, [r7, #12] 80031f4: 2200 movs r2, #0 80031f6: 87da strh r2, [r3, #62] ; 0x3e hspi->TxISR = NULL; 80031f8: 68fb ldr r3, [r7, #12] 80031fa: 2200 movs r2, #0 80031fc: 645a str r2, [r3, #68] ; 0x44 hspi->RxISR = NULL; 80031fe: 68fb ldr r3, [r7, #12] 8003200: 2200 movs r2, #0 8003202: 641a str r2, [r3, #64] ; 0x40 /* Configure communication direction : 1Line */ if (hspi->Init.Direction == SPI_DIRECTION_1LINE) 8003204: 68fb ldr r3, [r7, #12] 8003206: 689b ldr r3, [r3, #8] 8003208: f5b3 4f00 cmp.w r3, #32768 ; 0x8000 800320c: d10f bne.n 800322e { /* Disable SPI Peripheral before set 1Line direction (BIDIOE bit) */ __HAL_SPI_DISABLE(hspi); 800320e: 68fb ldr r3, [r7, #12] 8003210: 681b ldr r3, [r3, #0] 8003212: 681a ldr r2, [r3, #0] 8003214: 68fb ldr r3, [r7, #12] 8003216: 681b ldr r3, [r3, #0] 8003218: f022 0240 bic.w r2, r2, #64 ; 0x40 800321c: 601a str r2, [r3, #0] SPI_1LINE_TX(hspi); 800321e: 68fb ldr r3, [r7, #12] 8003220: 681b ldr r3, [r3, #0] 8003222: 681a ldr r2, [r3, #0] 8003224: 68fb ldr r3, [r7, #12] 8003226: 681b ldr r3, [r3, #0] 8003228: f442 4280 orr.w r2, r2, #16384 ; 0x4000 800322c: 601a str r2, [r3, #0] SPI_RESET_CRC(hspi); } #endif /* USE_SPI_CRC */ /* Check if the SPI is already enabled */ if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) 800322e: 68fb ldr r3, [r7, #12] 8003230: 681b ldr r3, [r3, #0] 8003232: 681b ldr r3, [r3, #0] 8003234: f003 0340 and.w r3, r3, #64 ; 0x40 8003238: 2b40 cmp r3, #64 ; 0x40 800323a: d007 beq.n 800324c { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); 800323c: 68fb ldr r3, [r7, #12] 800323e: 681b ldr r3, [r3, #0] 8003240: 681a ldr r2, [r3, #0] 8003242: 68fb ldr r3, [r7, #12] 8003244: 681b ldr r3, [r3, #0] 8003246: f042 0240 orr.w r2, r2, #64 ; 0x40 800324a: 601a str r2, [r3, #0] } /* Transmit data in 16 Bit mode */ if (hspi->Init.DataSize == SPI_DATASIZE_16BIT) 800324c: 68fb ldr r3, [r7, #12] 800324e: 68db ldr r3, [r3, #12] 8003250: f5b3 6f00 cmp.w r3, #2048 ; 0x800 8003254: d14b bne.n 80032ee { if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U)) 8003256: 68fb ldr r3, [r7, #12] 8003258: 685b ldr r3, [r3, #4] 800325a: 2b00 cmp r3, #0 800325c: d002 beq.n 8003264 800325e: 8afb ldrh r3, [r7, #22] 8003260: 2b01 cmp r3, #1 8003262: d13e bne.n 80032e2 { hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); 8003264: 68fb ldr r3, [r7, #12] 8003266: 6b1b ldr r3, [r3, #48] ; 0x30 8003268: 881a ldrh r2, [r3, #0] 800326a: 68fb ldr r3, [r7, #12] 800326c: 681b ldr r3, [r3, #0] 800326e: 60da str r2, [r3, #12] hspi->pTxBuffPtr += sizeof(uint16_t); 8003270: 68fb ldr r3, [r7, #12] 8003272: 6b1b ldr r3, [r3, #48] ; 0x30 8003274: 1c9a adds r2, r3, #2 8003276: 68fb ldr r3, [r7, #12] 8003278: 631a str r2, [r3, #48] ; 0x30 hspi->TxXferCount--; 800327a: 68fb ldr r3, [r7, #12] 800327c: 8edb ldrh r3, [r3, #54] ; 0x36 800327e: b29b uxth r3, r3 8003280: 3b01 subs r3, #1 8003282: b29a uxth r2, r3 8003284: 68fb ldr r3, [r7, #12] 8003286: 86da strh r2, [r3, #54] ; 0x36 } /* Transmit data in 16 Bit mode */ while (hspi->TxXferCount > 0U) 8003288: e02b b.n 80032e2 { /* Wait until TXE flag is set to send data */ if (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE)) 800328a: 68fb ldr r3, [r7, #12] 800328c: 681b ldr r3, [r3, #0] 800328e: 689b ldr r3, [r3, #8] 8003290: f003 0302 and.w r3, r3, #2 8003294: 2b02 cmp r3, #2 8003296: d112 bne.n 80032be { hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); 8003298: 68fb ldr r3, [r7, #12] 800329a: 6b1b ldr r3, [r3, #48] ; 0x30 800329c: 881a ldrh r2, [r3, #0] 800329e: 68fb ldr r3, [r7, #12] 80032a0: 681b ldr r3, [r3, #0] 80032a2: 60da str r2, [r3, #12] hspi->pTxBuffPtr += sizeof(uint16_t); 80032a4: 68fb ldr r3, [r7, #12] 80032a6: 6b1b ldr r3, [r3, #48] ; 0x30 80032a8: 1c9a adds r2, r3, #2 80032aa: 68fb ldr r3, [r7, #12] 80032ac: 631a str r2, [r3, #48] ; 0x30 hspi->TxXferCount--; 80032ae: 68fb ldr r3, [r7, #12] 80032b0: 8edb ldrh r3, [r3, #54] ; 0x36 80032b2: b29b uxth r3, r3 80032b4: 3b01 subs r3, #1 80032b6: b29a uxth r2, r3 80032b8: 68fb ldr r3, [r7, #12] 80032ba: 86da strh r2, [r3, #54] ; 0x36 80032bc: e011 b.n 80032e2 } else { /* Timeout management */ if ((((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY)) || (Timeout == 0U)) 80032be: f7fe fa4d bl 800175c 80032c2: 4602 mov r2, r0 80032c4: 69bb ldr r3, [r7, #24] 80032c6: 1ad3 subs r3, r2, r3 80032c8: 683a ldr r2, [r7, #0] 80032ca: 429a cmp r2, r3 80032cc: d803 bhi.n 80032d6 80032ce: 683b ldr r3, [r7, #0] 80032d0: f1b3 3fff cmp.w r3, #4294967295 80032d4: d102 bne.n 80032dc 80032d6: 683b ldr r3, [r7, #0] 80032d8: 2b00 cmp r3, #0 80032da: d102 bne.n 80032e2 { errorcode = HAL_TIMEOUT; 80032dc: 2303 movs r3, #3 80032de: 77fb strb r3, [r7, #31] goto error; 80032e0: e074 b.n 80033cc while (hspi->TxXferCount > 0U) 80032e2: 68fb ldr r3, [r7, #12] 80032e4: 8edb ldrh r3, [r3, #54] ; 0x36 80032e6: b29b uxth r3, r3 80032e8: 2b00 cmp r3, #0 80032ea: d1ce bne.n 800328a 80032ec: e04c b.n 8003388 } } /* Transmit data in 8 Bit mode */ else { if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U)) 80032ee: 68fb ldr r3, [r7, #12] 80032f0: 685b ldr r3, [r3, #4] 80032f2: 2b00 cmp r3, #0 80032f4: d002 beq.n 80032fc 80032f6: 8afb ldrh r3, [r7, #22] 80032f8: 2b01 cmp r3, #1 80032fa: d140 bne.n 800337e { *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr); 80032fc: 68fb ldr r3, [r7, #12] 80032fe: 6b1a ldr r2, [r3, #48] ; 0x30 8003300: 68fb ldr r3, [r7, #12] 8003302: 681b ldr r3, [r3, #0] 8003304: 330c adds r3, #12 8003306: 7812 ldrb r2, [r2, #0] 8003308: 701a strb r2, [r3, #0] hspi->pTxBuffPtr += sizeof(uint8_t); 800330a: 68fb ldr r3, [r7, #12] 800330c: 6b1b ldr r3, [r3, #48] ; 0x30 800330e: 1c5a adds r2, r3, #1 8003310: 68fb ldr r3, [r7, #12] 8003312: 631a str r2, [r3, #48] ; 0x30 hspi->TxXferCount--; 8003314: 68fb ldr r3, [r7, #12] 8003316: 8edb ldrh r3, [r3, #54] ; 0x36 8003318: b29b uxth r3, r3 800331a: 3b01 subs r3, #1 800331c: b29a uxth r2, r3 800331e: 68fb ldr r3, [r7, #12] 8003320: 86da strh r2, [r3, #54] ; 0x36 } while (hspi->TxXferCount > 0U) 8003322: e02c b.n 800337e { /* Wait until TXE flag is set to send data */ if (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE)) 8003324: 68fb ldr r3, [r7, #12] 8003326: 681b ldr r3, [r3, #0] 8003328: 689b ldr r3, [r3, #8] 800332a: f003 0302 and.w r3, r3, #2 800332e: 2b02 cmp r3, #2 8003330: d113 bne.n 800335a { *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr); 8003332: 68fb ldr r3, [r7, #12] 8003334: 6b1a ldr r2, [r3, #48] ; 0x30 8003336: 68fb ldr r3, [r7, #12] 8003338: 681b ldr r3, [r3, #0] 800333a: 330c adds r3, #12 800333c: 7812 ldrb r2, [r2, #0] 800333e: 701a strb r2, [r3, #0] hspi->pTxBuffPtr += sizeof(uint8_t); 8003340: 68fb ldr r3, [r7, #12] 8003342: 6b1b ldr r3, [r3, #48] ; 0x30 8003344: 1c5a adds r2, r3, #1 8003346: 68fb ldr r3, [r7, #12] 8003348: 631a str r2, [r3, #48] ; 0x30 hspi->TxXferCount--; 800334a: 68fb ldr r3, [r7, #12] 800334c: 8edb ldrh r3, [r3, #54] ; 0x36 800334e: b29b uxth r3, r3 8003350: 3b01 subs r3, #1 8003352: b29a uxth r2, r3 8003354: 68fb ldr r3, [r7, #12] 8003356: 86da strh r2, [r3, #54] ; 0x36 8003358: e011 b.n 800337e } else { /* Timeout management */ if ((((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY)) || (Timeout == 0U)) 800335a: f7fe f9ff bl 800175c 800335e: 4602 mov r2, r0 8003360: 69bb ldr r3, [r7, #24] 8003362: 1ad3 subs r3, r2, r3 8003364: 683a ldr r2, [r7, #0] 8003366: 429a cmp r2, r3 8003368: d803 bhi.n 8003372 800336a: 683b ldr r3, [r7, #0] 800336c: f1b3 3fff cmp.w r3, #4294967295 8003370: d102 bne.n 8003378 8003372: 683b ldr r3, [r7, #0] 8003374: 2b00 cmp r3, #0 8003376: d102 bne.n 800337e { errorcode = HAL_TIMEOUT; 8003378: 2303 movs r3, #3 800337a: 77fb strb r3, [r7, #31] goto error; 800337c: e026 b.n 80033cc while (hspi->TxXferCount > 0U) 800337e: 68fb ldr r3, [r7, #12] 8003380: 8edb ldrh r3, [r3, #54] ; 0x36 8003382: b29b uxth r3, r3 8003384: 2b00 cmp r3, #0 8003386: d1cd bne.n 8003324 SET_BIT(hspi->Instance->CR1, SPI_CR1_CRCNEXT); } #endif /* USE_SPI_CRC */ /* Check the end of the transaction */ if (SPI_EndRxTxTransaction(hspi, Timeout, tickstart) != HAL_OK) 8003388: 69ba ldr r2, [r7, #24] 800338a: 6839 ldr r1, [r7, #0] 800338c: 68f8 ldr r0, [r7, #12] 800338e: f000 fa55 bl 800383c 8003392: 4603 mov r3, r0 8003394: 2b00 cmp r3, #0 8003396: d002 beq.n 800339e { hspi->ErrorCode = HAL_SPI_ERROR_FLAG; 8003398: 68fb ldr r3, [r7, #12] 800339a: 2220 movs r2, #32 800339c: 655a str r2, [r3, #84] ; 0x54 } /* Clear overrun flag in 2 Lines communication mode because received is not read */ if (hspi->Init.Direction == SPI_DIRECTION_2LINES) 800339e: 68fb ldr r3, [r7, #12] 80033a0: 689b ldr r3, [r3, #8] 80033a2: 2b00 cmp r3, #0 80033a4: d10a bne.n 80033bc { __HAL_SPI_CLEAR_OVRFLAG(hspi); 80033a6: 2300 movs r3, #0 80033a8: 613b str r3, [r7, #16] 80033aa: 68fb ldr r3, [r7, #12] 80033ac: 681b ldr r3, [r3, #0] 80033ae: 68db ldr r3, [r3, #12] 80033b0: 613b str r3, [r7, #16] 80033b2: 68fb ldr r3, [r7, #12] 80033b4: 681b ldr r3, [r3, #0] 80033b6: 689b ldr r3, [r3, #8] 80033b8: 613b str r3, [r7, #16] 80033ba: 693b ldr r3, [r7, #16] } if (hspi->ErrorCode != HAL_SPI_ERROR_NONE) 80033bc: 68fb ldr r3, [r7, #12] 80033be: 6d5b ldr r3, [r3, #84] ; 0x54 80033c0: 2b00 cmp r3, #0 80033c2: d002 beq.n 80033ca { errorcode = HAL_ERROR; 80033c4: 2301 movs r3, #1 80033c6: 77fb strb r3, [r7, #31] 80033c8: e000 b.n 80033cc } error: 80033ca: bf00 nop hspi->State = HAL_SPI_STATE_READY; 80033cc: 68fb ldr r3, [r7, #12] 80033ce: 2201 movs r2, #1 80033d0: f883 2051 strb.w r2, [r3, #81] ; 0x51 /* Process Unlocked */ __HAL_UNLOCK(hspi); 80033d4: 68fb ldr r3, [r7, #12] 80033d6: 2200 movs r2, #0 80033d8: f883 2050 strb.w r2, [r3, #80] ; 0x50 return errorcode; 80033dc: 7ffb ldrb r3, [r7, #31] } 80033de: 4618 mov r0, r3 80033e0: 3720 adds r7, #32 80033e2: 46bd mov sp, r7 80033e4: bd80 pop {r7, pc} 080033e6 : * @param Timeout Timeout duration * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout) { 80033e6: b580 push {r7, lr} 80033e8: b08c sub sp, #48 ; 0x30 80033ea: af00 add r7, sp, #0 80033ec: 60f8 str r0, [r7, #12] 80033ee: 60b9 str r1, [r7, #8] 80033f0: 607a str r2, [r7, #4] 80033f2: 807b strh r3, [r7, #2] uint32_t tmp_mode; HAL_SPI_StateTypeDef tmp_state; uint32_t tickstart; /* Variable used to alternate Rx and Tx during transfer */ uint32_t txallowed = 1U; 80033f4: 2301 movs r3, #1 80033f6: 62fb str r3, [r7, #44] ; 0x2c HAL_StatusTypeDef errorcode = HAL_OK; 80033f8: 2300 movs r3, #0 80033fa: f887 302b strb.w r3, [r7, #43] ; 0x2b /* Check Direction parameter */ assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction)); /* Process Locked */ __HAL_LOCK(hspi); 80033fe: 68fb ldr r3, [r7, #12] 8003400: f893 3050 ldrb.w r3, [r3, #80] ; 0x50 8003404: 2b01 cmp r3, #1 8003406: d101 bne.n 800340c 8003408: 2302 movs r3, #2 800340a: e18a b.n 8003722 800340c: 68fb ldr r3, [r7, #12] 800340e: 2201 movs r2, #1 8003410: f883 2050 strb.w r2, [r3, #80] ; 0x50 /* Init tickstart for timeout management*/ tickstart = HAL_GetTick(); 8003414: f7fe f9a2 bl 800175c 8003418: 6278 str r0, [r7, #36] ; 0x24 /* Init temporary variables */ tmp_state = hspi->State; 800341a: 68fb ldr r3, [r7, #12] 800341c: f893 3051 ldrb.w r3, [r3, #81] ; 0x51 8003420: f887 3023 strb.w r3, [r7, #35] ; 0x23 tmp_mode = hspi->Init.Mode; 8003424: 68fb ldr r3, [r7, #12] 8003426: 685b ldr r3, [r3, #4] 8003428: 61fb str r3, [r7, #28] initial_TxXferCount = Size; 800342a: 887b ldrh r3, [r7, #2] 800342c: 837b strh r3, [r7, #26] if (!((tmp_state == HAL_SPI_STATE_READY) || \ 800342e: f897 3023 ldrb.w r3, [r7, #35] ; 0x23 8003432: 2b01 cmp r3, #1 8003434: d00f beq.n 8003456 8003436: 69fb ldr r3, [r7, #28] 8003438: f5b3 7f82 cmp.w r3, #260 ; 0x104 800343c: d107 bne.n 800344e ((tmp_mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES) && (tmp_state == HAL_SPI_STATE_BUSY_RX)))) 800343e: 68fb ldr r3, [r7, #12] 8003440: 689b ldr r3, [r3, #8] 8003442: 2b00 cmp r3, #0 8003444: d103 bne.n 800344e 8003446: f897 3023 ldrb.w r3, [r7, #35] ; 0x23 800344a: 2b04 cmp r3, #4 800344c: d003 beq.n 8003456 { errorcode = HAL_BUSY; 800344e: 2302 movs r3, #2 8003450: f887 302b strb.w r3, [r7, #43] ; 0x2b goto error; 8003454: e15b b.n 800370e } if ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U)) 8003456: 68bb ldr r3, [r7, #8] 8003458: 2b00 cmp r3, #0 800345a: d005 beq.n 8003468 800345c: 687b ldr r3, [r7, #4] 800345e: 2b00 cmp r3, #0 8003460: d002 beq.n 8003468 8003462: 887b ldrh r3, [r7, #2] 8003464: 2b00 cmp r3, #0 8003466: d103 bne.n 8003470 { errorcode = HAL_ERROR; 8003468: 2301 movs r3, #1 800346a: f887 302b strb.w r3, [r7, #43] ; 0x2b goto error; 800346e: e14e b.n 800370e } /* Don't overwrite in case of HAL_SPI_STATE_BUSY_RX */ if (hspi->State != HAL_SPI_STATE_BUSY_RX) 8003470: 68fb ldr r3, [r7, #12] 8003472: f893 3051 ldrb.w r3, [r3, #81] ; 0x51 8003476: b2db uxtb r3, r3 8003478: 2b04 cmp r3, #4 800347a: d003 beq.n 8003484 { hspi->State = HAL_SPI_STATE_BUSY_TX_RX; 800347c: 68fb ldr r3, [r7, #12] 800347e: 2205 movs r2, #5 8003480: f883 2051 strb.w r2, [r3, #81] ; 0x51 } /* Set the transaction information */ hspi->ErrorCode = HAL_SPI_ERROR_NONE; 8003484: 68fb ldr r3, [r7, #12] 8003486: 2200 movs r2, #0 8003488: 655a str r2, [r3, #84] ; 0x54 hspi->pRxBuffPtr = (uint8_t *)pRxData; 800348a: 68fb ldr r3, [r7, #12] 800348c: 687a ldr r2, [r7, #4] 800348e: 639a str r2, [r3, #56] ; 0x38 hspi->RxXferCount = Size; 8003490: 68fb ldr r3, [r7, #12] 8003492: 887a ldrh r2, [r7, #2] 8003494: 87da strh r2, [r3, #62] ; 0x3e hspi->RxXferSize = Size; 8003496: 68fb ldr r3, [r7, #12] 8003498: 887a ldrh r2, [r7, #2] 800349a: 879a strh r2, [r3, #60] ; 0x3c hspi->pTxBuffPtr = (uint8_t *)pTxData; 800349c: 68fb ldr r3, [r7, #12] 800349e: 68ba ldr r2, [r7, #8] 80034a0: 631a str r2, [r3, #48] ; 0x30 hspi->TxXferCount = Size; 80034a2: 68fb ldr r3, [r7, #12] 80034a4: 887a ldrh r2, [r7, #2] 80034a6: 86da strh r2, [r3, #54] ; 0x36 hspi->TxXferSize = Size; 80034a8: 68fb ldr r3, [r7, #12] 80034aa: 887a ldrh r2, [r7, #2] 80034ac: 869a strh r2, [r3, #52] ; 0x34 /*Init field not used in handle to zero */ hspi->RxISR = NULL; 80034ae: 68fb ldr r3, [r7, #12] 80034b0: 2200 movs r2, #0 80034b2: 641a str r2, [r3, #64] ; 0x40 hspi->TxISR = NULL; 80034b4: 68fb ldr r3, [r7, #12] 80034b6: 2200 movs r2, #0 80034b8: 645a str r2, [r3, #68] ; 0x44 SPI_RESET_CRC(hspi); } #endif /* USE_SPI_CRC */ /* Check if the SPI is already enabled */ if ((hspi->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) 80034ba: 68fb ldr r3, [r7, #12] 80034bc: 681b ldr r3, [r3, #0] 80034be: 681b ldr r3, [r3, #0] 80034c0: f003 0340 and.w r3, r3, #64 ; 0x40 80034c4: 2b40 cmp r3, #64 ; 0x40 80034c6: d007 beq.n 80034d8 { /* Enable SPI peripheral */ __HAL_SPI_ENABLE(hspi); 80034c8: 68fb ldr r3, [r7, #12] 80034ca: 681b ldr r3, [r3, #0] 80034cc: 681a ldr r2, [r3, #0] 80034ce: 68fb ldr r3, [r7, #12] 80034d0: 681b ldr r3, [r3, #0] 80034d2: f042 0240 orr.w r2, r2, #64 ; 0x40 80034d6: 601a str r2, [r3, #0] } /* Transmit and Receive data in 16 Bit mode */ if (hspi->Init.DataSize == SPI_DATASIZE_16BIT) 80034d8: 68fb ldr r3, [r7, #12] 80034da: 68db ldr r3, [r3, #12] 80034dc: f5b3 6f00 cmp.w r3, #2048 ; 0x800 80034e0: d178 bne.n 80035d4 { if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U)) 80034e2: 68fb ldr r3, [r7, #12] 80034e4: 685b ldr r3, [r3, #4] 80034e6: 2b00 cmp r3, #0 80034e8: d002 beq.n 80034f0 80034ea: 8b7b ldrh r3, [r7, #26] 80034ec: 2b01 cmp r3, #1 80034ee: d166 bne.n 80035be { hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); 80034f0: 68fb ldr r3, [r7, #12] 80034f2: 6b1b ldr r3, [r3, #48] ; 0x30 80034f4: 881a ldrh r2, [r3, #0] 80034f6: 68fb ldr r3, [r7, #12] 80034f8: 681b ldr r3, [r3, #0] 80034fa: 60da str r2, [r3, #12] hspi->pTxBuffPtr += sizeof(uint16_t); 80034fc: 68fb ldr r3, [r7, #12] 80034fe: 6b1b ldr r3, [r3, #48] ; 0x30 8003500: 1c9a adds r2, r3, #2 8003502: 68fb ldr r3, [r7, #12] 8003504: 631a str r2, [r3, #48] ; 0x30 hspi->TxXferCount--; 8003506: 68fb ldr r3, [r7, #12] 8003508: 8edb ldrh r3, [r3, #54] ; 0x36 800350a: b29b uxth r3, r3 800350c: 3b01 subs r3, #1 800350e: b29a uxth r2, r3 8003510: 68fb ldr r3, [r7, #12] 8003512: 86da strh r2, [r3, #54] ; 0x36 } while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U)) 8003514: e053 b.n 80035be { /* Check TXE flag */ if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE)) && (hspi->TxXferCount > 0U) && (txallowed == 1U)) 8003516: 68fb ldr r3, [r7, #12] 8003518: 681b ldr r3, [r3, #0] 800351a: 689b ldr r3, [r3, #8] 800351c: f003 0302 and.w r3, r3, #2 8003520: 2b02 cmp r3, #2 8003522: d11b bne.n 800355c 8003524: 68fb ldr r3, [r7, #12] 8003526: 8edb ldrh r3, [r3, #54] ; 0x36 8003528: b29b uxth r3, r3 800352a: 2b00 cmp r3, #0 800352c: d016 beq.n 800355c 800352e: 6afb ldr r3, [r7, #44] ; 0x2c 8003530: 2b01 cmp r3, #1 8003532: d113 bne.n 800355c { hspi->Instance->DR = *((uint16_t *)hspi->pTxBuffPtr); 8003534: 68fb ldr r3, [r7, #12] 8003536: 6b1b ldr r3, [r3, #48] ; 0x30 8003538: 881a ldrh r2, [r3, #0] 800353a: 68fb ldr r3, [r7, #12] 800353c: 681b ldr r3, [r3, #0] 800353e: 60da str r2, [r3, #12] hspi->pTxBuffPtr += sizeof(uint16_t); 8003540: 68fb ldr r3, [r7, #12] 8003542: 6b1b ldr r3, [r3, #48] ; 0x30 8003544: 1c9a adds r2, r3, #2 8003546: 68fb ldr r3, [r7, #12] 8003548: 631a str r2, [r3, #48] ; 0x30 hspi->TxXferCount--; 800354a: 68fb ldr r3, [r7, #12] 800354c: 8edb ldrh r3, [r3, #54] ; 0x36 800354e: b29b uxth r3, r3 8003550: 3b01 subs r3, #1 8003552: b29a uxth r2, r3 8003554: 68fb ldr r3, [r7, #12] 8003556: 86da strh r2, [r3, #54] ; 0x36 /* Next Data is a reception (Rx). Tx not allowed */ txallowed = 0U; 8003558: 2300 movs r3, #0 800355a: 62fb str r3, [r7, #44] ; 0x2c } #endif /* USE_SPI_CRC */ } /* Check RXNE flag */ if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_RXNE)) && (hspi->RxXferCount > 0U)) 800355c: 68fb ldr r3, [r7, #12] 800355e: 681b ldr r3, [r3, #0] 8003560: 689b ldr r3, [r3, #8] 8003562: f003 0301 and.w r3, r3, #1 8003566: 2b01 cmp r3, #1 8003568: d119 bne.n 800359e 800356a: 68fb ldr r3, [r7, #12] 800356c: 8fdb ldrh r3, [r3, #62] ; 0x3e 800356e: b29b uxth r3, r3 8003570: 2b00 cmp r3, #0 8003572: d014 beq.n 800359e { *((uint16_t *)hspi->pRxBuffPtr) = (uint16_t)hspi->Instance->DR; 8003574: 68fb ldr r3, [r7, #12] 8003576: 681b ldr r3, [r3, #0] 8003578: 68da ldr r2, [r3, #12] 800357a: 68fb ldr r3, [r7, #12] 800357c: 6b9b ldr r3, [r3, #56] ; 0x38 800357e: b292 uxth r2, r2 8003580: 801a strh r2, [r3, #0] hspi->pRxBuffPtr += sizeof(uint16_t); 8003582: 68fb ldr r3, [r7, #12] 8003584: 6b9b ldr r3, [r3, #56] ; 0x38 8003586: 1c9a adds r2, r3, #2 8003588: 68fb ldr r3, [r7, #12] 800358a: 639a str r2, [r3, #56] ; 0x38 hspi->RxXferCount--; 800358c: 68fb ldr r3, [r7, #12] 800358e: 8fdb ldrh r3, [r3, #62] ; 0x3e 8003590: b29b uxth r3, r3 8003592: 3b01 subs r3, #1 8003594: b29a uxth r2, r3 8003596: 68fb ldr r3, [r7, #12] 8003598: 87da strh r2, [r3, #62] ; 0x3e /* Next Data is a Transmission (Tx). Tx is allowed */ txallowed = 1U; 800359a: 2301 movs r3, #1 800359c: 62fb str r3, [r7, #44] ; 0x2c } if (((HAL_GetTick() - tickstart) >= Timeout) && (Timeout != HAL_MAX_DELAY)) 800359e: f7fe f8dd bl 800175c 80035a2: 4602 mov r2, r0 80035a4: 6a7b ldr r3, [r7, #36] ; 0x24 80035a6: 1ad3 subs r3, r2, r3 80035a8: 6bba ldr r2, [r7, #56] ; 0x38 80035aa: 429a cmp r2, r3 80035ac: d807 bhi.n 80035be 80035ae: 6bbb ldr r3, [r7, #56] ; 0x38 80035b0: f1b3 3fff cmp.w r3, #4294967295 80035b4: d003 beq.n 80035be { errorcode = HAL_TIMEOUT; 80035b6: 2303 movs r3, #3 80035b8: f887 302b strb.w r3, [r7, #43] ; 0x2b goto error; 80035bc: e0a7 b.n 800370e while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U)) 80035be: 68fb ldr r3, [r7, #12] 80035c0: 8edb ldrh r3, [r3, #54] ; 0x36 80035c2: b29b uxth r3, r3 80035c4: 2b00 cmp r3, #0 80035c6: d1a6 bne.n 8003516 80035c8: 68fb ldr r3, [r7, #12] 80035ca: 8fdb ldrh r3, [r3, #62] ; 0x3e 80035cc: b29b uxth r3, r3 80035ce: 2b00 cmp r3, #0 80035d0: d1a1 bne.n 8003516 80035d2: e07c b.n 80036ce } } /* Transmit and Receive data in 8 Bit mode */ else { if ((hspi->Init.Mode == SPI_MODE_SLAVE) || (initial_TxXferCount == 0x01U)) 80035d4: 68fb ldr r3, [r7, #12] 80035d6: 685b ldr r3, [r3, #4] 80035d8: 2b00 cmp r3, #0 80035da: d002 beq.n 80035e2 80035dc: 8b7b ldrh r3, [r7, #26] 80035de: 2b01 cmp r3, #1 80035e0: d16b bne.n 80036ba { *((__IO uint8_t *)&hspi->Instance->DR) = (*hspi->pTxBuffPtr); 80035e2: 68fb ldr r3, [r7, #12] 80035e4: 6b1a ldr r2, [r3, #48] ; 0x30 80035e6: 68fb ldr r3, [r7, #12] 80035e8: 681b ldr r3, [r3, #0] 80035ea: 330c adds r3, #12 80035ec: 7812 ldrb r2, [r2, #0] 80035ee: 701a strb r2, [r3, #0] hspi->pTxBuffPtr += sizeof(uint8_t); 80035f0: 68fb ldr r3, [r7, #12] 80035f2: 6b1b ldr r3, [r3, #48] ; 0x30 80035f4: 1c5a adds r2, r3, #1 80035f6: 68fb ldr r3, [r7, #12] 80035f8: 631a str r2, [r3, #48] ; 0x30 hspi->TxXferCount--; 80035fa: 68fb ldr r3, [r7, #12] 80035fc: 8edb ldrh r3, [r3, #54] ; 0x36 80035fe: b29b uxth r3, r3 8003600: 3b01 subs r3, #1 8003602: b29a uxth r2, r3 8003604: 68fb ldr r3, [r7, #12] 8003606: 86da strh r2, [r3, #54] ; 0x36 } while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U)) 8003608: e057 b.n 80036ba { /* Check TXE flag */ if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE)) && (hspi->TxXferCount > 0U) && (txallowed == 1U)) 800360a: 68fb ldr r3, [r7, #12] 800360c: 681b ldr r3, [r3, #0] 800360e: 689b ldr r3, [r3, #8] 8003610: f003 0302 and.w r3, r3, #2 8003614: 2b02 cmp r3, #2 8003616: d11c bne.n 8003652 8003618: 68fb ldr r3, [r7, #12] 800361a: 8edb ldrh r3, [r3, #54] ; 0x36 800361c: b29b uxth r3, r3 800361e: 2b00 cmp r3, #0 8003620: d017 beq.n 8003652 8003622: 6afb ldr r3, [r7, #44] ; 0x2c 8003624: 2b01 cmp r3, #1 8003626: d114 bne.n 8003652 { *(__IO uint8_t *)&hspi->Instance->DR = (*hspi->pTxBuffPtr); 8003628: 68fb ldr r3, [r7, #12] 800362a: 6b1a ldr r2, [r3, #48] ; 0x30 800362c: 68fb ldr r3, [r7, #12] 800362e: 681b ldr r3, [r3, #0] 8003630: 330c adds r3, #12 8003632: 7812 ldrb r2, [r2, #0] 8003634: 701a strb r2, [r3, #0] hspi->pTxBuffPtr++; 8003636: 68fb ldr r3, [r7, #12] 8003638: 6b1b ldr r3, [r3, #48] ; 0x30 800363a: 1c5a adds r2, r3, #1 800363c: 68fb ldr r3, [r7, #12] 800363e: 631a str r2, [r3, #48] ; 0x30 hspi->TxXferCount--; 8003640: 68fb ldr r3, [r7, #12] 8003642: 8edb ldrh r3, [r3, #54] ; 0x36 8003644: b29b uxth r3, r3 8003646: 3b01 subs r3, #1 8003648: b29a uxth r2, r3 800364a: 68fb ldr r3, [r7, #12] 800364c: 86da strh r2, [r3, #54] ; 0x36 /* Next Data is a reception (Rx). Tx not allowed */ txallowed = 0U; 800364e: 2300 movs r3, #0 8003650: 62fb str r3, [r7, #44] ; 0x2c } #endif /* USE_SPI_CRC */ } /* Wait until RXNE flag is reset */ if ((__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_RXNE)) && (hspi->RxXferCount > 0U)) 8003652: 68fb ldr r3, [r7, #12] 8003654: 681b ldr r3, [r3, #0] 8003656: 689b ldr r3, [r3, #8] 8003658: f003 0301 and.w r3, r3, #1 800365c: 2b01 cmp r3, #1 800365e: d119 bne.n 8003694 8003660: 68fb ldr r3, [r7, #12] 8003662: 8fdb ldrh r3, [r3, #62] ; 0x3e 8003664: b29b uxth r3, r3 8003666: 2b00 cmp r3, #0 8003668: d014 beq.n 8003694 { (*(uint8_t *)hspi->pRxBuffPtr) = hspi->Instance->DR; 800366a: 68fb ldr r3, [r7, #12] 800366c: 681b ldr r3, [r3, #0] 800366e: 68da ldr r2, [r3, #12] 8003670: 68fb ldr r3, [r7, #12] 8003672: 6b9b ldr r3, [r3, #56] ; 0x38 8003674: b2d2 uxtb r2, r2 8003676: 701a strb r2, [r3, #0] hspi->pRxBuffPtr++; 8003678: 68fb ldr r3, [r7, #12] 800367a: 6b9b ldr r3, [r3, #56] ; 0x38 800367c: 1c5a adds r2, r3, #1 800367e: 68fb ldr r3, [r7, #12] 8003680: 639a str r2, [r3, #56] ; 0x38 hspi->RxXferCount--; 8003682: 68fb ldr r3, [r7, #12] 8003684: 8fdb ldrh r3, [r3, #62] ; 0x3e 8003686: b29b uxth r3, r3 8003688: 3b01 subs r3, #1 800368a: b29a uxth r2, r3 800368c: 68fb ldr r3, [r7, #12] 800368e: 87da strh r2, [r3, #62] ; 0x3e /* Next Data is a Transmission (Tx). Tx is allowed */ txallowed = 1U; 8003690: 2301 movs r3, #1 8003692: 62fb str r3, [r7, #44] ; 0x2c } if ((((HAL_GetTick() - tickstart) >= Timeout) && ((Timeout != HAL_MAX_DELAY))) || (Timeout == 0U)) 8003694: f7fe f862 bl 800175c 8003698: 4602 mov r2, r0 800369a: 6a7b ldr r3, [r7, #36] ; 0x24 800369c: 1ad3 subs r3, r2, r3 800369e: 6bba ldr r2, [r7, #56] ; 0x38 80036a0: 429a cmp r2, r3 80036a2: d803 bhi.n 80036ac 80036a4: 6bbb ldr r3, [r7, #56] ; 0x38 80036a6: f1b3 3fff cmp.w r3, #4294967295 80036aa: d102 bne.n 80036b2 80036ac: 6bbb ldr r3, [r7, #56] ; 0x38 80036ae: 2b00 cmp r3, #0 80036b0: d103 bne.n 80036ba { errorcode = HAL_TIMEOUT; 80036b2: 2303 movs r3, #3 80036b4: f887 302b strb.w r3, [r7, #43] ; 0x2b goto error; 80036b8: e029 b.n 800370e while ((hspi->TxXferCount > 0U) || (hspi->RxXferCount > 0U)) 80036ba: 68fb ldr r3, [r7, #12] 80036bc: 8edb ldrh r3, [r3, #54] ; 0x36 80036be: b29b uxth r3, r3 80036c0: 2b00 cmp r3, #0 80036c2: d1a2 bne.n 800360a 80036c4: 68fb ldr r3, [r7, #12] 80036c6: 8fdb ldrh r3, [r3, #62] ; 0x3e 80036c8: b29b uxth r3, r3 80036ca: 2b00 cmp r3, #0 80036cc: d19d bne.n 800360a errorcode = HAL_ERROR; } #endif /* USE_SPI_CRC */ /* Check the end of the transaction */ if (SPI_EndRxTxTransaction(hspi, Timeout, tickstart) != HAL_OK) 80036ce: 6a7a ldr r2, [r7, #36] ; 0x24 80036d0: 6bb9 ldr r1, [r7, #56] ; 0x38 80036d2: 68f8 ldr r0, [r7, #12] 80036d4: f000 f8b2 bl 800383c 80036d8: 4603 mov r3, r0 80036da: 2b00 cmp r3, #0 80036dc: d006 beq.n 80036ec { errorcode = HAL_ERROR; 80036de: 2301 movs r3, #1 80036e0: f887 302b strb.w r3, [r7, #43] ; 0x2b hspi->ErrorCode = HAL_SPI_ERROR_FLAG; 80036e4: 68fb ldr r3, [r7, #12] 80036e6: 2220 movs r2, #32 80036e8: 655a str r2, [r3, #84] ; 0x54 goto error; 80036ea: e010 b.n 800370e } /* Clear overrun flag in 2 Lines communication mode because received is not read */ if (hspi->Init.Direction == SPI_DIRECTION_2LINES) 80036ec: 68fb ldr r3, [r7, #12] 80036ee: 689b ldr r3, [r3, #8] 80036f0: 2b00 cmp r3, #0 80036f2: d10b bne.n 800370c { __HAL_SPI_CLEAR_OVRFLAG(hspi); 80036f4: 2300 movs r3, #0 80036f6: 617b str r3, [r7, #20] 80036f8: 68fb ldr r3, [r7, #12] 80036fa: 681b ldr r3, [r3, #0] 80036fc: 68db ldr r3, [r3, #12] 80036fe: 617b str r3, [r7, #20] 8003700: 68fb ldr r3, [r7, #12] 8003702: 681b ldr r3, [r3, #0] 8003704: 689b ldr r3, [r3, #8] 8003706: 617b str r3, [r7, #20] 8003708: 697b ldr r3, [r7, #20] 800370a: e000 b.n 800370e } error : 800370c: bf00 nop hspi->State = HAL_SPI_STATE_READY; 800370e: 68fb ldr r3, [r7, #12] 8003710: 2201 movs r2, #1 8003712: f883 2051 strb.w r2, [r3, #81] ; 0x51 __HAL_UNLOCK(hspi); 8003716: 68fb ldr r3, [r7, #12] 8003718: 2200 movs r2, #0 800371a: f883 2050 strb.w r2, [r3, #80] ; 0x50 return errorcode; 800371e: f897 302b ldrb.w r3, [r7, #43] ; 0x2b } 8003722: 4618 mov r0, r3 8003724: 3730 adds r7, #48 ; 0x30 8003726: 46bd mov sp, r7 8003728: bd80 pop {r7, pc} ... 0800372c : * @param Tickstart tick start value * @retval HAL status */ static HAL_StatusTypeDef SPI_WaitFlagStateUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Flag, FlagStatus State, uint32_t Timeout, uint32_t Tickstart) { 800372c: b580 push {r7, lr} 800372e: b088 sub sp, #32 8003730: af00 add r7, sp, #0 8003732: 60f8 str r0, [r7, #12] 8003734: 60b9 str r1, [r7, #8] 8003736: 603b str r3, [r7, #0] 8003738: 4613 mov r3, r2 800373a: 71fb strb r3, [r7, #7] __IO uint32_t count; uint32_t tmp_timeout; uint32_t tmp_tickstart; /* Adjust Timeout value in case of end of transfer */ tmp_timeout = Timeout - (HAL_GetTick() - Tickstart); 800373c: f7fe f80e bl 800175c 8003740: 4602 mov r2, r0 8003742: 6abb ldr r3, [r7, #40] ; 0x28 8003744: 1a9b subs r3, r3, r2 8003746: 683a ldr r2, [r7, #0] 8003748: 4413 add r3, r2 800374a: 61fb str r3, [r7, #28] tmp_tickstart = HAL_GetTick(); 800374c: f7fe f806 bl 800175c 8003750: 61b8 str r0, [r7, #24] /* Calculate Timeout based on a software loop to avoid blocking issue if Systick is disabled */ count = tmp_timeout * ((SystemCoreClock * 32U) >> 20U); 8003752: 4b39 ldr r3, [pc, #228] ; (8003838 ) 8003754: 681b ldr r3, [r3, #0] 8003756: 015b lsls r3, r3, #5 8003758: 0d1b lsrs r3, r3, #20 800375a: 69fa ldr r2, [r7, #28] 800375c: fb02 f303 mul.w r3, r2, r3 8003760: 617b str r3, [r7, #20] while ((__HAL_SPI_GET_FLAG(hspi, Flag) ? SET : RESET) != State) 8003762: e054 b.n 800380e { if (Timeout != HAL_MAX_DELAY) 8003764: 683b ldr r3, [r7, #0] 8003766: f1b3 3fff cmp.w r3, #4294967295 800376a: d050 beq.n 800380e { if (((HAL_GetTick() - tmp_tickstart) >= tmp_timeout) || (tmp_timeout == 0U)) 800376c: f7fd fff6 bl 800175c 8003770: 4602 mov r2, r0 8003772: 69bb ldr r3, [r7, #24] 8003774: 1ad3 subs r3, r2, r3 8003776: 69fa ldr r2, [r7, #28] 8003778: 429a cmp r2, r3 800377a: d902 bls.n 8003782 800377c: 69fb ldr r3, [r7, #28] 800377e: 2b00 cmp r3, #0 8003780: d13d bne.n 80037fe /* Disable the SPI and reset the CRC: the CRC value should be cleared on both master and slave sides in order to resynchronize the master and slave for their respective CRC calculation */ /* Disable TXE, RXNE and ERR interrupts for the interrupt process */ __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR)); 8003782: 68fb ldr r3, [r7, #12] 8003784: 681b ldr r3, [r3, #0] 8003786: 685a ldr r2, [r3, #4] 8003788: 68fb ldr r3, [r7, #12] 800378a: 681b ldr r3, [r3, #0] 800378c: f022 02e0 bic.w r2, r2, #224 ; 0xe0 8003790: 605a str r2, [r3, #4] if ((hspi->Init.Mode == SPI_MODE_MASTER) && ((hspi->Init.Direction == SPI_DIRECTION_1LINE) 8003792: 68fb ldr r3, [r7, #12] 8003794: 685b ldr r3, [r3, #4] 8003796: f5b3 7f82 cmp.w r3, #260 ; 0x104 800379a: d111 bne.n 80037c0 800379c: 68fb ldr r3, [r7, #12] 800379e: 689b ldr r3, [r3, #8] 80037a0: f5b3 4f00 cmp.w r3, #32768 ; 0x8000 80037a4: d004 beq.n 80037b0 || (hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY))) 80037a6: 68fb ldr r3, [r7, #12] 80037a8: 689b ldr r3, [r3, #8] 80037aa: f5b3 6f80 cmp.w r3, #1024 ; 0x400 80037ae: d107 bne.n 80037c0 { /* Disable SPI peripheral */ __HAL_SPI_DISABLE(hspi); 80037b0: 68fb ldr r3, [r7, #12] 80037b2: 681b ldr r3, [r3, #0] 80037b4: 681a ldr r2, [r3, #0] 80037b6: 68fb ldr r3, [r7, #12] 80037b8: 681b ldr r3, [r3, #0] 80037ba: f022 0240 bic.w r2, r2, #64 ; 0x40 80037be: 601a str r2, [r3, #0] } /* Reset CRC Calculation */ if (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) 80037c0: 68fb ldr r3, [r7, #12] 80037c2: 6a9b ldr r3, [r3, #40] ; 0x28 80037c4: f5b3 5f00 cmp.w r3, #8192 ; 0x2000 80037c8: d10f bne.n 80037ea { SPI_RESET_CRC(hspi); 80037ca: 68fb ldr r3, [r7, #12] 80037cc: 681b ldr r3, [r3, #0] 80037ce: 681a ldr r2, [r3, #0] 80037d0: 68fb ldr r3, [r7, #12] 80037d2: 681b ldr r3, [r3, #0] 80037d4: f422 5200 bic.w r2, r2, #8192 ; 0x2000 80037d8: 601a str r2, [r3, #0] 80037da: 68fb ldr r3, [r7, #12] 80037dc: 681b ldr r3, [r3, #0] 80037de: 681a ldr r2, [r3, #0] 80037e0: 68fb ldr r3, [r7, #12] 80037e2: 681b ldr r3, [r3, #0] 80037e4: f442 5200 orr.w r2, r2, #8192 ; 0x2000 80037e8: 601a str r2, [r3, #0] } hspi->State = HAL_SPI_STATE_READY; 80037ea: 68fb ldr r3, [r7, #12] 80037ec: 2201 movs r2, #1 80037ee: f883 2051 strb.w r2, [r3, #81] ; 0x51 /* Process Unlocked */ __HAL_UNLOCK(hspi); 80037f2: 68fb ldr r3, [r7, #12] 80037f4: 2200 movs r2, #0 80037f6: f883 2050 strb.w r2, [r3, #80] ; 0x50 return HAL_TIMEOUT; 80037fa: 2303 movs r3, #3 80037fc: e017 b.n 800382e } /* If Systick is disabled or not incremented, deactivate timeout to go in disable loop procedure */ if(count == 0U) 80037fe: 697b ldr r3, [r7, #20] 8003800: 2b00 cmp r3, #0 8003802: d101 bne.n 8003808 { tmp_timeout = 0U; 8003804: 2300 movs r3, #0 8003806: 61fb str r3, [r7, #28] } count--; 8003808: 697b ldr r3, [r7, #20] 800380a: 3b01 subs r3, #1 800380c: 617b str r3, [r7, #20] while ((__HAL_SPI_GET_FLAG(hspi, Flag) ? SET : RESET) != State) 800380e: 68fb ldr r3, [r7, #12] 8003810: 681b ldr r3, [r3, #0] 8003812: 689a ldr r2, [r3, #8] 8003814: 68bb ldr r3, [r7, #8] 8003816: 4013 ands r3, r2 8003818: 68ba ldr r2, [r7, #8] 800381a: 429a cmp r2, r3 800381c: bf0c ite eq 800381e: 2301 moveq r3, #1 8003820: 2300 movne r3, #0 8003822: b2db uxtb r3, r3 8003824: 461a mov r2, r3 8003826: 79fb ldrb r3, [r7, #7] 8003828: 429a cmp r2, r3 800382a: d19b bne.n 8003764 } } return HAL_OK; 800382c: 2300 movs r3, #0 } 800382e: 4618 mov r0, r3 8003830: 3720 adds r7, #32 8003832: 46bd mov sp, r7 8003834: bd80 pop {r7, pc} 8003836: bf00 nop 8003838: 20000004 .word 0x20000004 0800383c : * @param Timeout Timeout duration * @param Tickstart tick start value * @retval HAL status */ static HAL_StatusTypeDef SPI_EndRxTxTransaction(SPI_HandleTypeDef *hspi, uint32_t Timeout, uint32_t Tickstart) { 800383c: b580 push {r7, lr} 800383e: b088 sub sp, #32 8003840: af02 add r7, sp, #8 8003842: 60f8 str r0, [r7, #12] 8003844: 60b9 str r1, [r7, #8] 8003846: 607a str r2, [r7, #4] /* Timeout in µs */ __IO uint32_t count = SPI_BSY_FLAG_WORKAROUND_TIMEOUT * (SystemCoreClock / 24U / 1000000U); 8003848: 4b1b ldr r3, [pc, #108] ; (80038b8 ) 800384a: 681b ldr r3, [r3, #0] 800384c: 4a1b ldr r2, [pc, #108] ; (80038bc ) 800384e: fba2 2303 umull r2, r3, r2, r3 8003852: 0d5b lsrs r3, r3, #21 8003854: f44f 727a mov.w r2, #1000 ; 0x3e8 8003858: fb02 f303 mul.w r3, r2, r3 800385c: 617b str r3, [r7, #20] /* Erratasheet: BSY bit may stay high at the end of a data transfer in Slave mode */ if (hspi->Init.Mode == SPI_MODE_MASTER) 800385e: 68fb ldr r3, [r7, #12] 8003860: 685b ldr r3, [r3, #4] 8003862: f5b3 7f82 cmp.w r3, #260 ; 0x104 8003866: d112 bne.n 800388e { /* Control the BSY flag */ if (SPI_WaitFlagStateUntilTimeout(hspi, SPI_FLAG_BSY, RESET, Timeout, Tickstart) != HAL_OK) 8003868: 687b ldr r3, [r7, #4] 800386a: 9300 str r3, [sp, #0] 800386c: 68bb ldr r3, [r7, #8] 800386e: 2200 movs r2, #0 8003870: 2180 movs r1, #128 ; 0x80 8003872: 68f8 ldr r0, [r7, #12] 8003874: f7ff ff5a bl 800372c 8003878: 4603 mov r3, r0 800387a: 2b00 cmp r3, #0 800387c: d016 beq.n 80038ac { SET_BIT(hspi->ErrorCode, HAL_SPI_ERROR_FLAG); 800387e: 68fb ldr r3, [r7, #12] 8003880: 6d5b ldr r3, [r3, #84] ; 0x54 8003882: f043 0220 orr.w r2, r3, #32 8003886: 68fb ldr r3, [r7, #12] 8003888: 655a str r2, [r3, #84] ; 0x54 return HAL_TIMEOUT; 800388a: 2303 movs r3, #3 800388c: e00f b.n 80038ae * User have to calculate the timeout value to fit with the time of 1 byte transfer. * This time is directly link with the SPI clock from Master device. */ do { if (count == 0U) 800388e: 697b ldr r3, [r7, #20] 8003890: 2b00 cmp r3, #0 8003892: d00a beq.n 80038aa { break; } count--; 8003894: 697b ldr r3, [r7, #20] 8003896: 3b01 subs r3, #1 8003898: 617b str r3, [r7, #20] } while (__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_BSY) != RESET); 800389a: 68fb ldr r3, [r7, #12] 800389c: 681b ldr r3, [r3, #0] 800389e: 689b ldr r3, [r3, #8] 80038a0: f003 0380 and.w r3, r3, #128 ; 0x80 80038a4: 2b80 cmp r3, #128 ; 0x80 80038a6: d0f2 beq.n 800388e 80038a8: e000 b.n 80038ac break; 80038aa: bf00 nop } return HAL_OK; 80038ac: 2300 movs r3, #0 } 80038ae: 4618 mov r0, r3 80038b0: 3718 adds r7, #24 80038b2: 46bd mov sp, r7 80038b4: bd80 pop {r7, pc} 80038b6: bf00 nop 80038b8: 20000004 .word 0x20000004 80038bc: 165e9f81 .word 0x165e9f81 080038c0 : * @param huart Pointer to a UART_HandleTypeDef structure that contains * the configuration information for the specified UART module. * @retval HAL status */ HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart) { 80038c0: b580 push {r7, lr} 80038c2: b082 sub sp, #8 80038c4: af00 add r7, sp, #0 80038c6: 6078 str r0, [r7, #4] /* Check the UART handle allocation */ if (huart == NULL) 80038c8: 687b ldr r3, [r7, #4] 80038ca: 2b00 cmp r3, #0 80038cc: d101 bne.n 80038d2 { return HAL_ERROR; 80038ce: 2301 movs r3, #1 80038d0: e03f b.n 8003952 assert_param(IS_UART_INSTANCE(huart->Instance)); } assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength)); assert_param(IS_UART_OVERSAMPLING(huart->Init.OverSampling)); if (huart->gState == HAL_UART_STATE_RESET) 80038d2: 687b ldr r3, [r7, #4] 80038d4: f893 3039 ldrb.w r3, [r3, #57] ; 0x39 80038d8: b2db uxtb r3, r3 80038da: 2b00 cmp r3, #0 80038dc: d106 bne.n 80038ec { /* Allocate lock resource and initialize it */ huart->Lock = HAL_UNLOCKED; 80038de: 687b ldr r3, [r7, #4] 80038e0: 2200 movs r2, #0 80038e2: f883 2038 strb.w r2, [r3, #56] ; 0x38 /* Init the low level hardware */ huart->MspInitCallback(huart); #else /* Init the low level hardware : GPIO, CLOCK */ HAL_UART_MspInit(huart); 80038e6: 6878 ldr r0, [r7, #4] 80038e8: f7fd fde4 bl 80014b4 #endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ } huart->gState = HAL_UART_STATE_BUSY; 80038ec: 687b ldr r3, [r7, #4] 80038ee: 2224 movs r2, #36 ; 0x24 80038f0: f883 2039 strb.w r2, [r3, #57] ; 0x39 /* Disable the peripheral */ __HAL_UART_DISABLE(huart); 80038f4: 687b ldr r3, [r7, #4] 80038f6: 681b ldr r3, [r3, #0] 80038f8: 68da ldr r2, [r3, #12] 80038fa: 687b ldr r3, [r7, #4] 80038fc: 681b ldr r3, [r3, #0] 80038fe: f422 5200 bic.w r2, r2, #8192 ; 0x2000 8003902: 60da str r2, [r3, #12] /* Set the UART Communication parameters */ UART_SetConfig(huart); 8003904: 6878 ldr r0, [r7, #4] 8003906: f000 f90b bl 8003b20 /* In asynchronous mode, the following bits must be kept cleared: - LINEN and CLKEN bits in the USART_CR2 register, - SCEN, HDSEL and IREN bits in the USART_CR3 register.*/ CLEAR_BIT(huart->Instance->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN)); 800390a: 687b ldr r3, [r7, #4] 800390c: 681b ldr r3, [r3, #0] 800390e: 691a ldr r2, [r3, #16] 8003910: 687b ldr r3, [r7, #4] 8003912: 681b ldr r3, [r3, #0] 8003914: f422 4290 bic.w r2, r2, #18432 ; 0x4800 8003918: 611a str r2, [r3, #16] CLEAR_BIT(huart->Instance->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL | USART_CR3_IREN)); 800391a: 687b ldr r3, [r7, #4] 800391c: 681b ldr r3, [r3, #0] 800391e: 695a ldr r2, [r3, #20] 8003920: 687b ldr r3, [r7, #4] 8003922: 681b ldr r3, [r3, #0] 8003924: f022 022a bic.w r2, r2, #42 ; 0x2a 8003928: 615a str r2, [r3, #20] /* Enable the peripheral */ __HAL_UART_ENABLE(huart); 800392a: 687b ldr r3, [r7, #4] 800392c: 681b ldr r3, [r3, #0] 800392e: 68da ldr r2, [r3, #12] 8003930: 687b ldr r3, [r7, #4] 8003932: 681b ldr r3, [r3, #0] 8003934: f442 5200 orr.w r2, r2, #8192 ; 0x2000 8003938: 60da str r2, [r3, #12] /* Initialize the UART state */ huart->ErrorCode = HAL_UART_ERROR_NONE; 800393a: 687b ldr r3, [r7, #4] 800393c: 2200 movs r2, #0 800393e: 63da str r2, [r3, #60] ; 0x3c huart->gState = HAL_UART_STATE_READY; 8003940: 687b ldr r3, [r7, #4] 8003942: 2220 movs r2, #32 8003944: f883 2039 strb.w r2, [r3, #57] ; 0x39 huart->RxState = HAL_UART_STATE_READY; 8003948: 687b ldr r3, [r7, #4] 800394a: 2220 movs r2, #32 800394c: f883 203a strb.w r2, [r3, #58] ; 0x3a return HAL_OK; 8003950: 2300 movs r3, #0 } 8003952: 4618 mov r0, r3 8003954: 3708 adds r7, #8 8003956: 46bd mov sp, r7 8003958: bd80 pop {r7, pc} 0800395a : * @param Size Amount of data elements (u8 or u16) to be sent * @param Timeout Timeout duration * @retval HAL status */ HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout) { 800395a: b580 push {r7, lr} 800395c: b088 sub sp, #32 800395e: af02 add r7, sp, #8 8003960: 60f8 str r0, [r7, #12] 8003962: 60b9 str r1, [r7, #8] 8003964: 603b str r3, [r7, #0] 8003966: 4613 mov r3, r2 8003968: 80fb strh r3, [r7, #6] uint16_t *tmp; uint32_t tickstart = 0U; 800396a: 2300 movs r3, #0 800396c: 617b str r3, [r7, #20] /* Check that a Tx process is not already ongoing */ if (huart->gState == HAL_UART_STATE_READY) 800396e: 68fb ldr r3, [r7, #12] 8003970: f893 3039 ldrb.w r3, [r3, #57] ; 0x39 8003974: b2db uxtb r3, r3 8003976: 2b20 cmp r3, #32 8003978: f040 8083 bne.w 8003a82 { if ((pData == NULL) || (Size == 0U)) 800397c: 68bb ldr r3, [r7, #8] 800397e: 2b00 cmp r3, #0 8003980: d002 beq.n 8003988 8003982: 88fb ldrh r3, [r7, #6] 8003984: 2b00 cmp r3, #0 8003986: d101 bne.n 800398c { return HAL_ERROR; 8003988: 2301 movs r3, #1 800398a: e07b b.n 8003a84 } /* Process Locked */ __HAL_LOCK(huart); 800398c: 68fb ldr r3, [r7, #12] 800398e: f893 3038 ldrb.w r3, [r3, #56] ; 0x38 8003992: 2b01 cmp r3, #1 8003994: d101 bne.n 800399a 8003996: 2302 movs r3, #2 8003998: e074 b.n 8003a84 800399a: 68fb ldr r3, [r7, #12] 800399c: 2201 movs r2, #1 800399e: f883 2038 strb.w r2, [r3, #56] ; 0x38 huart->ErrorCode = HAL_UART_ERROR_NONE; 80039a2: 68fb ldr r3, [r7, #12] 80039a4: 2200 movs r2, #0 80039a6: 63da str r2, [r3, #60] ; 0x3c huart->gState = HAL_UART_STATE_BUSY_TX; 80039a8: 68fb ldr r3, [r7, #12] 80039aa: 2221 movs r2, #33 ; 0x21 80039ac: f883 2039 strb.w r2, [r3, #57] ; 0x39 /* Init tickstart for timeout managment */ tickstart = HAL_GetTick(); 80039b0: f7fd fed4 bl 800175c 80039b4: 6178 str r0, [r7, #20] huart->TxXferSize = Size; 80039b6: 68fb ldr r3, [r7, #12] 80039b8: 88fa ldrh r2, [r7, #6] 80039ba: 849a strh r2, [r3, #36] ; 0x24 huart->TxXferCount = Size; 80039bc: 68fb ldr r3, [r7, #12] 80039be: 88fa ldrh r2, [r7, #6] 80039c0: 84da strh r2, [r3, #38] ; 0x26 /* Process Unlocked */ __HAL_UNLOCK(huart); 80039c2: 68fb ldr r3, [r7, #12] 80039c4: 2200 movs r2, #0 80039c6: f883 2038 strb.w r2, [r3, #56] ; 0x38 while (huart->TxXferCount > 0U) 80039ca: e042 b.n 8003a52 { huart->TxXferCount--; 80039cc: 68fb ldr r3, [r7, #12] 80039ce: 8cdb ldrh r3, [r3, #38] ; 0x26 80039d0: b29b uxth r3, r3 80039d2: 3b01 subs r3, #1 80039d4: b29a uxth r2, r3 80039d6: 68fb ldr r3, [r7, #12] 80039d8: 84da strh r2, [r3, #38] ; 0x26 if (huart->Init.WordLength == UART_WORDLENGTH_9B) 80039da: 68fb ldr r3, [r7, #12] 80039dc: 689b ldr r3, [r3, #8] 80039de: f5b3 5f80 cmp.w r3, #4096 ; 0x1000 80039e2: d122 bne.n 8003a2a { if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TXE, RESET, tickstart, Timeout) != HAL_OK) 80039e4: 683b ldr r3, [r7, #0] 80039e6: 9300 str r3, [sp, #0] 80039e8: 697b ldr r3, [r7, #20] 80039ea: 2200 movs r2, #0 80039ec: 2180 movs r1, #128 ; 0x80 80039ee: 68f8 ldr r0, [r7, #12] 80039f0: f000 f84c bl 8003a8c 80039f4: 4603 mov r3, r0 80039f6: 2b00 cmp r3, #0 80039f8: d001 beq.n 80039fe { return HAL_TIMEOUT; 80039fa: 2303 movs r3, #3 80039fc: e042 b.n 8003a84 } tmp = (uint16_t *) pData; 80039fe: 68bb ldr r3, [r7, #8] 8003a00: 613b str r3, [r7, #16] huart->Instance->DR = (*tmp & (uint16_t)0x01FF); 8003a02: 693b ldr r3, [r7, #16] 8003a04: 881b ldrh r3, [r3, #0] 8003a06: 461a mov r2, r3 8003a08: 68fb ldr r3, [r7, #12] 8003a0a: 681b ldr r3, [r3, #0] 8003a0c: f3c2 0208 ubfx r2, r2, #0, #9 8003a10: 605a str r2, [r3, #4] if (huart->Init.Parity == UART_PARITY_NONE) 8003a12: 68fb ldr r3, [r7, #12] 8003a14: 691b ldr r3, [r3, #16] 8003a16: 2b00 cmp r3, #0 8003a18: d103 bne.n 8003a22 { pData += 2U; 8003a1a: 68bb ldr r3, [r7, #8] 8003a1c: 3302 adds r3, #2 8003a1e: 60bb str r3, [r7, #8] 8003a20: e017 b.n 8003a52 } else { pData += 1U; 8003a22: 68bb ldr r3, [r7, #8] 8003a24: 3301 adds r3, #1 8003a26: 60bb str r3, [r7, #8] 8003a28: e013 b.n 8003a52 } } else { if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TXE, RESET, tickstart, Timeout) != HAL_OK) 8003a2a: 683b ldr r3, [r7, #0] 8003a2c: 9300 str r3, [sp, #0] 8003a2e: 697b ldr r3, [r7, #20] 8003a30: 2200 movs r2, #0 8003a32: 2180 movs r1, #128 ; 0x80 8003a34: 68f8 ldr r0, [r7, #12] 8003a36: f000 f829 bl 8003a8c 8003a3a: 4603 mov r3, r0 8003a3c: 2b00 cmp r3, #0 8003a3e: d001 beq.n 8003a44 { return HAL_TIMEOUT; 8003a40: 2303 movs r3, #3 8003a42: e01f b.n 8003a84 } huart->Instance->DR = (*pData++ & (uint8_t)0xFF); 8003a44: 68bb ldr r3, [r7, #8] 8003a46: 1c5a adds r2, r3, #1 8003a48: 60ba str r2, [r7, #8] 8003a4a: 781a ldrb r2, [r3, #0] 8003a4c: 68fb ldr r3, [r7, #12] 8003a4e: 681b ldr r3, [r3, #0] 8003a50: 605a str r2, [r3, #4] while (huart->TxXferCount > 0U) 8003a52: 68fb ldr r3, [r7, #12] 8003a54: 8cdb ldrh r3, [r3, #38] ; 0x26 8003a56: b29b uxth r3, r3 8003a58: 2b00 cmp r3, #0 8003a5a: d1b7 bne.n 80039cc } } if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TC, RESET, tickstart, Timeout) != HAL_OK) 8003a5c: 683b ldr r3, [r7, #0] 8003a5e: 9300 str r3, [sp, #0] 8003a60: 697b ldr r3, [r7, #20] 8003a62: 2200 movs r2, #0 8003a64: 2140 movs r1, #64 ; 0x40 8003a66: 68f8 ldr r0, [r7, #12] 8003a68: f000 f810 bl 8003a8c 8003a6c: 4603 mov r3, r0 8003a6e: 2b00 cmp r3, #0 8003a70: d001 beq.n 8003a76 { return HAL_TIMEOUT; 8003a72: 2303 movs r3, #3 8003a74: e006 b.n 8003a84 } /* At end of Tx process, restore huart->gState to Ready */ huart->gState = HAL_UART_STATE_READY; 8003a76: 68fb ldr r3, [r7, #12] 8003a78: 2220 movs r2, #32 8003a7a: f883 2039 strb.w r2, [r3, #57] ; 0x39 return HAL_OK; 8003a7e: 2300 movs r3, #0 8003a80: e000 b.n 8003a84 } else { return HAL_BUSY; 8003a82: 2302 movs r3, #2 } } 8003a84: 4618 mov r0, r3 8003a86: 3718 adds r7, #24 8003a88: 46bd mov sp, r7 8003a8a: bd80 pop {r7, pc} 08003a8c : * @param Tickstart Tick start value * @param Timeout Timeout duration * @retval HAL status */ static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Tickstart, uint32_t Timeout) { 8003a8c: b580 push {r7, lr} 8003a8e: b084 sub sp, #16 8003a90: af00 add r7, sp, #0 8003a92: 60f8 str r0, [r7, #12] 8003a94: 60b9 str r1, [r7, #8] 8003a96: 603b str r3, [r7, #0] 8003a98: 4613 mov r3, r2 8003a9a: 71fb strb r3, [r7, #7] /* Wait until flag is set */ while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status) 8003a9c: e02c b.n 8003af8 { /* Check for the Timeout */ if (Timeout != HAL_MAX_DELAY) 8003a9e: 69bb ldr r3, [r7, #24] 8003aa0: f1b3 3fff cmp.w r3, #4294967295 8003aa4: d028 beq.n 8003af8 { if ((Timeout == 0U) || ((HAL_GetTick() - Tickstart) > Timeout)) 8003aa6: 69bb ldr r3, [r7, #24] 8003aa8: 2b00 cmp r3, #0 8003aaa: d007 beq.n 8003abc 8003aac: f7fd fe56 bl 800175c 8003ab0: 4602 mov r2, r0 8003ab2: 683b ldr r3, [r7, #0] 8003ab4: 1ad3 subs r3, r2, r3 8003ab6: 69ba ldr r2, [r7, #24] 8003ab8: 429a cmp r2, r3 8003aba: d21d bcs.n 8003af8 { /* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts for the interrupt process */ CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE | USART_CR1_TXEIE)); 8003abc: 68fb ldr r3, [r7, #12] 8003abe: 681b ldr r3, [r3, #0] 8003ac0: 68da ldr r2, [r3, #12] 8003ac2: 68fb ldr r3, [r7, #12] 8003ac4: 681b ldr r3, [r3, #0] 8003ac6: f422 72d0 bic.w r2, r2, #416 ; 0x1a0 8003aca: 60da str r2, [r3, #12] CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); 8003acc: 68fb ldr r3, [r7, #12] 8003ace: 681b ldr r3, [r3, #0] 8003ad0: 695a ldr r2, [r3, #20] 8003ad2: 68fb ldr r3, [r7, #12] 8003ad4: 681b ldr r3, [r3, #0] 8003ad6: f022 0201 bic.w r2, r2, #1 8003ada: 615a str r2, [r3, #20] huart->gState = HAL_UART_STATE_READY; 8003adc: 68fb ldr r3, [r7, #12] 8003ade: 2220 movs r2, #32 8003ae0: f883 2039 strb.w r2, [r3, #57] ; 0x39 huart->RxState = HAL_UART_STATE_READY; 8003ae4: 68fb ldr r3, [r7, #12] 8003ae6: 2220 movs r2, #32 8003ae8: f883 203a strb.w r2, [r3, #58] ; 0x3a /* Process Unlocked */ __HAL_UNLOCK(huart); 8003aec: 68fb ldr r3, [r7, #12] 8003aee: 2200 movs r2, #0 8003af0: f883 2038 strb.w r2, [r3, #56] ; 0x38 return HAL_TIMEOUT; 8003af4: 2303 movs r3, #3 8003af6: e00f b.n 8003b18 while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status) 8003af8: 68fb ldr r3, [r7, #12] 8003afa: 681b ldr r3, [r3, #0] 8003afc: 681a ldr r2, [r3, #0] 8003afe: 68bb ldr r3, [r7, #8] 8003b00: 4013 ands r3, r2 8003b02: 68ba ldr r2, [r7, #8] 8003b04: 429a cmp r2, r3 8003b06: bf0c ite eq 8003b08: 2301 moveq r3, #1 8003b0a: 2300 movne r3, #0 8003b0c: b2db uxtb r3, r3 8003b0e: 461a mov r2, r3 8003b10: 79fb ldrb r3, [r7, #7] 8003b12: 429a cmp r2, r3 8003b14: d0c3 beq.n 8003a9e } } } return HAL_OK; 8003b16: 2300 movs r3, #0 } 8003b18: 4618 mov r0, r3 8003b1a: 3710 adds r7, #16 8003b1c: 46bd mov sp, r7 8003b1e: bd80 pop {r7, pc} 08003b20 : * @param huart Pointer to a UART_HandleTypeDef structure that contains * the configuration information for the specified UART module. * @retval None */ static void UART_SetConfig(UART_HandleTypeDef *huart) { 8003b20: b580 push {r7, lr} 8003b22: b084 sub sp, #16 8003b24: af00 add r7, sp, #0 8003b26: 6078 str r0, [r7, #4] assert_param(IS_UART_MODE(huart->Init.Mode)); /*-------------------------- USART CR2 Configuration -----------------------*/ /* Configure the UART Stop Bits: Set STOP[13:12] bits according to huart->Init.StopBits value */ MODIFY_REG(huart->Instance->CR2, USART_CR2_STOP, huart->Init.StopBits); 8003b28: 687b ldr r3, [r7, #4] 8003b2a: 681b ldr r3, [r3, #0] 8003b2c: 691b ldr r3, [r3, #16] 8003b2e: f423 5140 bic.w r1, r3, #12288 ; 0x3000 8003b32: 687b ldr r3, [r7, #4] 8003b34: 68da ldr r2, [r3, #12] 8003b36: 687b ldr r3, [r7, #4] 8003b38: 681b ldr r3, [r3, #0] 8003b3a: 430a orrs r2, r1 8003b3c: 611a str r2, [r3, #16] Set the M bits according to huart->Init.WordLength value Set PCE and PS bits according to huart->Init.Parity value Set TE and RE bits according to huart->Init.Mode value Set OVER8 bit according to huart->Init.OverSampling value */ tmpreg = (uint32_t)huart->Init.WordLength | huart->Init.Parity | huart->Init.Mode | huart->Init.OverSampling; 8003b3e: 687b ldr r3, [r7, #4] 8003b40: 689a ldr r2, [r3, #8] 8003b42: 687b ldr r3, [r7, #4] 8003b44: 691b ldr r3, [r3, #16] 8003b46: 431a orrs r2, r3 8003b48: 687b ldr r3, [r7, #4] 8003b4a: 695b ldr r3, [r3, #20] 8003b4c: 431a orrs r2, r3 8003b4e: 687b ldr r3, [r7, #4] 8003b50: 69db ldr r3, [r3, #28] 8003b52: 4313 orrs r3, r2 8003b54: 60bb str r3, [r7, #8] MODIFY_REG(huart->Instance->CR1, 8003b56: 687b ldr r3, [r7, #4] 8003b58: 681b ldr r3, [r3, #0] 8003b5a: 68db ldr r3, [r3, #12] 8003b5c: f423 4316 bic.w r3, r3, #38400 ; 0x9600 8003b60: f023 030c bic.w r3, r3, #12 8003b64: 687a ldr r2, [r7, #4] 8003b66: 6812 ldr r2, [r2, #0] 8003b68: 68b9 ldr r1, [r7, #8] 8003b6a: 430b orrs r3, r1 8003b6c: 60d3 str r3, [r2, #12] (uint32_t)(USART_CR1_M | USART_CR1_PCE | USART_CR1_PS | USART_CR1_TE | USART_CR1_RE | USART_CR1_OVER8), tmpreg); /*-------------------------- USART CR3 Configuration -----------------------*/ /* Configure the UART HFC: Set CTSE and RTSE bits according to huart->Init.HwFlowCtl value */ MODIFY_REG(huart->Instance->CR3, (USART_CR3_RTSE | USART_CR3_CTSE), huart->Init.HwFlowCtl); 8003b6e: 687b ldr r3, [r7, #4] 8003b70: 681b ldr r3, [r3, #0] 8003b72: 695b ldr r3, [r3, #20] 8003b74: f423 7140 bic.w r1, r3, #768 ; 0x300 8003b78: 687b ldr r3, [r7, #4] 8003b7a: 699a ldr r2, [r3, #24] 8003b7c: 687b ldr r3, [r7, #4] 8003b7e: 681b ldr r3, [r3, #0] 8003b80: 430a orrs r2, r1 8003b82: 615a str r2, [r3, #20] if((huart->Instance == USART1)) 8003b84: 687b ldr r3, [r7, #4] 8003b86: 681b ldr r3, [r3, #0] 8003b88: 4a55 ldr r2, [pc, #340] ; (8003ce0 ) 8003b8a: 4293 cmp r3, r2 8003b8c: d103 bne.n 8003b96 { pclk = HAL_RCC_GetPCLK2Freq(); 8003b8e: f7ff f9f1 bl 8002f74 8003b92: 60f8 str r0, [r7, #12] 8003b94: e002 b.n 8003b9c } else { pclk = HAL_RCC_GetPCLK1Freq(); 8003b96: f7ff f9d9 bl 8002f4c 8003b9a: 60f8 str r0, [r7, #12] } /*-------------------------- USART BRR Configuration ---------------------*/ if (huart->Init.OverSampling == UART_OVERSAMPLING_8) 8003b9c: 687b ldr r3, [r7, #4] 8003b9e: 69db ldr r3, [r3, #28] 8003ba0: f5b3 4f00 cmp.w r3, #32768 ; 0x8000 8003ba4: d14c bne.n 8003c40 { huart->Instance->BRR = UART_BRR_SAMPLING8(pclk, huart->Init.BaudRate); 8003ba6: 68fa ldr r2, [r7, #12] 8003ba8: 4613 mov r3, r2 8003baa: 009b lsls r3, r3, #2 8003bac: 4413 add r3, r2 8003bae: 009a lsls r2, r3, #2 8003bb0: 441a add r2, r3 8003bb2: 687b ldr r3, [r7, #4] 8003bb4: 685b ldr r3, [r3, #4] 8003bb6: 005b lsls r3, r3, #1 8003bb8: fbb2 f3f3 udiv r3, r2, r3 8003bbc: 4a49 ldr r2, [pc, #292] ; (8003ce4 ) 8003bbe: fba2 2303 umull r2, r3, r2, r3 8003bc2: 095b lsrs r3, r3, #5 8003bc4: 0119 lsls r1, r3, #4 8003bc6: 68fa ldr r2, [r7, #12] 8003bc8: 4613 mov r3, r2 8003bca: 009b lsls r3, r3, #2 8003bcc: 4413 add r3, r2 8003bce: 009a lsls r2, r3, #2 8003bd0: 441a add r2, r3 8003bd2: 687b ldr r3, [r7, #4] 8003bd4: 685b ldr r3, [r3, #4] 8003bd6: 005b lsls r3, r3, #1 8003bd8: fbb2 f2f3 udiv r2, r2, r3 8003bdc: 4b41 ldr r3, [pc, #260] ; (8003ce4 ) 8003bde: fba3 0302 umull r0, r3, r3, r2 8003be2: 095b lsrs r3, r3, #5 8003be4: 2064 movs r0, #100 ; 0x64 8003be6: fb00 f303 mul.w r3, r0, r3 8003bea: 1ad3 subs r3, r2, r3 8003bec: 00db lsls r3, r3, #3 8003bee: 3332 adds r3, #50 ; 0x32 8003bf0: 4a3c ldr r2, [pc, #240] ; (8003ce4 ) 8003bf2: fba2 2303 umull r2, r3, r2, r3 8003bf6: 095b lsrs r3, r3, #5 8003bf8: 005b lsls r3, r3, #1 8003bfa: f403 73f8 and.w r3, r3, #496 ; 0x1f0 8003bfe: 4419 add r1, r3 8003c00: 68fa ldr r2, [r7, #12] 8003c02: 4613 mov r3, r2 8003c04: 009b lsls r3, r3, #2 8003c06: 4413 add r3, r2 8003c08: 009a lsls r2, r3, #2 8003c0a: 441a add r2, r3 8003c0c: 687b ldr r3, [r7, #4] 8003c0e: 685b ldr r3, [r3, #4] 8003c10: 005b lsls r3, r3, #1 8003c12: fbb2 f2f3 udiv r2, r2, r3 8003c16: 4b33 ldr r3, [pc, #204] ; (8003ce4 ) 8003c18: fba3 0302 umull r0, r3, r3, r2 8003c1c: 095b lsrs r3, r3, #5 8003c1e: 2064 movs r0, #100 ; 0x64 8003c20: fb00 f303 mul.w r3, r0, r3 8003c24: 1ad3 subs r3, r2, r3 8003c26: 00db lsls r3, r3, #3 8003c28: 3332 adds r3, #50 ; 0x32 8003c2a: 4a2e ldr r2, [pc, #184] ; (8003ce4 ) 8003c2c: fba2 2303 umull r2, r3, r2, r3 8003c30: 095b lsrs r3, r3, #5 8003c32: f003 0207 and.w r2, r3, #7 8003c36: 687b ldr r3, [r7, #4] 8003c38: 681b ldr r3, [r3, #0] 8003c3a: 440a add r2, r1 8003c3c: 609a str r2, [r3, #8] } else { huart->Instance->BRR = UART_BRR_SAMPLING16(pclk, huart->Init.BaudRate); } } 8003c3e: e04a b.n 8003cd6 huart->Instance->BRR = UART_BRR_SAMPLING16(pclk, huart->Init.BaudRate); 8003c40: 68fa ldr r2, [r7, #12] 8003c42: 4613 mov r3, r2 8003c44: 009b lsls r3, r3, #2 8003c46: 4413 add r3, r2 8003c48: 009a lsls r2, r3, #2 8003c4a: 441a add r2, r3 8003c4c: 687b ldr r3, [r7, #4] 8003c4e: 685b ldr r3, [r3, #4] 8003c50: 009b lsls r3, r3, #2 8003c52: fbb2 f3f3 udiv r3, r2, r3 8003c56: 4a23 ldr r2, [pc, #140] ; (8003ce4 ) 8003c58: fba2 2303 umull r2, r3, r2, r3 8003c5c: 095b lsrs r3, r3, #5 8003c5e: 0119 lsls r1, r3, #4 8003c60: 68fa ldr r2, [r7, #12] 8003c62: 4613 mov r3, r2 8003c64: 009b lsls r3, r3, #2 8003c66: 4413 add r3, r2 8003c68: 009a lsls r2, r3, #2 8003c6a: 441a add r2, r3 8003c6c: 687b ldr r3, [r7, #4] 8003c6e: 685b ldr r3, [r3, #4] 8003c70: 009b lsls r3, r3, #2 8003c72: fbb2 f2f3 udiv r2, r2, r3 8003c76: 4b1b ldr r3, [pc, #108] ; (8003ce4 ) 8003c78: fba3 0302 umull r0, r3, r3, r2 8003c7c: 095b lsrs r3, r3, #5 8003c7e: 2064 movs r0, #100 ; 0x64 8003c80: fb00 f303 mul.w r3, r0, r3 8003c84: 1ad3 subs r3, r2, r3 8003c86: 011b lsls r3, r3, #4 8003c88: 3332 adds r3, #50 ; 0x32 8003c8a: 4a16 ldr r2, [pc, #88] ; (8003ce4 ) 8003c8c: fba2 2303 umull r2, r3, r2, r3 8003c90: 095b lsrs r3, r3, #5 8003c92: f003 03f0 and.w r3, r3, #240 ; 0xf0 8003c96: 4419 add r1, r3 8003c98: 68fa ldr r2, [r7, #12] 8003c9a: 4613 mov r3, r2 8003c9c: 009b lsls r3, r3, #2 8003c9e: 4413 add r3, r2 8003ca0: 009a lsls r2, r3, #2 8003ca2: 441a add r2, r3 8003ca4: 687b ldr r3, [r7, #4] 8003ca6: 685b ldr r3, [r3, #4] 8003ca8: 009b lsls r3, r3, #2 8003caa: fbb2 f2f3 udiv r2, r2, r3 8003cae: 4b0d ldr r3, [pc, #52] ; (8003ce4 ) 8003cb0: fba3 0302 umull r0, r3, r3, r2 8003cb4: 095b lsrs r3, r3, #5 8003cb6: 2064 movs r0, #100 ; 0x64 8003cb8: fb00 f303 mul.w r3, r0, r3 8003cbc: 1ad3 subs r3, r2, r3 8003cbe: 011b lsls r3, r3, #4 8003cc0: 3332 adds r3, #50 ; 0x32 8003cc2: 4a08 ldr r2, [pc, #32] ; (8003ce4 ) 8003cc4: fba2 2303 umull r2, r3, r2, r3 8003cc8: 095b lsrs r3, r3, #5 8003cca: f003 020f and.w r2, r3, #15 8003cce: 687b ldr r3, [r7, #4] 8003cd0: 681b ldr r3, [r3, #0] 8003cd2: 440a add r2, r1 8003cd4: 609a str r2, [r3, #8] } 8003cd6: bf00 nop 8003cd8: 3710 adds r7, #16 8003cda: 46bd mov sp, r7 8003cdc: bd80 pop {r7, pc} 8003cde: bf00 nop 8003ce0: 40013800 .word 0x40013800 8003ce4: 51eb851f .word 0x51eb851f 08003ce8 : /* USER CODE BEGIN Variables */ /* USER CODE END Variables */ void MX_FATFS_Init(void) { 8003ce8: b580 push {r7, lr} 8003cea: af00 add r7, sp, #0 /*## FatFS: Link the USER driver ###########################*/ retUSER = FATFS_LinkDriver(&USER_Driver, USERPath); 8003cec: 4904 ldr r1, [pc, #16] ; (8003d00 ) 8003cee: 4805 ldr r0, [pc, #20] ; (8003d04 ) 8003cf0: f003 f97c bl 8006fec 8003cf4: 4603 mov r3, r0 8003cf6: 461a mov r2, r3 8003cf8: 4b03 ldr r3, [pc, #12] ; (8003d08 ) 8003cfa: 701a strb r2, [r3, #0] /* USER CODE BEGIN Init */ /* additional user code for init */ /* USER CODE END Init */ } 8003cfc: bf00 nop 8003cfe: bd80 pop {r7, pc} 8003d00: 200024e0 .word 0x200024e0 8003d04: 20000010 .word 0x20000010 8003d08: 200024e4 .word 0x200024e4 08003d0c : * @brief Gets Time from RTC * @param None * @retval Time in DWORD */ DWORD get_fattime(void) { 8003d0c: b480 push {r7} 8003d0e: af00 add r7, sp, #0 /* USER CODE BEGIN get_fattime */ return 0; 8003d10: 2300 movs r3, #0 /* USER CODE END get_fattime */ } 8003d12: 4618 mov r0, r3 8003d14: 46bd mov sp, r7 8003d16: bc80 pop {r7} 8003d18: 4770 bx lr 08003d1a : * @retval DSTATUS: Operation status */ DSTATUS USER_initialize ( BYTE pdrv /* Physical drive nmuber to identify the drive */ ) { 8003d1a: b580 push {r7, lr} 8003d1c: b082 sub sp, #8 8003d1e: af00 add r7, sp, #0 8003d20: 4603 mov r3, r0 8003d22: 71fb strb r3, [r7, #7] /* USER CODE BEGIN INIT */ //Stat = STA_NOINIT; //return Stat; SD_disk_initialize (pdrv); 8003d24: 79fb ldrb r3, [r7, #7] 8003d26: 4618 mov r0, r3 8003d28: f7fc fd64 bl 80007f4 /* USER CODE END INIT */ } 8003d2c: bf00 nop 8003d2e: 4618 mov r0, r3 8003d30: 3708 adds r7, #8 8003d32: 46bd mov sp, r7 8003d34: bd80 pop {r7, pc} 08003d36 : * @retval DSTATUS: Operation status */ DSTATUS USER_status ( BYTE pdrv /* Physical drive number to identify the drive */ ) { 8003d36: b580 push {r7, lr} 8003d38: b082 sub sp, #8 8003d3a: af00 add r7, sp, #0 8003d3c: 4603 mov r3, r0 8003d3e: 71fb strb r3, [r7, #7] /* USER CODE BEGIN STATUS */ //Stat = STA_NOINIT; //return Stat; SD_disk_status (pdrv); 8003d40: 79fb ldrb r3, [r7, #7] 8003d42: 4618 mov r0, r3 8003d44: f7fc fe3c bl 80009c0 /* USER CODE END STATUS */ } 8003d48: bf00 nop 8003d4a: 4618 mov r0, r3 8003d4c: 3708 adds r7, #8 8003d4e: 46bd mov sp, r7 8003d50: bd80 pop {r7, pc} 08003d52 : BYTE pdrv, /* Physical drive nmuber to identify the drive */ BYTE *buff, /* Data buffer to store read data */ DWORD sector, /* Sector address in LBA */ UINT count /* Number of sectors to read */ ) { 8003d52: b580 push {r7, lr} 8003d54: b084 sub sp, #16 8003d56: af00 add r7, sp, #0 8003d58: 60b9 str r1, [r7, #8] 8003d5a: 607a str r2, [r7, #4] 8003d5c: 603b str r3, [r7, #0] 8003d5e: 4603 mov r3, r0 8003d60: 73fb strb r3, [r7, #15] /* USER CODE BEGIN READ */ //return RES_OK; SD_disk_read (pdrv, buff, sector, count); 8003d62: 7bf8 ldrb r0, [r7, #15] 8003d64: 683b ldr r3, [r7, #0] 8003d66: 687a ldr r2, [r7, #4] 8003d68: 68b9 ldr r1, [r7, #8] 8003d6a: f7fc fe3d bl 80009e8 /* USER CODE END READ */ } 8003d6e: bf00 nop 8003d70: 4618 mov r0, r3 8003d72: 3710 adds r7, #16 8003d74: 46bd mov sp, r7 8003d76: bd80 pop {r7, pc} 08003d78 : BYTE pdrv, /* Physical drive nmuber to identify the drive */ const BYTE *buff, /* Data to be written */ DWORD sector, /* Sector address in LBA */ UINT count /* Number of sectors to write */ ) { 8003d78: b580 push {r7, lr} 8003d7a: b084 sub sp, #16 8003d7c: af00 add r7, sp, #0 8003d7e: 60b9 str r1, [r7, #8] 8003d80: 607a str r2, [r7, #4] 8003d82: 603b str r3, [r7, #0] 8003d84: 4603 mov r3, r0 8003d86: 73fb strb r3, [r7, #15] /* USER CODE BEGIN WRITE */ /* USER CODE HERE */ //return RES_OK; SD_disk_write (pdrv, buff, sector, count); 8003d88: 7bf8 ldrb r0, [r7, #15] 8003d8a: 683b ldr r3, [r7, #0] 8003d8c: 687a ldr r2, [r7, #4] 8003d8e: 68b9 ldr r1, [r7, #8] 8003d90: f7fc fe94 bl 8000abc /* USER CODE END WRITE */ } 8003d94: bf00 nop 8003d96: 4618 mov r0, r3 8003d98: 3710 adds r7, #16 8003d9a: 46bd mov sp, r7 8003d9c: bd80 pop {r7, pc} 08003d9e : DRESULT USER_ioctl ( BYTE pdrv, /* Physical drive nmuber (0..) */ BYTE cmd, /* Control code */ void *buff /* Buffer to send/receive control data */ ) { 8003d9e: b580 push {r7, lr} 8003da0: b082 sub sp, #8 8003da2: af00 add r7, sp, #0 8003da4: 4603 mov r3, r0 8003da6: 603a str r2, [r7, #0] 8003da8: 71fb strb r3, [r7, #7] 8003daa: 460b mov r3, r1 8003dac: 71bb strb r3, [r7, #6] /* USER CODE BEGIN IOCTL */ //DRESULT res = RES_ERROR; //return res; SD_disk_ioctl (pdrv, cmd, buff); 8003dae: 79fb ldrb r3, [r7, #7] 8003db0: 79b9 ldrb r1, [r7, #6] 8003db2: 683a ldr r2, [r7, #0] 8003db4: 4618 mov r0, r3 8003db6: f7fc ff05 bl 8000bc4 /* USER CODE END IOCTL */ } 8003dba: bf00 nop 8003dbc: 4618 mov r0, r3 8003dbe: 3708 adds r7, #8 8003dc0: 46bd mov sp, r7 8003dc2: bd80 pop {r7, pc} 08003dc4 : * @retval DSTATUS: Operation status */ DSTATUS disk_status ( BYTE pdrv /* Physical drive number to identify the drive */ ) { 8003dc4: b580 push {r7, lr} 8003dc6: b084 sub sp, #16 8003dc8: af00 add r7, sp, #0 8003dca: 4603 mov r3, r0 8003dcc: 71fb strb r3, [r7, #7] DSTATUS stat; stat = disk.drv[pdrv]->disk_status(disk.lun[pdrv]); 8003dce: 79fb ldrb r3, [r7, #7] 8003dd0: 4a08 ldr r2, [pc, #32] ; (8003df4 ) 8003dd2: 009b lsls r3, r3, #2 8003dd4: 4413 add r3, r2 8003dd6: 685b ldr r3, [r3, #4] 8003dd8: 685b ldr r3, [r3, #4] 8003dda: 79fa ldrb r2, [r7, #7] 8003ddc: 4905 ldr r1, [pc, #20] ; (8003df4 ) 8003dde: 440a add r2, r1 8003de0: 7a12 ldrb r2, [r2, #8] 8003de2: 4610 mov r0, r2 8003de4: 4798 blx r3 8003de6: 4603 mov r3, r0 8003de8: 73fb strb r3, [r7, #15] return stat; 8003dea: 7bfb ldrb r3, [r7, #15] } 8003dec: 4618 mov r0, r3 8003dee: 3710 adds r7, #16 8003df0: 46bd mov sp, r7 8003df2: bd80 pop {r7, pc} 8003df4: 200002d4 .word 0x200002d4 08003df8 : * @retval DSTATUS: Operation status */ DSTATUS disk_initialize ( BYTE pdrv /* Physical drive nmuber to identify the drive */ ) { 8003df8: b580 push {r7, lr} 8003dfa: b084 sub sp, #16 8003dfc: af00 add r7, sp, #0 8003dfe: 4603 mov r3, r0 8003e00: 71fb strb r3, [r7, #7] DSTATUS stat = RES_OK; 8003e02: 2300 movs r3, #0 8003e04: 73fb strb r3, [r7, #15] if(disk.is_initialized[pdrv] == 0) 8003e06: 79fb ldrb r3, [r7, #7] 8003e08: 4a0d ldr r2, [pc, #52] ; (8003e40 ) 8003e0a: 5cd3 ldrb r3, [r2, r3] 8003e0c: 2b00 cmp r3, #0 8003e0e: d111 bne.n 8003e34 { disk.is_initialized[pdrv] = 1; 8003e10: 79fb ldrb r3, [r7, #7] 8003e12: 4a0b ldr r2, [pc, #44] ; (8003e40 ) 8003e14: 2101 movs r1, #1 8003e16: 54d1 strb r1, [r2, r3] stat = disk.drv[pdrv]->disk_initialize(disk.lun[pdrv]); 8003e18: 79fb ldrb r3, [r7, #7] 8003e1a: 4a09 ldr r2, [pc, #36] ; (8003e40 ) 8003e1c: 009b lsls r3, r3, #2 8003e1e: 4413 add r3, r2 8003e20: 685b ldr r3, [r3, #4] 8003e22: 681b ldr r3, [r3, #0] 8003e24: 79fa ldrb r2, [r7, #7] 8003e26: 4906 ldr r1, [pc, #24] ; (8003e40 ) 8003e28: 440a add r2, r1 8003e2a: 7a12 ldrb r2, [r2, #8] 8003e2c: 4610 mov r0, r2 8003e2e: 4798 blx r3 8003e30: 4603 mov r3, r0 8003e32: 73fb strb r3, [r7, #15] } return stat; 8003e34: 7bfb ldrb r3, [r7, #15] } 8003e36: 4618 mov r0, r3 8003e38: 3710 adds r7, #16 8003e3a: 46bd mov sp, r7 8003e3c: bd80 pop {r7, pc} 8003e3e: bf00 nop 8003e40: 200002d4 .word 0x200002d4 08003e44 : BYTE pdrv, /* Physical drive nmuber to identify the drive */ BYTE *buff, /* Data buffer to store read data */ DWORD sector, /* Sector address in LBA */ UINT count /* Number of sectors to read */ ) { 8003e44: b590 push {r4, r7, lr} 8003e46: b087 sub sp, #28 8003e48: af00 add r7, sp, #0 8003e4a: 60b9 str r1, [r7, #8] 8003e4c: 607a str r2, [r7, #4] 8003e4e: 603b str r3, [r7, #0] 8003e50: 4603 mov r3, r0 8003e52: 73fb strb r3, [r7, #15] DRESULT res; res = disk.drv[pdrv]->disk_read(disk.lun[pdrv], buff, sector, count); 8003e54: 7bfb ldrb r3, [r7, #15] 8003e56: 4a0a ldr r2, [pc, #40] ; (8003e80 ) 8003e58: 009b lsls r3, r3, #2 8003e5a: 4413 add r3, r2 8003e5c: 685b ldr r3, [r3, #4] 8003e5e: 689c ldr r4, [r3, #8] 8003e60: 7bfb ldrb r3, [r7, #15] 8003e62: 4a07 ldr r2, [pc, #28] ; (8003e80 ) 8003e64: 4413 add r3, r2 8003e66: 7a18 ldrb r0, [r3, #8] 8003e68: 683b ldr r3, [r7, #0] 8003e6a: 687a ldr r2, [r7, #4] 8003e6c: 68b9 ldr r1, [r7, #8] 8003e6e: 47a0 blx r4 8003e70: 4603 mov r3, r0 8003e72: 75fb strb r3, [r7, #23] return res; 8003e74: 7dfb ldrb r3, [r7, #23] } 8003e76: 4618 mov r0, r3 8003e78: 371c adds r7, #28 8003e7a: 46bd mov sp, r7 8003e7c: bd90 pop {r4, r7, pc} 8003e7e: bf00 nop 8003e80: 200002d4 .word 0x200002d4 08003e84 : BYTE pdrv, /* Physical drive nmuber to identify the drive */ const BYTE *buff, /* Data to be written */ DWORD sector, /* Sector address in LBA */ UINT count /* Number of sectors to write */ ) { 8003e84: b590 push {r4, r7, lr} 8003e86: b087 sub sp, #28 8003e88: af00 add r7, sp, #0 8003e8a: 60b9 str r1, [r7, #8] 8003e8c: 607a str r2, [r7, #4] 8003e8e: 603b str r3, [r7, #0] 8003e90: 4603 mov r3, r0 8003e92: 73fb strb r3, [r7, #15] DRESULT res; res = disk.drv[pdrv]->disk_write(disk.lun[pdrv], buff, sector, count); 8003e94: 7bfb ldrb r3, [r7, #15] 8003e96: 4a0a ldr r2, [pc, #40] ; (8003ec0 ) 8003e98: 009b lsls r3, r3, #2 8003e9a: 4413 add r3, r2 8003e9c: 685b ldr r3, [r3, #4] 8003e9e: 68dc ldr r4, [r3, #12] 8003ea0: 7bfb ldrb r3, [r7, #15] 8003ea2: 4a07 ldr r2, [pc, #28] ; (8003ec0 ) 8003ea4: 4413 add r3, r2 8003ea6: 7a18 ldrb r0, [r3, #8] 8003ea8: 683b ldr r3, [r7, #0] 8003eaa: 687a ldr r2, [r7, #4] 8003eac: 68b9 ldr r1, [r7, #8] 8003eae: 47a0 blx r4 8003eb0: 4603 mov r3, r0 8003eb2: 75fb strb r3, [r7, #23] return res; 8003eb4: 7dfb ldrb r3, [r7, #23] } 8003eb6: 4618 mov r0, r3 8003eb8: 371c adds r7, #28 8003eba: 46bd mov sp, r7 8003ebc: bd90 pop {r4, r7, pc} 8003ebe: bf00 nop 8003ec0: 200002d4 .word 0x200002d4 08003ec4 : DRESULT disk_ioctl ( BYTE pdrv, /* Physical drive nmuber (0..) */ BYTE cmd, /* Control code */ void *buff /* Buffer to send/receive control data */ ) { 8003ec4: b580 push {r7, lr} 8003ec6: b084 sub sp, #16 8003ec8: af00 add r7, sp, #0 8003eca: 4603 mov r3, r0 8003ecc: 603a str r2, [r7, #0] 8003ece: 71fb strb r3, [r7, #7] 8003ed0: 460b mov r3, r1 8003ed2: 71bb strb r3, [r7, #6] DRESULT res; res = disk.drv[pdrv]->disk_ioctl(disk.lun[pdrv], cmd, buff); 8003ed4: 79fb ldrb r3, [r7, #7] 8003ed6: 4a09 ldr r2, [pc, #36] ; (8003efc ) 8003ed8: 009b lsls r3, r3, #2 8003eda: 4413 add r3, r2 8003edc: 685b ldr r3, [r3, #4] 8003ede: 691b ldr r3, [r3, #16] 8003ee0: 79fa ldrb r2, [r7, #7] 8003ee2: 4906 ldr r1, [pc, #24] ; (8003efc ) 8003ee4: 440a add r2, r1 8003ee6: 7a10 ldrb r0, [r2, #8] 8003ee8: 79b9 ldrb r1, [r7, #6] 8003eea: 683a ldr r2, [r7, #0] 8003eec: 4798 blx r3 8003eee: 4603 mov r3, r0 8003ef0: 73fb strb r3, [r7, #15] return res; 8003ef2: 7bfb ldrb r3, [r7, #15] } 8003ef4: 4618 mov r0, r3 8003ef6: 3710 adds r7, #16 8003ef8: 46bd mov sp, r7 8003efa: bd80 pop {r7, pc} 8003efc: 200002d4 .word 0x200002d4 08003f00 : /* Load/Store multi-byte word in the FAT structure */ /*-----------------------------------------------------------------------*/ static WORD ld_word (const BYTE* ptr) /* Load a 2-byte little-endian word */ { 8003f00: b480 push {r7} 8003f02: b085 sub sp, #20 8003f04: af00 add r7, sp, #0 8003f06: 6078 str r0, [r7, #4] WORD rv; rv = ptr[1]; 8003f08: 687b ldr r3, [r7, #4] 8003f0a: 3301 adds r3, #1 8003f0c: 781b ldrb r3, [r3, #0] 8003f0e: 81fb strh r3, [r7, #14] rv = rv << 8 | ptr[0]; 8003f10: 89fb ldrh r3, [r7, #14] 8003f12: 021b lsls r3, r3, #8 8003f14: b21a sxth r2, r3 8003f16: 687b ldr r3, [r7, #4] 8003f18: 781b ldrb r3, [r3, #0] 8003f1a: b21b sxth r3, r3 8003f1c: 4313 orrs r3, r2 8003f1e: b21b sxth r3, r3 8003f20: 81fb strh r3, [r7, #14] return rv; 8003f22: 89fb ldrh r3, [r7, #14] } 8003f24: 4618 mov r0, r3 8003f26: 3714 adds r7, #20 8003f28: 46bd mov sp, r7 8003f2a: bc80 pop {r7} 8003f2c: 4770 bx lr 08003f2e : static DWORD ld_dword (const BYTE* ptr) /* Load a 4-byte little-endian word */ { 8003f2e: b480 push {r7} 8003f30: b085 sub sp, #20 8003f32: af00 add r7, sp, #0 8003f34: 6078 str r0, [r7, #4] DWORD rv; rv = ptr[3]; 8003f36: 687b ldr r3, [r7, #4] 8003f38: 3303 adds r3, #3 8003f3a: 781b ldrb r3, [r3, #0] 8003f3c: 60fb str r3, [r7, #12] rv = rv << 8 | ptr[2]; 8003f3e: 68fb ldr r3, [r7, #12] 8003f40: 021b lsls r3, r3, #8 8003f42: 687a ldr r2, [r7, #4] 8003f44: 3202 adds r2, #2 8003f46: 7812 ldrb r2, [r2, #0] 8003f48: 4313 orrs r3, r2 8003f4a: 60fb str r3, [r7, #12] rv = rv << 8 | ptr[1]; 8003f4c: 68fb ldr r3, [r7, #12] 8003f4e: 021b lsls r3, r3, #8 8003f50: 687a ldr r2, [r7, #4] 8003f52: 3201 adds r2, #1 8003f54: 7812 ldrb r2, [r2, #0] 8003f56: 4313 orrs r3, r2 8003f58: 60fb str r3, [r7, #12] rv = rv << 8 | ptr[0]; 8003f5a: 68fb ldr r3, [r7, #12] 8003f5c: 021b lsls r3, r3, #8 8003f5e: 687a ldr r2, [r7, #4] 8003f60: 7812 ldrb r2, [r2, #0] 8003f62: 4313 orrs r3, r2 8003f64: 60fb str r3, [r7, #12] return rv; 8003f66: 68fb ldr r3, [r7, #12] } 8003f68: 4618 mov r0, r3 8003f6a: 3714 adds r7, #20 8003f6c: 46bd mov sp, r7 8003f6e: bc80 pop {r7} 8003f70: 4770 bx lr 08003f72 : #endif #if !_FS_READONLY static void st_word (BYTE* ptr, WORD val) /* Store a 2-byte word in little-endian */ { 8003f72: b480 push {r7} 8003f74: b083 sub sp, #12 8003f76: af00 add r7, sp, #0 8003f78: 6078 str r0, [r7, #4] 8003f7a: 460b mov r3, r1 8003f7c: 807b strh r3, [r7, #2] *ptr++ = (BYTE)val; val >>= 8; 8003f7e: 687b ldr r3, [r7, #4] 8003f80: 1c5a adds r2, r3, #1 8003f82: 607a str r2, [r7, #4] 8003f84: 887a ldrh r2, [r7, #2] 8003f86: b2d2 uxtb r2, r2 8003f88: 701a strb r2, [r3, #0] 8003f8a: 887b ldrh r3, [r7, #2] 8003f8c: 0a1b lsrs r3, r3, #8 8003f8e: 807b strh r3, [r7, #2] *ptr++ = (BYTE)val; 8003f90: 687b ldr r3, [r7, #4] 8003f92: 1c5a adds r2, r3, #1 8003f94: 607a str r2, [r7, #4] 8003f96: 887a ldrh r2, [r7, #2] 8003f98: b2d2 uxtb r2, r2 8003f9a: 701a strb r2, [r3, #0] } 8003f9c: bf00 nop 8003f9e: 370c adds r7, #12 8003fa0: 46bd mov sp, r7 8003fa2: bc80 pop {r7} 8003fa4: 4770 bx lr 08003fa6 : static void st_dword (BYTE* ptr, DWORD val) /* Store a 4-byte word in little-endian */ { 8003fa6: b480 push {r7} 8003fa8: b083 sub sp, #12 8003faa: af00 add r7, sp, #0 8003fac: 6078 str r0, [r7, #4] 8003fae: 6039 str r1, [r7, #0] *ptr++ = (BYTE)val; val >>= 8; 8003fb0: 687b ldr r3, [r7, #4] 8003fb2: 1c5a adds r2, r3, #1 8003fb4: 607a str r2, [r7, #4] 8003fb6: 683a ldr r2, [r7, #0] 8003fb8: b2d2 uxtb r2, r2 8003fba: 701a strb r2, [r3, #0] 8003fbc: 683b ldr r3, [r7, #0] 8003fbe: 0a1b lsrs r3, r3, #8 8003fc0: 603b str r3, [r7, #0] *ptr++ = (BYTE)val; val >>= 8; 8003fc2: 687b ldr r3, [r7, #4] 8003fc4: 1c5a adds r2, r3, #1 8003fc6: 607a str r2, [r7, #4] 8003fc8: 683a ldr r2, [r7, #0] 8003fca: b2d2 uxtb r2, r2 8003fcc: 701a strb r2, [r3, #0] 8003fce: 683b ldr r3, [r7, #0] 8003fd0: 0a1b lsrs r3, r3, #8 8003fd2: 603b str r3, [r7, #0] *ptr++ = (BYTE)val; val >>= 8; 8003fd4: 687b ldr r3, [r7, #4] 8003fd6: 1c5a adds r2, r3, #1 8003fd8: 607a str r2, [r7, #4] 8003fda: 683a ldr r2, [r7, #0] 8003fdc: b2d2 uxtb r2, r2 8003fde: 701a strb r2, [r3, #0] 8003fe0: 683b ldr r3, [r7, #0] 8003fe2: 0a1b lsrs r3, r3, #8 8003fe4: 603b str r3, [r7, #0] *ptr++ = (BYTE)val; 8003fe6: 687b ldr r3, [r7, #4] 8003fe8: 1c5a adds r2, r3, #1 8003fea: 607a str r2, [r7, #4] 8003fec: 683a ldr r2, [r7, #0] 8003fee: b2d2 uxtb r2, r2 8003ff0: 701a strb r2, [r3, #0] } 8003ff2: bf00 nop 8003ff4: 370c adds r7, #12 8003ff6: 46bd mov sp, r7 8003ff8: bc80 pop {r7} 8003ffa: 4770 bx lr 08003ffc : /* String functions */ /*-----------------------------------------------------------------------*/ /* Copy memory to memory */ static void mem_cpy (void* dst, const void* src, UINT cnt) { 8003ffc: b480 push {r7} 8003ffe: b087 sub sp, #28 8004000: af00 add r7, sp, #0 8004002: 60f8 str r0, [r7, #12] 8004004: 60b9 str r1, [r7, #8] 8004006: 607a str r2, [r7, #4] BYTE *d = (BYTE*)dst; 8004008: 68fb ldr r3, [r7, #12] 800400a: 617b str r3, [r7, #20] const BYTE *s = (const BYTE*)src; 800400c: 68bb ldr r3, [r7, #8] 800400e: 613b str r3, [r7, #16] if (cnt) { 8004010: 687b ldr r3, [r7, #4] 8004012: 2b00 cmp r3, #0 8004014: d00d beq.n 8004032 do { *d++ = *s++; 8004016: 693a ldr r2, [r7, #16] 8004018: 1c53 adds r3, r2, #1 800401a: 613b str r3, [r7, #16] 800401c: 697b ldr r3, [r7, #20] 800401e: 1c59 adds r1, r3, #1 8004020: 6179 str r1, [r7, #20] 8004022: 7812 ldrb r2, [r2, #0] 8004024: 701a strb r2, [r3, #0] } while (--cnt); 8004026: 687b ldr r3, [r7, #4] 8004028: 3b01 subs r3, #1 800402a: 607b str r3, [r7, #4] 800402c: 687b ldr r3, [r7, #4] 800402e: 2b00 cmp r3, #0 8004030: d1f1 bne.n 8004016 } } 8004032: bf00 nop 8004034: 371c adds r7, #28 8004036: 46bd mov sp, r7 8004038: bc80 pop {r7} 800403a: 4770 bx lr 0800403c : /* Fill memory block */ static void mem_set (void* dst, int val, UINT cnt) { 800403c: b480 push {r7} 800403e: b087 sub sp, #28 8004040: af00 add r7, sp, #0 8004042: 60f8 str r0, [r7, #12] 8004044: 60b9 str r1, [r7, #8] 8004046: 607a str r2, [r7, #4] BYTE *d = (BYTE*)dst; 8004048: 68fb ldr r3, [r7, #12] 800404a: 617b str r3, [r7, #20] do { *d++ = (BYTE)val; 800404c: 697b ldr r3, [r7, #20] 800404e: 1c5a adds r2, r3, #1 8004050: 617a str r2, [r7, #20] 8004052: 68ba ldr r2, [r7, #8] 8004054: b2d2 uxtb r2, r2 8004056: 701a strb r2, [r3, #0] } while (--cnt); 8004058: 687b ldr r3, [r7, #4] 800405a: 3b01 subs r3, #1 800405c: 607b str r3, [r7, #4] 800405e: 687b ldr r3, [r7, #4] 8004060: 2b00 cmp r3, #0 8004062: d1f3 bne.n 800404c } 8004064: bf00 nop 8004066: 371c adds r7, #28 8004068: 46bd mov sp, r7 800406a: bc80 pop {r7} 800406c: 4770 bx lr 0800406e : /* Compare memory block */ static int mem_cmp (const void* dst, const void* src, UINT cnt) { /* ZR:same, NZ:different */ 800406e: b480 push {r7} 8004070: b089 sub sp, #36 ; 0x24 8004072: af00 add r7, sp, #0 8004074: 60f8 str r0, [r7, #12] 8004076: 60b9 str r1, [r7, #8] 8004078: 607a str r2, [r7, #4] const BYTE *d = (const BYTE *)dst, *s = (const BYTE *)src; 800407a: 68fb ldr r3, [r7, #12] 800407c: 61fb str r3, [r7, #28] 800407e: 68bb ldr r3, [r7, #8] 8004080: 61bb str r3, [r7, #24] int r = 0; 8004082: 2300 movs r3, #0 8004084: 617b str r3, [r7, #20] do { r = *d++ - *s++; 8004086: 69fb ldr r3, [r7, #28] 8004088: 1c5a adds r2, r3, #1 800408a: 61fa str r2, [r7, #28] 800408c: 781b ldrb r3, [r3, #0] 800408e: 4619 mov r1, r3 8004090: 69bb ldr r3, [r7, #24] 8004092: 1c5a adds r2, r3, #1 8004094: 61ba str r2, [r7, #24] 8004096: 781b ldrb r3, [r3, #0] 8004098: 1acb subs r3, r1, r3 800409a: 617b str r3, [r7, #20] } while (--cnt && r == 0); 800409c: 687b ldr r3, [r7, #4] 800409e: 3b01 subs r3, #1 80040a0: 607b str r3, [r7, #4] 80040a2: 687b ldr r3, [r7, #4] 80040a4: 2b00 cmp r3, #0 80040a6: d002 beq.n 80040ae 80040a8: 697b ldr r3, [r7, #20] 80040aa: 2b00 cmp r3, #0 80040ac: d0eb beq.n 8004086 return r; 80040ae: 697b ldr r3, [r7, #20] } 80040b0: 4618 mov r0, r3 80040b2: 3724 adds r7, #36 ; 0x24 80040b4: 46bd mov sp, r7 80040b6: bc80 pop {r7} 80040b8: 4770 bx lr 080040ba : /* Check if chr is contained in the string */ static int chk_chr (const char* str, int chr) { /* NZ:contained, ZR:not contained */ 80040ba: b480 push {r7} 80040bc: b083 sub sp, #12 80040be: af00 add r7, sp, #0 80040c0: 6078 str r0, [r7, #4] 80040c2: 6039 str r1, [r7, #0] while (*str && *str != chr) str++; 80040c4: e002 b.n 80040cc 80040c6: 687b ldr r3, [r7, #4] 80040c8: 3301 adds r3, #1 80040ca: 607b str r3, [r7, #4] 80040cc: 687b ldr r3, [r7, #4] 80040ce: 781b ldrb r3, [r3, #0] 80040d0: 2b00 cmp r3, #0 80040d2: d005 beq.n 80040e0 80040d4: 687b ldr r3, [r7, #4] 80040d6: 781b ldrb r3, [r3, #0] 80040d8: 461a mov r2, r3 80040da: 683b ldr r3, [r7, #0] 80040dc: 4293 cmp r3, r2 80040de: d1f2 bne.n 80040c6 return *str; 80040e0: 687b ldr r3, [r7, #4] 80040e2: 781b ldrb r3, [r3, #0] } 80040e4: 4618 mov r0, r3 80040e6: 370c adds r7, #12 80040e8: 46bd mov sp, r7 80040ea: bc80 pop {r7} 80040ec: 4770 bx lr ... 080040f0 : static FRESULT chk_lock ( /* Check if the file can be accessed */ DIR* dp, /* Directory object pointing the file to be checked */ int acc /* Desired access type (0:Read, 1:Write, 2:Delete/Rename) */ ) { 80040f0: b480 push {r7} 80040f2: b085 sub sp, #20 80040f4: af00 add r7, sp, #0 80040f6: 6078 str r0, [r7, #4] 80040f8: 6039 str r1, [r7, #0] UINT i, be; /* Search file semaphore table */ for (i = be = 0; i < _FS_LOCK; i++) { 80040fa: 2300 movs r3, #0 80040fc: 60bb str r3, [r7, #8] 80040fe: 68bb ldr r3, [r7, #8] 8004100: 60fb str r3, [r7, #12] 8004102: e029 b.n 8004158 if (Files[i].fs) { /* Existing entry */ 8004104: 4a26 ldr r2, [pc, #152] ; (80041a0 ) 8004106: 68fb ldr r3, [r7, #12] 8004108: 011b lsls r3, r3, #4 800410a: 4413 add r3, r2 800410c: 681b ldr r3, [r3, #0] 800410e: 2b00 cmp r3, #0 8004110: d01d beq.n 800414e if (Files[i].fs == dp->obj.fs && /* Check if the object matched with an open object */ 8004112: 4a23 ldr r2, [pc, #140] ; (80041a0 ) 8004114: 68fb ldr r3, [r7, #12] 8004116: 011b lsls r3, r3, #4 8004118: 4413 add r3, r2 800411a: 681a ldr r2, [r3, #0] 800411c: 687b ldr r3, [r7, #4] 800411e: 681b ldr r3, [r3, #0] 8004120: 429a cmp r2, r3 8004122: d116 bne.n 8004152 Files[i].clu == dp->obj.sclust && 8004124: 4a1e ldr r2, [pc, #120] ; (80041a0 ) 8004126: 68fb ldr r3, [r7, #12] 8004128: 011b lsls r3, r3, #4 800412a: 4413 add r3, r2 800412c: 3304 adds r3, #4 800412e: 681a ldr r2, [r3, #0] 8004130: 687b ldr r3, [r7, #4] 8004132: 689b ldr r3, [r3, #8] if (Files[i].fs == dp->obj.fs && /* Check if the object matched with an open object */ 8004134: 429a cmp r2, r3 8004136: d10c bne.n 8004152 Files[i].ofs == dp->dptr) break; 8004138: 4a19 ldr r2, [pc, #100] ; (80041a0 ) 800413a: 68fb ldr r3, [r7, #12] 800413c: 011b lsls r3, r3, #4 800413e: 4413 add r3, r2 8004140: 3308 adds r3, #8 8004142: 681a ldr r2, [r3, #0] 8004144: 687b ldr r3, [r7, #4] 8004146: 695b ldr r3, [r3, #20] Files[i].clu == dp->obj.sclust && 8004148: 429a cmp r2, r3 800414a: d102 bne.n 8004152 Files[i].ofs == dp->dptr) break; 800414c: e007 b.n 800415e } else { /* Blank entry */ be = 1; 800414e: 2301 movs r3, #1 8004150: 60bb str r3, [r7, #8] for (i = be = 0; i < _FS_LOCK; i++) { 8004152: 68fb ldr r3, [r7, #12] 8004154: 3301 adds r3, #1 8004156: 60fb str r3, [r7, #12] 8004158: 68fb ldr r3, [r7, #12] 800415a: 2b01 cmp r3, #1 800415c: d9d2 bls.n 8004104 } } if (i == _FS_LOCK) { /* The object is not opened */ 800415e: 68fb ldr r3, [r7, #12] 8004160: 2b02 cmp r3, #2 8004162: d109 bne.n 8004178 return (be || acc == 2) ? FR_OK : FR_TOO_MANY_OPEN_FILES; /* Is there a blank entry for new object? */ 8004164: 68bb ldr r3, [r7, #8] 8004166: 2b00 cmp r3, #0 8004168: d102 bne.n 8004170 800416a: 683b ldr r3, [r7, #0] 800416c: 2b02 cmp r3, #2 800416e: d101 bne.n 8004174 8004170: 2300 movs r3, #0 8004172: e010 b.n 8004196 8004174: 2312 movs r3, #18 8004176: e00e b.n 8004196 } /* The object has been opened. Reject any open against writing file and all write mode open */ return (acc || Files[i].ctr == 0x100) ? FR_LOCKED : FR_OK; 8004178: 683b ldr r3, [r7, #0] 800417a: 2b00 cmp r3, #0 800417c: d108 bne.n 8004190 800417e: 4a08 ldr r2, [pc, #32] ; (80041a0 ) 8004180: 68fb ldr r3, [r7, #12] 8004182: 011b lsls r3, r3, #4 8004184: 4413 add r3, r2 8004186: 330c adds r3, #12 8004188: 881b ldrh r3, [r3, #0] 800418a: f5b3 7f80 cmp.w r3, #256 ; 0x100 800418e: d101 bne.n 8004194 8004190: 2310 movs r3, #16 8004192: e000 b.n 8004196 8004194: 2300 movs r3, #0 } 8004196: 4618 mov r0, r3 8004198: 3714 adds r7, #20 800419a: 46bd mov sp, r7 800419c: bc80 pop {r7} 800419e: 4770 bx lr 80041a0: 200000b4 .word 0x200000b4 080041a4 : static int enq_lock (void) /* Check if an entry is available for a new object */ { 80041a4: b480 push {r7} 80041a6: b083 sub sp, #12 80041a8: af00 add r7, sp, #0 UINT i; for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ; 80041aa: 2300 movs r3, #0 80041ac: 607b str r3, [r7, #4] 80041ae: e002 b.n 80041b6 80041b0: 687b ldr r3, [r7, #4] 80041b2: 3301 adds r3, #1 80041b4: 607b str r3, [r7, #4] 80041b6: 687b ldr r3, [r7, #4] 80041b8: 2b01 cmp r3, #1 80041ba: d806 bhi.n 80041ca 80041bc: 4a08 ldr r2, [pc, #32] ; (80041e0 ) 80041be: 687b ldr r3, [r7, #4] 80041c0: 011b lsls r3, r3, #4 80041c2: 4413 add r3, r2 80041c4: 681b ldr r3, [r3, #0] 80041c6: 2b00 cmp r3, #0 80041c8: d1f2 bne.n 80041b0 return (i == _FS_LOCK) ? 0 : 1; 80041ca: 687b ldr r3, [r7, #4] 80041cc: 2b02 cmp r3, #2 80041ce: bf14 ite ne 80041d0: 2301 movne r3, #1 80041d2: 2300 moveq r3, #0 80041d4: b2db uxtb r3, r3 } 80041d6: 4618 mov r0, r3 80041d8: 370c adds r7, #12 80041da: 46bd mov sp, r7 80041dc: bc80 pop {r7} 80041de: 4770 bx lr 80041e0: 200000b4 .word 0x200000b4 080041e4 : static UINT inc_lock ( /* Increment object open counter and returns its index (0:Internal error) */ DIR* dp, /* Directory object pointing the file to register or increment */ int acc /* Desired access (0:Read, 1:Write, 2:Delete/Rename) */ ) { 80041e4: b480 push {r7} 80041e6: b085 sub sp, #20 80041e8: af00 add r7, sp, #0 80041ea: 6078 str r0, [r7, #4] 80041ec: 6039 str r1, [r7, #0] UINT i; for (i = 0; i < _FS_LOCK; i++) { /* Find the object */ 80041ee: 2300 movs r3, #0 80041f0: 60fb str r3, [r7, #12] 80041f2: e01f b.n 8004234 if (Files[i].fs == dp->obj.fs && 80041f4: 4a41 ldr r2, [pc, #260] ; (80042fc ) 80041f6: 68fb ldr r3, [r7, #12] 80041f8: 011b lsls r3, r3, #4 80041fa: 4413 add r3, r2 80041fc: 681a ldr r2, [r3, #0] 80041fe: 687b ldr r3, [r7, #4] 8004200: 681b ldr r3, [r3, #0] 8004202: 429a cmp r2, r3 8004204: d113 bne.n 800422e Files[i].clu == dp->obj.sclust && 8004206: 4a3d ldr r2, [pc, #244] ; (80042fc ) 8004208: 68fb ldr r3, [r7, #12] 800420a: 011b lsls r3, r3, #4 800420c: 4413 add r3, r2 800420e: 3304 adds r3, #4 8004210: 681a ldr r2, [r3, #0] 8004212: 687b ldr r3, [r7, #4] 8004214: 689b ldr r3, [r3, #8] if (Files[i].fs == dp->obj.fs && 8004216: 429a cmp r2, r3 8004218: d109 bne.n 800422e Files[i].ofs == dp->dptr) break; 800421a: 4a38 ldr r2, [pc, #224] ; (80042fc ) 800421c: 68fb ldr r3, [r7, #12] 800421e: 011b lsls r3, r3, #4 8004220: 4413 add r3, r2 8004222: 3308 adds r3, #8 8004224: 681a ldr r2, [r3, #0] 8004226: 687b ldr r3, [r7, #4] 8004228: 695b ldr r3, [r3, #20] Files[i].clu == dp->obj.sclust && 800422a: 429a cmp r2, r3 800422c: d006 beq.n 800423c for (i = 0; i < _FS_LOCK; i++) { /* Find the object */ 800422e: 68fb ldr r3, [r7, #12] 8004230: 3301 adds r3, #1 8004232: 60fb str r3, [r7, #12] 8004234: 68fb ldr r3, [r7, #12] 8004236: 2b01 cmp r3, #1 8004238: d9dc bls.n 80041f4 800423a: e000 b.n 800423e Files[i].ofs == dp->dptr) break; 800423c: bf00 nop } if (i == _FS_LOCK) { /* Not opened. Register it as new. */ 800423e: 68fb ldr r3, [r7, #12] 8004240: 2b02 cmp r3, #2 8004242: d132 bne.n 80042aa for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ; 8004244: 2300 movs r3, #0 8004246: 60fb str r3, [r7, #12] 8004248: e002 b.n 8004250 800424a: 68fb ldr r3, [r7, #12] 800424c: 3301 adds r3, #1 800424e: 60fb str r3, [r7, #12] 8004250: 68fb ldr r3, [r7, #12] 8004252: 2b01 cmp r3, #1 8004254: d806 bhi.n 8004264 8004256: 4a29 ldr r2, [pc, #164] ; (80042fc ) 8004258: 68fb ldr r3, [r7, #12] 800425a: 011b lsls r3, r3, #4 800425c: 4413 add r3, r2 800425e: 681b ldr r3, [r3, #0] 8004260: 2b00 cmp r3, #0 8004262: d1f2 bne.n 800424a if (i == _FS_LOCK) return 0; /* No free entry to register (int err) */ 8004264: 68fb ldr r3, [r7, #12] 8004266: 2b02 cmp r3, #2 8004268: d101 bne.n 800426e 800426a: 2300 movs r3, #0 800426c: e040 b.n 80042f0 Files[i].fs = dp->obj.fs; 800426e: 687b ldr r3, [r7, #4] 8004270: 681a ldr r2, [r3, #0] 8004272: 4922 ldr r1, [pc, #136] ; (80042fc ) 8004274: 68fb ldr r3, [r7, #12] 8004276: 011b lsls r3, r3, #4 8004278: 440b add r3, r1 800427a: 601a str r2, [r3, #0] Files[i].clu = dp->obj.sclust; 800427c: 687b ldr r3, [r7, #4] 800427e: 689a ldr r2, [r3, #8] 8004280: 491e ldr r1, [pc, #120] ; (80042fc ) 8004282: 68fb ldr r3, [r7, #12] 8004284: 011b lsls r3, r3, #4 8004286: 440b add r3, r1 8004288: 3304 adds r3, #4 800428a: 601a str r2, [r3, #0] Files[i].ofs = dp->dptr; 800428c: 687b ldr r3, [r7, #4] 800428e: 695a ldr r2, [r3, #20] 8004290: 491a ldr r1, [pc, #104] ; (80042fc ) 8004292: 68fb ldr r3, [r7, #12] 8004294: 011b lsls r3, r3, #4 8004296: 440b add r3, r1 8004298: 3308 adds r3, #8 800429a: 601a str r2, [r3, #0] Files[i].ctr = 0; 800429c: 4a17 ldr r2, [pc, #92] ; (80042fc ) 800429e: 68fb ldr r3, [r7, #12] 80042a0: 011b lsls r3, r3, #4 80042a2: 4413 add r3, r2 80042a4: 330c adds r3, #12 80042a6: 2200 movs r2, #0 80042a8: 801a strh r2, [r3, #0] } if (acc && Files[i].ctr) return 0; /* Access violation (int err) */ 80042aa: 683b ldr r3, [r7, #0] 80042ac: 2b00 cmp r3, #0 80042ae: d009 beq.n 80042c4 80042b0: 4a12 ldr r2, [pc, #72] ; (80042fc ) 80042b2: 68fb ldr r3, [r7, #12] 80042b4: 011b lsls r3, r3, #4 80042b6: 4413 add r3, r2 80042b8: 330c adds r3, #12 80042ba: 881b ldrh r3, [r3, #0] 80042bc: 2b00 cmp r3, #0 80042be: d001 beq.n 80042c4 80042c0: 2300 movs r3, #0 80042c2: e015 b.n 80042f0 Files[i].ctr = acc ? 0x100 : Files[i].ctr + 1; /* Set semaphore value */ 80042c4: 683b ldr r3, [r7, #0] 80042c6: 2b00 cmp r3, #0 80042c8: d108 bne.n 80042dc 80042ca: 4a0c ldr r2, [pc, #48] ; (80042fc ) 80042cc: 68fb ldr r3, [r7, #12] 80042ce: 011b lsls r3, r3, #4 80042d0: 4413 add r3, r2 80042d2: 330c adds r3, #12 80042d4: 881b ldrh r3, [r3, #0] 80042d6: 3301 adds r3, #1 80042d8: b29a uxth r2, r3 80042da: e001 b.n 80042e0 80042dc: f44f 7280 mov.w r2, #256 ; 0x100 80042e0: 4906 ldr r1, [pc, #24] ; (80042fc ) 80042e2: 68fb ldr r3, [r7, #12] 80042e4: 011b lsls r3, r3, #4 80042e6: 440b add r3, r1 80042e8: 330c adds r3, #12 80042ea: 801a strh r2, [r3, #0] return i + 1; 80042ec: 68fb ldr r3, [r7, #12] 80042ee: 3301 adds r3, #1 } 80042f0: 4618 mov r0, r3 80042f2: 3714 adds r7, #20 80042f4: 46bd mov sp, r7 80042f6: bc80 pop {r7} 80042f8: 4770 bx lr 80042fa: bf00 nop 80042fc: 200000b4 .word 0x200000b4 08004300 : static FRESULT dec_lock ( /* Decrement object open counter */ UINT i /* Semaphore index (1..) */ ) { 8004300: b480 push {r7} 8004302: b085 sub sp, #20 8004304: af00 add r7, sp, #0 8004306: 6078 str r0, [r7, #4] WORD n; FRESULT res; if (--i < _FS_LOCK) { /* Shift index number origin from 0 */ 8004308: 687b ldr r3, [r7, #4] 800430a: 3b01 subs r3, #1 800430c: 607b str r3, [r7, #4] 800430e: 687b ldr r3, [r7, #4] 8004310: 2b01 cmp r3, #1 8004312: d825 bhi.n 8004360 n = Files[i].ctr; 8004314: 4a16 ldr r2, [pc, #88] ; (8004370 ) 8004316: 687b ldr r3, [r7, #4] 8004318: 011b lsls r3, r3, #4 800431a: 4413 add r3, r2 800431c: 330c adds r3, #12 800431e: 881b ldrh r3, [r3, #0] 8004320: 81fb strh r3, [r7, #14] if (n == 0x100) n = 0; /* If write mode open, delete the entry */ 8004322: 89fb ldrh r3, [r7, #14] 8004324: f5b3 7f80 cmp.w r3, #256 ; 0x100 8004328: d101 bne.n 800432e 800432a: 2300 movs r3, #0 800432c: 81fb strh r3, [r7, #14] if (n > 0) n--; /* Decrement read mode open count */ 800432e: 89fb ldrh r3, [r7, #14] 8004330: 2b00 cmp r3, #0 8004332: d002 beq.n 800433a 8004334: 89fb ldrh r3, [r7, #14] 8004336: 3b01 subs r3, #1 8004338: 81fb strh r3, [r7, #14] Files[i].ctr = n; 800433a: 4a0d ldr r2, [pc, #52] ; (8004370 ) 800433c: 687b ldr r3, [r7, #4] 800433e: 011b lsls r3, r3, #4 8004340: 4413 add r3, r2 8004342: 330c adds r3, #12 8004344: 89fa ldrh r2, [r7, #14] 8004346: 801a strh r2, [r3, #0] if (n == 0) Files[i].fs = 0; /* Delete the entry if open count gets zero */ 8004348: 89fb ldrh r3, [r7, #14] 800434a: 2b00 cmp r3, #0 800434c: d105 bne.n 800435a 800434e: 4a08 ldr r2, [pc, #32] ; (8004370 ) 8004350: 687b ldr r3, [r7, #4] 8004352: 011b lsls r3, r3, #4 8004354: 4413 add r3, r2 8004356: 2200 movs r2, #0 8004358: 601a str r2, [r3, #0] res = FR_OK; 800435a: 2300 movs r3, #0 800435c: 737b strb r3, [r7, #13] 800435e: e001 b.n 8004364 } else { res = FR_INT_ERR; /* Invalid index nunber */ 8004360: 2302 movs r3, #2 8004362: 737b strb r3, [r7, #13] } return res; 8004364: 7b7b ldrb r3, [r7, #13] } 8004366: 4618 mov r0, r3 8004368: 3714 adds r7, #20 800436a: 46bd mov sp, r7 800436c: bc80 pop {r7} 800436e: 4770 bx lr 8004370: 200000b4 .word 0x200000b4 08004374 : static void clear_lock ( /* Clear lock entries of the volume */ FATFS *fs ) { 8004374: b480 push {r7} 8004376: b085 sub sp, #20 8004378: af00 add r7, sp, #0 800437a: 6078 str r0, [r7, #4] UINT i; for (i = 0; i < _FS_LOCK; i++) { 800437c: 2300 movs r3, #0 800437e: 60fb str r3, [r7, #12] 8004380: e010 b.n 80043a4 if (Files[i].fs == fs) Files[i].fs = 0; 8004382: 4a0c ldr r2, [pc, #48] ; (80043b4 ) 8004384: 68fb ldr r3, [r7, #12] 8004386: 011b lsls r3, r3, #4 8004388: 4413 add r3, r2 800438a: 681b ldr r3, [r3, #0] 800438c: 687a ldr r2, [r7, #4] 800438e: 429a cmp r2, r3 8004390: d105 bne.n 800439e 8004392: 4a08 ldr r2, [pc, #32] ; (80043b4 ) 8004394: 68fb ldr r3, [r7, #12] 8004396: 011b lsls r3, r3, #4 8004398: 4413 add r3, r2 800439a: 2200 movs r2, #0 800439c: 601a str r2, [r3, #0] for (i = 0; i < _FS_LOCK; i++) { 800439e: 68fb ldr r3, [r7, #12] 80043a0: 3301 adds r3, #1 80043a2: 60fb str r3, [r7, #12] 80043a4: 68fb ldr r3, [r7, #12] 80043a6: 2b01 cmp r3, #1 80043a8: d9eb bls.n 8004382 } } 80043aa: bf00 nop 80043ac: 3714 adds r7, #20 80043ae: 46bd mov sp, r7 80043b0: bc80 pop {r7} 80043b2: 4770 bx lr 80043b4: 200000b4 .word 0x200000b4 080043b8 : #if !_FS_READONLY static FRESULT sync_window ( /* Returns FR_OK or FR_DISK_ERROR */ FATFS* fs /* File system object */ ) { 80043b8: b580 push {r7, lr} 80043ba: b086 sub sp, #24 80043bc: af00 add r7, sp, #0 80043be: 6078 str r0, [r7, #4] DWORD wsect; UINT nf; FRESULT res = FR_OK; 80043c0: 2300 movs r3, #0 80043c2: 73fb strb r3, [r7, #15] if (fs->wflag) { /* Write back the sector if it is dirty */ 80043c4: 687b ldr r3, [r7, #4] 80043c6: 78db ldrb r3, [r3, #3] 80043c8: 2b00 cmp r3, #0 80043ca: d034 beq.n 8004436 wsect = fs->winsect; /* Current sector number */ 80043cc: 687b ldr r3, [r7, #4] 80043ce: 6b5b ldr r3, [r3, #52] ; 0x34 80043d0: 617b str r3, [r7, #20] if (disk_write(fs->drv, fs->win, wsect, 1) != RES_OK) { 80043d2: 687b ldr r3, [r7, #4] 80043d4: 7858 ldrb r0, [r3, #1] 80043d6: 687b ldr r3, [r7, #4] 80043d8: f103 0138 add.w r1, r3, #56 ; 0x38 80043dc: 2301 movs r3, #1 80043de: 697a ldr r2, [r7, #20] 80043e0: f7ff fd50 bl 8003e84 80043e4: 4603 mov r3, r0 80043e6: 2b00 cmp r3, #0 80043e8: d002 beq.n 80043f0 res = FR_DISK_ERR; 80043ea: 2301 movs r3, #1 80043ec: 73fb strb r3, [r7, #15] 80043ee: e022 b.n 8004436 } else { fs->wflag = 0; 80043f0: 687b ldr r3, [r7, #4] 80043f2: 2200 movs r2, #0 80043f4: 70da strb r2, [r3, #3] if (wsect - fs->fatbase < fs->fsize) { /* Is it in the FAT area? */ 80043f6: 687b ldr r3, [r7, #4] 80043f8: 6a9b ldr r3, [r3, #40] ; 0x28 80043fa: 697a ldr r2, [r7, #20] 80043fc: 1ad2 subs r2, r2, r3 80043fe: 687b ldr r3, [r7, #4] 8004400: 6a1b ldr r3, [r3, #32] 8004402: 429a cmp r2, r3 8004404: d217 bcs.n 8004436 for (nf = fs->n_fats; nf >= 2; nf--) { /* Reflect the change to all FAT copies */ 8004406: 687b ldr r3, [r7, #4] 8004408: 789b ldrb r3, [r3, #2] 800440a: 613b str r3, [r7, #16] 800440c: e010 b.n 8004430 wsect += fs->fsize; 800440e: 687b ldr r3, [r7, #4] 8004410: 6a1b ldr r3, [r3, #32] 8004412: 697a ldr r2, [r7, #20] 8004414: 4413 add r3, r2 8004416: 617b str r3, [r7, #20] disk_write(fs->drv, fs->win, wsect, 1); 8004418: 687b ldr r3, [r7, #4] 800441a: 7858 ldrb r0, [r3, #1] 800441c: 687b ldr r3, [r7, #4] 800441e: f103 0138 add.w r1, r3, #56 ; 0x38 8004422: 2301 movs r3, #1 8004424: 697a ldr r2, [r7, #20] 8004426: f7ff fd2d bl 8003e84 for (nf = fs->n_fats; nf >= 2; nf--) { /* Reflect the change to all FAT copies */ 800442a: 693b ldr r3, [r7, #16] 800442c: 3b01 subs r3, #1 800442e: 613b str r3, [r7, #16] 8004430: 693b ldr r3, [r7, #16] 8004432: 2b01 cmp r3, #1 8004434: d8eb bhi.n 800440e } } } } return res; 8004436: 7bfb ldrb r3, [r7, #15] } 8004438: 4618 mov r0, r3 800443a: 3718 adds r7, #24 800443c: 46bd mov sp, r7 800443e: bd80 pop {r7, pc} 08004440 : static FRESULT move_window ( /* Returns FR_OK or FR_DISK_ERROR */ FATFS* fs, /* File system object */ DWORD sector /* Sector number to make appearance in the fs->win[] */ ) { 8004440: b580 push {r7, lr} 8004442: b084 sub sp, #16 8004444: af00 add r7, sp, #0 8004446: 6078 str r0, [r7, #4] 8004448: 6039 str r1, [r7, #0] FRESULT res = FR_OK; 800444a: 2300 movs r3, #0 800444c: 73fb strb r3, [r7, #15] if (sector != fs->winsect) { /* Window offset changed? */ 800444e: 687b ldr r3, [r7, #4] 8004450: 6b5b ldr r3, [r3, #52] ; 0x34 8004452: 683a ldr r2, [r7, #0] 8004454: 429a cmp r2, r3 8004456: d01b beq.n 8004490 #if !_FS_READONLY res = sync_window(fs); /* Write-back changes */ 8004458: 6878 ldr r0, [r7, #4] 800445a: f7ff ffad bl 80043b8 800445e: 4603 mov r3, r0 8004460: 73fb strb r3, [r7, #15] #endif if (res == FR_OK) { /* Fill sector window with new data */ 8004462: 7bfb ldrb r3, [r7, #15] 8004464: 2b00 cmp r3, #0 8004466: d113 bne.n 8004490 if (disk_read(fs->drv, fs->win, sector, 1) != RES_OK) { 8004468: 687b ldr r3, [r7, #4] 800446a: 7858 ldrb r0, [r3, #1] 800446c: 687b ldr r3, [r7, #4] 800446e: f103 0138 add.w r1, r3, #56 ; 0x38 8004472: 2301 movs r3, #1 8004474: 683a ldr r2, [r7, #0] 8004476: f7ff fce5 bl 8003e44 800447a: 4603 mov r3, r0 800447c: 2b00 cmp r3, #0 800447e: d004 beq.n 800448a sector = 0xFFFFFFFF; /* Invalidate window if data is not reliable */ 8004480: f04f 33ff mov.w r3, #4294967295 8004484: 603b str r3, [r7, #0] res = FR_DISK_ERR; 8004486: 2301 movs r3, #1 8004488: 73fb strb r3, [r7, #15] } fs->winsect = sector; 800448a: 687b ldr r3, [r7, #4] 800448c: 683a ldr r2, [r7, #0] 800448e: 635a str r2, [r3, #52] ; 0x34 } } return res; 8004490: 7bfb ldrb r3, [r7, #15] } 8004492: 4618 mov r0, r3 8004494: 3710 adds r7, #16 8004496: 46bd mov sp, r7 8004498: bd80 pop {r7, pc} ... 0800449c : static FRESULT sync_fs ( /* FR_OK:succeeded, !=0:error */ FATFS* fs /* File system object */ ) { 800449c: b580 push {r7, lr} 800449e: b084 sub sp, #16 80044a0: af00 add r7, sp, #0 80044a2: 6078 str r0, [r7, #4] FRESULT res; res = sync_window(fs); 80044a4: 6878 ldr r0, [r7, #4] 80044a6: f7ff ff87 bl 80043b8 80044aa: 4603 mov r3, r0 80044ac: 73fb strb r3, [r7, #15] if (res == FR_OK) { 80044ae: 7bfb ldrb r3, [r7, #15] 80044b0: 2b00 cmp r3, #0 80044b2: d159 bne.n 8004568 /* Update FSInfo sector if needed */ if (fs->fs_type == FS_FAT32 && fs->fsi_flag == 1) { 80044b4: 687b ldr r3, [r7, #4] 80044b6: 781b ldrb r3, [r3, #0] 80044b8: 2b03 cmp r3, #3 80044ba: d149 bne.n 8004550 80044bc: 687b ldr r3, [r7, #4] 80044be: 791b ldrb r3, [r3, #4] 80044c0: 2b01 cmp r3, #1 80044c2: d145 bne.n 8004550 /* Create FSInfo structure */ mem_set(fs->win, 0, SS(fs)); 80044c4: 687b ldr r3, [r7, #4] 80044c6: f103 0038 add.w r0, r3, #56 ; 0x38 80044ca: 687b ldr r3, [r7, #4] 80044cc: 899b ldrh r3, [r3, #12] 80044ce: 461a mov r2, r3 80044d0: 2100 movs r1, #0 80044d2: f7ff fdb3 bl 800403c st_word(fs->win + BS_55AA, 0xAA55); 80044d6: 687b ldr r3, [r7, #4] 80044d8: 3338 adds r3, #56 ; 0x38 80044da: f503 73ff add.w r3, r3, #510 ; 0x1fe 80044de: f64a 2155 movw r1, #43605 ; 0xaa55 80044e2: 4618 mov r0, r3 80044e4: f7ff fd45 bl 8003f72 st_dword(fs->win + FSI_LeadSig, 0x41615252); 80044e8: 687b ldr r3, [r7, #4] 80044ea: 3338 adds r3, #56 ; 0x38 80044ec: 4921 ldr r1, [pc, #132] ; (8004574 ) 80044ee: 4618 mov r0, r3 80044f0: f7ff fd59 bl 8003fa6 st_dword(fs->win + FSI_StrucSig, 0x61417272); 80044f4: 687b ldr r3, [r7, #4] 80044f6: 3338 adds r3, #56 ; 0x38 80044f8: f503 73f2 add.w r3, r3, #484 ; 0x1e4 80044fc: 491e ldr r1, [pc, #120] ; (8004578 ) 80044fe: 4618 mov r0, r3 8004500: f7ff fd51 bl 8003fa6 st_dword(fs->win + FSI_Free_Count, fs->free_clst); 8004504: 687b ldr r3, [r7, #4] 8004506: 3338 adds r3, #56 ; 0x38 8004508: f503 72f4 add.w r2, r3, #488 ; 0x1e8 800450c: 687b ldr r3, [r7, #4] 800450e: 699b ldr r3, [r3, #24] 8004510: 4619 mov r1, r3 8004512: 4610 mov r0, r2 8004514: f7ff fd47 bl 8003fa6 st_dword(fs->win + FSI_Nxt_Free, fs->last_clst); 8004518: 687b ldr r3, [r7, #4] 800451a: 3338 adds r3, #56 ; 0x38 800451c: f503 72f6 add.w r2, r3, #492 ; 0x1ec 8004520: 687b ldr r3, [r7, #4] 8004522: 695b ldr r3, [r3, #20] 8004524: 4619 mov r1, r3 8004526: 4610 mov r0, r2 8004528: f7ff fd3d bl 8003fa6 /* Write it into the FSInfo sector */ fs->winsect = fs->volbase + 1; 800452c: 687b ldr r3, [r7, #4] 800452e: 6a5b ldr r3, [r3, #36] ; 0x24 8004530: 1c5a adds r2, r3, #1 8004532: 687b ldr r3, [r7, #4] 8004534: 635a str r2, [r3, #52] ; 0x34 disk_write(fs->drv, fs->win, fs->winsect, 1); 8004536: 687b ldr r3, [r7, #4] 8004538: 7858 ldrb r0, [r3, #1] 800453a: 687b ldr r3, [r7, #4] 800453c: f103 0138 add.w r1, r3, #56 ; 0x38 8004540: 687b ldr r3, [r7, #4] 8004542: 6b5a ldr r2, [r3, #52] ; 0x34 8004544: 2301 movs r3, #1 8004546: f7ff fc9d bl 8003e84 fs->fsi_flag = 0; 800454a: 687b ldr r3, [r7, #4] 800454c: 2200 movs r2, #0 800454e: 711a strb r2, [r3, #4] } /* Make sure that no pending write process in the physical drive */ if (disk_ioctl(fs->drv, CTRL_SYNC, 0) != RES_OK) res = FR_DISK_ERR; 8004550: 687b ldr r3, [r7, #4] 8004552: 785b ldrb r3, [r3, #1] 8004554: 2200 movs r2, #0 8004556: 2100 movs r1, #0 8004558: 4618 mov r0, r3 800455a: f7ff fcb3 bl 8003ec4 800455e: 4603 mov r3, r0 8004560: 2b00 cmp r3, #0 8004562: d001 beq.n 8004568 8004564: 2301 movs r3, #1 8004566: 73fb strb r3, [r7, #15] } return res; 8004568: 7bfb ldrb r3, [r7, #15] } 800456a: 4618 mov r0, r3 800456c: 3710 adds r7, #16 800456e: 46bd mov sp, r7 8004570: bd80 pop {r7, pc} 8004572: bf00 nop 8004574: 41615252 .word 0x41615252 8004578: 61417272 .word 0x61417272 0800457c : static DWORD clust2sect ( /* !=0:Sector number, 0:Failed (invalid cluster#) */ FATFS* fs, /* File system object */ DWORD clst /* Cluster# to be converted */ ) { 800457c: b480 push {r7} 800457e: b083 sub sp, #12 8004580: af00 add r7, sp, #0 8004582: 6078 str r0, [r7, #4] 8004584: 6039 str r1, [r7, #0] clst -= 2; 8004586: 683b ldr r3, [r7, #0] 8004588: 3b02 subs r3, #2 800458a: 603b str r3, [r7, #0] if (clst >= fs->n_fatent - 2) return 0; /* Invalid cluster# */ 800458c: 687b ldr r3, [r7, #4] 800458e: 69db ldr r3, [r3, #28] 8004590: 3b02 subs r3, #2 8004592: 683a ldr r2, [r7, #0] 8004594: 429a cmp r2, r3 8004596: d301 bcc.n 800459c 8004598: 2300 movs r3, #0 800459a: e008 b.n 80045ae return clst * fs->csize + fs->database; 800459c: 687b ldr r3, [r7, #4] 800459e: 895b ldrh r3, [r3, #10] 80045a0: 461a mov r2, r3 80045a2: 683b ldr r3, [r7, #0] 80045a4: fb03 f202 mul.w r2, r3, r2 80045a8: 687b ldr r3, [r7, #4] 80045aa: 6b1b ldr r3, [r3, #48] ; 0x30 80045ac: 4413 add r3, r2 } 80045ae: 4618 mov r0, r3 80045b0: 370c adds r7, #12 80045b2: 46bd mov sp, r7 80045b4: bc80 pop {r7} 80045b6: 4770 bx lr 080045b8 : static DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x7FFFFFFF:Cluster status */ _FDID* obj, /* Corresponding object */ DWORD clst /* Cluster number to get the value */ ) { 80045b8: b580 push {r7, lr} 80045ba: b086 sub sp, #24 80045bc: af00 add r7, sp, #0 80045be: 6078 str r0, [r7, #4] 80045c0: 6039 str r1, [r7, #0] UINT wc, bc; DWORD val; FATFS *fs = obj->fs; 80045c2: 687b ldr r3, [r7, #4] 80045c4: 681b ldr r3, [r3, #0] 80045c6: 613b str r3, [r7, #16] if (clst < 2 || clst >= fs->n_fatent) { /* Check if in valid range */ 80045c8: 683b ldr r3, [r7, #0] 80045ca: 2b01 cmp r3, #1 80045cc: d904 bls.n 80045d8 80045ce: 693b ldr r3, [r7, #16] 80045d0: 69db ldr r3, [r3, #28] 80045d2: 683a ldr r2, [r7, #0] 80045d4: 429a cmp r2, r3 80045d6: d302 bcc.n 80045de val = 1; /* Internal error */ 80045d8: 2301 movs r3, #1 80045da: 617b str r3, [r7, #20] 80045dc: e0b7 b.n 800474e } else { val = 0xFFFFFFFF; /* Default value falls on disk error */ 80045de: f04f 33ff mov.w r3, #4294967295 80045e2: 617b str r3, [r7, #20] switch (fs->fs_type) { 80045e4: 693b ldr r3, [r7, #16] 80045e6: 781b ldrb r3, [r3, #0] 80045e8: 2b02 cmp r3, #2 80045ea: d05a beq.n 80046a2 80045ec: 2b03 cmp r3, #3 80045ee: d07d beq.n 80046ec 80045f0: 2b01 cmp r3, #1 80045f2: f040 80a2 bne.w 800473a case FS_FAT12 : bc = (UINT)clst; bc += bc / 2; 80045f6: 683b ldr r3, [r7, #0] 80045f8: 60fb str r3, [r7, #12] 80045fa: 68fb ldr r3, [r7, #12] 80045fc: 085b lsrs r3, r3, #1 80045fe: 68fa ldr r2, [r7, #12] 8004600: 4413 add r3, r2 8004602: 60fb str r3, [r7, #12] if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break; 8004604: 693b ldr r3, [r7, #16] 8004606: 6a9a ldr r2, [r3, #40] ; 0x28 8004608: 693b ldr r3, [r7, #16] 800460a: 899b ldrh r3, [r3, #12] 800460c: 4619 mov r1, r3 800460e: 68fb ldr r3, [r7, #12] 8004610: fbb3 f3f1 udiv r3, r3, r1 8004614: 4413 add r3, r2 8004616: 4619 mov r1, r3 8004618: 6938 ldr r0, [r7, #16] 800461a: f7ff ff11 bl 8004440 800461e: 4603 mov r3, r0 8004620: 2b00 cmp r3, #0 8004622: f040 808d bne.w 8004740 wc = fs->win[bc++ % SS(fs)]; 8004626: 68fb ldr r3, [r7, #12] 8004628: 1c5a adds r2, r3, #1 800462a: 60fa str r2, [r7, #12] 800462c: 693a ldr r2, [r7, #16] 800462e: 8992 ldrh r2, [r2, #12] 8004630: fbb3 f1f2 udiv r1, r3, r2 8004634: fb02 f201 mul.w r2, r2, r1 8004638: 1a9b subs r3, r3, r2 800463a: 693a ldr r2, [r7, #16] 800463c: 4413 add r3, r2 800463e: f893 3038 ldrb.w r3, [r3, #56] ; 0x38 8004642: 60bb str r3, [r7, #8] if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break; 8004644: 693b ldr r3, [r7, #16] 8004646: 6a9a ldr r2, [r3, #40] ; 0x28 8004648: 693b ldr r3, [r7, #16] 800464a: 899b ldrh r3, [r3, #12] 800464c: 4619 mov r1, r3 800464e: 68fb ldr r3, [r7, #12] 8004650: fbb3 f3f1 udiv r3, r3, r1 8004654: 4413 add r3, r2 8004656: 4619 mov r1, r3 8004658: 6938 ldr r0, [r7, #16] 800465a: f7ff fef1 bl 8004440 800465e: 4603 mov r3, r0 8004660: 2b00 cmp r3, #0 8004662: d16f bne.n 8004744 wc |= fs->win[bc % SS(fs)] << 8; 8004664: 693b ldr r3, [r7, #16] 8004666: 899b ldrh r3, [r3, #12] 8004668: 461a mov r2, r3 800466a: 68fb ldr r3, [r7, #12] 800466c: fbb3 f1f2 udiv r1, r3, r2 8004670: fb02 f201 mul.w r2, r2, r1 8004674: 1a9b subs r3, r3, r2 8004676: 693a ldr r2, [r7, #16] 8004678: 4413 add r3, r2 800467a: f893 3038 ldrb.w r3, [r3, #56] ; 0x38 800467e: 021b lsls r3, r3, #8 8004680: 461a mov r2, r3 8004682: 68bb ldr r3, [r7, #8] 8004684: 4313 orrs r3, r2 8004686: 60bb str r3, [r7, #8] val = (clst & 1) ? (wc >> 4) : (wc & 0xFFF); 8004688: 683b ldr r3, [r7, #0] 800468a: f003 0301 and.w r3, r3, #1 800468e: 2b00 cmp r3, #0 8004690: d002 beq.n 8004698 8004692: 68bb ldr r3, [r7, #8] 8004694: 091b lsrs r3, r3, #4 8004696: e002 b.n 800469e 8004698: 68bb ldr r3, [r7, #8] 800469a: f3c3 030b ubfx r3, r3, #0, #12 800469e: 617b str r3, [r7, #20] break; 80046a0: e055 b.n 800474e case FS_FAT16 : if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))) != FR_OK) break; 80046a2: 693b ldr r3, [r7, #16] 80046a4: 6a9a ldr r2, [r3, #40] ; 0x28 80046a6: 693b ldr r3, [r7, #16] 80046a8: 899b ldrh r3, [r3, #12] 80046aa: 085b lsrs r3, r3, #1 80046ac: b29b uxth r3, r3 80046ae: 4619 mov r1, r3 80046b0: 683b ldr r3, [r7, #0] 80046b2: fbb3 f3f1 udiv r3, r3, r1 80046b6: 4413 add r3, r2 80046b8: 4619 mov r1, r3 80046ba: 6938 ldr r0, [r7, #16] 80046bc: f7ff fec0 bl 8004440 80046c0: 4603 mov r3, r0 80046c2: 2b00 cmp r3, #0 80046c4: d140 bne.n 8004748 val = ld_word(fs->win + clst * 2 % SS(fs)); 80046c6: 693b ldr r3, [r7, #16] 80046c8: f103 0138 add.w r1, r3, #56 ; 0x38 80046cc: 683b ldr r3, [r7, #0] 80046ce: 005b lsls r3, r3, #1 80046d0: 693a ldr r2, [r7, #16] 80046d2: 8992 ldrh r2, [r2, #12] 80046d4: fbb3 f0f2 udiv r0, r3, r2 80046d8: fb02 f200 mul.w r2, r2, r0 80046dc: 1a9b subs r3, r3, r2 80046de: 440b add r3, r1 80046e0: 4618 mov r0, r3 80046e2: f7ff fc0d bl 8003f00 80046e6: 4603 mov r3, r0 80046e8: 617b str r3, [r7, #20] break; 80046ea: e030 b.n 800474e case FS_FAT32 : if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break; 80046ec: 693b ldr r3, [r7, #16] 80046ee: 6a9a ldr r2, [r3, #40] ; 0x28 80046f0: 693b ldr r3, [r7, #16] 80046f2: 899b ldrh r3, [r3, #12] 80046f4: 089b lsrs r3, r3, #2 80046f6: b29b uxth r3, r3 80046f8: 4619 mov r1, r3 80046fa: 683b ldr r3, [r7, #0] 80046fc: fbb3 f3f1 udiv r3, r3, r1 8004700: 4413 add r3, r2 8004702: 4619 mov r1, r3 8004704: 6938 ldr r0, [r7, #16] 8004706: f7ff fe9b bl 8004440 800470a: 4603 mov r3, r0 800470c: 2b00 cmp r3, #0 800470e: d11d bne.n 800474c val = ld_dword(fs->win + clst * 4 % SS(fs)) & 0x0FFFFFFF; 8004710: 693b ldr r3, [r7, #16] 8004712: f103 0138 add.w r1, r3, #56 ; 0x38 8004716: 683b ldr r3, [r7, #0] 8004718: 009b lsls r3, r3, #2 800471a: 693a ldr r2, [r7, #16] 800471c: 8992 ldrh r2, [r2, #12] 800471e: fbb3 f0f2 udiv r0, r3, r2 8004722: fb02 f200 mul.w r2, r2, r0 8004726: 1a9b subs r3, r3, r2 8004728: 440b add r3, r1 800472a: 4618 mov r0, r3 800472c: f7ff fbff bl 8003f2e 8004730: 4603 mov r3, r0 8004732: f023 4370 bic.w r3, r3, #4026531840 ; 0xf0000000 8004736: 617b str r3, [r7, #20] break; 8004738: e009 b.n 800474e } } /* go to default */ #endif default: val = 1; /* Internal error */ 800473a: 2301 movs r3, #1 800473c: 617b str r3, [r7, #20] 800473e: e006 b.n 800474e if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break; 8004740: bf00 nop 8004742: e004 b.n 800474e if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break; 8004744: bf00 nop 8004746: e002 b.n 800474e if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))) != FR_OK) break; 8004748: bf00 nop 800474a: e000 b.n 800474e if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break; 800474c: bf00 nop } } return val; 800474e: 697b ldr r3, [r7, #20] } 8004750: 4618 mov r0, r3 8004752: 3718 adds r7, #24 8004754: 46bd mov sp, r7 8004756: bd80 pop {r7, pc} 08004758 : FRESULT put_fat ( /* FR_OK(0):succeeded, !=0:error */ FATFS* fs, /* Corresponding file system object */ DWORD clst, /* FAT index number (cluster number) to be changed */ DWORD val /* New value to be set to the entry */ ) { 8004758: b590 push {r4, r7, lr} 800475a: b089 sub sp, #36 ; 0x24 800475c: af00 add r7, sp, #0 800475e: 60f8 str r0, [r7, #12] 8004760: 60b9 str r1, [r7, #8] 8004762: 607a str r2, [r7, #4] UINT bc; BYTE *p; FRESULT res = FR_INT_ERR; 8004764: 2302 movs r3, #2 8004766: 77fb strb r3, [r7, #31] if (clst >= 2 && clst < fs->n_fatent) { /* Check if in valid range */ 8004768: 68bb ldr r3, [r7, #8] 800476a: 2b01 cmp r3, #1 800476c: f240 8106 bls.w 800497c 8004770: 68fb ldr r3, [r7, #12] 8004772: 69db ldr r3, [r3, #28] 8004774: 68ba ldr r2, [r7, #8] 8004776: 429a cmp r2, r3 8004778: f080 8100 bcs.w 800497c switch (fs->fs_type) { 800477c: 68fb ldr r3, [r7, #12] 800477e: 781b ldrb r3, [r3, #0] 8004780: 2b02 cmp r3, #2 8004782: f000 8088 beq.w 8004896 8004786: 2b03 cmp r3, #3 8004788: f000 80b0 beq.w 80048ec 800478c: 2b01 cmp r3, #1 800478e: f040 80f5 bne.w 800497c case FS_FAT12 : /* Bitfield items */ bc = (UINT)clst; bc += bc / 2; 8004792: 68bb ldr r3, [r7, #8] 8004794: 61bb str r3, [r7, #24] 8004796: 69bb ldr r3, [r7, #24] 8004798: 085b lsrs r3, r3, #1 800479a: 69ba ldr r2, [r7, #24] 800479c: 4413 add r3, r2 800479e: 61bb str r3, [r7, #24] res = move_window(fs, fs->fatbase + (bc / SS(fs))); 80047a0: 68fb ldr r3, [r7, #12] 80047a2: 6a9a ldr r2, [r3, #40] ; 0x28 80047a4: 68fb ldr r3, [r7, #12] 80047a6: 899b ldrh r3, [r3, #12] 80047a8: 4619 mov r1, r3 80047aa: 69bb ldr r3, [r7, #24] 80047ac: fbb3 f3f1 udiv r3, r3, r1 80047b0: 4413 add r3, r2 80047b2: 4619 mov r1, r3 80047b4: 68f8 ldr r0, [r7, #12] 80047b6: f7ff fe43 bl 8004440 80047ba: 4603 mov r3, r0 80047bc: 77fb strb r3, [r7, #31] if (res != FR_OK) break; 80047be: 7ffb ldrb r3, [r7, #31] 80047c0: 2b00 cmp r3, #0 80047c2: f040 80d4 bne.w 800496e p = fs->win + bc++ % SS(fs); 80047c6: 68fb ldr r3, [r7, #12] 80047c8: f103 0138 add.w r1, r3, #56 ; 0x38 80047cc: 69bb ldr r3, [r7, #24] 80047ce: 1c5a adds r2, r3, #1 80047d0: 61ba str r2, [r7, #24] 80047d2: 68fa ldr r2, [r7, #12] 80047d4: 8992 ldrh r2, [r2, #12] 80047d6: fbb3 f0f2 udiv r0, r3, r2 80047da: fb02 f200 mul.w r2, r2, r0 80047de: 1a9b subs r3, r3, r2 80047e0: 440b add r3, r1 80047e2: 617b str r3, [r7, #20] *p = (clst & 1) ? ((*p & 0x0F) | ((BYTE)val << 4)) : (BYTE)val; 80047e4: 68bb ldr r3, [r7, #8] 80047e6: f003 0301 and.w r3, r3, #1 80047ea: 2b00 cmp r3, #0 80047ec: d00d beq.n 800480a 80047ee: 697b ldr r3, [r7, #20] 80047f0: 781b ldrb r3, [r3, #0] 80047f2: b25b sxtb r3, r3 80047f4: f003 030f and.w r3, r3, #15 80047f8: b25a sxtb r2, r3 80047fa: 687b ldr r3, [r7, #4] 80047fc: b2db uxtb r3, r3 80047fe: 011b lsls r3, r3, #4 8004800: b25b sxtb r3, r3 8004802: 4313 orrs r3, r2 8004804: b25b sxtb r3, r3 8004806: b2db uxtb r3, r3 8004808: e001 b.n 800480e 800480a: 687b ldr r3, [r7, #4] 800480c: b2db uxtb r3, r3 800480e: 697a ldr r2, [r7, #20] 8004810: 7013 strb r3, [r2, #0] fs->wflag = 1; 8004812: 68fb ldr r3, [r7, #12] 8004814: 2201 movs r2, #1 8004816: 70da strb r2, [r3, #3] res = move_window(fs, fs->fatbase + (bc / SS(fs))); 8004818: 68fb ldr r3, [r7, #12] 800481a: 6a9a ldr r2, [r3, #40] ; 0x28 800481c: 68fb ldr r3, [r7, #12] 800481e: 899b ldrh r3, [r3, #12] 8004820: 4619 mov r1, r3 8004822: 69bb ldr r3, [r7, #24] 8004824: fbb3 f3f1 udiv r3, r3, r1 8004828: 4413 add r3, r2 800482a: 4619 mov r1, r3 800482c: 68f8 ldr r0, [r7, #12] 800482e: f7ff fe07 bl 8004440 8004832: 4603 mov r3, r0 8004834: 77fb strb r3, [r7, #31] if (res != FR_OK) break; 8004836: 7ffb ldrb r3, [r7, #31] 8004838: 2b00 cmp r3, #0 800483a: f040 809a bne.w 8004972 p = fs->win + bc % SS(fs); 800483e: 68fb ldr r3, [r7, #12] 8004840: f103 0138 add.w r1, r3, #56 ; 0x38 8004844: 68fb ldr r3, [r7, #12] 8004846: 899b ldrh r3, [r3, #12] 8004848: 461a mov r2, r3 800484a: 69bb ldr r3, [r7, #24] 800484c: fbb3 f0f2 udiv r0, r3, r2 8004850: fb02 f200 mul.w r2, r2, r0 8004854: 1a9b subs r3, r3, r2 8004856: 440b add r3, r1 8004858: 617b str r3, [r7, #20] *p = (clst & 1) ? (BYTE)(val >> 4) : ((*p & 0xF0) | ((BYTE)(val >> 8) & 0x0F)); 800485a: 68bb ldr r3, [r7, #8] 800485c: f003 0301 and.w r3, r3, #1 8004860: 2b00 cmp r3, #0 8004862: d003 beq.n 800486c 8004864: 687b ldr r3, [r7, #4] 8004866: 091b lsrs r3, r3, #4 8004868: b2db uxtb r3, r3 800486a: e00e b.n 800488a 800486c: 697b ldr r3, [r7, #20] 800486e: 781b ldrb r3, [r3, #0] 8004870: b25b sxtb r3, r3 8004872: f023 030f bic.w r3, r3, #15 8004876: b25a sxtb r2, r3 8004878: 687b ldr r3, [r7, #4] 800487a: 0a1b lsrs r3, r3, #8 800487c: b25b sxtb r3, r3 800487e: f003 030f and.w r3, r3, #15 8004882: b25b sxtb r3, r3 8004884: 4313 orrs r3, r2 8004886: b25b sxtb r3, r3 8004888: b2db uxtb r3, r3 800488a: 697a ldr r2, [r7, #20] 800488c: 7013 strb r3, [r2, #0] fs->wflag = 1; 800488e: 68fb ldr r3, [r7, #12] 8004890: 2201 movs r2, #1 8004892: 70da strb r2, [r3, #3] break; 8004894: e072 b.n 800497c case FS_FAT16 : /* WORD aligned items */ res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))); 8004896: 68fb ldr r3, [r7, #12] 8004898: 6a9a ldr r2, [r3, #40] ; 0x28 800489a: 68fb ldr r3, [r7, #12] 800489c: 899b ldrh r3, [r3, #12] 800489e: 085b lsrs r3, r3, #1 80048a0: b29b uxth r3, r3 80048a2: 4619 mov r1, r3 80048a4: 68bb ldr r3, [r7, #8] 80048a6: fbb3 f3f1 udiv r3, r3, r1 80048aa: 4413 add r3, r2 80048ac: 4619 mov r1, r3 80048ae: 68f8 ldr r0, [r7, #12] 80048b0: f7ff fdc6 bl 8004440 80048b4: 4603 mov r3, r0 80048b6: 77fb strb r3, [r7, #31] if (res != FR_OK) break; 80048b8: 7ffb ldrb r3, [r7, #31] 80048ba: 2b00 cmp r3, #0 80048bc: d15b bne.n 8004976 st_word(fs->win + clst * 2 % SS(fs), (WORD)val); 80048be: 68fb ldr r3, [r7, #12] 80048c0: f103 0138 add.w r1, r3, #56 ; 0x38 80048c4: 68bb ldr r3, [r7, #8] 80048c6: 005b lsls r3, r3, #1 80048c8: 68fa ldr r2, [r7, #12] 80048ca: 8992 ldrh r2, [r2, #12] 80048cc: fbb3 f0f2 udiv r0, r3, r2 80048d0: fb02 f200 mul.w r2, r2, r0 80048d4: 1a9b subs r3, r3, r2 80048d6: 440b add r3, r1 80048d8: 687a ldr r2, [r7, #4] 80048da: b292 uxth r2, r2 80048dc: 4611 mov r1, r2 80048de: 4618 mov r0, r3 80048e0: f7ff fb47 bl 8003f72 fs->wflag = 1; 80048e4: 68fb ldr r3, [r7, #12] 80048e6: 2201 movs r2, #1 80048e8: 70da strb r2, [r3, #3] break; 80048ea: e047 b.n 800497c case FS_FAT32 : /* DWORD aligned items */ #if _FS_EXFAT case FS_EXFAT : #endif res = move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))); 80048ec: 68fb ldr r3, [r7, #12] 80048ee: 6a9a ldr r2, [r3, #40] ; 0x28 80048f0: 68fb ldr r3, [r7, #12] 80048f2: 899b ldrh r3, [r3, #12] 80048f4: 089b lsrs r3, r3, #2 80048f6: b29b uxth r3, r3 80048f8: 4619 mov r1, r3 80048fa: 68bb ldr r3, [r7, #8] 80048fc: fbb3 f3f1 udiv r3, r3, r1 8004900: 4413 add r3, r2 8004902: 4619 mov r1, r3 8004904: 68f8 ldr r0, [r7, #12] 8004906: f7ff fd9b bl 8004440 800490a: 4603 mov r3, r0 800490c: 77fb strb r3, [r7, #31] if (res != FR_OK) break; 800490e: 7ffb ldrb r3, [r7, #31] 8004910: 2b00 cmp r3, #0 8004912: d132 bne.n 800497a if (!_FS_EXFAT || fs->fs_type != FS_EXFAT) { val = (val & 0x0FFFFFFF) | (ld_dword(fs->win + clst * 4 % SS(fs)) & 0xF0000000); 8004914: 687b ldr r3, [r7, #4] 8004916: f023 4470 bic.w r4, r3, #4026531840 ; 0xf0000000 800491a: 68fb ldr r3, [r7, #12] 800491c: f103 0138 add.w r1, r3, #56 ; 0x38 8004920: 68bb ldr r3, [r7, #8] 8004922: 009b lsls r3, r3, #2 8004924: 68fa ldr r2, [r7, #12] 8004926: 8992 ldrh r2, [r2, #12] 8004928: fbb3 f0f2 udiv r0, r3, r2 800492c: fb02 f200 mul.w r2, r2, r0 8004930: 1a9b subs r3, r3, r2 8004932: 440b add r3, r1 8004934: 4618 mov r0, r3 8004936: f7ff fafa bl 8003f2e 800493a: 4603 mov r3, r0 800493c: f003 4370 and.w r3, r3, #4026531840 ; 0xf0000000 8004940: 4323 orrs r3, r4 8004942: 607b str r3, [r7, #4] } st_dword(fs->win + clst * 4 % SS(fs), val); 8004944: 68fb ldr r3, [r7, #12] 8004946: f103 0138 add.w r1, r3, #56 ; 0x38 800494a: 68bb ldr r3, [r7, #8] 800494c: 009b lsls r3, r3, #2 800494e: 68fa ldr r2, [r7, #12] 8004950: 8992 ldrh r2, [r2, #12] 8004952: fbb3 f0f2 udiv r0, r3, r2 8004956: fb02 f200 mul.w r2, r2, r0 800495a: 1a9b subs r3, r3, r2 800495c: 440b add r3, r1 800495e: 6879 ldr r1, [r7, #4] 8004960: 4618 mov r0, r3 8004962: f7ff fb20 bl 8003fa6 fs->wflag = 1; 8004966: 68fb ldr r3, [r7, #12] 8004968: 2201 movs r2, #1 800496a: 70da strb r2, [r3, #3] break; 800496c: e006 b.n 800497c if (res != FR_OK) break; 800496e: bf00 nop 8004970: e004 b.n 800497c if (res != FR_OK) break; 8004972: bf00 nop 8004974: e002 b.n 800497c if (res != FR_OK) break; 8004976: bf00 nop 8004978: e000 b.n 800497c if (res != FR_OK) break; 800497a: bf00 nop } } return res; 800497c: 7ffb ldrb r3, [r7, #31] } 800497e: 4618 mov r0, r3 8004980: 3724 adds r7, #36 ; 0x24 8004982: 46bd mov sp, r7 8004984: bd90 pop {r4, r7, pc} 08004986 : FRESULT remove_chain ( /* FR_OK(0):succeeded, !=0:error */ _FDID* obj, /* Corresponding object */ DWORD clst, /* Cluster to remove a chain from */ DWORD pclst /* Previous cluster of clst (0:an entire chain) */ ) { 8004986: b580 push {r7, lr} 8004988: b088 sub sp, #32 800498a: af00 add r7, sp, #0 800498c: 60f8 str r0, [r7, #12] 800498e: 60b9 str r1, [r7, #8] 8004990: 607a str r2, [r7, #4] FRESULT res = FR_OK; 8004992: 2300 movs r3, #0 8004994: 77fb strb r3, [r7, #31] DWORD nxt; FATFS *fs = obj->fs; 8004996: 68fb ldr r3, [r7, #12] 8004998: 681b ldr r3, [r3, #0] 800499a: 61bb str r3, [r7, #24] #endif #if _USE_TRIM DWORD rt[2]; #endif if (clst < 2 || clst >= fs->n_fatent) return FR_INT_ERR; /* Check if in valid range */ 800499c: 68bb ldr r3, [r7, #8] 800499e: 2b01 cmp r3, #1 80049a0: d904 bls.n 80049ac 80049a2: 69bb ldr r3, [r7, #24] 80049a4: 69db ldr r3, [r3, #28] 80049a6: 68ba ldr r2, [r7, #8] 80049a8: 429a cmp r2, r3 80049aa: d301 bcc.n 80049b0 80049ac: 2302 movs r3, #2 80049ae: e04b b.n 8004a48 /* Mark the previous cluster 'EOC' on the FAT if it exists */ if (pclst && (!_FS_EXFAT || fs->fs_type != FS_EXFAT || obj->stat != 2)) { 80049b0: 687b ldr r3, [r7, #4] 80049b2: 2b00 cmp r3, #0 80049b4: d00c beq.n 80049d0 res = put_fat(fs, pclst, 0xFFFFFFFF); 80049b6: f04f 32ff mov.w r2, #4294967295 80049ba: 6879 ldr r1, [r7, #4] 80049bc: 69b8 ldr r0, [r7, #24] 80049be: f7ff fecb bl 8004758 80049c2: 4603 mov r3, r0 80049c4: 77fb strb r3, [r7, #31] if (res != FR_OK) return res; 80049c6: 7ffb ldrb r3, [r7, #31] 80049c8: 2b00 cmp r3, #0 80049ca: d001 beq.n 80049d0 80049cc: 7ffb ldrb r3, [r7, #31] 80049ce: e03b b.n 8004a48 } /* Remove the chain */ do { nxt = get_fat(obj, clst); /* Get cluster status */ 80049d0: 68b9 ldr r1, [r7, #8] 80049d2: 68f8 ldr r0, [r7, #12] 80049d4: f7ff fdf0 bl 80045b8 80049d8: 6178 str r0, [r7, #20] if (nxt == 0) break; /* Empty cluster? */ 80049da: 697b ldr r3, [r7, #20] 80049dc: 2b00 cmp r3, #0 80049de: d031 beq.n 8004a44 if (nxt == 1) return FR_INT_ERR; /* Internal error? */ 80049e0: 697b ldr r3, [r7, #20] 80049e2: 2b01 cmp r3, #1 80049e4: d101 bne.n 80049ea 80049e6: 2302 movs r3, #2 80049e8: e02e b.n 8004a48 if (nxt == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error? */ 80049ea: 697b ldr r3, [r7, #20] 80049ec: f1b3 3fff cmp.w r3, #4294967295 80049f0: d101 bne.n 80049f6 80049f2: 2301 movs r3, #1 80049f4: e028 b.n 8004a48 if (!_FS_EXFAT || fs->fs_type != FS_EXFAT) { res = put_fat(fs, clst, 0); /* Mark the cluster 'free' on the FAT */ 80049f6: 2200 movs r2, #0 80049f8: 68b9 ldr r1, [r7, #8] 80049fa: 69b8 ldr r0, [r7, #24] 80049fc: f7ff feac bl 8004758 8004a00: 4603 mov r3, r0 8004a02: 77fb strb r3, [r7, #31] if (res != FR_OK) return res; 8004a04: 7ffb ldrb r3, [r7, #31] 8004a06: 2b00 cmp r3, #0 8004a08: d001 beq.n 8004a0e 8004a0a: 7ffb ldrb r3, [r7, #31] 8004a0c: e01c b.n 8004a48 } if (fs->free_clst < fs->n_fatent - 2) { /* Update FSINFO */ 8004a0e: 69bb ldr r3, [r7, #24] 8004a10: 699a ldr r2, [r3, #24] 8004a12: 69bb ldr r3, [r7, #24] 8004a14: 69db ldr r3, [r3, #28] 8004a16: 3b02 subs r3, #2 8004a18: 429a cmp r2, r3 8004a1a: d20b bcs.n 8004a34 fs->free_clst++; 8004a1c: 69bb ldr r3, [r7, #24] 8004a1e: 699b ldr r3, [r3, #24] 8004a20: 1c5a adds r2, r3, #1 8004a22: 69bb ldr r3, [r7, #24] 8004a24: 619a str r2, [r3, #24] fs->fsi_flag |= 1; 8004a26: 69bb ldr r3, [r7, #24] 8004a28: 791b ldrb r3, [r3, #4] 8004a2a: f043 0301 orr.w r3, r3, #1 8004a2e: b2da uxtb r2, r3 8004a30: 69bb ldr r3, [r7, #24] 8004a32: 711a strb r2, [r3, #4] disk_ioctl(fs->drv, CTRL_TRIM, rt); /* Inform device the block can be erased */ #endif scl = ecl = nxt; } #endif clst = nxt; /* Next cluster */ 8004a34: 697b ldr r3, [r7, #20] 8004a36: 60bb str r3, [r7, #8] } while (clst < fs->n_fatent); /* Repeat while not the last link */ 8004a38: 69bb ldr r3, [r7, #24] 8004a3a: 69db ldr r3, [r3, #28] 8004a3c: 68ba ldr r2, [r7, #8] 8004a3e: 429a cmp r2, r3 8004a40: d3c6 bcc.n 80049d0 8004a42: e000 b.n 8004a46 if (nxt == 0) break; /* Empty cluster? */ 8004a44: bf00 nop obj->stat = 2; /* Change the object status 'contiguous' */ } } } #endif return FR_OK; 8004a46: 2300 movs r3, #0 } 8004a48: 4618 mov r0, r3 8004a4a: 3720 adds r7, #32 8004a4c: 46bd mov sp, r7 8004a4e: bd80 pop {r7, pc} 08004a50 : static DWORD create_chain ( /* 0:No free cluster, 1:Internal error, 0xFFFFFFFF:Disk error, >=2:New cluster# */ _FDID* obj, /* Corresponding object */ DWORD clst /* Cluster# to stretch, 0:Create a new chain */ ) { 8004a50: b580 push {r7, lr} 8004a52: b088 sub sp, #32 8004a54: af00 add r7, sp, #0 8004a56: 6078 str r0, [r7, #4] 8004a58: 6039 str r1, [r7, #0] DWORD cs, ncl, scl; FRESULT res; FATFS *fs = obj->fs; 8004a5a: 687b ldr r3, [r7, #4] 8004a5c: 681b ldr r3, [r3, #0] 8004a5e: 613b str r3, [r7, #16] if (clst == 0) { /* Create a new chain */ 8004a60: 683b ldr r3, [r7, #0] 8004a62: 2b00 cmp r3, #0 8004a64: d10d bne.n 8004a82 scl = fs->last_clst; /* Get suggested cluster to start from */ 8004a66: 693b ldr r3, [r7, #16] 8004a68: 695b ldr r3, [r3, #20] 8004a6a: 61bb str r3, [r7, #24] if (scl == 0 || scl >= fs->n_fatent) scl = 1; 8004a6c: 69bb ldr r3, [r7, #24] 8004a6e: 2b00 cmp r3, #0 8004a70: d004 beq.n 8004a7c 8004a72: 693b ldr r3, [r7, #16] 8004a74: 69db ldr r3, [r3, #28] 8004a76: 69ba ldr r2, [r7, #24] 8004a78: 429a cmp r2, r3 8004a7a: d31b bcc.n 8004ab4 8004a7c: 2301 movs r3, #1 8004a7e: 61bb str r3, [r7, #24] 8004a80: e018 b.n 8004ab4 } else { /* Stretch current chain */ cs = get_fat(obj, clst); /* Check the cluster status */ 8004a82: 6839 ldr r1, [r7, #0] 8004a84: 6878 ldr r0, [r7, #4] 8004a86: f7ff fd97 bl 80045b8 8004a8a: 60f8 str r0, [r7, #12] if (cs < 2) return 1; /* Invalid FAT value */ 8004a8c: 68fb ldr r3, [r7, #12] 8004a8e: 2b01 cmp r3, #1 8004a90: d801 bhi.n 8004a96 8004a92: 2301 movs r3, #1 8004a94: e070 b.n 8004b78 if (cs == 0xFFFFFFFF) return cs; /* A disk error occurred */ 8004a96: 68fb ldr r3, [r7, #12] 8004a98: f1b3 3fff cmp.w r3, #4294967295 8004a9c: d101 bne.n 8004aa2 8004a9e: 68fb ldr r3, [r7, #12] 8004aa0: e06a b.n 8004b78 if (cs < fs->n_fatent) return cs; /* It is already followed by next cluster */ 8004aa2: 693b ldr r3, [r7, #16] 8004aa4: 69db ldr r3, [r3, #28] 8004aa6: 68fa ldr r2, [r7, #12] 8004aa8: 429a cmp r2, r3 8004aaa: d201 bcs.n 8004ab0 8004aac: 68fb ldr r3, [r7, #12] 8004aae: e063 b.n 8004b78 scl = clst; 8004ab0: 683b ldr r3, [r7, #0] 8004ab2: 61bb str r3, [r7, #24] } } } else #endif { /* On the FAT12/16/32 volume */ ncl = scl; /* Start cluster */ 8004ab4: 69bb ldr r3, [r7, #24] 8004ab6: 61fb str r3, [r7, #28] for (;;) { ncl++; /* Next cluster */ 8004ab8: 69fb ldr r3, [r7, #28] 8004aba: 3301 adds r3, #1 8004abc: 61fb str r3, [r7, #28] if (ncl >= fs->n_fatent) { /* Check wrap-around */ 8004abe: 693b ldr r3, [r7, #16] 8004ac0: 69db ldr r3, [r3, #28] 8004ac2: 69fa ldr r2, [r7, #28] 8004ac4: 429a cmp r2, r3 8004ac6: d307 bcc.n 8004ad8 ncl = 2; 8004ac8: 2302 movs r3, #2 8004aca: 61fb str r3, [r7, #28] if (ncl > scl) return 0; /* No free cluster */ 8004acc: 69fa ldr r2, [r7, #28] 8004ace: 69bb ldr r3, [r7, #24] 8004ad0: 429a cmp r2, r3 8004ad2: d901 bls.n 8004ad8 8004ad4: 2300 movs r3, #0 8004ad6: e04f b.n 8004b78 } cs = get_fat(obj, ncl); /* Get the cluster status */ 8004ad8: 69f9 ldr r1, [r7, #28] 8004ada: 6878 ldr r0, [r7, #4] 8004adc: f7ff fd6c bl 80045b8 8004ae0: 60f8 str r0, [r7, #12] if (cs == 0) break; /* Found a free cluster */ 8004ae2: 68fb ldr r3, [r7, #12] 8004ae4: 2b00 cmp r3, #0 8004ae6: d00e beq.n 8004b06 if (cs == 1 || cs == 0xFFFFFFFF) return cs; /* An error occurred */ 8004ae8: 68fb ldr r3, [r7, #12] 8004aea: 2b01 cmp r3, #1 8004aec: d003 beq.n 8004af6 8004aee: 68fb ldr r3, [r7, #12] 8004af0: f1b3 3fff cmp.w r3, #4294967295 8004af4: d101 bne.n 8004afa 8004af6: 68fb ldr r3, [r7, #12] 8004af8: e03e b.n 8004b78 if (ncl == scl) return 0; /* No free cluster */ 8004afa: 69fa ldr r2, [r7, #28] 8004afc: 69bb ldr r3, [r7, #24] 8004afe: 429a cmp r2, r3 8004b00: d1da bne.n 8004ab8 8004b02: 2300 movs r3, #0 8004b04: e038 b.n 8004b78 if (cs == 0) break; /* Found a free cluster */ 8004b06: bf00 nop } res = put_fat(fs, ncl, 0xFFFFFFFF); /* Mark the new cluster 'EOC' */ 8004b08: f04f 32ff mov.w r2, #4294967295 8004b0c: 69f9 ldr r1, [r7, #28] 8004b0e: 6938 ldr r0, [r7, #16] 8004b10: f7ff fe22 bl 8004758 8004b14: 4603 mov r3, r0 8004b16: 75fb strb r3, [r7, #23] if (res == FR_OK && clst != 0) { 8004b18: 7dfb ldrb r3, [r7, #23] 8004b1a: 2b00 cmp r3, #0 8004b1c: d109 bne.n 8004b32 8004b1e: 683b ldr r3, [r7, #0] 8004b20: 2b00 cmp r3, #0 8004b22: d006 beq.n 8004b32 res = put_fat(fs, clst, ncl); /* Link it from the previous one if needed */ 8004b24: 69fa ldr r2, [r7, #28] 8004b26: 6839 ldr r1, [r7, #0] 8004b28: 6938 ldr r0, [r7, #16] 8004b2a: f7ff fe15 bl 8004758 8004b2e: 4603 mov r3, r0 8004b30: 75fb strb r3, [r7, #23] } } if (res == FR_OK) { /* Update FSINFO if function succeeded. */ 8004b32: 7dfb ldrb r3, [r7, #23] 8004b34: 2b00 cmp r3, #0 8004b36: d116 bne.n 8004b66 fs->last_clst = ncl; 8004b38: 693b ldr r3, [r7, #16] 8004b3a: 69fa ldr r2, [r7, #28] 8004b3c: 615a str r2, [r3, #20] if (fs->free_clst <= fs->n_fatent - 2) fs->free_clst--; 8004b3e: 693b ldr r3, [r7, #16] 8004b40: 699a ldr r2, [r3, #24] 8004b42: 693b ldr r3, [r7, #16] 8004b44: 69db ldr r3, [r3, #28] 8004b46: 3b02 subs r3, #2 8004b48: 429a cmp r2, r3 8004b4a: d804 bhi.n 8004b56 8004b4c: 693b ldr r3, [r7, #16] 8004b4e: 699b ldr r3, [r3, #24] 8004b50: 1e5a subs r2, r3, #1 8004b52: 693b ldr r3, [r7, #16] 8004b54: 619a str r2, [r3, #24] fs->fsi_flag |= 1; 8004b56: 693b ldr r3, [r7, #16] 8004b58: 791b ldrb r3, [r3, #4] 8004b5a: f043 0301 orr.w r3, r3, #1 8004b5e: b2da uxtb r2, r3 8004b60: 693b ldr r3, [r7, #16] 8004b62: 711a strb r2, [r3, #4] 8004b64: e007 b.n 8004b76 } else { ncl = (res == FR_DISK_ERR) ? 0xFFFFFFFF : 1; /* Failed. Generate error status */ 8004b66: 7dfb ldrb r3, [r7, #23] 8004b68: 2b01 cmp r3, #1 8004b6a: d102 bne.n 8004b72 8004b6c: f04f 33ff mov.w r3, #4294967295 8004b70: e000 b.n 8004b74 8004b72: 2301 movs r3, #1 8004b74: 61fb str r3, [r7, #28] } return ncl; /* Return new cluster number or error status */ 8004b76: 69fb ldr r3, [r7, #28] } 8004b78: 4618 mov r0, r3 8004b7a: 3720 adds r7, #32 8004b7c: 46bd mov sp, r7 8004b7e: bd80 pop {r7, pc} 08004b80 : static DWORD clmt_clust ( /* <2:Error, >=2:Cluster number */ FIL* fp, /* Pointer to the file object */ FSIZE_t ofs /* File offset to be converted to cluster# */ ) { 8004b80: b480 push {r7} 8004b82: b087 sub sp, #28 8004b84: af00 add r7, sp, #0 8004b86: 6078 str r0, [r7, #4] 8004b88: 6039 str r1, [r7, #0] DWORD cl, ncl, *tbl; FATFS *fs = fp->obj.fs; 8004b8a: 687b ldr r3, [r7, #4] 8004b8c: 681b ldr r3, [r3, #0] 8004b8e: 60fb str r3, [r7, #12] tbl = fp->cltbl + 1; /* Top of CLMT */ 8004b90: 687b ldr r3, [r7, #4] 8004b92: 6adb ldr r3, [r3, #44] ; 0x2c 8004b94: 3304 adds r3, #4 8004b96: 613b str r3, [r7, #16] cl = (DWORD)(ofs / SS(fs) / fs->csize); /* Cluster order from top of the file */ 8004b98: 68fb ldr r3, [r7, #12] 8004b9a: 899b ldrh r3, [r3, #12] 8004b9c: 461a mov r2, r3 8004b9e: 683b ldr r3, [r7, #0] 8004ba0: fbb3 f3f2 udiv r3, r3, r2 8004ba4: 68fa ldr r2, [r7, #12] 8004ba6: 8952 ldrh r2, [r2, #10] 8004ba8: fbb3 f3f2 udiv r3, r3, r2 8004bac: 617b str r3, [r7, #20] for (;;) { ncl = *tbl++; /* Number of cluters in the fragment */ 8004bae: 693b ldr r3, [r7, #16] 8004bb0: 1d1a adds r2, r3, #4 8004bb2: 613a str r2, [r7, #16] 8004bb4: 681b ldr r3, [r3, #0] 8004bb6: 60bb str r3, [r7, #8] if (ncl == 0) return 0; /* End of table? (error) */ 8004bb8: 68bb ldr r3, [r7, #8] 8004bba: 2b00 cmp r3, #0 8004bbc: d101 bne.n 8004bc2 8004bbe: 2300 movs r3, #0 8004bc0: e010 b.n 8004be4 if (cl < ncl) break; /* In this fragment? */ 8004bc2: 697a ldr r2, [r7, #20] 8004bc4: 68bb ldr r3, [r7, #8] 8004bc6: 429a cmp r2, r3 8004bc8: d307 bcc.n 8004bda cl -= ncl; tbl++; /* Next fragment */ 8004bca: 697a ldr r2, [r7, #20] 8004bcc: 68bb ldr r3, [r7, #8] 8004bce: 1ad3 subs r3, r2, r3 8004bd0: 617b str r3, [r7, #20] 8004bd2: 693b ldr r3, [r7, #16] 8004bd4: 3304 adds r3, #4 8004bd6: 613b str r3, [r7, #16] ncl = *tbl++; /* Number of cluters in the fragment */ 8004bd8: e7e9 b.n 8004bae if (cl < ncl) break; /* In this fragment? */ 8004bda: bf00 nop } return cl + *tbl; /* Return the cluster number */ 8004bdc: 693b ldr r3, [r7, #16] 8004bde: 681a ldr r2, [r3, #0] 8004be0: 697b ldr r3, [r7, #20] 8004be2: 4413 add r3, r2 } 8004be4: 4618 mov r0, r3 8004be6: 371c adds r7, #28 8004be8: 46bd mov sp, r7 8004bea: bc80 pop {r7} 8004bec: 4770 bx lr 08004bee : static FRESULT dir_sdi ( /* FR_OK(0):succeeded, !=0:error */ DIR* dp, /* Pointer to directory object */ DWORD ofs /* Offset of directory table */ ) { 8004bee: b580 push {r7, lr} 8004bf0: b086 sub sp, #24 8004bf2: af00 add r7, sp, #0 8004bf4: 6078 str r0, [r7, #4] 8004bf6: 6039 str r1, [r7, #0] DWORD csz, clst; FATFS *fs = dp->obj.fs; 8004bf8: 687b ldr r3, [r7, #4] 8004bfa: 681b ldr r3, [r3, #0] 8004bfc: 613b str r3, [r7, #16] if (ofs >= (DWORD)((_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR) || ofs % SZDIRE) { /* Check range of offset and alignment */ 8004bfe: 683b ldr r3, [r7, #0] 8004c00: f5b3 1f00 cmp.w r3, #2097152 ; 0x200000 8004c04: d204 bcs.n 8004c10 8004c06: 683b ldr r3, [r7, #0] 8004c08: f003 031f and.w r3, r3, #31 8004c0c: 2b00 cmp r3, #0 8004c0e: d001 beq.n 8004c14 return FR_INT_ERR; 8004c10: 2302 movs r3, #2 8004c12: e071 b.n 8004cf8 } dp->dptr = ofs; /* Set current offset */ 8004c14: 687b ldr r3, [r7, #4] 8004c16: 683a ldr r2, [r7, #0] 8004c18: 615a str r2, [r3, #20] clst = dp->obj.sclust; /* Table start cluster (0:root) */ 8004c1a: 687b ldr r3, [r7, #4] 8004c1c: 689b ldr r3, [r3, #8] 8004c1e: 617b str r3, [r7, #20] if (clst == 0 && fs->fs_type >= FS_FAT32) { /* Replace cluster# 0 with root cluster# */ 8004c20: 697b ldr r3, [r7, #20] 8004c22: 2b00 cmp r3, #0 8004c24: d106 bne.n 8004c34 8004c26: 693b ldr r3, [r7, #16] 8004c28: 781b ldrb r3, [r3, #0] 8004c2a: 2b02 cmp r3, #2 8004c2c: d902 bls.n 8004c34 clst = fs->dirbase; 8004c2e: 693b ldr r3, [r7, #16] 8004c30: 6adb ldr r3, [r3, #44] ; 0x2c 8004c32: 617b str r3, [r7, #20] if (_FS_EXFAT) dp->obj.stat = 0; /* exFAT: Root dir has an FAT chain */ } if (clst == 0) { /* Static table (root-directory in FAT12/16) */ 8004c34: 697b ldr r3, [r7, #20] 8004c36: 2b00 cmp r3, #0 8004c38: d10c bne.n 8004c54 if (ofs / SZDIRE >= fs->n_rootdir) return FR_INT_ERR; /* Is index out of range? */ 8004c3a: 683b ldr r3, [r7, #0] 8004c3c: 095b lsrs r3, r3, #5 8004c3e: 693a ldr r2, [r7, #16] 8004c40: 8912 ldrh r2, [r2, #8] 8004c42: 4293 cmp r3, r2 8004c44: d301 bcc.n 8004c4a 8004c46: 2302 movs r3, #2 8004c48: e056 b.n 8004cf8 dp->sect = fs->dirbase; 8004c4a: 693b ldr r3, [r7, #16] 8004c4c: 6ada ldr r2, [r3, #44] ; 0x2c 8004c4e: 687b ldr r3, [r7, #4] 8004c50: 61da str r2, [r3, #28] 8004c52: e02d b.n 8004cb0 } else { /* Dynamic table (sub-directory or root-directory in FAT32+) */ csz = (DWORD)fs->csize * SS(fs); /* Bytes per cluster */ 8004c54: 693b ldr r3, [r7, #16] 8004c56: 895b ldrh r3, [r3, #10] 8004c58: 461a mov r2, r3 8004c5a: 693b ldr r3, [r7, #16] 8004c5c: 899b ldrh r3, [r3, #12] 8004c5e: fb03 f302 mul.w r3, r3, r2 8004c62: 60fb str r3, [r7, #12] while (ofs >= csz) { /* Follow cluster chain */ 8004c64: e019 b.n 8004c9a clst = get_fat(&dp->obj, clst); /* Get next cluster */ 8004c66: 687b ldr r3, [r7, #4] 8004c68: 6979 ldr r1, [r7, #20] 8004c6a: 4618 mov r0, r3 8004c6c: f7ff fca4 bl 80045b8 8004c70: 6178 str r0, [r7, #20] if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */ 8004c72: 697b ldr r3, [r7, #20] 8004c74: f1b3 3fff cmp.w r3, #4294967295 8004c78: d101 bne.n 8004c7e 8004c7a: 2301 movs r3, #1 8004c7c: e03c b.n 8004cf8 if (clst < 2 || clst >= fs->n_fatent) return FR_INT_ERR; /* Reached to end of table or internal error */ 8004c7e: 697b ldr r3, [r7, #20] 8004c80: 2b01 cmp r3, #1 8004c82: d904 bls.n 8004c8e 8004c84: 693b ldr r3, [r7, #16] 8004c86: 69db ldr r3, [r3, #28] 8004c88: 697a ldr r2, [r7, #20] 8004c8a: 429a cmp r2, r3 8004c8c: d301 bcc.n 8004c92 8004c8e: 2302 movs r3, #2 8004c90: e032 b.n 8004cf8 ofs -= csz; 8004c92: 683a ldr r2, [r7, #0] 8004c94: 68fb ldr r3, [r7, #12] 8004c96: 1ad3 subs r3, r2, r3 8004c98: 603b str r3, [r7, #0] while (ofs >= csz) { /* Follow cluster chain */ 8004c9a: 683a ldr r2, [r7, #0] 8004c9c: 68fb ldr r3, [r7, #12] 8004c9e: 429a cmp r2, r3 8004ca0: d2e1 bcs.n 8004c66 } dp->sect = clust2sect(fs, clst); 8004ca2: 6979 ldr r1, [r7, #20] 8004ca4: 6938 ldr r0, [r7, #16] 8004ca6: f7ff fc69 bl 800457c 8004caa: 4602 mov r2, r0 8004cac: 687b ldr r3, [r7, #4] 8004cae: 61da str r2, [r3, #28] } dp->clust = clst; /* Current cluster# */ 8004cb0: 687b ldr r3, [r7, #4] 8004cb2: 697a ldr r2, [r7, #20] 8004cb4: 619a str r2, [r3, #24] if (!dp->sect) return FR_INT_ERR; 8004cb6: 687b ldr r3, [r7, #4] 8004cb8: 69db ldr r3, [r3, #28] 8004cba: 2b00 cmp r3, #0 8004cbc: d101 bne.n 8004cc2 8004cbe: 2302 movs r3, #2 8004cc0: e01a b.n 8004cf8 dp->sect += ofs / SS(fs); /* Sector# of the directory entry */ 8004cc2: 687b ldr r3, [r7, #4] 8004cc4: 69da ldr r2, [r3, #28] 8004cc6: 693b ldr r3, [r7, #16] 8004cc8: 899b ldrh r3, [r3, #12] 8004cca: 4619 mov r1, r3 8004ccc: 683b ldr r3, [r7, #0] 8004cce: fbb3 f3f1 udiv r3, r3, r1 8004cd2: 441a add r2, r3 8004cd4: 687b ldr r3, [r7, #4] 8004cd6: 61da str r2, [r3, #28] dp->dir = fs->win + (ofs % SS(fs)); /* Pointer to the entry in the win[] */ 8004cd8: 693b ldr r3, [r7, #16] 8004cda: f103 0138 add.w r1, r3, #56 ; 0x38 8004cde: 693b ldr r3, [r7, #16] 8004ce0: 899b ldrh r3, [r3, #12] 8004ce2: 461a mov r2, r3 8004ce4: 683b ldr r3, [r7, #0] 8004ce6: fbb3 f0f2 udiv r0, r3, r2 8004cea: fb02 f200 mul.w r2, r2, r0 8004cee: 1a9b subs r3, r3, r2 8004cf0: 18ca adds r2, r1, r3 8004cf2: 687b ldr r3, [r7, #4] 8004cf4: 621a str r2, [r3, #32] return FR_OK; 8004cf6: 2300 movs r3, #0 } 8004cf8: 4618 mov r0, r3 8004cfa: 3718 adds r7, #24 8004cfc: 46bd mov sp, r7 8004cfe: bd80 pop {r7, pc} 08004d00 : static FRESULT dir_next ( /* FR_OK(0):succeeded, FR_NO_FILE:End of table, FR_DENIED:Could not stretch */ DIR* dp, /* Pointer to the directory object */ int stretch /* 0: Do not stretch table, 1: Stretch table if needed */ ) { 8004d00: b580 push {r7, lr} 8004d02: b086 sub sp, #24 8004d04: af00 add r7, sp, #0 8004d06: 6078 str r0, [r7, #4] 8004d08: 6039 str r1, [r7, #0] DWORD ofs, clst; FATFS *fs = dp->obj.fs; 8004d0a: 687b ldr r3, [r7, #4] 8004d0c: 681b ldr r3, [r3, #0] 8004d0e: 60fb str r3, [r7, #12] #if !_FS_READONLY UINT n; #endif ofs = dp->dptr + SZDIRE; /* Next entry */ 8004d10: 687b ldr r3, [r7, #4] 8004d12: 695b ldr r3, [r3, #20] 8004d14: 3320 adds r3, #32 8004d16: 60bb str r3, [r7, #8] if (!dp->sect || ofs >= (DWORD)((_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR)) return FR_NO_FILE; /* Report EOT when offset has reached max value */ 8004d18: 687b ldr r3, [r7, #4] 8004d1a: 69db ldr r3, [r3, #28] 8004d1c: 2b00 cmp r3, #0 8004d1e: d003 beq.n 8004d28 8004d20: 68bb ldr r3, [r7, #8] 8004d22: f5b3 1f00 cmp.w r3, #2097152 ; 0x200000 8004d26: d301 bcc.n 8004d2c 8004d28: 2304 movs r3, #4 8004d2a: e0bb b.n 8004ea4 if (ofs % SS(fs) == 0) { /* Sector changed? */ 8004d2c: 68fb ldr r3, [r7, #12] 8004d2e: 899b ldrh r3, [r3, #12] 8004d30: 461a mov r2, r3 8004d32: 68bb ldr r3, [r7, #8] 8004d34: fbb3 f1f2 udiv r1, r3, r2 8004d38: fb02 f201 mul.w r2, r2, r1 8004d3c: 1a9b subs r3, r3, r2 8004d3e: 2b00 cmp r3, #0 8004d40: f040 809d bne.w 8004e7e dp->sect++; /* Next sector */ 8004d44: 687b ldr r3, [r7, #4] 8004d46: 69db ldr r3, [r3, #28] 8004d48: 1c5a adds r2, r3, #1 8004d4a: 687b ldr r3, [r7, #4] 8004d4c: 61da str r2, [r3, #28] if (!dp->clust) { /* Static table */ 8004d4e: 687b ldr r3, [r7, #4] 8004d50: 699b ldr r3, [r3, #24] 8004d52: 2b00 cmp r3, #0 8004d54: d10b bne.n 8004d6e if (ofs / SZDIRE >= fs->n_rootdir) { /* Report EOT if it reached end of static table */ 8004d56: 68bb ldr r3, [r7, #8] 8004d58: 095b lsrs r3, r3, #5 8004d5a: 68fa ldr r2, [r7, #12] 8004d5c: 8912 ldrh r2, [r2, #8] 8004d5e: 4293 cmp r3, r2 8004d60: f0c0 808d bcc.w 8004e7e dp->sect = 0; return FR_NO_FILE; 8004d64: 687b ldr r3, [r7, #4] 8004d66: 2200 movs r2, #0 8004d68: 61da str r2, [r3, #28] 8004d6a: 2304 movs r3, #4 8004d6c: e09a b.n 8004ea4 } } else { /* Dynamic table */ if ((ofs / SS(fs) & (fs->csize - 1)) == 0) { /* Cluster changed? */ 8004d6e: 68fb ldr r3, [r7, #12] 8004d70: 899b ldrh r3, [r3, #12] 8004d72: 461a mov r2, r3 8004d74: 68bb ldr r3, [r7, #8] 8004d76: fbb3 f3f2 udiv r3, r3, r2 8004d7a: 68fa ldr r2, [r7, #12] 8004d7c: 8952 ldrh r2, [r2, #10] 8004d7e: 3a01 subs r2, #1 8004d80: 4013 ands r3, r2 8004d82: 2b00 cmp r3, #0 8004d84: d17b bne.n 8004e7e clst = get_fat(&dp->obj, dp->clust); /* Get next cluster */ 8004d86: 687a ldr r2, [r7, #4] 8004d88: 687b ldr r3, [r7, #4] 8004d8a: 699b ldr r3, [r3, #24] 8004d8c: 4619 mov r1, r3 8004d8e: 4610 mov r0, r2 8004d90: f7ff fc12 bl 80045b8 8004d94: 6178 str r0, [r7, #20] if (clst <= 1) return FR_INT_ERR; /* Internal error */ 8004d96: 697b ldr r3, [r7, #20] 8004d98: 2b01 cmp r3, #1 8004d9a: d801 bhi.n 8004da0 8004d9c: 2302 movs r3, #2 8004d9e: e081 b.n 8004ea4 if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */ 8004da0: 697b ldr r3, [r7, #20] 8004da2: f1b3 3fff cmp.w r3, #4294967295 8004da6: d101 bne.n 8004dac 8004da8: 2301 movs r3, #1 8004daa: e07b b.n 8004ea4 if (clst >= fs->n_fatent) { /* Reached end of dynamic table */ 8004dac: 68fb ldr r3, [r7, #12] 8004dae: 69db ldr r3, [r3, #28] 8004db0: 697a ldr r2, [r7, #20] 8004db2: 429a cmp r2, r3 8004db4: d359 bcc.n 8004e6a #if !_FS_READONLY if (!stretch) { /* If no stretch, report EOT */ 8004db6: 683b ldr r3, [r7, #0] 8004db8: 2b00 cmp r3, #0 8004dba: d104 bne.n 8004dc6 dp->sect = 0; return FR_NO_FILE; 8004dbc: 687b ldr r3, [r7, #4] 8004dbe: 2200 movs r2, #0 8004dc0: 61da str r2, [r3, #28] 8004dc2: 2304 movs r3, #4 8004dc4: e06e b.n 8004ea4 } clst = create_chain(&dp->obj, dp->clust); /* Allocate a cluster */ 8004dc6: 687a ldr r2, [r7, #4] 8004dc8: 687b ldr r3, [r7, #4] 8004dca: 699b ldr r3, [r3, #24] 8004dcc: 4619 mov r1, r3 8004dce: 4610 mov r0, r2 8004dd0: f7ff fe3e bl 8004a50 8004dd4: 6178 str r0, [r7, #20] if (clst == 0) return FR_DENIED; /* No free cluster */ 8004dd6: 697b ldr r3, [r7, #20] 8004dd8: 2b00 cmp r3, #0 8004dda: d101 bne.n 8004de0 8004ddc: 2307 movs r3, #7 8004dde: e061 b.n 8004ea4 if (clst == 1) return FR_INT_ERR; /* Internal error */ 8004de0: 697b ldr r3, [r7, #20] 8004de2: 2b01 cmp r3, #1 8004de4: d101 bne.n 8004dea 8004de6: 2302 movs r3, #2 8004de8: e05c b.n 8004ea4 if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */ 8004dea: 697b ldr r3, [r7, #20] 8004dec: f1b3 3fff cmp.w r3, #4294967295 8004df0: d101 bne.n 8004df6 8004df2: 2301 movs r3, #1 8004df4: e056 b.n 8004ea4 /* Clean-up the stretched table */ if (_FS_EXFAT) dp->obj.stat |= 4; /* The directory needs to be updated */ if (sync_window(fs) != FR_OK) return FR_DISK_ERR; /* Flush disk access window */ 8004df6: 68f8 ldr r0, [r7, #12] 8004df8: f7ff fade bl 80043b8 8004dfc: 4603 mov r3, r0 8004dfe: 2b00 cmp r3, #0 8004e00: d001 beq.n 8004e06 8004e02: 2301 movs r3, #1 8004e04: e04e b.n 8004ea4 mem_set(fs->win, 0, SS(fs)); /* Clear window buffer */ 8004e06: 68fb ldr r3, [r7, #12] 8004e08: f103 0038 add.w r0, r3, #56 ; 0x38 8004e0c: 68fb ldr r3, [r7, #12] 8004e0e: 899b ldrh r3, [r3, #12] 8004e10: 461a mov r2, r3 8004e12: 2100 movs r1, #0 8004e14: f7ff f912 bl 800403c for (n = 0, fs->winsect = clust2sect(fs, clst); n < fs->csize; n++, fs->winsect++) { /* Fill the new cluster with 0 */ 8004e18: 2300 movs r3, #0 8004e1a: 613b str r3, [r7, #16] 8004e1c: 6979 ldr r1, [r7, #20] 8004e1e: 68f8 ldr r0, [r7, #12] 8004e20: f7ff fbac bl 800457c 8004e24: 4602 mov r2, r0 8004e26: 68fb ldr r3, [r7, #12] 8004e28: 635a str r2, [r3, #52] ; 0x34 8004e2a: e012 b.n 8004e52 fs->wflag = 1; 8004e2c: 68fb ldr r3, [r7, #12] 8004e2e: 2201 movs r2, #1 8004e30: 70da strb r2, [r3, #3] if (sync_window(fs) != FR_OK) return FR_DISK_ERR; 8004e32: 68f8 ldr r0, [r7, #12] 8004e34: f7ff fac0 bl 80043b8 8004e38: 4603 mov r3, r0 8004e3a: 2b00 cmp r3, #0 8004e3c: d001 beq.n 8004e42 8004e3e: 2301 movs r3, #1 8004e40: e030 b.n 8004ea4 for (n = 0, fs->winsect = clust2sect(fs, clst); n < fs->csize; n++, fs->winsect++) { /* Fill the new cluster with 0 */ 8004e42: 693b ldr r3, [r7, #16] 8004e44: 3301 adds r3, #1 8004e46: 613b str r3, [r7, #16] 8004e48: 68fb ldr r3, [r7, #12] 8004e4a: 6b5b ldr r3, [r3, #52] ; 0x34 8004e4c: 1c5a adds r2, r3, #1 8004e4e: 68fb ldr r3, [r7, #12] 8004e50: 635a str r2, [r3, #52] ; 0x34 8004e52: 68fb ldr r3, [r7, #12] 8004e54: 895b ldrh r3, [r3, #10] 8004e56: 461a mov r2, r3 8004e58: 693b ldr r3, [r7, #16] 8004e5a: 4293 cmp r3, r2 8004e5c: d3e6 bcc.n 8004e2c } fs->winsect -= n; /* Restore window offset */ 8004e5e: 68fb ldr r3, [r7, #12] 8004e60: 6b5a ldr r2, [r3, #52] ; 0x34 8004e62: 693b ldr r3, [r7, #16] 8004e64: 1ad2 subs r2, r2, r3 8004e66: 68fb ldr r3, [r7, #12] 8004e68: 635a str r2, [r3, #52] ; 0x34 #else if (!stretch) dp->sect = 0; /* (this line is to suppress compiler warning) */ dp->sect = 0; return FR_NO_FILE; /* Report EOT */ #endif } dp->clust = clst; /* Initialize data for new cluster */ 8004e6a: 687b ldr r3, [r7, #4] 8004e6c: 697a ldr r2, [r7, #20] 8004e6e: 619a str r2, [r3, #24] dp->sect = clust2sect(fs, clst); 8004e70: 6979 ldr r1, [r7, #20] 8004e72: 68f8 ldr r0, [r7, #12] 8004e74: f7ff fb82 bl 800457c 8004e78: 4602 mov r2, r0 8004e7a: 687b ldr r3, [r7, #4] 8004e7c: 61da str r2, [r3, #28] } } } dp->dptr = ofs; /* Current entry */ 8004e7e: 687b ldr r3, [r7, #4] 8004e80: 68ba ldr r2, [r7, #8] 8004e82: 615a str r2, [r3, #20] dp->dir = fs->win + ofs % SS(fs); /* Pointer to the entry in the win[] */ 8004e84: 68fb ldr r3, [r7, #12] 8004e86: f103 0138 add.w r1, r3, #56 ; 0x38 8004e8a: 68fb ldr r3, [r7, #12] 8004e8c: 899b ldrh r3, [r3, #12] 8004e8e: 461a mov r2, r3 8004e90: 68bb ldr r3, [r7, #8] 8004e92: fbb3 f0f2 udiv r0, r3, r2 8004e96: fb02 f200 mul.w r2, r2, r0 8004e9a: 1a9b subs r3, r3, r2 8004e9c: 18ca adds r2, r1, r3 8004e9e: 687b ldr r3, [r7, #4] 8004ea0: 621a str r2, [r3, #32] return FR_OK; 8004ea2: 2300 movs r3, #0 } 8004ea4: 4618 mov r0, r3 8004ea6: 3718 adds r7, #24 8004ea8: 46bd mov sp, r7 8004eaa: bd80 pop {r7, pc} 08004eac : static FRESULT dir_alloc ( /* FR_OK(0):succeeded, !=0:error */ DIR* dp, /* Pointer to the directory object */ UINT nent /* Number of contiguous entries to allocate */ ) { 8004eac: b580 push {r7, lr} 8004eae: b086 sub sp, #24 8004eb0: af00 add r7, sp, #0 8004eb2: 6078 str r0, [r7, #4] 8004eb4: 6039 str r1, [r7, #0] FRESULT res; UINT n; FATFS *fs = dp->obj.fs; 8004eb6: 687b ldr r3, [r7, #4] 8004eb8: 681b ldr r3, [r3, #0] 8004eba: 60fb str r3, [r7, #12] res = dir_sdi(dp, 0); 8004ebc: 2100 movs r1, #0 8004ebe: 6878 ldr r0, [r7, #4] 8004ec0: f7ff fe95 bl 8004bee 8004ec4: 4603 mov r3, r0 8004ec6: 75fb strb r3, [r7, #23] if (res == FR_OK) { 8004ec8: 7dfb ldrb r3, [r7, #23] 8004eca: 2b00 cmp r3, #0 8004ecc: d12b bne.n 8004f26 n = 0; 8004ece: 2300 movs r3, #0 8004ed0: 613b str r3, [r7, #16] do { res = move_window(fs, dp->sect); 8004ed2: 687b ldr r3, [r7, #4] 8004ed4: 69db ldr r3, [r3, #28] 8004ed6: 4619 mov r1, r3 8004ed8: 68f8 ldr r0, [r7, #12] 8004eda: f7ff fab1 bl 8004440 8004ede: 4603 mov r3, r0 8004ee0: 75fb strb r3, [r7, #23] if (res != FR_OK) break; 8004ee2: 7dfb ldrb r3, [r7, #23] 8004ee4: 2b00 cmp r3, #0 8004ee6: d11d bne.n 8004f24 #if _FS_EXFAT if ((fs->fs_type == FS_EXFAT) ? (int)((dp->dir[XDIR_Type] & 0x80) == 0) : (int)(dp->dir[DIR_Name] == DDEM || dp->dir[DIR_Name] == 0)) { #else if (dp->dir[DIR_Name] == DDEM || dp->dir[DIR_Name] == 0) { 8004ee8: 687b ldr r3, [r7, #4] 8004eea: 6a1b ldr r3, [r3, #32] 8004eec: 781b ldrb r3, [r3, #0] 8004eee: 2be5 cmp r3, #229 ; 0xe5 8004ef0: d004 beq.n 8004efc 8004ef2: 687b ldr r3, [r7, #4] 8004ef4: 6a1b ldr r3, [r3, #32] 8004ef6: 781b ldrb r3, [r3, #0] 8004ef8: 2b00 cmp r3, #0 8004efa: d107 bne.n 8004f0c #endif if (++n == nent) break; /* A block of contiguous free entries is found */ 8004efc: 693b ldr r3, [r7, #16] 8004efe: 3301 adds r3, #1 8004f00: 613b str r3, [r7, #16] 8004f02: 693a ldr r2, [r7, #16] 8004f04: 683b ldr r3, [r7, #0] 8004f06: 429a cmp r2, r3 8004f08: d102 bne.n 8004f10 8004f0a: e00c b.n 8004f26 } else { n = 0; /* Not a blank entry. Restart to search */ 8004f0c: 2300 movs r3, #0 8004f0e: 613b str r3, [r7, #16] } res = dir_next(dp, 1); 8004f10: 2101 movs r1, #1 8004f12: 6878 ldr r0, [r7, #4] 8004f14: f7ff fef4 bl 8004d00 8004f18: 4603 mov r3, r0 8004f1a: 75fb strb r3, [r7, #23] } while (res == FR_OK); /* Next entry with table stretch enabled */ 8004f1c: 7dfb ldrb r3, [r7, #23] 8004f1e: 2b00 cmp r3, #0 8004f20: d0d7 beq.n 8004ed2 8004f22: e000 b.n 8004f26 if (res != FR_OK) break; 8004f24: bf00 nop } if (res == FR_NO_FILE) res = FR_DENIED; /* No directory entry to allocate */ 8004f26: 7dfb ldrb r3, [r7, #23] 8004f28: 2b04 cmp r3, #4 8004f2a: d101 bne.n 8004f30 8004f2c: 2307 movs r3, #7 8004f2e: 75fb strb r3, [r7, #23] return res; 8004f30: 7dfb ldrb r3, [r7, #23] } 8004f32: 4618 mov r0, r3 8004f34: 3718 adds r7, #24 8004f36: 46bd mov sp, r7 8004f38: bd80 pop {r7, pc} 08004f3a : static DWORD ld_clust ( /* Returns the top cluster value of the SFN entry */ FATFS* fs, /* Pointer to the fs object */ const BYTE* dir /* Pointer to the key entry */ ) { 8004f3a: b580 push {r7, lr} 8004f3c: b084 sub sp, #16 8004f3e: af00 add r7, sp, #0 8004f40: 6078 str r0, [r7, #4] 8004f42: 6039 str r1, [r7, #0] DWORD cl; cl = ld_word(dir + DIR_FstClusLO); 8004f44: 683b ldr r3, [r7, #0] 8004f46: 331a adds r3, #26 8004f48: 4618 mov r0, r3 8004f4a: f7fe ffd9 bl 8003f00 8004f4e: 4603 mov r3, r0 8004f50: 60fb str r3, [r7, #12] if (fs->fs_type == FS_FAT32) { 8004f52: 687b ldr r3, [r7, #4] 8004f54: 781b ldrb r3, [r3, #0] 8004f56: 2b03 cmp r3, #3 8004f58: d109 bne.n 8004f6e cl |= (DWORD)ld_word(dir + DIR_FstClusHI) << 16; 8004f5a: 683b ldr r3, [r7, #0] 8004f5c: 3314 adds r3, #20 8004f5e: 4618 mov r0, r3 8004f60: f7fe ffce bl 8003f00 8004f64: 4603 mov r3, r0 8004f66: 041b lsls r3, r3, #16 8004f68: 68fa ldr r2, [r7, #12] 8004f6a: 4313 orrs r3, r2 8004f6c: 60fb str r3, [r7, #12] } return cl; 8004f6e: 68fb ldr r3, [r7, #12] } 8004f70: 4618 mov r0, r3 8004f72: 3710 adds r7, #16 8004f74: 46bd mov sp, r7 8004f76: bd80 pop {r7, pc} 08004f78 : void st_clust ( FATFS* fs, /* Pointer to the fs object */ BYTE* dir, /* Pointer to the key entry */ DWORD cl /* Value to be set */ ) { 8004f78: b580 push {r7, lr} 8004f7a: b084 sub sp, #16 8004f7c: af00 add r7, sp, #0 8004f7e: 60f8 str r0, [r7, #12] 8004f80: 60b9 str r1, [r7, #8] 8004f82: 607a str r2, [r7, #4] st_word(dir + DIR_FstClusLO, (WORD)cl); 8004f84: 68bb ldr r3, [r7, #8] 8004f86: 331a adds r3, #26 8004f88: 687a ldr r2, [r7, #4] 8004f8a: b292 uxth r2, r2 8004f8c: 4611 mov r1, r2 8004f8e: 4618 mov r0, r3 8004f90: f7fe ffef bl 8003f72 if (fs->fs_type == FS_FAT32) { 8004f94: 68fb ldr r3, [r7, #12] 8004f96: 781b ldrb r3, [r3, #0] 8004f98: 2b03 cmp r3, #3 8004f9a: d109 bne.n 8004fb0 st_word(dir + DIR_FstClusHI, (WORD)(cl >> 16)); 8004f9c: 68bb ldr r3, [r7, #8] 8004f9e: f103 0214 add.w r2, r3, #20 8004fa2: 687b ldr r3, [r7, #4] 8004fa4: 0c1b lsrs r3, r3, #16 8004fa6: b29b uxth r3, r3 8004fa8: 4619 mov r1, r3 8004faa: 4610 mov r0, r2 8004fac: f7fe ffe1 bl 8003f72 } } 8004fb0: bf00 nop 8004fb2: 3710 adds r7, #16 8004fb4: 46bd mov sp, r7 8004fb6: bd80 pop {r7, pc} 08004fb8 : static int cmp_lfn ( /* 1:matched, 0:not matched */ const WCHAR* lfnbuf, /* Pointer to the LFN working buffer to be compared */ BYTE* dir /* Pointer to the directory entry containing the part of LFN */ ) { 8004fb8: b590 push {r4, r7, lr} 8004fba: b087 sub sp, #28 8004fbc: af00 add r7, sp, #0 8004fbe: 6078 str r0, [r7, #4] 8004fc0: 6039 str r1, [r7, #0] UINT i, s; WCHAR wc, uc; if (ld_word(dir + LDIR_FstClusLO) != 0) return 0; /* Check LDIR_FstClusLO */ 8004fc2: 683b ldr r3, [r7, #0] 8004fc4: 331a adds r3, #26 8004fc6: 4618 mov r0, r3 8004fc8: f7fe ff9a bl 8003f00 8004fcc: 4603 mov r3, r0 8004fce: 2b00 cmp r3, #0 8004fd0: d001 beq.n 8004fd6 8004fd2: 2300 movs r3, #0 8004fd4: e059 b.n 800508a i = ((dir[LDIR_Ord] & 0x3F) - 1) * 13; /* Offset in the LFN buffer */ 8004fd6: 683b ldr r3, [r7, #0] 8004fd8: 781b ldrb r3, [r3, #0] 8004fda: f003 033f and.w r3, r3, #63 ; 0x3f 8004fde: 1e5a subs r2, r3, #1 8004fe0: 4613 mov r3, r2 8004fe2: 005b lsls r3, r3, #1 8004fe4: 4413 add r3, r2 8004fe6: 009b lsls r3, r3, #2 8004fe8: 4413 add r3, r2 8004fea: 617b str r3, [r7, #20] for (wc = 1, s = 0; s < 13; s++) { /* Process all characters in the entry */ 8004fec: 2301 movs r3, #1 8004fee: 81fb strh r3, [r7, #14] 8004ff0: 2300 movs r3, #0 8004ff2: 613b str r3, [r7, #16] 8004ff4: e033 b.n 800505e uc = ld_word(dir + LfnOfs[s]); /* Pick an LFN character */ 8004ff6: 4a27 ldr r2, [pc, #156] ; (8005094 ) 8004ff8: 693b ldr r3, [r7, #16] 8004ffa: 4413 add r3, r2 8004ffc: 781b ldrb r3, [r3, #0] 8004ffe: 461a mov r2, r3 8005000: 683b ldr r3, [r7, #0] 8005002: 4413 add r3, r2 8005004: 4618 mov r0, r3 8005006: f7fe ff7b bl 8003f00 800500a: 4603 mov r3, r0 800500c: 81bb strh r3, [r7, #12] if (wc) { 800500e: 89fb ldrh r3, [r7, #14] 8005010: 2b00 cmp r3, #0 8005012: d01a beq.n 800504a if (i >= _MAX_LFN || ff_wtoupper(uc) != ff_wtoupper(lfnbuf[i++])) { /* Compare it */ 8005014: 697b ldr r3, [r7, #20] 8005016: 2bfe cmp r3, #254 ; 0xfe 8005018: d812 bhi.n 8005040 800501a: 89bb ldrh r3, [r7, #12] 800501c: 4618 mov r0, r3 800501e: f002 f82f bl 8007080 8005022: 4603 mov r3, r0 8005024: 461c mov r4, r3 8005026: 697b ldr r3, [r7, #20] 8005028: 1c5a adds r2, r3, #1 800502a: 617a str r2, [r7, #20] 800502c: 005b lsls r3, r3, #1 800502e: 687a ldr r2, [r7, #4] 8005030: 4413 add r3, r2 8005032: 881b ldrh r3, [r3, #0] 8005034: 4618 mov r0, r3 8005036: f002 f823 bl 8007080 800503a: 4603 mov r3, r0 800503c: 429c cmp r4, r3 800503e: d001 beq.n 8005044 return 0; /* Not matched */ 8005040: 2300 movs r3, #0 8005042: e022 b.n 800508a } wc = uc; 8005044: 89bb ldrh r3, [r7, #12] 8005046: 81fb strh r3, [r7, #14] 8005048: e006 b.n 8005058 } else { if (uc != 0xFFFF) return 0; /* Check filler */ 800504a: 89bb ldrh r3, [r7, #12] 800504c: f64f 72ff movw r2, #65535 ; 0xffff 8005050: 4293 cmp r3, r2 8005052: d001 beq.n 8005058 8005054: 2300 movs r3, #0 8005056: e018 b.n 800508a for (wc = 1, s = 0; s < 13; s++) { /* Process all characters in the entry */ 8005058: 693b ldr r3, [r7, #16] 800505a: 3301 adds r3, #1 800505c: 613b str r3, [r7, #16] 800505e: 693b ldr r3, [r7, #16] 8005060: 2b0c cmp r3, #12 8005062: d9c8 bls.n 8004ff6 } } if ((dir[LDIR_Ord] & LLEF) && wc && lfnbuf[i]) return 0; /* Last segment matched but different length */ 8005064: 683b ldr r3, [r7, #0] 8005066: 781b ldrb r3, [r3, #0] 8005068: f003 0340 and.w r3, r3, #64 ; 0x40 800506c: 2b00 cmp r3, #0 800506e: d00b beq.n 8005088 8005070: 89fb ldrh r3, [r7, #14] 8005072: 2b00 cmp r3, #0 8005074: d008 beq.n 8005088 8005076: 697b ldr r3, [r7, #20] 8005078: 005b lsls r3, r3, #1 800507a: 687a ldr r2, [r7, #4] 800507c: 4413 add r3, r2 800507e: 881b ldrh r3, [r3, #0] 8005080: 2b00 cmp r3, #0 8005082: d001 beq.n 8005088 8005084: 2300 movs r3, #0 8005086: e000 b.n 800508a return 1; /* The part of LFN matched */ 8005088: 2301 movs r3, #1 } 800508a: 4618 mov r0, r3 800508c: 371c adds r7, #28 800508e: 46bd mov sp, r7 8005090: bd90 pop {r4, r7, pc} 8005092: bf00 nop 8005094: 08007c04 .word 0x08007c04 08005098 : const WCHAR* lfn, /* Pointer to the LFN */ BYTE* dir, /* Pointer to the LFN entry to be created */ BYTE ord, /* LFN order (1-20) */ BYTE sum /* Checksum of the corresponding SFN */ ) { 8005098: b580 push {r7, lr} 800509a: b088 sub sp, #32 800509c: af00 add r7, sp, #0 800509e: 60f8 str r0, [r7, #12] 80050a0: 60b9 str r1, [r7, #8] 80050a2: 4611 mov r1, r2 80050a4: 461a mov r2, r3 80050a6: 460b mov r3, r1 80050a8: 71fb strb r3, [r7, #7] 80050aa: 4613 mov r3, r2 80050ac: 71bb strb r3, [r7, #6] UINT i, s; WCHAR wc; dir[LDIR_Chksum] = sum; /* Set checksum */ 80050ae: 68bb ldr r3, [r7, #8] 80050b0: 330d adds r3, #13 80050b2: 79ba ldrb r2, [r7, #6] 80050b4: 701a strb r2, [r3, #0] dir[LDIR_Attr] = AM_LFN; /* Set attribute. LFN entry */ 80050b6: 68bb ldr r3, [r7, #8] 80050b8: 330b adds r3, #11 80050ba: 220f movs r2, #15 80050bc: 701a strb r2, [r3, #0] dir[LDIR_Type] = 0; 80050be: 68bb ldr r3, [r7, #8] 80050c0: 330c adds r3, #12 80050c2: 2200 movs r2, #0 80050c4: 701a strb r2, [r3, #0] st_word(dir + LDIR_FstClusLO, 0); 80050c6: 68bb ldr r3, [r7, #8] 80050c8: 331a adds r3, #26 80050ca: 2100 movs r1, #0 80050cc: 4618 mov r0, r3 80050ce: f7fe ff50 bl 8003f72 i = (ord - 1) * 13; /* Get offset in the LFN working buffer */ 80050d2: 79fb ldrb r3, [r7, #7] 80050d4: 1e5a subs r2, r3, #1 80050d6: 4613 mov r3, r2 80050d8: 005b lsls r3, r3, #1 80050da: 4413 add r3, r2 80050dc: 009b lsls r3, r3, #2 80050de: 4413 add r3, r2 80050e0: 61fb str r3, [r7, #28] s = wc = 0; 80050e2: 2300 movs r3, #0 80050e4: 82fb strh r3, [r7, #22] 80050e6: 2300 movs r3, #0 80050e8: 61bb str r3, [r7, #24] do { if (wc != 0xFFFF) wc = lfn[i++]; /* Get an effective character */ 80050ea: 8afb ldrh r3, [r7, #22] 80050ec: f64f 72ff movw r2, #65535 ; 0xffff 80050f0: 4293 cmp r3, r2 80050f2: d007 beq.n 8005104 80050f4: 69fb ldr r3, [r7, #28] 80050f6: 1c5a adds r2, r3, #1 80050f8: 61fa str r2, [r7, #28] 80050fa: 005b lsls r3, r3, #1 80050fc: 68fa ldr r2, [r7, #12] 80050fe: 4413 add r3, r2 8005100: 881b ldrh r3, [r3, #0] 8005102: 82fb strh r3, [r7, #22] st_word(dir + LfnOfs[s], wc); /* Put it */ 8005104: 4a17 ldr r2, [pc, #92] ; (8005164 ) 8005106: 69bb ldr r3, [r7, #24] 8005108: 4413 add r3, r2 800510a: 781b ldrb r3, [r3, #0] 800510c: 461a mov r2, r3 800510e: 68bb ldr r3, [r7, #8] 8005110: 4413 add r3, r2 8005112: 8afa ldrh r2, [r7, #22] 8005114: 4611 mov r1, r2 8005116: 4618 mov r0, r3 8005118: f7fe ff2b bl 8003f72 if (wc == 0) wc = 0xFFFF; /* Padding characters for left locations */ 800511c: 8afb ldrh r3, [r7, #22] 800511e: 2b00 cmp r3, #0 8005120: d102 bne.n 8005128 8005122: f64f 73ff movw r3, #65535 ; 0xffff 8005126: 82fb strh r3, [r7, #22] } while (++s < 13); 8005128: 69bb ldr r3, [r7, #24] 800512a: 3301 adds r3, #1 800512c: 61bb str r3, [r7, #24] 800512e: 69bb ldr r3, [r7, #24] 8005130: 2b0c cmp r3, #12 8005132: d9da bls.n 80050ea if (wc == 0xFFFF || !lfn[i]) ord |= LLEF; /* Last LFN part is the start of LFN sequence */ 8005134: 8afb ldrh r3, [r7, #22] 8005136: f64f 72ff movw r2, #65535 ; 0xffff 800513a: 4293 cmp r3, r2 800513c: d006 beq.n 800514c 800513e: 69fb ldr r3, [r7, #28] 8005140: 005b lsls r3, r3, #1 8005142: 68fa ldr r2, [r7, #12] 8005144: 4413 add r3, r2 8005146: 881b ldrh r3, [r3, #0] 8005148: 2b00 cmp r3, #0 800514a: d103 bne.n 8005154 800514c: 79fb ldrb r3, [r7, #7] 800514e: f043 0340 orr.w r3, r3, #64 ; 0x40 8005152: 71fb strb r3, [r7, #7] dir[LDIR_Ord] = ord; /* Set the LFN order */ 8005154: 68bb ldr r3, [r7, #8] 8005156: 79fa ldrb r2, [r7, #7] 8005158: 701a strb r2, [r3, #0] } 800515a: bf00 nop 800515c: 3720 adds r7, #32 800515e: 46bd mov sp, r7 8005160: bd80 pop {r7, pc} 8005162: bf00 nop 8005164: 08007c04 .word 0x08007c04 08005168 : BYTE* dst, /* Pointer to the buffer to store numbered SFN */ const BYTE* src, /* Pointer to SFN */ const WCHAR* lfn, /* Pointer to LFN */ UINT seq /* Sequence number */ ) { 8005168: b580 push {r7, lr} 800516a: b08c sub sp, #48 ; 0x30 800516c: af00 add r7, sp, #0 800516e: 60f8 str r0, [r7, #12] 8005170: 60b9 str r1, [r7, #8] 8005172: 607a str r2, [r7, #4] 8005174: 603b str r3, [r7, #0] UINT i, j; WCHAR wc; DWORD sr; mem_cpy(dst, src, 11); 8005176: 220b movs r2, #11 8005178: 68b9 ldr r1, [r7, #8] 800517a: 68f8 ldr r0, [r7, #12] 800517c: f7fe ff3e bl 8003ffc if (seq > 5) { /* In case of many collisions, generate a hash number instead of sequential number */ 8005180: 683b ldr r3, [r7, #0] 8005182: 2b05 cmp r3, #5 8005184: d92b bls.n 80051de sr = seq; 8005186: 683b ldr r3, [r7, #0] 8005188: 61fb str r3, [r7, #28] while (*lfn) { /* Create a CRC */ 800518a: e022 b.n 80051d2 wc = *lfn++; 800518c: 687b ldr r3, [r7, #4] 800518e: 1c9a adds r2, r3, #2 8005190: 607a str r2, [r7, #4] 8005192: 881b ldrh r3, [r3, #0] 8005194: 847b strh r3, [r7, #34] ; 0x22 for (i = 0; i < 16; i++) { 8005196: 2300 movs r3, #0 8005198: 62bb str r3, [r7, #40] ; 0x28 800519a: e017 b.n 80051cc sr = (sr << 1) + (wc & 1); 800519c: 69fb ldr r3, [r7, #28] 800519e: 005a lsls r2, r3, #1 80051a0: 8c7b ldrh r3, [r7, #34] ; 0x22 80051a2: f003 0301 and.w r3, r3, #1 80051a6: 4413 add r3, r2 80051a8: 61fb str r3, [r7, #28] wc >>= 1; 80051aa: 8c7b ldrh r3, [r7, #34] ; 0x22 80051ac: 085b lsrs r3, r3, #1 80051ae: 847b strh r3, [r7, #34] ; 0x22 if (sr & 0x10000) sr ^= 0x11021; 80051b0: 69fb ldr r3, [r7, #28] 80051b2: f403 3380 and.w r3, r3, #65536 ; 0x10000 80051b6: 2b00 cmp r3, #0 80051b8: d005 beq.n 80051c6 80051ba: 69fb ldr r3, [r7, #28] 80051bc: f483 3388 eor.w r3, r3, #69632 ; 0x11000 80051c0: f083 0321 eor.w r3, r3, #33 ; 0x21 80051c4: 61fb str r3, [r7, #28] for (i = 0; i < 16; i++) { 80051c6: 6abb ldr r3, [r7, #40] ; 0x28 80051c8: 3301 adds r3, #1 80051ca: 62bb str r3, [r7, #40] ; 0x28 80051cc: 6abb ldr r3, [r7, #40] ; 0x28 80051ce: 2b0f cmp r3, #15 80051d0: d9e4 bls.n 800519c while (*lfn) { /* Create a CRC */ 80051d2: 687b ldr r3, [r7, #4] 80051d4: 881b ldrh r3, [r3, #0] 80051d6: 2b00 cmp r3, #0 80051d8: d1d8 bne.n 800518c } } seq = (UINT)sr; 80051da: 69fb ldr r3, [r7, #28] 80051dc: 603b str r3, [r7, #0] } /* itoa (hexdecimal) */ i = 7; 80051de: 2307 movs r3, #7 80051e0: 62bb str r3, [r7, #40] ; 0x28 do { c = (BYTE)((seq % 16) + '0'); 80051e2: 683b ldr r3, [r7, #0] 80051e4: b2db uxtb r3, r3 80051e6: f003 030f and.w r3, r3, #15 80051ea: b2db uxtb r3, r3 80051ec: 3330 adds r3, #48 ; 0x30 80051ee: f887 302f strb.w r3, [r7, #47] ; 0x2f if (c > '9') c += 7; 80051f2: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 80051f6: 2b39 cmp r3, #57 ; 0x39 80051f8: d904 bls.n 8005204 80051fa: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 80051fe: 3307 adds r3, #7 8005200: f887 302f strb.w r3, [r7, #47] ; 0x2f ns[i--] = c; 8005204: 6abb ldr r3, [r7, #40] ; 0x28 8005206: 1e5a subs r2, r3, #1 8005208: 62ba str r2, [r7, #40] ; 0x28 800520a: f107 0230 add.w r2, r7, #48 ; 0x30 800520e: 4413 add r3, r2 8005210: f897 202f ldrb.w r2, [r7, #47] ; 0x2f 8005214: f803 2c1c strb.w r2, [r3, #-28] seq /= 16; 8005218: 683b ldr r3, [r7, #0] 800521a: 091b lsrs r3, r3, #4 800521c: 603b str r3, [r7, #0] } while (seq); 800521e: 683b ldr r3, [r7, #0] 8005220: 2b00 cmp r3, #0 8005222: d1de bne.n 80051e2 ns[i] = '~'; 8005224: f107 0214 add.w r2, r7, #20 8005228: 6abb ldr r3, [r7, #40] ; 0x28 800522a: 4413 add r3, r2 800522c: 227e movs r2, #126 ; 0x7e 800522e: 701a strb r2, [r3, #0] /* Append the number */ for (j = 0; j < i && dst[j] != ' '; j++) { 8005230: 2300 movs r3, #0 8005232: 627b str r3, [r7, #36] ; 0x24 8005234: e002 b.n 800523c 8005236: 6a7b ldr r3, [r7, #36] ; 0x24 8005238: 3301 adds r3, #1 800523a: 627b str r3, [r7, #36] ; 0x24 800523c: 6a7a ldr r2, [r7, #36] ; 0x24 800523e: 6abb ldr r3, [r7, #40] ; 0x28 8005240: 429a cmp r2, r3 8005242: d205 bcs.n 8005250 8005244: 68fa ldr r2, [r7, #12] 8005246: 6a7b ldr r3, [r7, #36] ; 0x24 8005248: 4413 add r3, r2 800524a: 781b ldrb r3, [r3, #0] 800524c: 2b20 cmp r3, #32 800524e: d1f2 bne.n 8005236 if (j == i - 1) break; j++; } } do { dst[j++] = (i < 8) ? ns[i++] : ' '; 8005250: 6abb ldr r3, [r7, #40] ; 0x28 8005252: 2b07 cmp r3, #7 8005254: d808 bhi.n 8005268 8005256: 6abb ldr r3, [r7, #40] ; 0x28 8005258: 1c5a adds r2, r3, #1 800525a: 62ba str r2, [r7, #40] ; 0x28 800525c: f107 0230 add.w r2, r7, #48 ; 0x30 8005260: 4413 add r3, r2 8005262: f813 1c1c ldrb.w r1, [r3, #-28] 8005266: e000 b.n 800526a 8005268: 2120 movs r1, #32 800526a: 6a7b ldr r3, [r7, #36] ; 0x24 800526c: 1c5a adds r2, r3, #1 800526e: 627a str r2, [r7, #36] ; 0x24 8005270: 68fa ldr r2, [r7, #12] 8005272: 4413 add r3, r2 8005274: 460a mov r2, r1 8005276: 701a strb r2, [r3, #0] } while (j < 8); 8005278: 6a7b ldr r3, [r7, #36] ; 0x24 800527a: 2b07 cmp r3, #7 800527c: d9e8 bls.n 8005250 } 800527e: bf00 nop 8005280: 3730 adds r7, #48 ; 0x30 8005282: 46bd mov sp, r7 8005284: bd80 pop {r7, pc} 08005286 : static BYTE sum_sfn ( const BYTE* dir /* Pointer to the SFN entry */ ) { 8005286: b480 push {r7} 8005288: b085 sub sp, #20 800528a: af00 add r7, sp, #0 800528c: 6078 str r0, [r7, #4] BYTE sum = 0; 800528e: 2300 movs r3, #0 8005290: 73fb strb r3, [r7, #15] UINT n = 11; 8005292: 230b movs r3, #11 8005294: 60bb str r3, [r7, #8] do { sum = (sum >> 1) + (sum << 7) + *dir++; 8005296: 7bfb ldrb r3, [r7, #15] 8005298: b2da uxtb r2, r3 800529a: 0852 lsrs r2, r2, #1 800529c: 01db lsls r3, r3, #7 800529e: 4313 orrs r3, r2 80052a0: b2da uxtb r2, r3 80052a2: 687b ldr r3, [r7, #4] 80052a4: 1c59 adds r1, r3, #1 80052a6: 6079 str r1, [r7, #4] 80052a8: 781b ldrb r3, [r3, #0] 80052aa: 4413 add r3, r2 80052ac: 73fb strb r3, [r7, #15] } while (--n); 80052ae: 68bb ldr r3, [r7, #8] 80052b0: 3b01 subs r3, #1 80052b2: 60bb str r3, [r7, #8] 80052b4: 68bb ldr r3, [r7, #8] 80052b6: 2b00 cmp r3, #0 80052b8: d1ed bne.n 8005296 return sum; 80052ba: 7bfb ldrb r3, [r7, #15] } 80052bc: 4618 mov r0, r3 80052be: 3714 adds r7, #20 80052c0: 46bd mov sp, r7 80052c2: bc80 pop {r7} 80052c4: 4770 bx lr 080052c6 : static FRESULT dir_find ( /* FR_OK(0):succeeded, !=0:error */ DIR* dp /* Pointer to the directory object with the file name */ ) { 80052c6: b580 push {r7, lr} 80052c8: b086 sub sp, #24 80052ca: af00 add r7, sp, #0 80052cc: 6078 str r0, [r7, #4] FRESULT res; FATFS *fs = dp->obj.fs; 80052ce: 687b ldr r3, [r7, #4] 80052d0: 681b ldr r3, [r3, #0] 80052d2: 613b str r3, [r7, #16] BYTE c; #if _USE_LFN != 0 BYTE a, ord, sum; #endif res = dir_sdi(dp, 0); /* Rewind directory object */ 80052d4: 2100 movs r1, #0 80052d6: 6878 ldr r0, [r7, #4] 80052d8: f7ff fc89 bl 8004bee 80052dc: 4603 mov r3, r0 80052de: 75fb strb r3, [r7, #23] if (res != FR_OK) return res; 80052e0: 7dfb ldrb r3, [r7, #23] 80052e2: 2b00 cmp r3, #0 80052e4: d001 beq.n 80052ea 80052e6: 7dfb ldrb r3, [r7, #23] 80052e8: e0a9 b.n 800543e return res; } #endif /* On the FAT12/16/32 volume */ #if _USE_LFN != 0 ord = sum = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */ 80052ea: 23ff movs r3, #255 ; 0xff 80052ec: 753b strb r3, [r7, #20] 80052ee: 7d3b ldrb r3, [r7, #20] 80052f0: 757b strb r3, [r7, #21] 80052f2: 687b ldr r3, [r7, #4] 80052f4: f04f 32ff mov.w r2, #4294967295 80052f8: 631a str r2, [r3, #48] ; 0x30 #endif do { res = move_window(fs, dp->sect); 80052fa: 687b ldr r3, [r7, #4] 80052fc: 69db ldr r3, [r3, #28] 80052fe: 4619 mov r1, r3 8005300: 6938 ldr r0, [r7, #16] 8005302: f7ff f89d bl 8004440 8005306: 4603 mov r3, r0 8005308: 75fb strb r3, [r7, #23] if (res != FR_OK) break; 800530a: 7dfb ldrb r3, [r7, #23] 800530c: 2b00 cmp r3, #0 800530e: f040 8090 bne.w 8005432 c = dp->dir[DIR_Name]; 8005312: 687b ldr r3, [r7, #4] 8005314: 6a1b ldr r3, [r3, #32] 8005316: 781b ldrb r3, [r3, #0] 8005318: 75bb strb r3, [r7, #22] if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */ 800531a: 7dbb ldrb r3, [r7, #22] 800531c: 2b00 cmp r3, #0 800531e: d102 bne.n 8005326 8005320: 2304 movs r3, #4 8005322: 75fb strb r3, [r7, #23] 8005324: e08a b.n 800543c #if _USE_LFN != 0 /* LFN configuration */ dp->obj.attr = a = dp->dir[DIR_Attr] & AM_MASK; 8005326: 687b ldr r3, [r7, #4] 8005328: 6a1b ldr r3, [r3, #32] 800532a: 330b adds r3, #11 800532c: 781b ldrb r3, [r3, #0] 800532e: f003 033f and.w r3, r3, #63 ; 0x3f 8005332: 73fb strb r3, [r7, #15] 8005334: 687b ldr r3, [r7, #4] 8005336: 7bfa ldrb r2, [r7, #15] 8005338: 719a strb r2, [r3, #6] if (c == DDEM || ((a & AM_VOL) && a != AM_LFN)) { /* An entry without valid data */ 800533a: 7dbb ldrb r3, [r7, #22] 800533c: 2be5 cmp r3, #229 ; 0xe5 800533e: d007 beq.n 8005350 8005340: 7bfb ldrb r3, [r7, #15] 8005342: f003 0308 and.w r3, r3, #8 8005346: 2b00 cmp r3, #0 8005348: d009 beq.n 800535e 800534a: 7bfb ldrb r3, [r7, #15] 800534c: 2b0f cmp r3, #15 800534e: d006 beq.n 800535e ord = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */ 8005350: 23ff movs r3, #255 ; 0xff 8005352: 757b strb r3, [r7, #21] 8005354: 687b ldr r3, [r7, #4] 8005356: f04f 32ff mov.w r2, #4294967295 800535a: 631a str r2, [r3, #48] ; 0x30 800535c: e05e b.n 800541c } else { if (a == AM_LFN) { /* An LFN entry is found */ 800535e: 7bfb ldrb r3, [r7, #15] 8005360: 2b0f cmp r3, #15 8005362: d136 bne.n 80053d2 if (!(dp->fn[NSFLAG] & NS_NOLFN)) { 8005364: 687b ldr r3, [r7, #4] 8005366: f893 302f ldrb.w r3, [r3, #47] ; 0x2f 800536a: f003 0340 and.w r3, r3, #64 ; 0x40 800536e: 2b00 cmp r3, #0 8005370: d154 bne.n 800541c if (c & LLEF) { /* Is it start of LFN sequence? */ 8005372: 7dbb ldrb r3, [r7, #22] 8005374: f003 0340 and.w r3, r3, #64 ; 0x40 8005378: 2b00 cmp r3, #0 800537a: d00d beq.n 8005398 sum = dp->dir[LDIR_Chksum]; 800537c: 687b ldr r3, [r7, #4] 800537e: 6a1b ldr r3, [r3, #32] 8005380: 7b5b ldrb r3, [r3, #13] 8005382: 753b strb r3, [r7, #20] c &= (BYTE)~LLEF; ord = c; /* LFN start order */ 8005384: 7dbb ldrb r3, [r7, #22] 8005386: f023 0340 bic.w r3, r3, #64 ; 0x40 800538a: 75bb strb r3, [r7, #22] 800538c: 7dbb ldrb r3, [r7, #22] 800538e: 757b strb r3, [r7, #21] dp->blk_ofs = dp->dptr; /* Start offset of LFN */ 8005390: 687b ldr r3, [r7, #4] 8005392: 695a ldr r2, [r3, #20] 8005394: 687b ldr r3, [r7, #4] 8005396: 631a str r2, [r3, #48] ; 0x30 } /* Check validity of the LFN entry and compare it with given name */ ord = (c == ord && sum == dp->dir[LDIR_Chksum] && cmp_lfn(fs->lfnbuf, dp->dir)) ? ord - 1 : 0xFF; 8005398: 7dba ldrb r2, [r7, #22] 800539a: 7d7b ldrb r3, [r7, #21] 800539c: 429a cmp r2, r3 800539e: d115 bne.n 80053cc 80053a0: 687b ldr r3, [r7, #4] 80053a2: 6a1b ldr r3, [r3, #32] 80053a4: 330d adds r3, #13 80053a6: 781b ldrb r3, [r3, #0] 80053a8: 7d3a ldrb r2, [r7, #20] 80053aa: 429a cmp r2, r3 80053ac: d10e bne.n 80053cc 80053ae: 693b ldr r3, [r7, #16] 80053b0: 691a ldr r2, [r3, #16] 80053b2: 687b ldr r3, [r7, #4] 80053b4: 6a1b ldr r3, [r3, #32] 80053b6: 4619 mov r1, r3 80053b8: 4610 mov r0, r2 80053ba: f7ff fdfd bl 8004fb8 80053be: 4603 mov r3, r0 80053c0: 2b00 cmp r3, #0 80053c2: d003 beq.n 80053cc 80053c4: 7d7b ldrb r3, [r7, #21] 80053c6: 3b01 subs r3, #1 80053c8: b2db uxtb r3, r3 80053ca: e000 b.n 80053ce 80053cc: 23ff movs r3, #255 ; 0xff 80053ce: 757b strb r3, [r7, #21] 80053d0: e024 b.n 800541c } } else { /* An SFN entry is found */ if (!ord && sum == sum_sfn(dp->dir)) break; /* LFN matched? */ 80053d2: 7d7b ldrb r3, [r7, #21] 80053d4: 2b00 cmp r3, #0 80053d6: d109 bne.n 80053ec 80053d8: 687b ldr r3, [r7, #4] 80053da: 6a1b ldr r3, [r3, #32] 80053dc: 4618 mov r0, r3 80053de: f7ff ff52 bl 8005286 80053e2: 4603 mov r3, r0 80053e4: 461a mov r2, r3 80053e6: 7d3b ldrb r3, [r7, #20] 80053e8: 4293 cmp r3, r2 80053ea: d024 beq.n 8005436 if (!(dp->fn[NSFLAG] & NS_LOSS) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* SFN matched? */ 80053ec: 687b ldr r3, [r7, #4] 80053ee: f893 302f ldrb.w r3, [r3, #47] ; 0x2f 80053f2: f003 0301 and.w r3, r3, #1 80053f6: 2b00 cmp r3, #0 80053f8: d10a bne.n 8005410 80053fa: 687b ldr r3, [r7, #4] 80053fc: 6a18 ldr r0, [r3, #32] 80053fe: 687b ldr r3, [r7, #4] 8005400: 3324 adds r3, #36 ; 0x24 8005402: 220b movs r2, #11 8005404: 4619 mov r1, r3 8005406: f7fe fe32 bl 800406e 800540a: 4603 mov r3, r0 800540c: 2b00 cmp r3, #0 800540e: d014 beq.n 800543a ord = 0xFF; dp->blk_ofs = 0xFFFFFFFF; /* Reset LFN sequence */ 8005410: 23ff movs r3, #255 ; 0xff 8005412: 757b strb r3, [r7, #21] 8005414: 687b ldr r3, [r7, #4] 8005416: f04f 32ff mov.w r2, #4294967295 800541a: 631a str r2, [r3, #48] ; 0x30 } #else /* Non LFN configuration */ dp->obj.attr = dp->dir[DIR_Attr] & AM_MASK; if (!(dp->dir[DIR_Attr] & AM_VOL) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* Is it a valid entry? */ #endif res = dir_next(dp, 0); /* Next entry */ 800541c: 2100 movs r1, #0 800541e: 6878 ldr r0, [r7, #4] 8005420: f7ff fc6e bl 8004d00 8005424: 4603 mov r3, r0 8005426: 75fb strb r3, [r7, #23] } while (res == FR_OK); 8005428: 7dfb ldrb r3, [r7, #23] 800542a: 2b00 cmp r3, #0 800542c: f43f af65 beq.w 80052fa 8005430: e004 b.n 800543c if (res != FR_OK) break; 8005432: bf00 nop 8005434: e002 b.n 800543c if (!ord && sum == sum_sfn(dp->dir)) break; /* LFN matched? */ 8005436: bf00 nop 8005438: e000 b.n 800543c if (!(dp->fn[NSFLAG] & NS_LOSS) && !mem_cmp(dp->dir, dp->fn, 11)) break; /* SFN matched? */ 800543a: bf00 nop return res; 800543c: 7dfb ldrb r3, [r7, #23] } 800543e: 4618 mov r0, r3 8005440: 3718 adds r7, #24 8005442: 46bd mov sp, r7 8005444: bd80 pop {r7, pc} ... 08005448 : static FRESULT dir_register ( /* FR_OK:succeeded, FR_DENIED:no free entry or too many SFN collision, FR_DISK_ERR:disk error */ DIR* dp /* Target directory with object name to be created */ ) { 8005448: b580 push {r7, lr} 800544a: b08c sub sp, #48 ; 0x30 800544c: af00 add r7, sp, #0 800544e: 6078 str r0, [r7, #4] FRESULT res; FATFS *fs = dp->obj.fs; 8005450: 687b ldr r3, [r7, #4] 8005452: 681b ldr r3, [r3, #0] 8005454: 61fb str r3, [r7, #28] #if _USE_LFN != 0 /* LFN configuration */ UINT n, nlen, nent; BYTE sn[12], sum; if (dp->fn[NSFLAG] & (NS_DOT | NS_NONAME)) return FR_INVALID_NAME; /* Check name validity */ 8005456: 687b ldr r3, [r7, #4] 8005458: f893 302f ldrb.w r3, [r3, #47] ; 0x2f 800545c: f003 03a0 and.w r3, r3, #160 ; 0xa0 8005460: 2b00 cmp r3, #0 8005462: d001 beq.n 8005468 8005464: 2306 movs r3, #6 8005466: e0e0 b.n 800562a for (nlen = 0; fs->lfnbuf[nlen]; nlen++) ; /* Get lfn length */ 8005468: 2300 movs r3, #0 800546a: 627b str r3, [r7, #36] ; 0x24 800546c: e002 b.n 8005474 800546e: 6a7b ldr r3, [r7, #36] ; 0x24 8005470: 3301 adds r3, #1 8005472: 627b str r3, [r7, #36] ; 0x24 8005474: 69fb ldr r3, [r7, #28] 8005476: 691a ldr r2, [r3, #16] 8005478: 6a7b ldr r3, [r7, #36] ; 0x24 800547a: 005b lsls r3, r3, #1 800547c: 4413 add r3, r2 800547e: 881b ldrh r3, [r3, #0] 8005480: 2b00 cmp r3, #0 8005482: d1f4 bne.n 800546e create_xdir(fs->dirbuf, fs->lfnbuf); /* Create on-memory directory block to be written later */ return FR_OK; } #endif /* On the FAT12/16/32 volume */ mem_cpy(sn, dp->fn, 12); 8005484: 687b ldr r3, [r7, #4] 8005486: f103 0124 add.w r1, r3, #36 ; 0x24 800548a: f107 030c add.w r3, r7, #12 800548e: 220c movs r2, #12 8005490: 4618 mov r0, r3 8005492: f7fe fdb3 bl 8003ffc if (sn[NSFLAG] & NS_LOSS) { /* When LFN is out of 8.3 format, generate a numbered name */ 8005496: 7dfb ldrb r3, [r7, #23] 8005498: f003 0301 and.w r3, r3, #1 800549c: 2b00 cmp r3, #0 800549e: d032 beq.n 8005506 dp->fn[NSFLAG] = NS_NOLFN; /* Find only SFN */ 80054a0: 687b ldr r3, [r7, #4] 80054a2: 2240 movs r2, #64 ; 0x40 80054a4: f883 202f strb.w r2, [r3, #47] ; 0x2f for (n = 1; n < 100; n++) { 80054a8: 2301 movs r3, #1 80054aa: 62bb str r3, [r7, #40] ; 0x28 80054ac: e016 b.n 80054dc gen_numname(dp->fn, sn, fs->lfnbuf, n); /* Generate a numbered name */ 80054ae: 687b ldr r3, [r7, #4] 80054b0: f103 0024 add.w r0, r3, #36 ; 0x24 80054b4: 69fb ldr r3, [r7, #28] 80054b6: 691a ldr r2, [r3, #16] 80054b8: f107 010c add.w r1, r7, #12 80054bc: 6abb ldr r3, [r7, #40] ; 0x28 80054be: f7ff fe53 bl 8005168 res = dir_find(dp); /* Check if the name collides with existing SFN */ 80054c2: 6878 ldr r0, [r7, #4] 80054c4: f7ff feff bl 80052c6 80054c8: 4603 mov r3, r0 80054ca: f887 302f strb.w r3, [r7, #47] ; 0x2f if (res != FR_OK) break; 80054ce: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 80054d2: 2b00 cmp r3, #0 80054d4: d106 bne.n 80054e4 for (n = 1; n < 100; n++) { 80054d6: 6abb ldr r3, [r7, #40] ; 0x28 80054d8: 3301 adds r3, #1 80054da: 62bb str r3, [r7, #40] ; 0x28 80054dc: 6abb ldr r3, [r7, #40] ; 0x28 80054de: 2b63 cmp r3, #99 ; 0x63 80054e0: d9e5 bls.n 80054ae 80054e2: e000 b.n 80054e6 if (res != FR_OK) break; 80054e4: bf00 nop } if (n == 100) return FR_DENIED; /* Abort if too many collisions */ 80054e6: 6abb ldr r3, [r7, #40] ; 0x28 80054e8: 2b64 cmp r3, #100 ; 0x64 80054ea: d101 bne.n 80054f0 80054ec: 2307 movs r3, #7 80054ee: e09c b.n 800562a if (res != FR_NO_FILE) return res; /* Abort if the result is other than 'not collided' */ 80054f0: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 80054f4: 2b04 cmp r3, #4 80054f6: d002 beq.n 80054fe 80054f8: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 80054fc: e095 b.n 800562a dp->fn[NSFLAG] = sn[NSFLAG]; 80054fe: 7dfa ldrb r2, [r7, #23] 8005500: 687b ldr r3, [r7, #4] 8005502: f883 202f strb.w r2, [r3, #47] ; 0x2f } /* Create an SFN with/without LFNs. */ nent = (sn[NSFLAG] & NS_LFN) ? (nlen + 12) / 13 + 1 : 1; /* Number of entries to allocate */ 8005506: 7dfb ldrb r3, [r7, #23] 8005508: f003 0302 and.w r3, r3, #2 800550c: 2b00 cmp r3, #0 800550e: d007 beq.n 8005520 8005510: 6a7b ldr r3, [r7, #36] ; 0x24 8005512: 330c adds r3, #12 8005514: 4a47 ldr r2, [pc, #284] ; (8005634 ) 8005516: fba2 2303 umull r2, r3, r2, r3 800551a: 089b lsrs r3, r3, #2 800551c: 3301 adds r3, #1 800551e: e000 b.n 8005522 8005520: 2301 movs r3, #1 8005522: 623b str r3, [r7, #32] res = dir_alloc(dp, nent); /* Allocate entries */ 8005524: 6a39 ldr r1, [r7, #32] 8005526: 6878 ldr r0, [r7, #4] 8005528: f7ff fcc0 bl 8004eac 800552c: 4603 mov r3, r0 800552e: f887 302f strb.w r3, [r7, #47] ; 0x2f if (res == FR_OK && --nent) { /* Set LFN entry if needed */ 8005532: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 8005536: 2b00 cmp r3, #0 8005538: d148 bne.n 80055cc 800553a: 6a3b ldr r3, [r7, #32] 800553c: 3b01 subs r3, #1 800553e: 623b str r3, [r7, #32] 8005540: 6a3b ldr r3, [r7, #32] 8005542: 2b00 cmp r3, #0 8005544: d042 beq.n 80055cc res = dir_sdi(dp, dp->dptr - nent * SZDIRE); 8005546: 687b ldr r3, [r7, #4] 8005548: 695a ldr r2, [r3, #20] 800554a: 6a3b ldr r3, [r7, #32] 800554c: 015b lsls r3, r3, #5 800554e: 1ad3 subs r3, r2, r3 8005550: 4619 mov r1, r3 8005552: 6878 ldr r0, [r7, #4] 8005554: f7ff fb4b bl 8004bee 8005558: 4603 mov r3, r0 800555a: f887 302f strb.w r3, [r7, #47] ; 0x2f if (res == FR_OK) { 800555e: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 8005562: 2b00 cmp r3, #0 8005564: d132 bne.n 80055cc sum = sum_sfn(dp->fn); /* Checksum value of the SFN tied to the LFN */ 8005566: 687b ldr r3, [r7, #4] 8005568: 3324 adds r3, #36 ; 0x24 800556a: 4618 mov r0, r3 800556c: f7ff fe8b bl 8005286 8005570: 4603 mov r3, r0 8005572: 76fb strb r3, [r7, #27] do { /* Store LFN entries in bottom first */ res = move_window(fs, dp->sect); 8005574: 687b ldr r3, [r7, #4] 8005576: 69db ldr r3, [r3, #28] 8005578: 4619 mov r1, r3 800557a: 69f8 ldr r0, [r7, #28] 800557c: f7fe ff60 bl 8004440 8005580: 4603 mov r3, r0 8005582: f887 302f strb.w r3, [r7, #47] ; 0x2f if (res != FR_OK) break; 8005586: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 800558a: 2b00 cmp r3, #0 800558c: d11d bne.n 80055ca put_lfn(fs->lfnbuf, dp->dir, (BYTE)nent, sum); 800558e: 69fb ldr r3, [r7, #28] 8005590: 6918 ldr r0, [r3, #16] 8005592: 687b ldr r3, [r7, #4] 8005594: 6a19 ldr r1, [r3, #32] 8005596: 6a3b ldr r3, [r7, #32] 8005598: b2da uxtb r2, r3 800559a: 7efb ldrb r3, [r7, #27] 800559c: f7ff fd7c bl 8005098 fs->wflag = 1; 80055a0: 69fb ldr r3, [r7, #28] 80055a2: 2201 movs r2, #1 80055a4: 70da strb r2, [r3, #3] res = dir_next(dp, 0); /* Next entry */ 80055a6: 2100 movs r1, #0 80055a8: 6878 ldr r0, [r7, #4] 80055aa: f7ff fba9 bl 8004d00 80055ae: 4603 mov r3, r0 80055b0: f887 302f strb.w r3, [r7, #47] ; 0x2f } while (res == FR_OK && --nent); 80055b4: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 80055b8: 2b00 cmp r3, #0 80055ba: d107 bne.n 80055cc 80055bc: 6a3b ldr r3, [r7, #32] 80055be: 3b01 subs r3, #1 80055c0: 623b str r3, [r7, #32] 80055c2: 6a3b ldr r3, [r7, #32] 80055c4: 2b00 cmp r3, #0 80055c6: d1d5 bne.n 8005574 80055c8: e000 b.n 80055cc if (res != FR_OK) break; 80055ca: bf00 nop res = dir_alloc(dp, 1); /* Allocate an entry for SFN */ #endif /* Set SFN entry */ if (res == FR_OK) { 80055cc: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 80055d0: 2b00 cmp r3, #0 80055d2: d128 bne.n 8005626 res = move_window(fs, dp->sect); 80055d4: 687b ldr r3, [r7, #4] 80055d6: 69db ldr r3, [r3, #28] 80055d8: 4619 mov r1, r3 80055da: 69f8 ldr r0, [r7, #28] 80055dc: f7fe ff30 bl 8004440 80055e0: 4603 mov r3, r0 80055e2: f887 302f strb.w r3, [r7, #47] ; 0x2f if (res == FR_OK) { 80055e6: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 80055ea: 2b00 cmp r3, #0 80055ec: d11b bne.n 8005626 mem_set(dp->dir, 0, SZDIRE); /* Clean the entry */ 80055ee: 687b ldr r3, [r7, #4] 80055f0: 6a1b ldr r3, [r3, #32] 80055f2: 2220 movs r2, #32 80055f4: 2100 movs r1, #0 80055f6: 4618 mov r0, r3 80055f8: f7fe fd20 bl 800403c mem_cpy(dp->dir + DIR_Name, dp->fn, 11); /* Put SFN */ 80055fc: 687b ldr r3, [r7, #4] 80055fe: 6a18 ldr r0, [r3, #32] 8005600: 687b ldr r3, [r7, #4] 8005602: 3324 adds r3, #36 ; 0x24 8005604: 220b movs r2, #11 8005606: 4619 mov r1, r3 8005608: f7fe fcf8 bl 8003ffc #if _USE_LFN != 0 dp->dir[DIR_NTres] = dp->fn[NSFLAG] & (NS_BODY | NS_EXT); /* Put NT flag */ 800560c: 687b ldr r3, [r7, #4] 800560e: f893 202f ldrb.w r2, [r3, #47] ; 0x2f 8005612: 687b ldr r3, [r7, #4] 8005614: 6a1b ldr r3, [r3, #32] 8005616: 330c adds r3, #12 8005618: f002 0218 and.w r2, r2, #24 800561c: b2d2 uxtb r2, r2 800561e: 701a strb r2, [r3, #0] #endif fs->wflag = 1; 8005620: 69fb ldr r3, [r7, #28] 8005622: 2201 movs r2, #1 8005624: 70da strb r2, [r3, #3] } } return res; 8005626: f897 302f ldrb.w r3, [r7, #47] ; 0x2f } 800562a: 4618 mov r0, r3 800562c: 3730 adds r7, #48 ; 0x30 800562e: 46bd mov sp, r7 8005630: bd80 pop {r7, pc} 8005632: bf00 nop 8005634: 4ec4ec4f .word 0x4ec4ec4f 08005638 : static FRESULT create_name ( /* FR_OK: successful, FR_INVALID_NAME: could not create */ DIR* dp, /* Pointer to the directory object */ const TCHAR** path /* Pointer to pointer to the segment in the path string */ ) { 8005638: b580 push {r7, lr} 800563a: b08a sub sp, #40 ; 0x28 800563c: af00 add r7, sp, #0 800563e: 6078 str r0, [r7, #4] 8005640: 6039 str r1, [r7, #0] WCHAR w, *lfn; UINT i, ni, si, di; const TCHAR *p; /* Create LFN in Unicode */ p = *path; lfn = dp->obj.fs->lfnbuf; si = di = 0; 8005642: 683b ldr r3, [r7, #0] 8005644: 681b ldr r3, [r3, #0] 8005646: 613b str r3, [r7, #16] 8005648: 687b ldr r3, [r7, #4] 800564a: 681b ldr r3, [r3, #0] 800564c: 691b ldr r3, [r3, #16] 800564e: 60fb str r3, [r7, #12] 8005650: 2300 movs r3, #0 8005652: 617b str r3, [r7, #20] 8005654: 697b ldr r3, [r7, #20] 8005656: 61bb str r3, [r7, #24] for (;;) { w = p[si++]; /* Get a character */ 8005658: 69bb ldr r3, [r7, #24] 800565a: 1c5a adds r2, r3, #1 800565c: 61ba str r2, [r7, #24] 800565e: 693a ldr r2, [r7, #16] 8005660: 4413 add r3, r2 8005662: 781b ldrb r3, [r3, #0] 8005664: 84bb strh r3, [r7, #36] ; 0x24 if (w < ' ') break; /* Break if end of the path name */ 8005666: 8cbb ldrh r3, [r7, #36] ; 0x24 8005668: 2b1f cmp r3, #31 800566a: d940 bls.n 80056ee if (w == '/' || w == '\\') { /* Break if a separator is found */ 800566c: 8cbb ldrh r3, [r7, #36] ; 0x24 800566e: 2b2f cmp r3, #47 ; 0x2f 8005670: d006 beq.n 8005680 8005672: 8cbb ldrh r3, [r7, #36] ; 0x24 8005674: 2b5c cmp r3, #92 ; 0x5c 8005676: d110 bne.n 800569a while (p[si] == '/' || p[si] == '\\') si++; /* Skip duplicated separator if exist */ 8005678: e002 b.n 8005680 800567a: 69bb ldr r3, [r7, #24] 800567c: 3301 adds r3, #1 800567e: 61bb str r3, [r7, #24] 8005680: 693a ldr r2, [r7, #16] 8005682: 69bb ldr r3, [r7, #24] 8005684: 4413 add r3, r2 8005686: 781b ldrb r3, [r3, #0] 8005688: 2b2f cmp r3, #47 ; 0x2f 800568a: d0f6 beq.n 800567a 800568c: 693a ldr r2, [r7, #16] 800568e: 69bb ldr r3, [r7, #24] 8005690: 4413 add r3, r2 8005692: 781b ldrb r3, [r3, #0] 8005694: 2b5c cmp r3, #92 ; 0x5c 8005696: d0f0 beq.n 800567a break; 8005698: e02a b.n 80056f0 } if (di >= _MAX_LFN) return FR_INVALID_NAME; /* Reject too long name */ 800569a: 697b ldr r3, [r7, #20] 800569c: 2bfe cmp r3, #254 ; 0xfe 800569e: d901 bls.n 80056a4 80056a0: 2306 movs r3, #6 80056a2: e177 b.n 8005994 #if !_LFN_UNICODE w &= 0xFF; 80056a4: 8cbb ldrh r3, [r7, #36] ; 0x24 80056a6: b2db uxtb r3, r3 80056a8: 84bb strh r3, [r7, #36] ; 0x24 if (IsDBCS1(w)) { /* Check if it is a DBC 1st byte (always false on SBCS cfg) */ b = (BYTE)p[si++]; /* Get 2nd byte */ w = (w << 8) + b; /* Create a DBC */ if (!IsDBCS2(b)) return FR_INVALID_NAME; /* Reject invalid sequence */ } w = ff_convert(w, 1); /* Convert ANSI/OEM to Unicode */ 80056aa: 8cbb ldrh r3, [r7, #36] ; 0x24 80056ac: 2101 movs r1, #1 80056ae: 4618 mov r0, r3 80056b0: f001 fcac bl 800700c 80056b4: 4603 mov r3, r0 80056b6: 84bb strh r3, [r7, #36] ; 0x24 if (!w) return FR_INVALID_NAME; /* Reject invalid code */ 80056b8: 8cbb ldrh r3, [r7, #36] ; 0x24 80056ba: 2b00 cmp r3, #0 80056bc: d101 bne.n 80056c2 80056be: 2306 movs r3, #6 80056c0: e168 b.n 8005994 #endif if (w < 0x80 && chk_chr("\"*:<>\?|\x7F", w)) return FR_INVALID_NAME; /* Reject illegal characters for LFN */ 80056c2: 8cbb ldrh r3, [r7, #36] ; 0x24 80056c4: 2b7f cmp r3, #127 ; 0x7f 80056c6: d809 bhi.n 80056dc 80056c8: 8cbb ldrh r3, [r7, #36] ; 0x24 80056ca: 4619 mov r1, r3 80056cc: 48b3 ldr r0, [pc, #716] ; (800599c ) 80056ce: f7fe fcf4 bl 80040ba 80056d2: 4603 mov r3, r0 80056d4: 2b00 cmp r3, #0 80056d6: d001 beq.n 80056dc 80056d8: 2306 movs r3, #6 80056da: e15b b.n 8005994 lfn[di++] = w; /* Store the Unicode character */ 80056dc: 697b ldr r3, [r7, #20] 80056de: 1c5a adds r2, r3, #1 80056e0: 617a str r2, [r7, #20] 80056e2: 005b lsls r3, r3, #1 80056e4: 68fa ldr r2, [r7, #12] 80056e6: 4413 add r3, r2 80056e8: 8cba ldrh r2, [r7, #36] ; 0x24 80056ea: 801a strh r2, [r3, #0] w = p[si++]; /* Get a character */ 80056ec: e7b4 b.n 8005658 if (w < ' ') break; /* Break if end of the path name */ 80056ee: bf00 nop } *path = &p[si]; /* Return pointer to the next segment */ 80056f0: 693a ldr r2, [r7, #16] 80056f2: 69bb ldr r3, [r7, #24] 80056f4: 441a add r2, r3 80056f6: 683b ldr r3, [r7, #0] 80056f8: 601a str r2, [r3, #0] cf = (w < ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */ 80056fa: 8cbb ldrh r3, [r7, #36] ; 0x24 80056fc: 2b1f cmp r3, #31 80056fe: d801 bhi.n 8005704 8005700: 2304 movs r3, #4 8005702: e000 b.n 8005706 8005704: 2300 movs r3, #0 8005706: f887 3027 strb.w r3, [r7, #39] ; 0x27 dp->fn[i] = (i < di) ? '.' : ' '; dp->fn[i] = cf | NS_DOT; /* This is a dot entry */ return FR_OK; } #endif while (di) { /* Snip off trailing spaces and dots if exist */ 800570a: e011 b.n 8005730 w = lfn[di - 1]; 800570c: 697b ldr r3, [r7, #20] 800570e: f103 4300 add.w r3, r3, #2147483648 ; 0x80000000 8005712: 3b01 subs r3, #1 8005714: 005b lsls r3, r3, #1 8005716: 68fa ldr r2, [r7, #12] 8005718: 4413 add r3, r2 800571a: 881b ldrh r3, [r3, #0] 800571c: 84bb strh r3, [r7, #36] ; 0x24 if (w != ' ' && w != '.') break; 800571e: 8cbb ldrh r3, [r7, #36] ; 0x24 8005720: 2b20 cmp r3, #32 8005722: d002 beq.n 800572a 8005724: 8cbb ldrh r3, [r7, #36] ; 0x24 8005726: 2b2e cmp r3, #46 ; 0x2e 8005728: d106 bne.n 8005738 di--; 800572a: 697b ldr r3, [r7, #20] 800572c: 3b01 subs r3, #1 800572e: 617b str r3, [r7, #20] while (di) { /* Snip off trailing spaces and dots if exist */ 8005730: 697b ldr r3, [r7, #20] 8005732: 2b00 cmp r3, #0 8005734: d1ea bne.n 800570c 8005736: e000 b.n 800573a if (w != ' ' && w != '.') break; 8005738: bf00 nop } lfn[di] = 0; /* LFN is created */ 800573a: 697b ldr r3, [r7, #20] 800573c: 005b lsls r3, r3, #1 800573e: 68fa ldr r2, [r7, #12] 8005740: 4413 add r3, r2 8005742: 2200 movs r2, #0 8005744: 801a strh r2, [r3, #0] if (di == 0) return FR_INVALID_NAME; /* Reject nul name */ 8005746: 697b ldr r3, [r7, #20] 8005748: 2b00 cmp r3, #0 800574a: d101 bne.n 8005750 800574c: 2306 movs r3, #6 800574e: e121 b.n 8005994 /* Create SFN in directory form */ mem_set(dp->fn, ' ', 11); 8005750: 687b ldr r3, [r7, #4] 8005752: 3324 adds r3, #36 ; 0x24 8005754: 220b movs r2, #11 8005756: 2120 movs r1, #32 8005758: 4618 mov r0, r3 800575a: f7fe fc6f bl 800403c for (si = 0; lfn[si] == ' ' || lfn[si] == '.'; si++) ; /* Strip leading spaces and dots */ 800575e: 2300 movs r3, #0 8005760: 61bb str r3, [r7, #24] 8005762: e002 b.n 800576a 8005764: 69bb ldr r3, [r7, #24] 8005766: 3301 adds r3, #1 8005768: 61bb str r3, [r7, #24] 800576a: 69bb ldr r3, [r7, #24] 800576c: 005b lsls r3, r3, #1 800576e: 68fa ldr r2, [r7, #12] 8005770: 4413 add r3, r2 8005772: 881b ldrh r3, [r3, #0] 8005774: 2b20 cmp r3, #32 8005776: d0f5 beq.n 8005764 8005778: 69bb ldr r3, [r7, #24] 800577a: 005b lsls r3, r3, #1 800577c: 68fa ldr r2, [r7, #12] 800577e: 4413 add r3, r2 8005780: 881b ldrh r3, [r3, #0] 8005782: 2b2e cmp r3, #46 ; 0x2e 8005784: d0ee beq.n 8005764 if (si) cf |= NS_LOSS | NS_LFN; 8005786: 69bb ldr r3, [r7, #24] 8005788: 2b00 cmp r3, #0 800578a: d009 beq.n 80057a0 800578c: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 8005790: f043 0303 orr.w r3, r3, #3 8005794: f887 3027 strb.w r3, [r7, #39] ; 0x27 while (di && lfn[di - 1] != '.') di--; /* Find extension (di<=si: no extension) */ 8005798: e002 b.n 80057a0 800579a: 697b ldr r3, [r7, #20] 800579c: 3b01 subs r3, #1 800579e: 617b str r3, [r7, #20] 80057a0: 697b ldr r3, [r7, #20] 80057a2: 2b00 cmp r3, #0 80057a4: d009 beq.n 80057ba 80057a6: 697b ldr r3, [r7, #20] 80057a8: f103 4300 add.w r3, r3, #2147483648 ; 0x80000000 80057ac: 3b01 subs r3, #1 80057ae: 005b lsls r3, r3, #1 80057b0: 68fa ldr r2, [r7, #12] 80057b2: 4413 add r3, r2 80057b4: 881b ldrh r3, [r3, #0] 80057b6: 2b2e cmp r3, #46 ; 0x2e 80057b8: d1ef bne.n 800579a i = b = 0; ni = 8; 80057ba: 2300 movs r3, #0 80057bc: f887 3026 strb.w r3, [r7, #38] ; 0x26 80057c0: 2300 movs r3, #0 80057c2: 623b str r3, [r7, #32] 80057c4: 2308 movs r3, #8 80057c6: 61fb str r3, [r7, #28] for (;;) { w = lfn[si++]; /* Get an LFN character */ 80057c8: 69bb ldr r3, [r7, #24] 80057ca: 1c5a adds r2, r3, #1 80057cc: 61ba str r2, [r7, #24] 80057ce: 005b lsls r3, r3, #1 80057d0: 68fa ldr r2, [r7, #12] 80057d2: 4413 add r3, r2 80057d4: 881b ldrh r3, [r3, #0] 80057d6: 84bb strh r3, [r7, #36] ; 0x24 if (!w) break; /* Break on end of the LFN */ 80057d8: 8cbb ldrh r3, [r7, #36] ; 0x24 80057da: 2b00 cmp r3, #0 80057dc: f000 8090 beq.w 8005900 if (w == ' ' || (w == '.' && si != di)) { /* Remove spaces and dots */ 80057e0: 8cbb ldrh r3, [r7, #36] ; 0x24 80057e2: 2b20 cmp r3, #32 80057e4: d006 beq.n 80057f4 80057e6: 8cbb ldrh r3, [r7, #36] ; 0x24 80057e8: 2b2e cmp r3, #46 ; 0x2e 80057ea: d10a bne.n 8005802 80057ec: 69ba ldr r2, [r7, #24] 80057ee: 697b ldr r3, [r7, #20] 80057f0: 429a cmp r2, r3 80057f2: d006 beq.n 8005802 cf |= NS_LOSS | NS_LFN; continue; 80057f4: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 80057f8: f043 0303 orr.w r3, r3, #3 80057fc: f887 3027 strb.w r3, [r7, #39] ; 0x27 8005800: e07d b.n 80058fe } if (i >= ni || si == di) { /* Extension or end of SFN */ 8005802: 6a3a ldr r2, [r7, #32] 8005804: 69fb ldr r3, [r7, #28] 8005806: 429a cmp r2, r3 8005808: d203 bcs.n 8005812 800580a: 69ba ldr r2, [r7, #24] 800580c: 697b ldr r3, [r7, #20] 800580e: 429a cmp r2, r3 8005810: d123 bne.n 800585a if (ni == 11) { /* Long extension */ 8005812: 69fb ldr r3, [r7, #28] 8005814: 2b0b cmp r3, #11 8005816: d106 bne.n 8005826 cf |= NS_LOSS | NS_LFN; break; 8005818: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 800581c: f043 0303 orr.w r3, r3, #3 8005820: f887 3027 strb.w r3, [r7, #39] ; 0x27 8005824: e06f b.n 8005906 } if (si != di) cf |= NS_LOSS | NS_LFN; /* Out of 8.3 format */ 8005826: 69ba ldr r2, [r7, #24] 8005828: 697b ldr r3, [r7, #20] 800582a: 429a cmp r2, r3 800582c: d005 beq.n 800583a 800582e: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 8005832: f043 0303 orr.w r3, r3, #3 8005836: f887 3027 strb.w r3, [r7, #39] ; 0x27 if (si > di) break; /* No extension */ 800583a: 69ba ldr r2, [r7, #24] 800583c: 697b ldr r3, [r7, #20] 800583e: 429a cmp r2, r3 8005840: d860 bhi.n 8005904 si = di; i = 8; ni = 11; /* Enter extension section */ 8005842: 697b ldr r3, [r7, #20] 8005844: 61bb str r3, [r7, #24] 8005846: 2308 movs r3, #8 8005848: 623b str r3, [r7, #32] 800584a: 230b movs r3, #11 800584c: 61fb str r3, [r7, #28] b <<= 2; continue; 800584e: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 8005852: 009b lsls r3, r3, #2 8005854: f887 3026 strb.w r3, [r7, #38] ; 0x26 8005858: e051 b.n 80058fe } if (w >= 0x80) { /* Non ASCII character */ 800585a: 8cbb ldrh r3, [r7, #36] ; 0x24 800585c: 2b7f cmp r3, #127 ; 0x7f 800585e: d914 bls.n 800588a #ifdef _EXCVT w = ff_convert(w, 0); /* Unicode -> OEM code */ 8005860: 8cbb ldrh r3, [r7, #36] ; 0x24 8005862: 2100 movs r1, #0 8005864: 4618 mov r0, r3 8005866: f001 fbd1 bl 800700c 800586a: 4603 mov r3, r0 800586c: 84bb strh r3, [r7, #36] ; 0x24 if (w) w = ExCvt[w - 0x80]; /* Convert extended character to upper (SBCS) */ 800586e: 8cbb ldrh r3, [r7, #36] ; 0x24 8005870: 2b00 cmp r3, #0 8005872: d004 beq.n 800587e 8005874: 8cbb ldrh r3, [r7, #36] ; 0x24 8005876: 3b80 subs r3, #128 ; 0x80 8005878: 4a49 ldr r2, [pc, #292] ; (80059a0 ) 800587a: 5cd3 ldrb r3, [r2, r3] 800587c: 84bb strh r3, [r7, #36] ; 0x24 #else w = ff_convert(ff_wtoupper(w), 0); /* Upper converted Unicode -> OEM code */ #endif cf |= NS_LFN; /* Force create LFN entry */ 800587e: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 8005882: f043 0302 orr.w r3, r3, #2 8005886: f887 3027 strb.w r3, [r7, #39] ; 0x27 if (i >= ni - 1) { cf |= NS_LOSS | NS_LFN; i = ni; continue; } dp->fn[i++] = (BYTE)(w >> 8); } else { /* SBC */ if (!w || chk_chr("+,;=[]", w)) { /* Replace illegal characters for SFN */ 800588a: 8cbb ldrh r3, [r7, #36] ; 0x24 800588c: 2b00 cmp r3, #0 800588e: d007 beq.n 80058a0 8005890: 8cbb ldrh r3, [r7, #36] ; 0x24 8005892: 4619 mov r1, r3 8005894: 4843 ldr r0, [pc, #268] ; (80059a4 ) 8005896: f7fe fc10 bl 80040ba 800589a: 4603 mov r3, r0 800589c: 2b00 cmp r3, #0 800589e: d008 beq.n 80058b2 w = '_'; cf |= NS_LOSS | NS_LFN;/* Lossy conversion */ 80058a0: 235f movs r3, #95 ; 0x5f 80058a2: 84bb strh r3, [r7, #36] ; 0x24 80058a4: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 80058a8: f043 0303 orr.w r3, r3, #3 80058ac: f887 3027 strb.w r3, [r7, #39] ; 0x27 80058b0: e01b b.n 80058ea } else { if (IsUpper(w)) { /* ASCII large capital */ 80058b2: 8cbb ldrh r3, [r7, #36] ; 0x24 80058b4: 2b40 cmp r3, #64 ; 0x40 80058b6: d909 bls.n 80058cc 80058b8: 8cbb ldrh r3, [r7, #36] ; 0x24 80058ba: 2b5a cmp r3, #90 ; 0x5a 80058bc: d806 bhi.n 80058cc b |= 2; 80058be: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 80058c2: f043 0302 orr.w r3, r3, #2 80058c6: f887 3026 strb.w r3, [r7, #38] ; 0x26 80058ca: e00e b.n 80058ea } else { if (IsLower(w)) { /* ASCII small capital */ 80058cc: 8cbb ldrh r3, [r7, #36] ; 0x24 80058ce: 2b60 cmp r3, #96 ; 0x60 80058d0: d90b bls.n 80058ea 80058d2: 8cbb ldrh r3, [r7, #36] ; 0x24 80058d4: 2b7a cmp r3, #122 ; 0x7a 80058d6: d808 bhi.n 80058ea b |= 1; w -= 0x20; 80058d8: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 80058dc: f043 0301 orr.w r3, r3, #1 80058e0: f887 3026 strb.w r3, [r7, #38] ; 0x26 80058e4: 8cbb ldrh r3, [r7, #36] ; 0x24 80058e6: 3b20 subs r3, #32 80058e8: 84bb strh r3, [r7, #36] ; 0x24 } } } } dp->fn[i++] = (BYTE)w; 80058ea: 6a3b ldr r3, [r7, #32] 80058ec: 1c5a adds r2, r3, #1 80058ee: 623a str r2, [r7, #32] 80058f0: 8cba ldrh r2, [r7, #36] ; 0x24 80058f2: b2d1 uxtb r1, r2 80058f4: 687a ldr r2, [r7, #4] 80058f6: 4413 add r3, r2 80058f8: 460a mov r2, r1 80058fa: f883 2024 strb.w r2, [r3, #36] ; 0x24 w = lfn[si++]; /* Get an LFN character */ 80058fe: e763 b.n 80057c8 if (!w) break; /* Break on end of the LFN */ 8005900: bf00 nop 8005902: e000 b.n 8005906 if (si > di) break; /* No extension */ 8005904: bf00 nop } if (dp->fn[0] == DDEM) dp->fn[0] = RDDEM; /* If the first character collides with DDEM, replace it with RDDEM */ 8005906: 687b ldr r3, [r7, #4] 8005908: f893 3024 ldrb.w r3, [r3, #36] ; 0x24 800590c: 2be5 cmp r3, #229 ; 0xe5 800590e: d103 bne.n 8005918 8005910: 687b ldr r3, [r7, #4] 8005912: 2205 movs r2, #5 8005914: f883 2024 strb.w r2, [r3, #36] ; 0x24 if (ni == 8) b <<= 2; 8005918: 69fb ldr r3, [r7, #28] 800591a: 2b08 cmp r3, #8 800591c: d104 bne.n 8005928 800591e: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 8005922: 009b lsls r3, r3, #2 8005924: f887 3026 strb.w r3, [r7, #38] ; 0x26 if ((b & 0x0C) == 0x0C || (b & 0x03) == 0x03) cf |= NS_LFN; /* Create LFN entry when there are composite capitals */ 8005928: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 800592c: f003 030c and.w r3, r3, #12 8005930: 2b0c cmp r3, #12 8005932: d005 beq.n 8005940 8005934: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 8005938: f003 0303 and.w r3, r3, #3 800593c: 2b03 cmp r3, #3 800593e: d105 bne.n 800594c 8005940: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 8005944: f043 0302 orr.w r3, r3, #2 8005948: f887 3027 strb.w r3, [r7, #39] ; 0x27 if (!(cf & NS_LFN)) { /* When LFN is in 8.3 format without extended character, NT flags are created */ 800594c: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 8005950: f003 0302 and.w r3, r3, #2 8005954: 2b00 cmp r3, #0 8005956: d117 bne.n 8005988 if ((b & 0x03) == 0x01) cf |= NS_EXT; /* NT flag (Extension has only small capital) */ 8005958: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 800595c: f003 0303 and.w r3, r3, #3 8005960: 2b01 cmp r3, #1 8005962: d105 bne.n 8005970 8005964: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 8005968: f043 0310 orr.w r3, r3, #16 800596c: f887 3027 strb.w r3, [r7, #39] ; 0x27 if ((b & 0x0C) == 0x04) cf |= NS_BODY; /* NT flag (Filename has only small capital) */ 8005970: f897 3026 ldrb.w r3, [r7, #38] ; 0x26 8005974: f003 030c and.w r3, r3, #12 8005978: 2b04 cmp r3, #4 800597a: d105 bne.n 8005988 800597c: f897 3027 ldrb.w r3, [r7, #39] ; 0x27 8005980: f043 0308 orr.w r3, r3, #8 8005984: f887 3027 strb.w r3, [r7, #39] ; 0x27 } dp->fn[NSFLAG] = cf; /* SFN is created */ 8005988: 687b ldr r3, [r7, #4] 800598a: f897 2027 ldrb.w r2, [r7, #39] ; 0x27 800598e: f883 202f strb.w r2, [r3, #47] ; 0x2f return FR_OK; 8005992: 2300 movs r3, #0 if (sfn[0] == DDEM) sfn[0] = RDDEM; /* If the first character collides with DDEM, replace it with RDDEM */ sfn[NSFLAG] = (c <= ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */ return FR_OK; #endif /* _USE_LFN != 0 */ } 8005994: 4618 mov r0, r3 8005996: 3728 adds r7, #40 ; 0x28 8005998: 46bd mov sp, r7 800599a: bd80 pop {r7, pc} 800599c: 08007b18 .word 0x08007b18 80059a0: 08007b84 .word 0x08007b84 80059a4: 08007b24 .word 0x08007b24 080059a8 : static FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */ DIR* dp, /* Directory object to return last directory and found object */ const TCHAR* path /* Full-path string to find a file or directory */ ) { 80059a8: b580 push {r7, lr} 80059aa: b086 sub sp, #24 80059ac: af00 add r7, sp, #0 80059ae: 6078 str r0, [r7, #4] 80059b0: 6039 str r1, [r7, #0] FRESULT res; BYTE ns; _FDID *obj = &dp->obj; 80059b2: 687b ldr r3, [r7, #4] 80059b4: 613b str r3, [r7, #16] FATFS *fs = obj->fs; 80059b6: 693b ldr r3, [r7, #16] 80059b8: 681b ldr r3, [r3, #0] 80059ba: 60fb str r3, [r7, #12] if (*path != '/' && *path != '\\') { /* Without heading separator */ obj->sclust = fs->cdir; /* Start from current directory */ } else #endif { /* With heading separator */ while (*path == '/' || *path == '\\') path++; /* Strip heading separator */ 80059bc: e002 b.n 80059c4 80059be: 683b ldr r3, [r7, #0] 80059c0: 3301 adds r3, #1 80059c2: 603b str r3, [r7, #0] 80059c4: 683b ldr r3, [r7, #0] 80059c6: 781b ldrb r3, [r3, #0] 80059c8: 2b2f cmp r3, #47 ; 0x2f 80059ca: d0f8 beq.n 80059be 80059cc: 683b ldr r3, [r7, #0] 80059ce: 781b ldrb r3, [r3, #0] 80059d0: 2b5c cmp r3, #92 ; 0x5c 80059d2: d0f4 beq.n 80059be obj->sclust = 0; /* Start from root directory */ 80059d4: 693b ldr r3, [r7, #16] 80059d6: 2200 movs r2, #0 80059d8: 609a str r2, [r3, #8] obj->stat = fs->dirbuf[XDIR_GenFlags] & 2; } #endif #endif if ((UINT)*path < ' ') { /* Null path name is the origin directory itself */ 80059da: 683b ldr r3, [r7, #0] 80059dc: 781b ldrb r3, [r3, #0] 80059de: 2b1f cmp r3, #31 80059e0: d80a bhi.n 80059f8 dp->fn[NSFLAG] = NS_NONAME; 80059e2: 687b ldr r3, [r7, #4] 80059e4: 2280 movs r2, #128 ; 0x80 80059e6: f883 202f strb.w r2, [r3, #47] ; 0x2f res = dir_sdi(dp, 0); 80059ea: 2100 movs r1, #0 80059ec: 6878 ldr r0, [r7, #4] 80059ee: f7ff f8fe bl 8004bee 80059f2: 4603 mov r3, r0 80059f4: 75fb strb r3, [r7, #23] 80059f6: e048 b.n 8005a8a } else { /* Follow path */ for (;;) { res = create_name(dp, &path); /* Get a segment name of the path */ 80059f8: 463b mov r3, r7 80059fa: 4619 mov r1, r3 80059fc: 6878 ldr r0, [r7, #4] 80059fe: f7ff fe1b bl 8005638 8005a02: 4603 mov r3, r0 8005a04: 75fb strb r3, [r7, #23] if (res != FR_OK) break; 8005a06: 7dfb ldrb r3, [r7, #23] 8005a08: 2b00 cmp r3, #0 8005a0a: d139 bne.n 8005a80 res = dir_find(dp); /* Find an object with the segment name */ 8005a0c: 6878 ldr r0, [r7, #4] 8005a0e: f7ff fc5a bl 80052c6 8005a12: 4603 mov r3, r0 8005a14: 75fb strb r3, [r7, #23] ns = dp->fn[NSFLAG]; 8005a16: 687b ldr r3, [r7, #4] 8005a18: f893 302f ldrb.w r3, [r3, #47] ; 0x2f 8005a1c: 72fb strb r3, [r7, #11] if (res != FR_OK) { /* Failed to find the object */ 8005a1e: 7dfb ldrb r3, [r7, #23] 8005a20: 2b00 cmp r3, #0 8005a22: d00a beq.n 8005a3a if (res == FR_NO_FILE) { /* Object is not found */ 8005a24: 7dfb ldrb r3, [r7, #23] 8005a26: 2b04 cmp r3, #4 8005a28: d12c bne.n 8005a84 if (_FS_RPATH && (ns & NS_DOT)) { /* If dot entry is not exist, stay there */ if (!(ns & NS_LAST)) continue; /* Continue to follow if not last segment */ dp->fn[NSFLAG] = NS_NONAME; res = FR_OK; } else { /* Could not find the object */ if (!(ns & NS_LAST)) res = FR_NO_PATH; /* Adjust error code if not last segment */ 8005a2a: 7afb ldrb r3, [r7, #11] 8005a2c: f003 0304 and.w r3, r3, #4 8005a30: 2b00 cmp r3, #0 8005a32: d127 bne.n 8005a84 8005a34: 2305 movs r3, #5 8005a36: 75fb strb r3, [r7, #23] } } break; 8005a38: e024 b.n 8005a84 } if (ns & NS_LAST) break; /* Last segment matched. Function completed. */ 8005a3a: 7afb ldrb r3, [r7, #11] 8005a3c: f003 0304 and.w r3, r3, #4 8005a40: 2b00 cmp r3, #0 8005a42: d121 bne.n 8005a88 /* Get into the sub-directory */ if (!(obj->attr & AM_DIR)) { /* It is not a sub-directory and cannot follow */ 8005a44: 693b ldr r3, [r7, #16] 8005a46: 799b ldrb r3, [r3, #6] 8005a48: f003 0310 and.w r3, r3, #16 8005a4c: 2b00 cmp r3, #0 8005a4e: d102 bne.n 8005a56 res = FR_NO_PATH; break; 8005a50: 2305 movs r3, #5 8005a52: 75fb strb r3, [r7, #23] 8005a54: e019 b.n 8005a8a obj->stat = fs->dirbuf[XDIR_GenFlags] & 2; obj->objsize = ld_qword(fs->dirbuf + XDIR_FileSize); } else #endif { obj->sclust = ld_clust(fs, fs->win + dp->dptr % SS(fs)); /* Open next directory */ 8005a56: 68fb ldr r3, [r7, #12] 8005a58: f103 0138 add.w r1, r3, #56 ; 0x38 8005a5c: 687b ldr r3, [r7, #4] 8005a5e: 695b ldr r3, [r3, #20] 8005a60: 68fa ldr r2, [r7, #12] 8005a62: 8992 ldrh r2, [r2, #12] 8005a64: fbb3 f0f2 udiv r0, r3, r2 8005a68: fb02 f200 mul.w r2, r2, r0 8005a6c: 1a9b subs r3, r3, r2 8005a6e: 440b add r3, r1 8005a70: 4619 mov r1, r3 8005a72: 68f8 ldr r0, [r7, #12] 8005a74: f7ff fa61 bl 8004f3a 8005a78: 4602 mov r2, r0 8005a7a: 693b ldr r3, [r7, #16] 8005a7c: 609a str r2, [r3, #8] res = create_name(dp, &path); /* Get a segment name of the path */ 8005a7e: e7bb b.n 80059f8 if (res != FR_OK) break; 8005a80: bf00 nop 8005a82: e002 b.n 8005a8a break; 8005a84: bf00 nop 8005a86: e000 b.n 8005a8a if (ns & NS_LAST) break; /* Last segment matched. Function completed. */ 8005a88: bf00 nop } } } return res; 8005a8a: 7dfb ldrb r3, [r7, #23] } 8005a8c: 4618 mov r0, r3 8005a8e: 3718 adds r7, #24 8005a90: 46bd mov sp, r7 8005a92: bd80 pop {r7, pc} 08005a94 : static int get_ldnumber ( /* Returns logical drive number (-1:invalid drive) */ const TCHAR** path /* Pointer to pointer to the path name */ ) { 8005a94: b480 push {r7} 8005a96: b087 sub sp, #28 8005a98: af00 add r7, sp, #0 8005a9a: 6078 str r0, [r7, #4] const TCHAR *tp, *tt; UINT i; int vol = -1; 8005a9c: f04f 33ff mov.w r3, #4294967295 8005aa0: 613b str r3, [r7, #16] char c; TCHAR tc; #endif if (*path) { /* If the pointer is not a null */ 8005aa2: 687b ldr r3, [r7, #4] 8005aa4: 681b ldr r3, [r3, #0] 8005aa6: 2b00 cmp r3, #0 8005aa8: d031 beq.n 8005b0e for (tt = *path; (UINT)*tt >= (_USE_LFN ? ' ' : '!') && *tt != ':'; tt++) ; /* Find ':' in the path */ 8005aaa: 687b ldr r3, [r7, #4] 8005aac: 681b ldr r3, [r3, #0] 8005aae: 617b str r3, [r7, #20] 8005ab0: e002 b.n 8005ab8 8005ab2: 697b ldr r3, [r7, #20] 8005ab4: 3301 adds r3, #1 8005ab6: 617b str r3, [r7, #20] 8005ab8: 697b ldr r3, [r7, #20] 8005aba: 781b ldrb r3, [r3, #0] 8005abc: 2b1f cmp r3, #31 8005abe: d903 bls.n 8005ac8 8005ac0: 697b ldr r3, [r7, #20] 8005ac2: 781b ldrb r3, [r3, #0] 8005ac4: 2b3a cmp r3, #58 ; 0x3a 8005ac6: d1f4 bne.n 8005ab2 if (*tt == ':') { /* If a ':' is exist in the path name */ 8005ac8: 697b ldr r3, [r7, #20] 8005aca: 781b ldrb r3, [r3, #0] 8005acc: 2b3a cmp r3, #58 ; 0x3a 8005ace: d11c bne.n 8005b0a tp = *path; 8005ad0: 687b ldr r3, [r7, #4] 8005ad2: 681b ldr r3, [r3, #0] 8005ad4: 60fb str r3, [r7, #12] i = *tp++ - '0'; 8005ad6: 68fb ldr r3, [r7, #12] 8005ad8: 1c5a adds r2, r3, #1 8005ada: 60fa str r2, [r7, #12] 8005adc: 781b ldrb r3, [r3, #0] 8005ade: 3b30 subs r3, #48 ; 0x30 8005ae0: 60bb str r3, [r7, #8] if (i < 10 && tp == tt) { /* Is there a numeric drive id? */ 8005ae2: 68bb ldr r3, [r7, #8] 8005ae4: 2b09 cmp r3, #9 8005ae6: d80e bhi.n 8005b06 8005ae8: 68fa ldr r2, [r7, #12] 8005aea: 697b ldr r3, [r7, #20] 8005aec: 429a cmp r2, r3 8005aee: d10a bne.n 8005b06 if (i < _VOLUMES) { /* If a drive id is found, get the value and strip it */ 8005af0: 68bb ldr r3, [r7, #8] 8005af2: 2b00 cmp r3, #0 8005af4: d107 bne.n 8005b06 vol = (int)i; 8005af6: 68bb ldr r3, [r7, #8] 8005af8: 613b str r3, [r7, #16] *path = ++tt; 8005afa: 697b ldr r3, [r7, #20] 8005afc: 3301 adds r3, #1 8005afe: 617b str r3, [r7, #20] 8005b00: 687b ldr r3, [r7, #4] 8005b02: 697a ldr r2, [r7, #20] 8005b04: 601a str r2, [r3, #0] vol = (int)i; *path = tt; } } #endif return vol; 8005b06: 693b ldr r3, [r7, #16] 8005b08: e002 b.n 8005b10 } #if _FS_RPATH != 0 && _VOLUMES >= 2 vol = CurrVol; /* Current drive */ #else vol = 0; /* Drive 0 */ 8005b0a: 2300 movs r3, #0 8005b0c: 613b str r3, [r7, #16] #endif } return vol; 8005b0e: 693b ldr r3, [r7, #16] } 8005b10: 4618 mov r0, r3 8005b12: 371c adds r7, #28 8005b14: 46bd mov sp, r7 8005b16: bc80 pop {r7} 8005b18: 4770 bx lr ... 08005b1c : static BYTE check_fs ( /* 0:FAT, 1:exFAT, 2:Valid BS but not FAT, 3:Not a BS, 4:Disk error */ FATFS* fs, /* File system object */ DWORD sect /* Sector# (lba) to load and check if it is an FAT-VBR or not */ ) { 8005b1c: b580 push {r7, lr} 8005b1e: b082 sub sp, #8 8005b20: af00 add r7, sp, #0 8005b22: 6078 str r0, [r7, #4] 8005b24: 6039 str r1, [r7, #0] fs->wflag = 0; fs->winsect = 0xFFFFFFFF; /* Invaidate window */ 8005b26: 687b ldr r3, [r7, #4] 8005b28: 2200 movs r2, #0 8005b2a: 70da strb r2, [r3, #3] 8005b2c: 687b ldr r3, [r7, #4] 8005b2e: f04f 32ff mov.w r2, #4294967295 8005b32: 635a str r2, [r3, #52] ; 0x34 if (move_window(fs, sect) != FR_OK) return 4; /* Load boot record */ 8005b34: 6839 ldr r1, [r7, #0] 8005b36: 6878 ldr r0, [r7, #4] 8005b38: f7fe fc82 bl 8004440 8005b3c: 4603 mov r3, r0 8005b3e: 2b00 cmp r3, #0 8005b40: d001 beq.n 8005b46 8005b42: 2304 movs r3, #4 8005b44: e038 b.n 8005bb8 if (ld_word(fs->win + BS_55AA) != 0xAA55) return 3; /* Check boot record signature (always placed here even if the sector size is >512) */ 8005b46: 687b ldr r3, [r7, #4] 8005b48: 3338 adds r3, #56 ; 0x38 8005b4a: f503 73ff add.w r3, r3, #510 ; 0x1fe 8005b4e: 4618 mov r0, r3 8005b50: f7fe f9d6 bl 8003f00 8005b54: 4603 mov r3, r0 8005b56: 461a mov r2, r3 8005b58: f64a 2355 movw r3, #43605 ; 0xaa55 8005b5c: 429a cmp r2, r3 8005b5e: d001 beq.n 8005b64 8005b60: 2303 movs r3, #3 8005b62: e029 b.n 8005bb8 if (fs->win[BS_JmpBoot] == 0xE9 || (fs->win[BS_JmpBoot] == 0xEB && fs->win[BS_JmpBoot + 2] == 0x90)) { 8005b64: 687b ldr r3, [r7, #4] 8005b66: f893 3038 ldrb.w r3, [r3, #56] ; 0x38 8005b6a: 2be9 cmp r3, #233 ; 0xe9 8005b6c: d009 beq.n 8005b82 8005b6e: 687b ldr r3, [r7, #4] 8005b70: f893 3038 ldrb.w r3, [r3, #56] ; 0x38 8005b74: 2beb cmp r3, #235 ; 0xeb 8005b76: d11e bne.n 8005bb6 8005b78: 687b ldr r3, [r7, #4] 8005b7a: f893 303a ldrb.w r3, [r3, #58] ; 0x3a 8005b7e: 2b90 cmp r3, #144 ; 0x90 8005b80: d119 bne.n 8005bb6 if ((ld_dword(fs->win + BS_FilSysType) & 0xFFFFFF) == 0x544146) return 0; /* Check "FAT" string */ 8005b82: 687b ldr r3, [r7, #4] 8005b84: 3338 adds r3, #56 ; 0x38 8005b86: 3336 adds r3, #54 ; 0x36 8005b88: 4618 mov r0, r3 8005b8a: f7fe f9d0 bl 8003f2e 8005b8e: 4603 mov r3, r0 8005b90: f023 437f bic.w r3, r3, #4278190080 ; 0xff000000 8005b94: 4a0a ldr r2, [pc, #40] ; (8005bc0 ) 8005b96: 4293 cmp r3, r2 8005b98: d101 bne.n 8005b9e 8005b9a: 2300 movs r3, #0 8005b9c: e00c b.n 8005bb8 if (ld_dword(fs->win + BS_FilSysType32) == 0x33544146) return 0; /* Check "FAT3" string */ 8005b9e: 687b ldr r3, [r7, #4] 8005ba0: 3338 adds r3, #56 ; 0x38 8005ba2: 3352 adds r3, #82 ; 0x52 8005ba4: 4618 mov r0, r3 8005ba6: f7fe f9c2 bl 8003f2e 8005baa: 4602 mov r2, r0 8005bac: 4b05 ldr r3, [pc, #20] ; (8005bc4 ) 8005bae: 429a cmp r2, r3 8005bb0: d101 bne.n 8005bb6 8005bb2: 2300 movs r3, #0 8005bb4: e000 b.n 8005bb8 } #if _FS_EXFAT if (!mem_cmp(fs->win + BS_JmpBoot, "\xEB\x76\x90" "EXFAT ", 11)) return 1; #endif return 2; 8005bb6: 2302 movs r3, #2 } 8005bb8: 4618 mov r0, r3 8005bba: 3708 adds r7, #8 8005bbc: 46bd mov sp, r7 8005bbe: bd80 pop {r7, pc} 8005bc0: 00544146 .word 0x00544146 8005bc4: 33544146 .word 0x33544146 08005bc8 : FRESULT find_volume ( /* FR_OK(0): successful, !=0: any error occurred */ const TCHAR** path, /* Pointer to pointer to the path name (drive number) */ FATFS** rfs, /* Pointer to pointer to the found file system object */ BYTE mode /* !=0: Check write protection for write access */ ) { 8005bc8: b580 push {r7, lr} 8005bca: b096 sub sp, #88 ; 0x58 8005bcc: af00 add r7, sp, #0 8005bce: 60f8 str r0, [r7, #12] 8005bd0: 60b9 str r1, [r7, #8] 8005bd2: 4613 mov r3, r2 8005bd4: 71fb strb r3, [r7, #7] FATFS *fs; UINT i; /* Get logical drive number */ *rfs = 0; 8005bd6: 68bb ldr r3, [r7, #8] 8005bd8: 2200 movs r2, #0 8005bda: 601a str r2, [r3, #0] vol = get_ldnumber(path); 8005bdc: 68f8 ldr r0, [r7, #12] 8005bde: f7ff ff59 bl 8005a94 8005be2: 63f8 str r0, [r7, #60] ; 0x3c if (vol < 0) return FR_INVALID_DRIVE; 8005be4: 6bfb ldr r3, [r7, #60] ; 0x3c 8005be6: 2b00 cmp r3, #0 8005be8: da01 bge.n 8005bee 8005bea: 230b movs r3, #11 8005bec: e268 b.n 80060c0 /* Check if the file system object is valid or not */ fs = FatFs[vol]; /* Get pointer to the file system object */ 8005bee: 4ab0 ldr r2, [pc, #704] ; (8005eb0 ) 8005bf0: 6bfb ldr r3, [r7, #60] ; 0x3c 8005bf2: f852 3023 ldr.w r3, [r2, r3, lsl #2] 8005bf6: 63bb str r3, [r7, #56] ; 0x38 if (!fs) return FR_NOT_ENABLED; /* Is the file system object available? */ 8005bf8: 6bbb ldr r3, [r7, #56] ; 0x38 8005bfa: 2b00 cmp r3, #0 8005bfc: d101 bne.n 8005c02 8005bfe: 230c movs r3, #12 8005c00: e25e b.n 80060c0 ENTER_FF(fs); /* Lock the volume */ *rfs = fs; /* Return pointer to the file system object */ 8005c02: 68bb ldr r3, [r7, #8] 8005c04: 6bba ldr r2, [r7, #56] ; 0x38 8005c06: 601a str r2, [r3, #0] mode &= (BYTE)~FA_READ; /* Desired access mode, write access or not */ 8005c08: 79fb ldrb r3, [r7, #7] 8005c0a: f023 0301 bic.w r3, r3, #1 8005c0e: 71fb strb r3, [r7, #7] if (fs->fs_type) { /* If the volume has been mounted */ 8005c10: 6bbb ldr r3, [r7, #56] ; 0x38 8005c12: 781b ldrb r3, [r3, #0] 8005c14: 2b00 cmp r3, #0 8005c16: d01a beq.n 8005c4e stat = disk_status(fs->drv); 8005c18: 6bbb ldr r3, [r7, #56] ; 0x38 8005c1a: 785b ldrb r3, [r3, #1] 8005c1c: 4618 mov r0, r3 8005c1e: f7fe f8d1 bl 8003dc4 8005c22: 4603 mov r3, r0 8005c24: f887 3037 strb.w r3, [r7, #55] ; 0x37 if (!(stat & STA_NOINIT)) { /* and the physical drive is kept initialized */ 8005c28: f897 3037 ldrb.w r3, [r7, #55] ; 0x37 8005c2c: f003 0301 and.w r3, r3, #1 8005c30: 2b00 cmp r3, #0 8005c32: d10c bne.n 8005c4e if (!_FS_READONLY && mode && (stat & STA_PROTECT)) { /* Check write protection if needed */ 8005c34: 79fb ldrb r3, [r7, #7] 8005c36: 2b00 cmp r3, #0 8005c38: d007 beq.n 8005c4a 8005c3a: f897 3037 ldrb.w r3, [r7, #55] ; 0x37 8005c3e: f003 0304 and.w r3, r3, #4 8005c42: 2b00 cmp r3, #0 8005c44: d001 beq.n 8005c4a return FR_WRITE_PROTECTED; 8005c46: 230a movs r3, #10 8005c48: e23a b.n 80060c0 } return FR_OK; /* The file system object is valid */ 8005c4a: 2300 movs r3, #0 8005c4c: e238 b.n 80060c0 } /* The file system object is not valid. */ /* Following code attempts to mount the volume. (analyze BPB and initialize the fs object) */ fs->fs_type = 0; /* Clear the file system object */ 8005c4e: 6bbb ldr r3, [r7, #56] ; 0x38 8005c50: 2200 movs r2, #0 8005c52: 701a strb r2, [r3, #0] fs->drv = LD2PD(vol); /* Bind the logical drive and a physical drive */ 8005c54: 6bfb ldr r3, [r7, #60] ; 0x3c 8005c56: b2da uxtb r2, r3 8005c58: 6bbb ldr r3, [r7, #56] ; 0x38 8005c5a: 705a strb r2, [r3, #1] stat = disk_initialize(fs->drv); /* Initialize the physical drive */ 8005c5c: 6bbb ldr r3, [r7, #56] ; 0x38 8005c5e: 785b ldrb r3, [r3, #1] 8005c60: 4618 mov r0, r3 8005c62: f7fe f8c9 bl 8003df8 8005c66: 4603 mov r3, r0 8005c68: f887 3037 strb.w r3, [r7, #55] ; 0x37 if (stat & STA_NOINIT) { /* Check if the initialization succeeded */ 8005c6c: f897 3037 ldrb.w r3, [r7, #55] ; 0x37 8005c70: f003 0301 and.w r3, r3, #1 8005c74: 2b00 cmp r3, #0 8005c76: d001 beq.n 8005c7c return FR_NOT_READY; /* Failed to initialize due to no medium or hard error */ 8005c78: 2303 movs r3, #3 8005c7a: e221 b.n 80060c0 } if (!_FS_READONLY && mode && (stat & STA_PROTECT)) { /* Check disk write protection if needed */ 8005c7c: 79fb ldrb r3, [r7, #7] 8005c7e: 2b00 cmp r3, #0 8005c80: d007 beq.n 8005c92 8005c82: f897 3037 ldrb.w r3, [r7, #55] ; 0x37 8005c86: f003 0304 and.w r3, r3, #4 8005c8a: 2b00 cmp r3, #0 8005c8c: d001 beq.n 8005c92 return FR_WRITE_PROTECTED; 8005c8e: 230a movs r3, #10 8005c90: e216 b.n 80060c0 } #if _MAX_SS != _MIN_SS /* Get sector size (multiple sector size cfg only) */ if (disk_ioctl(fs->drv, GET_SECTOR_SIZE, &SS(fs)) != RES_OK) return FR_DISK_ERR; 8005c92: 6bbb ldr r3, [r7, #56] ; 0x38 8005c94: 7858 ldrb r0, [r3, #1] 8005c96: 6bbb ldr r3, [r7, #56] ; 0x38 8005c98: 330c adds r3, #12 8005c9a: 461a mov r2, r3 8005c9c: 2102 movs r1, #2 8005c9e: f7fe f911 bl 8003ec4 8005ca2: 4603 mov r3, r0 8005ca4: 2b00 cmp r3, #0 8005ca6: d001 beq.n 8005cac 8005ca8: 2301 movs r3, #1 8005caa: e209 b.n 80060c0 if (SS(fs) > _MAX_SS || SS(fs) < _MIN_SS || (SS(fs) & (SS(fs) - 1))) return FR_DISK_ERR; 8005cac: 6bbb ldr r3, [r7, #56] ; 0x38 8005cae: 899b ldrh r3, [r3, #12] 8005cb0: f5b3 5f80 cmp.w r3, #4096 ; 0x1000 8005cb4: d80d bhi.n 8005cd2 8005cb6: 6bbb ldr r3, [r7, #56] ; 0x38 8005cb8: 899b ldrh r3, [r3, #12] 8005cba: f5b3 7f00 cmp.w r3, #512 ; 0x200 8005cbe: d308 bcc.n 8005cd2 8005cc0: 6bbb ldr r3, [r7, #56] ; 0x38 8005cc2: 899b ldrh r3, [r3, #12] 8005cc4: 461a mov r2, r3 8005cc6: 6bbb ldr r3, [r7, #56] ; 0x38 8005cc8: 899b ldrh r3, [r3, #12] 8005cca: 3b01 subs r3, #1 8005ccc: 4013 ands r3, r2 8005cce: 2b00 cmp r3, #0 8005cd0: d001 beq.n 8005cd6 8005cd2: 2301 movs r3, #1 8005cd4: e1f4 b.n 80060c0 #endif /* Find an FAT partition on the drive. Supports only generic partitioning rules, FDISK and SFD. */ bsect = 0; 8005cd6: 2300 movs r3, #0 8005cd8: 653b str r3, [r7, #80] ; 0x50 fmt = check_fs(fs, bsect); /* Load sector 0 and check if it is an FAT-VBR as SFD */ 8005cda: 6d39 ldr r1, [r7, #80] ; 0x50 8005cdc: 6bb8 ldr r0, [r7, #56] ; 0x38 8005cde: f7ff ff1d bl 8005b1c 8005ce2: 4603 mov r3, r0 8005ce4: f887 3057 strb.w r3, [r7, #87] ; 0x57 if (fmt == 2 || (fmt < 2 && LD2PT(vol) != 0)) { /* Not an FAT-VBR or forced partition number */ 8005ce8: f897 3057 ldrb.w r3, [r7, #87] ; 0x57 8005cec: 2b02 cmp r3, #2 8005cee: d14b bne.n 8005d88 for (i = 0; i < 4; i++) { /* Get partition offset */ 8005cf0: 2300 movs r3, #0 8005cf2: 643b str r3, [r7, #64] ; 0x40 8005cf4: e01f b.n 8005d36 pt = fs->win + (MBR_Table + i * SZ_PTE); 8005cf6: 6bbb ldr r3, [r7, #56] ; 0x38 8005cf8: f103 0238 add.w r2, r3, #56 ; 0x38 8005cfc: 6c3b ldr r3, [r7, #64] ; 0x40 8005cfe: 011b lsls r3, r3, #4 8005d00: f503 73df add.w r3, r3, #446 ; 0x1be 8005d04: 4413 add r3, r2 8005d06: 633b str r3, [r7, #48] ; 0x30 br[i] = pt[PTE_System] ? ld_dword(pt + PTE_StLba) : 0; 8005d08: 6b3b ldr r3, [r7, #48] ; 0x30 8005d0a: 3304 adds r3, #4 8005d0c: 781b ldrb r3, [r3, #0] 8005d0e: 2b00 cmp r3, #0 8005d10: d006 beq.n 8005d20 8005d12: 6b3b ldr r3, [r7, #48] ; 0x30 8005d14: 3308 adds r3, #8 8005d16: 4618 mov r0, r3 8005d18: f7fe f909 bl 8003f2e 8005d1c: 4602 mov r2, r0 8005d1e: e000 b.n 8005d22 8005d20: 2200 movs r2, #0 8005d22: 6c3b ldr r3, [r7, #64] ; 0x40 8005d24: 009b lsls r3, r3, #2 8005d26: f107 0158 add.w r1, r7, #88 ; 0x58 8005d2a: 440b add r3, r1 8005d2c: f843 2c44 str.w r2, [r3, #-68] for (i = 0; i < 4; i++) { /* Get partition offset */ 8005d30: 6c3b ldr r3, [r7, #64] ; 0x40 8005d32: 3301 adds r3, #1 8005d34: 643b str r3, [r7, #64] ; 0x40 8005d36: 6c3b ldr r3, [r7, #64] ; 0x40 8005d38: 2b03 cmp r3, #3 8005d3a: d9dc bls.n 8005cf6 } i = LD2PT(vol); /* Partition number: 0:auto, 1-4:forced */ 8005d3c: 2300 movs r3, #0 8005d3e: 643b str r3, [r7, #64] ; 0x40 if (i) i--; 8005d40: 6c3b ldr r3, [r7, #64] ; 0x40 8005d42: 2b00 cmp r3, #0 8005d44: d002 beq.n 8005d4c 8005d46: 6c3b ldr r3, [r7, #64] ; 0x40 8005d48: 3b01 subs r3, #1 8005d4a: 643b str r3, [r7, #64] ; 0x40 do { /* Find an FAT volume */ bsect = br[i]; 8005d4c: 6c3b ldr r3, [r7, #64] ; 0x40 8005d4e: 009b lsls r3, r3, #2 8005d50: f107 0258 add.w r2, r7, #88 ; 0x58 8005d54: 4413 add r3, r2 8005d56: f853 3c44 ldr.w r3, [r3, #-68] 8005d5a: 653b str r3, [r7, #80] ; 0x50 fmt = bsect ? check_fs(fs, bsect) : 3; /* Check the partition */ 8005d5c: 6d3b ldr r3, [r7, #80] ; 0x50 8005d5e: 2b00 cmp r3, #0 8005d60: d005 beq.n 8005d6e 8005d62: 6d39 ldr r1, [r7, #80] ; 0x50 8005d64: 6bb8 ldr r0, [r7, #56] ; 0x38 8005d66: f7ff fed9 bl 8005b1c 8005d6a: 4603 mov r3, r0 8005d6c: e000 b.n 8005d70 8005d6e: 2303 movs r3, #3 8005d70: f887 3057 strb.w r3, [r7, #87] ; 0x57 } while (LD2PT(vol) == 0 && fmt >= 2 && ++i < 4); 8005d74: f897 3057 ldrb.w r3, [r7, #87] ; 0x57 8005d78: 2b01 cmp r3, #1 8005d7a: d905 bls.n 8005d88 8005d7c: 6c3b ldr r3, [r7, #64] ; 0x40 8005d7e: 3301 adds r3, #1 8005d80: 643b str r3, [r7, #64] ; 0x40 8005d82: 6c3b ldr r3, [r7, #64] ; 0x40 8005d84: 2b03 cmp r3, #3 8005d86: d9e1 bls.n 8005d4c } if (fmt == 4) return FR_DISK_ERR; /* An error occured in the disk I/O layer */ 8005d88: f897 3057 ldrb.w r3, [r7, #87] ; 0x57 8005d8c: 2b04 cmp r3, #4 8005d8e: d101 bne.n 8005d94 8005d90: 2301 movs r3, #1 8005d92: e195 b.n 80060c0 if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */ 8005d94: f897 3057 ldrb.w r3, [r7, #87] ; 0x57 8005d98: 2b01 cmp r3, #1 8005d9a: d901 bls.n 8005da0 8005d9c: 230d movs r3, #13 8005d9e: e18f b.n 80060c0 #endif fmt = FS_EXFAT; /* FAT sub-type */ } else #endif /* _FS_EXFAT */ { if (ld_word(fs->win + BPB_BytsPerSec) != SS(fs)) return FR_NO_FILESYSTEM; /* (BPB_BytsPerSec must be equal to the physical sector size) */ 8005da0: 6bbb ldr r3, [r7, #56] ; 0x38 8005da2: 3338 adds r3, #56 ; 0x38 8005da4: 330b adds r3, #11 8005da6: 4618 mov r0, r3 8005da8: f7fe f8aa bl 8003f00 8005dac: 4603 mov r3, r0 8005dae: 461a mov r2, r3 8005db0: 6bbb ldr r3, [r7, #56] ; 0x38 8005db2: 899b ldrh r3, [r3, #12] 8005db4: 429a cmp r2, r3 8005db6: d001 beq.n 8005dbc 8005db8: 230d movs r3, #13 8005dba: e181 b.n 80060c0 fasize = ld_word(fs->win + BPB_FATSz16); /* Number of sectors per FAT */ 8005dbc: 6bbb ldr r3, [r7, #56] ; 0x38 8005dbe: 3338 adds r3, #56 ; 0x38 8005dc0: 3316 adds r3, #22 8005dc2: 4618 mov r0, r3 8005dc4: f7fe f89c bl 8003f00 8005dc8: 4603 mov r3, r0 8005dca: 64fb str r3, [r7, #76] ; 0x4c if (fasize == 0) fasize = ld_dword(fs->win + BPB_FATSz32); 8005dcc: 6cfb ldr r3, [r7, #76] ; 0x4c 8005dce: 2b00 cmp r3, #0 8005dd0: d106 bne.n 8005de0 8005dd2: 6bbb ldr r3, [r7, #56] ; 0x38 8005dd4: 3338 adds r3, #56 ; 0x38 8005dd6: 3324 adds r3, #36 ; 0x24 8005dd8: 4618 mov r0, r3 8005dda: f7fe f8a8 bl 8003f2e 8005dde: 64f8 str r0, [r7, #76] ; 0x4c fs->fsize = fasize; 8005de0: 6bbb ldr r3, [r7, #56] ; 0x38 8005de2: 6cfa ldr r2, [r7, #76] ; 0x4c 8005de4: 621a str r2, [r3, #32] fs->n_fats = fs->win[BPB_NumFATs]; /* Number of FATs */ 8005de6: 6bbb ldr r3, [r7, #56] ; 0x38 8005de8: f893 2048 ldrb.w r2, [r3, #72] ; 0x48 8005dec: 6bbb ldr r3, [r7, #56] ; 0x38 8005dee: 709a strb r2, [r3, #2] if (fs->n_fats != 1 && fs->n_fats != 2) return FR_NO_FILESYSTEM; /* (Must be 1 or 2) */ 8005df0: 6bbb ldr r3, [r7, #56] ; 0x38 8005df2: 789b ldrb r3, [r3, #2] 8005df4: 2b01 cmp r3, #1 8005df6: d005 beq.n 8005e04 8005df8: 6bbb ldr r3, [r7, #56] ; 0x38 8005dfa: 789b ldrb r3, [r3, #2] 8005dfc: 2b02 cmp r3, #2 8005dfe: d001 beq.n 8005e04 8005e00: 230d movs r3, #13 8005e02: e15d b.n 80060c0 fasize *= fs->n_fats; /* Number of sectors for FAT area */ 8005e04: 6bbb ldr r3, [r7, #56] ; 0x38 8005e06: 789b ldrb r3, [r3, #2] 8005e08: 461a mov r2, r3 8005e0a: 6cfb ldr r3, [r7, #76] ; 0x4c 8005e0c: fb02 f303 mul.w r3, r2, r3 8005e10: 64fb str r3, [r7, #76] ; 0x4c fs->csize = fs->win[BPB_SecPerClus]; /* Cluster size */ 8005e12: 6bbb ldr r3, [r7, #56] ; 0x38 8005e14: f893 3045 ldrb.w r3, [r3, #69] ; 0x45 8005e18: b29a uxth r2, r3 8005e1a: 6bbb ldr r3, [r7, #56] ; 0x38 8005e1c: 815a strh r2, [r3, #10] if (fs->csize == 0 || (fs->csize & (fs->csize - 1))) return FR_NO_FILESYSTEM; /* (Must be power of 2) */ 8005e1e: 6bbb ldr r3, [r7, #56] ; 0x38 8005e20: 895b ldrh r3, [r3, #10] 8005e22: 2b00 cmp r3, #0 8005e24: d008 beq.n 8005e38 8005e26: 6bbb ldr r3, [r7, #56] ; 0x38 8005e28: 895b ldrh r3, [r3, #10] 8005e2a: 461a mov r2, r3 8005e2c: 6bbb ldr r3, [r7, #56] ; 0x38 8005e2e: 895b ldrh r3, [r3, #10] 8005e30: 3b01 subs r3, #1 8005e32: 4013 ands r3, r2 8005e34: 2b00 cmp r3, #0 8005e36: d001 beq.n 8005e3c 8005e38: 230d movs r3, #13 8005e3a: e141 b.n 80060c0 fs->n_rootdir = ld_word(fs->win + BPB_RootEntCnt); /* Number of root directory entries */ 8005e3c: 6bbb ldr r3, [r7, #56] ; 0x38 8005e3e: 3338 adds r3, #56 ; 0x38 8005e40: 3311 adds r3, #17 8005e42: 4618 mov r0, r3 8005e44: f7fe f85c bl 8003f00 8005e48: 4603 mov r3, r0 8005e4a: 461a mov r2, r3 8005e4c: 6bbb ldr r3, [r7, #56] ; 0x38 8005e4e: 811a strh r2, [r3, #8] if (fs->n_rootdir % (SS(fs) / SZDIRE)) return FR_NO_FILESYSTEM; /* (Must be sector aligned) */ 8005e50: 6bbb ldr r3, [r7, #56] ; 0x38 8005e52: 891b ldrh r3, [r3, #8] 8005e54: 6bba ldr r2, [r7, #56] ; 0x38 8005e56: 8992 ldrh r2, [r2, #12] 8005e58: 0952 lsrs r2, r2, #5 8005e5a: b292 uxth r2, r2 8005e5c: fbb3 f1f2 udiv r1, r3, r2 8005e60: fb02 f201 mul.w r2, r2, r1 8005e64: 1a9b subs r3, r3, r2 8005e66: b29b uxth r3, r3 8005e68: 2b00 cmp r3, #0 8005e6a: d001 beq.n 8005e70 8005e6c: 230d movs r3, #13 8005e6e: e127 b.n 80060c0 tsect = ld_word(fs->win + BPB_TotSec16); /* Number of sectors on the volume */ 8005e70: 6bbb ldr r3, [r7, #56] ; 0x38 8005e72: 3338 adds r3, #56 ; 0x38 8005e74: 3313 adds r3, #19 8005e76: 4618 mov r0, r3 8005e78: f7fe f842 bl 8003f00 8005e7c: 4603 mov r3, r0 8005e7e: 64bb str r3, [r7, #72] ; 0x48 if (tsect == 0) tsect = ld_dword(fs->win + BPB_TotSec32); 8005e80: 6cbb ldr r3, [r7, #72] ; 0x48 8005e82: 2b00 cmp r3, #0 8005e84: d106 bne.n 8005e94 8005e86: 6bbb ldr r3, [r7, #56] ; 0x38 8005e88: 3338 adds r3, #56 ; 0x38 8005e8a: 3320 adds r3, #32 8005e8c: 4618 mov r0, r3 8005e8e: f7fe f84e bl 8003f2e 8005e92: 64b8 str r0, [r7, #72] ; 0x48 nrsv = ld_word(fs->win + BPB_RsvdSecCnt); /* Number of reserved sectors */ 8005e94: 6bbb ldr r3, [r7, #56] ; 0x38 8005e96: 3338 adds r3, #56 ; 0x38 8005e98: 330e adds r3, #14 8005e9a: 4618 mov r0, r3 8005e9c: f7fe f830 bl 8003f00 8005ea0: 4603 mov r3, r0 8005ea2: 85fb strh r3, [r7, #46] ; 0x2e if (nrsv == 0) return FR_NO_FILESYSTEM; /* (Must not be 0) */ 8005ea4: 8dfb ldrh r3, [r7, #46] ; 0x2e 8005ea6: 2b00 cmp r3, #0 8005ea8: d104 bne.n 8005eb4 8005eaa: 230d movs r3, #13 8005eac: e108 b.n 80060c0 8005eae: bf00 nop 8005eb0: 200000ac .word 0x200000ac /* Determine the FAT sub type */ sysect = nrsv + fasize + fs->n_rootdir / (SS(fs) / SZDIRE); /* RSV + FAT + DIR */ 8005eb4: 8dfa ldrh r2, [r7, #46] ; 0x2e 8005eb6: 6cfb ldr r3, [r7, #76] ; 0x4c 8005eb8: 4413 add r3, r2 8005eba: 6bba ldr r2, [r7, #56] ; 0x38 8005ebc: 8911 ldrh r1, [r2, #8] 8005ebe: 6bba ldr r2, [r7, #56] ; 0x38 8005ec0: 8992 ldrh r2, [r2, #12] 8005ec2: 0952 lsrs r2, r2, #5 8005ec4: b292 uxth r2, r2 8005ec6: fbb1 f2f2 udiv r2, r1, r2 8005eca: b292 uxth r2, r2 8005ecc: 4413 add r3, r2 8005ece: 62bb str r3, [r7, #40] ; 0x28 if (tsect < sysect) return FR_NO_FILESYSTEM; /* (Invalid volume size) */ 8005ed0: 6cba ldr r2, [r7, #72] ; 0x48 8005ed2: 6abb ldr r3, [r7, #40] ; 0x28 8005ed4: 429a cmp r2, r3 8005ed6: d201 bcs.n 8005edc 8005ed8: 230d movs r3, #13 8005eda: e0f1 b.n 80060c0 nclst = (tsect - sysect) / fs->csize; /* Number of clusters */ 8005edc: 6cba ldr r2, [r7, #72] ; 0x48 8005ede: 6abb ldr r3, [r7, #40] ; 0x28 8005ee0: 1ad3 subs r3, r2, r3 8005ee2: 6bba ldr r2, [r7, #56] ; 0x38 8005ee4: 8952 ldrh r2, [r2, #10] 8005ee6: fbb3 f3f2 udiv r3, r3, r2 8005eea: 627b str r3, [r7, #36] ; 0x24 if (nclst == 0) return FR_NO_FILESYSTEM; /* (Invalid volume size) */ 8005eec: 6a7b ldr r3, [r7, #36] ; 0x24 8005eee: 2b00 cmp r3, #0 8005ef0: d101 bne.n 8005ef6 8005ef2: 230d movs r3, #13 8005ef4: e0e4 b.n 80060c0 fmt = FS_FAT32; 8005ef6: 2303 movs r3, #3 8005ef8: f887 3057 strb.w r3, [r7, #87] ; 0x57 if (nclst <= MAX_FAT16) fmt = FS_FAT16; 8005efc: 6a7b ldr r3, [r7, #36] ; 0x24 8005efe: f64f 72f5 movw r2, #65525 ; 0xfff5 8005f02: 4293 cmp r3, r2 8005f04: d802 bhi.n 8005f0c 8005f06: 2302 movs r3, #2 8005f08: f887 3057 strb.w r3, [r7, #87] ; 0x57 if (nclst <= MAX_FAT12) fmt = FS_FAT12; 8005f0c: 6a7b ldr r3, [r7, #36] ; 0x24 8005f0e: f640 72f5 movw r2, #4085 ; 0xff5 8005f12: 4293 cmp r3, r2 8005f14: d802 bhi.n 8005f1c 8005f16: 2301 movs r3, #1 8005f18: f887 3057 strb.w r3, [r7, #87] ; 0x57 /* Boundaries and Limits */ fs->n_fatent = nclst + 2; /* Number of FAT entries */ 8005f1c: 6a7b ldr r3, [r7, #36] ; 0x24 8005f1e: 1c9a adds r2, r3, #2 8005f20: 6bbb ldr r3, [r7, #56] ; 0x38 8005f22: 61da str r2, [r3, #28] fs->volbase = bsect; /* Volume start sector */ 8005f24: 6bbb ldr r3, [r7, #56] ; 0x38 8005f26: 6d3a ldr r2, [r7, #80] ; 0x50 8005f28: 625a str r2, [r3, #36] ; 0x24 fs->fatbase = bsect + nrsv; /* FAT start sector */ 8005f2a: 8dfa ldrh r2, [r7, #46] ; 0x2e 8005f2c: 6d3b ldr r3, [r7, #80] ; 0x50 8005f2e: 441a add r2, r3 8005f30: 6bbb ldr r3, [r7, #56] ; 0x38 8005f32: 629a str r2, [r3, #40] ; 0x28 fs->database = bsect + sysect; /* Data start sector */ 8005f34: 6d3a ldr r2, [r7, #80] ; 0x50 8005f36: 6abb ldr r3, [r7, #40] ; 0x28 8005f38: 441a add r2, r3 8005f3a: 6bbb ldr r3, [r7, #56] ; 0x38 8005f3c: 631a str r2, [r3, #48] ; 0x30 if (fmt == FS_FAT32) { 8005f3e: f897 3057 ldrb.w r3, [r7, #87] ; 0x57 8005f42: 2b03 cmp r3, #3 8005f44: d11e bne.n 8005f84 if (ld_word(fs->win + BPB_FSVer32) != 0) return FR_NO_FILESYSTEM; /* (Must be FAT32 revision 0.0) */ 8005f46: 6bbb ldr r3, [r7, #56] ; 0x38 8005f48: 3338 adds r3, #56 ; 0x38 8005f4a: 332a adds r3, #42 ; 0x2a 8005f4c: 4618 mov r0, r3 8005f4e: f7fd ffd7 bl 8003f00 8005f52: 4603 mov r3, r0 8005f54: 2b00 cmp r3, #0 8005f56: d001 beq.n 8005f5c 8005f58: 230d movs r3, #13 8005f5a: e0b1 b.n 80060c0 if (fs->n_rootdir) return FR_NO_FILESYSTEM; /* (BPB_RootEntCnt must be 0) */ 8005f5c: 6bbb ldr r3, [r7, #56] ; 0x38 8005f5e: 891b ldrh r3, [r3, #8] 8005f60: 2b00 cmp r3, #0 8005f62: d001 beq.n 8005f68 8005f64: 230d movs r3, #13 8005f66: e0ab b.n 80060c0 fs->dirbase = ld_dword(fs->win + BPB_RootClus32); /* Root directory start cluster */ 8005f68: 6bbb ldr r3, [r7, #56] ; 0x38 8005f6a: 3338 adds r3, #56 ; 0x38 8005f6c: 332c adds r3, #44 ; 0x2c 8005f6e: 4618 mov r0, r3 8005f70: f7fd ffdd bl 8003f2e 8005f74: 4602 mov r2, r0 8005f76: 6bbb ldr r3, [r7, #56] ; 0x38 8005f78: 62da str r2, [r3, #44] ; 0x2c szbfat = fs->n_fatent * 4; /* (Needed FAT size) */ 8005f7a: 6bbb ldr r3, [r7, #56] ; 0x38 8005f7c: 69db ldr r3, [r3, #28] 8005f7e: 009b lsls r3, r3, #2 8005f80: 647b str r3, [r7, #68] ; 0x44 8005f82: e01f b.n 8005fc4 } else { if (fs->n_rootdir == 0) return FR_NO_FILESYSTEM;/* (BPB_RootEntCnt must not be 0) */ 8005f84: 6bbb ldr r3, [r7, #56] ; 0x38 8005f86: 891b ldrh r3, [r3, #8] 8005f88: 2b00 cmp r3, #0 8005f8a: d101 bne.n 8005f90 8005f8c: 230d movs r3, #13 8005f8e: e097 b.n 80060c0 fs->dirbase = fs->fatbase + fasize; /* Root directory start sector */ 8005f90: 6bbb ldr r3, [r7, #56] ; 0x38 8005f92: 6a9a ldr r2, [r3, #40] ; 0x28 8005f94: 6cfb ldr r3, [r7, #76] ; 0x4c 8005f96: 441a add r2, r3 8005f98: 6bbb ldr r3, [r7, #56] ; 0x38 8005f9a: 62da str r2, [r3, #44] ; 0x2c szbfat = (fmt == FS_FAT16) ? /* (Needed FAT size) */ fs->n_fatent * 2 : fs->n_fatent * 3 / 2 + (fs->n_fatent & 1); 8005f9c: f897 3057 ldrb.w r3, [r7, #87] ; 0x57 8005fa0: 2b02 cmp r3, #2 8005fa2: d103 bne.n 8005fac 8005fa4: 6bbb ldr r3, [r7, #56] ; 0x38 8005fa6: 69db ldr r3, [r3, #28] 8005fa8: 005b lsls r3, r3, #1 8005faa: e00a b.n 8005fc2 8005fac: 6bbb ldr r3, [r7, #56] ; 0x38 8005fae: 69da ldr r2, [r3, #28] 8005fb0: 4613 mov r3, r2 8005fb2: 005b lsls r3, r3, #1 8005fb4: 4413 add r3, r2 8005fb6: 085a lsrs r2, r3, #1 8005fb8: 6bbb ldr r3, [r7, #56] ; 0x38 8005fba: 69db ldr r3, [r3, #28] 8005fbc: f003 0301 and.w r3, r3, #1 8005fc0: 4413 add r3, r2 szbfat = (fmt == FS_FAT16) ? /* (Needed FAT size) */ 8005fc2: 647b str r3, [r7, #68] ; 0x44 } if (fs->fsize < (szbfat + (SS(fs) - 1)) / SS(fs)) return FR_NO_FILESYSTEM; /* (BPB_FATSz must not be less than the size needed) */ 8005fc4: 6bbb ldr r3, [r7, #56] ; 0x38 8005fc6: 6a1a ldr r2, [r3, #32] 8005fc8: 6bbb ldr r3, [r7, #56] ; 0x38 8005fca: 899b ldrh r3, [r3, #12] 8005fcc: 4619 mov r1, r3 8005fce: 6c7b ldr r3, [r7, #68] ; 0x44 8005fd0: 440b add r3, r1 8005fd2: 3b01 subs r3, #1 8005fd4: 6bb9 ldr r1, [r7, #56] ; 0x38 8005fd6: 8989 ldrh r1, [r1, #12] 8005fd8: fbb3 f3f1 udiv r3, r3, r1 8005fdc: 429a cmp r2, r3 8005fde: d201 bcs.n 8005fe4 8005fe0: 230d movs r3, #13 8005fe2: e06d b.n 80060c0 #if !_FS_READONLY /* Get FSINFO if available */ fs->last_clst = fs->free_clst = 0xFFFFFFFF; /* Initialize cluster allocation information */ 8005fe4: 6bbb ldr r3, [r7, #56] ; 0x38 8005fe6: f04f 32ff mov.w r2, #4294967295 8005fea: 619a str r2, [r3, #24] 8005fec: 6bbb ldr r3, [r7, #56] ; 0x38 8005fee: 699a ldr r2, [r3, #24] 8005ff0: 6bbb ldr r3, [r7, #56] ; 0x38 8005ff2: 615a str r2, [r3, #20] fs->fsi_flag = 0x80; 8005ff4: 6bbb ldr r3, [r7, #56] ; 0x38 8005ff6: 2280 movs r2, #128 ; 0x80 8005ff8: 711a strb r2, [r3, #4] #if (_FS_NOFSINFO & 3) != 3 if (fmt == FS_FAT32 /* Enable FSINFO only if FAT32 and BPB_FSInfo32 == 1 */ 8005ffa: f897 3057 ldrb.w r3, [r7, #87] ; 0x57 8005ffe: 2b03 cmp r3, #3 8006000: d149 bne.n 8006096 && ld_word(fs->win + BPB_FSInfo32) == 1 8006002: 6bbb ldr r3, [r7, #56] ; 0x38 8006004: 3338 adds r3, #56 ; 0x38 8006006: 3330 adds r3, #48 ; 0x30 8006008: 4618 mov r0, r3 800600a: f7fd ff79 bl 8003f00 800600e: 4603 mov r3, r0 8006010: 2b01 cmp r3, #1 8006012: d140 bne.n 8006096 && move_window(fs, bsect + 1) == FR_OK) 8006014: 6d3b ldr r3, [r7, #80] ; 0x50 8006016: 3301 adds r3, #1 8006018: 4619 mov r1, r3 800601a: 6bb8 ldr r0, [r7, #56] ; 0x38 800601c: f7fe fa10 bl 8004440 8006020: 4603 mov r3, r0 8006022: 2b00 cmp r3, #0 8006024: d137 bne.n 8006096 { fs->fsi_flag = 0; 8006026: 6bbb ldr r3, [r7, #56] ; 0x38 8006028: 2200 movs r2, #0 800602a: 711a strb r2, [r3, #4] if (ld_word(fs->win + BS_55AA) == 0xAA55 /* Load FSINFO data if available */ 800602c: 6bbb ldr r3, [r7, #56] ; 0x38 800602e: 3338 adds r3, #56 ; 0x38 8006030: f503 73ff add.w r3, r3, #510 ; 0x1fe 8006034: 4618 mov r0, r3 8006036: f7fd ff63 bl 8003f00 800603a: 4603 mov r3, r0 800603c: 461a mov r2, r3 800603e: f64a 2355 movw r3, #43605 ; 0xaa55 8006042: 429a cmp r2, r3 8006044: d127 bne.n 8006096 && ld_dword(fs->win + FSI_LeadSig) == 0x41615252 8006046: 6bbb ldr r3, [r7, #56] ; 0x38 8006048: 3338 adds r3, #56 ; 0x38 800604a: 4618 mov r0, r3 800604c: f7fd ff6f bl 8003f2e 8006050: 4602 mov r2, r0 8006052: 4b1d ldr r3, [pc, #116] ; (80060c8 ) 8006054: 429a cmp r2, r3 8006056: d11e bne.n 8006096 && ld_dword(fs->win + FSI_StrucSig) == 0x61417272) 8006058: 6bbb ldr r3, [r7, #56] ; 0x38 800605a: 3338 adds r3, #56 ; 0x38 800605c: f503 73f2 add.w r3, r3, #484 ; 0x1e4 8006060: 4618 mov r0, r3 8006062: f7fd ff64 bl 8003f2e 8006066: 4602 mov r2, r0 8006068: 4b18 ldr r3, [pc, #96] ; (80060cc ) 800606a: 429a cmp r2, r3 800606c: d113 bne.n 8006096 { #if (_FS_NOFSINFO & 1) == 0 fs->free_clst = ld_dword(fs->win + FSI_Free_Count); 800606e: 6bbb ldr r3, [r7, #56] ; 0x38 8006070: 3338 adds r3, #56 ; 0x38 8006072: f503 73f4 add.w r3, r3, #488 ; 0x1e8 8006076: 4618 mov r0, r3 8006078: f7fd ff59 bl 8003f2e 800607c: 4602 mov r2, r0 800607e: 6bbb ldr r3, [r7, #56] ; 0x38 8006080: 619a str r2, [r3, #24] #endif #if (_FS_NOFSINFO & 2) == 0 fs->last_clst = ld_dword(fs->win + FSI_Nxt_Free); 8006082: 6bbb ldr r3, [r7, #56] ; 0x38 8006084: 3338 adds r3, #56 ; 0x38 8006086: f503 73f6 add.w r3, r3, #492 ; 0x1ec 800608a: 4618 mov r0, r3 800608c: f7fd ff4f bl 8003f2e 8006090: 4602 mov r2, r0 8006092: 6bbb ldr r3, [r7, #56] ; 0x38 8006094: 615a str r2, [r3, #20] } #endif /* (_FS_NOFSINFO & 3) != 3 */ #endif /* !_FS_READONLY */ } fs->fs_type = fmt; /* FAT sub-type */ 8006096: 6bbb ldr r3, [r7, #56] ; 0x38 8006098: f897 2057 ldrb.w r2, [r7, #87] ; 0x57 800609c: 701a strb r2, [r3, #0] fs->id = ++Fsid; /* File system mount ID */ 800609e: 4b0c ldr r3, [pc, #48] ; (80060d0 ) 80060a0: 881b ldrh r3, [r3, #0] 80060a2: 3301 adds r3, #1 80060a4: b29a uxth r2, r3 80060a6: 4b0a ldr r3, [pc, #40] ; (80060d0 ) 80060a8: 801a strh r2, [r3, #0] 80060aa: 4b09 ldr r3, [pc, #36] ; (80060d0 ) 80060ac: 881a ldrh r2, [r3, #0] 80060ae: 6bbb ldr r3, [r7, #56] ; 0x38 80060b0: 80da strh r2, [r3, #6] #if _USE_LFN == 1 fs->lfnbuf = LfnBuf; /* Static LFN working buffer */ 80060b2: 6bbb ldr r3, [r7, #56] ; 0x38 80060b4: 4a07 ldr r2, [pc, #28] ; (80060d4 ) 80060b6: 611a str r2, [r3, #16] #endif #if _FS_RPATH != 0 fs->cdir = 0; /* Initialize current directory */ #endif #if _FS_LOCK != 0 /* Clear file lock semaphores */ clear_lock(fs); 80060b8: 6bb8 ldr r0, [r7, #56] ; 0x38 80060ba: f7fe f95b bl 8004374 #endif return FR_OK; 80060be: 2300 movs r3, #0 } 80060c0: 4618 mov r0, r3 80060c2: 3758 adds r7, #88 ; 0x58 80060c4: 46bd mov sp, r7 80060c6: bd80 pop {r7, pc} 80060c8: 41615252 .word 0x41615252 80060cc: 61417272 .word 0x61417272 80060d0: 200000b0 .word 0x200000b0 80060d4: 200000d4 .word 0x200000d4 080060d8 : static FRESULT validate ( /* Returns FR_OK or FR_INVALID_OBJECT */ _FDID* obj, /* Pointer to the _OBJ, the 1st member in the FIL/DIR object, to check validity */ FATFS** fs /* Pointer to pointer to the owner file system object to return */ ) { 80060d8: b580 push {r7, lr} 80060da: b084 sub sp, #16 80060dc: af00 add r7, sp, #0 80060de: 6078 str r0, [r7, #4] 80060e0: 6039 str r1, [r7, #0] FRESULT res = FR_INVALID_OBJECT; 80060e2: 2309 movs r3, #9 80060e4: 73fb strb r3, [r7, #15] if (obj && obj->fs && obj->fs->fs_type && obj->id == obj->fs->id) { /* Test if the object is valid */ 80060e6: 687b ldr r3, [r7, #4] 80060e8: 2b00 cmp r3, #0 80060ea: d01c beq.n 8006126 80060ec: 687b ldr r3, [r7, #4] 80060ee: 681b ldr r3, [r3, #0] 80060f0: 2b00 cmp r3, #0 80060f2: d018 beq.n 8006126 80060f4: 687b ldr r3, [r7, #4] 80060f6: 681b ldr r3, [r3, #0] 80060f8: 781b ldrb r3, [r3, #0] 80060fa: 2b00 cmp r3, #0 80060fc: d013 beq.n 8006126 80060fe: 687b ldr r3, [r7, #4] 8006100: 889a ldrh r2, [r3, #4] 8006102: 687b ldr r3, [r7, #4] 8006104: 681b ldr r3, [r3, #0] 8006106: 88db ldrh r3, [r3, #6] 8006108: 429a cmp r2, r3 800610a: d10c bne.n 8006126 } } else { res = FR_TIMEOUT; } #else if (!(disk_status(obj->fs->drv) & STA_NOINIT)) { /* Test if the phsical drive is kept initialized */ 800610c: 687b ldr r3, [r7, #4] 800610e: 681b ldr r3, [r3, #0] 8006110: 785b ldrb r3, [r3, #1] 8006112: 4618 mov r0, r3 8006114: f7fd fe56 bl 8003dc4 8006118: 4603 mov r3, r0 800611a: f003 0301 and.w r3, r3, #1 800611e: 2b00 cmp r3, #0 8006120: d101 bne.n 8006126 res = FR_OK; 8006122: 2300 movs r3, #0 8006124: 73fb strb r3, [r7, #15] } #endif } *fs = (res == FR_OK) ? obj->fs : 0; /* Corresponding filesystem object */ 8006126: 7bfb ldrb r3, [r7, #15] 8006128: 2b00 cmp r3, #0 800612a: d102 bne.n 8006132 800612c: 687b ldr r3, [r7, #4] 800612e: 681b ldr r3, [r3, #0] 8006130: e000 b.n 8006134 8006132: 2300 movs r3, #0 8006134: 683a ldr r2, [r7, #0] 8006136: 6013 str r3, [r2, #0] return res; 8006138: 7bfb ldrb r3, [r7, #15] } 800613a: 4618 mov r0, r3 800613c: 3710 adds r7, #16 800613e: 46bd mov sp, r7 8006140: bd80 pop {r7, pc} ... 08006144 : FRESULT f_mount ( FATFS* fs, /* Pointer to the file system object (NULL:unmount)*/ const TCHAR* path, /* Logical drive number to be mounted/unmounted */ BYTE opt /* Mode option 0:Do not mount (delayed mount), 1:Mount immediately */ ) { 8006144: b580 push {r7, lr} 8006146: b088 sub sp, #32 8006148: af00 add r7, sp, #0 800614a: 60f8 str r0, [r7, #12] 800614c: 60b9 str r1, [r7, #8] 800614e: 4613 mov r3, r2 8006150: 71fb strb r3, [r7, #7] FATFS *cfs; int vol; FRESULT res; const TCHAR *rp = path; 8006152: 68bb ldr r3, [r7, #8] 8006154: 613b str r3, [r7, #16] /* Get logical drive number */ vol = get_ldnumber(&rp); 8006156: f107 0310 add.w r3, r7, #16 800615a: 4618 mov r0, r3 800615c: f7ff fc9a bl 8005a94 8006160: 61f8 str r0, [r7, #28] if (vol < 0) return FR_INVALID_DRIVE; 8006162: 69fb ldr r3, [r7, #28] 8006164: 2b00 cmp r3, #0 8006166: da01 bge.n 800616c 8006168: 230b movs r3, #11 800616a: e02b b.n 80061c4 cfs = FatFs[vol]; /* Pointer to fs object */ 800616c: 4a17 ldr r2, [pc, #92] ; (80061cc ) 800616e: 69fb ldr r3, [r7, #28] 8006170: f852 3023 ldr.w r3, [r2, r3, lsl #2] 8006174: 61bb str r3, [r7, #24] if (cfs) { 8006176: 69bb ldr r3, [r7, #24] 8006178: 2b00 cmp r3, #0 800617a: d005 beq.n 8006188 #if _FS_LOCK != 0 clear_lock(cfs); 800617c: 69b8 ldr r0, [r7, #24] 800617e: f7fe f8f9 bl 8004374 #endif #if _FS_REENTRANT /* Discard sync object of the current volume */ if (!ff_del_syncobj(cfs->sobj)) return FR_INT_ERR; #endif cfs->fs_type = 0; /* Clear old fs object */ 8006182: 69bb ldr r3, [r7, #24] 8006184: 2200 movs r2, #0 8006186: 701a strb r2, [r3, #0] } if (fs) { 8006188: 68fb ldr r3, [r7, #12] 800618a: 2b00 cmp r3, #0 800618c: d002 beq.n 8006194 fs->fs_type = 0; /* Clear new fs object */ 800618e: 68fb ldr r3, [r7, #12] 8006190: 2200 movs r2, #0 8006192: 701a strb r2, [r3, #0] #if _FS_REENTRANT /* Create sync object for the new volume */ if (!ff_cre_syncobj((BYTE)vol, &fs->sobj)) return FR_INT_ERR; #endif } FatFs[vol] = fs; /* Register new fs object */ 8006194: 68fa ldr r2, [r7, #12] 8006196: 490d ldr r1, [pc, #52] ; (80061cc ) 8006198: 69fb ldr r3, [r7, #28] 800619a: f841 2023 str.w r2, [r1, r3, lsl #2] if (!fs || opt != 1) return FR_OK; /* Do not mount now, it will be mounted later */ 800619e: 68fb ldr r3, [r7, #12] 80061a0: 2b00 cmp r3, #0 80061a2: d002 beq.n 80061aa 80061a4: 79fb ldrb r3, [r7, #7] 80061a6: 2b01 cmp r3, #1 80061a8: d001 beq.n 80061ae 80061aa: 2300 movs r3, #0 80061ac: e00a b.n 80061c4 res = find_volume(&path, &fs, 0); /* Force mounted the volume */ 80061ae: f107 010c add.w r1, r7, #12 80061b2: f107 0308 add.w r3, r7, #8 80061b6: 2200 movs r2, #0 80061b8: 4618 mov r0, r3 80061ba: f7ff fd05 bl 8005bc8 80061be: 4603 mov r3, r0 80061c0: 75fb strb r3, [r7, #23] LEAVE_FF(fs, res); 80061c2: 7dfb ldrb r3, [r7, #23] } 80061c4: 4618 mov r0, r3 80061c6: 3720 adds r7, #32 80061c8: 46bd mov sp, r7 80061ca: bd80 pop {r7, pc} 80061cc: 200000ac .word 0x200000ac 080061d0 : FRESULT f_open ( FIL* fp, /* Pointer to the blank file object */ const TCHAR* path, /* Pointer to the file name */ BYTE mode /* Access mode and file open mode flags */ ) { 80061d0: b580 push {r7, lr} 80061d2: b09a sub sp, #104 ; 0x68 80061d4: af00 add r7, sp, #0 80061d6: 60f8 str r0, [r7, #12] 80061d8: 60b9 str r1, [r7, #8] 80061da: 4613 mov r3, r2 80061dc: 71fb strb r3, [r7, #7] FSIZE_t ofs; #endif DEF_NAMBUF if (!fp) return FR_INVALID_OBJECT; 80061de: 68fb ldr r3, [r7, #12] 80061e0: 2b00 cmp r3, #0 80061e2: d101 bne.n 80061e8 80061e4: 2309 movs r3, #9 80061e6: e1bb b.n 8006560 /* Get logical drive */ mode &= _FS_READONLY ? FA_READ : FA_READ | FA_WRITE | FA_CREATE_ALWAYS | FA_CREATE_NEW | FA_OPEN_ALWAYS | FA_OPEN_APPEND | FA_SEEKEND; 80061e8: 79fb ldrb r3, [r7, #7] 80061ea: f003 033f and.w r3, r3, #63 ; 0x3f 80061ee: 71fb strb r3, [r7, #7] res = find_volume(&path, &fs, mode); 80061f0: 79fa ldrb r2, [r7, #7] 80061f2: f107 0114 add.w r1, r7, #20 80061f6: f107 0308 add.w r3, r7, #8 80061fa: 4618 mov r0, r3 80061fc: f7ff fce4 bl 8005bc8 8006200: 4603 mov r3, r0 8006202: f887 3067 strb.w r3, [r7, #103] ; 0x67 if (res == FR_OK) { 8006206: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 800620a: 2b00 cmp r3, #0 800620c: f040 819f bne.w 800654e dj.obj.fs = fs; 8006210: 697b ldr r3, [r7, #20] 8006212: 61bb str r3, [r7, #24] INIT_NAMBUF(fs); res = follow_path(&dj, path); /* Follow the file path */ 8006214: 68ba ldr r2, [r7, #8] 8006216: f107 0318 add.w r3, r7, #24 800621a: 4611 mov r1, r2 800621c: 4618 mov r0, r3 800621e: f7ff fbc3 bl 80059a8 8006222: 4603 mov r3, r0 8006224: f887 3067 strb.w r3, [r7, #103] ; 0x67 #if !_FS_READONLY /* R/W configuration */ if (res == FR_OK) { 8006228: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 800622c: 2b00 cmp r3, #0 800622e: d11a bne.n 8006266 if (dj.fn[NSFLAG] & NS_NONAME) { /* Origin directory itself? */ 8006230: f897 3047 ldrb.w r3, [r7, #71] ; 0x47 8006234: b25b sxtb r3, r3 8006236: 2b00 cmp r3, #0 8006238: da03 bge.n 8006242 res = FR_INVALID_NAME; 800623a: 2306 movs r3, #6 800623c: f887 3067 strb.w r3, [r7, #103] ; 0x67 8006240: e011 b.n 8006266 } #if _FS_LOCK != 0 else { res = chk_lock(&dj, (mode & ~FA_READ) ? 1 : 0); 8006242: 79fb ldrb r3, [r7, #7] 8006244: f023 0301 bic.w r3, r3, #1 8006248: 2b00 cmp r3, #0 800624a: bf14 ite ne 800624c: 2301 movne r3, #1 800624e: 2300 moveq r3, #0 8006250: b2db uxtb r3, r3 8006252: 461a mov r2, r3 8006254: f107 0318 add.w r3, r7, #24 8006258: 4611 mov r1, r2 800625a: 4618 mov r0, r3 800625c: f7fd ff48 bl 80040f0 8006260: 4603 mov r3, r0 8006262: f887 3067 strb.w r3, [r7, #103] ; 0x67 } #endif } /* Create or Open a file */ if (mode & (FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW)) { 8006266: 79fb ldrb r3, [r7, #7] 8006268: f003 031c and.w r3, r3, #28 800626c: 2b00 cmp r3, #0 800626e: d07f beq.n 8006370 if (res != FR_OK) { /* No file, create new */ 8006270: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 8006274: 2b00 cmp r3, #0 8006276: d017 beq.n 80062a8 if (res == FR_NO_FILE) { /* There is no file to open, create a new entry */ 8006278: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 800627c: 2b04 cmp r3, #4 800627e: d10e bne.n 800629e #if _FS_LOCK != 0 res = enq_lock() ? dir_register(&dj) : FR_TOO_MANY_OPEN_FILES; 8006280: f7fd ff90 bl 80041a4 8006284: 4603 mov r3, r0 8006286: 2b00 cmp r3, #0 8006288: d006 beq.n 8006298 800628a: f107 0318 add.w r3, r7, #24 800628e: 4618 mov r0, r3 8006290: f7ff f8da bl 8005448 8006294: 4603 mov r3, r0 8006296: e000 b.n 800629a 8006298: 2312 movs r3, #18 800629a: f887 3067 strb.w r3, [r7, #103] ; 0x67 #else res = dir_register(&dj); #endif } mode |= FA_CREATE_ALWAYS; /* File is created */ 800629e: 79fb ldrb r3, [r7, #7] 80062a0: f043 0308 orr.w r3, r3, #8 80062a4: 71fb strb r3, [r7, #7] 80062a6: e010 b.n 80062ca } else { /* Any object is already existing */ if (dj.obj.attr & (AM_RDO | AM_DIR)) { /* Cannot overwrite it (R/O or DIR) */ 80062a8: 7fbb ldrb r3, [r7, #30] 80062aa: f003 0311 and.w r3, r3, #17 80062ae: 2b00 cmp r3, #0 80062b0: d003 beq.n 80062ba res = FR_DENIED; 80062b2: 2307 movs r3, #7 80062b4: f887 3067 strb.w r3, [r7, #103] ; 0x67 80062b8: e007 b.n 80062ca } else { if (mode & FA_CREATE_NEW) res = FR_EXIST; /* Cannot create as new file */ 80062ba: 79fb ldrb r3, [r7, #7] 80062bc: f003 0304 and.w r3, r3, #4 80062c0: 2b00 cmp r3, #0 80062c2: d002 beq.n 80062ca 80062c4: 2308 movs r3, #8 80062c6: f887 3067 strb.w r3, [r7, #103] ; 0x67 } } if (res == FR_OK && (mode & FA_CREATE_ALWAYS)) { /* Truncate it if overwrite mode */ 80062ca: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 80062ce: 2b00 cmp r3, #0 80062d0: d168 bne.n 80063a4 80062d2: 79fb ldrb r3, [r7, #7] 80062d4: f003 0308 and.w r3, r3, #8 80062d8: 2b00 cmp r3, #0 80062da: d063 beq.n 80063a4 dw = GET_FATTIME(); 80062dc: f7fd fd16 bl 8003d0c 80062e0: 65b8 str r0, [r7, #88] ; 0x58 } } else #endif { /* Clean directory info */ st_dword(dj.dir + DIR_CrtTime, dw); /* Set created time */ 80062e2: 6bbb ldr r3, [r7, #56] ; 0x38 80062e4: 330e adds r3, #14 80062e6: 6db9 ldr r1, [r7, #88] ; 0x58 80062e8: 4618 mov r0, r3 80062ea: f7fd fe5c bl 8003fa6 st_dword(dj.dir + DIR_ModTime, dw); /* Set modified time */ 80062ee: 6bbb ldr r3, [r7, #56] ; 0x38 80062f0: 3316 adds r3, #22 80062f2: 6db9 ldr r1, [r7, #88] ; 0x58 80062f4: 4618 mov r0, r3 80062f6: f7fd fe56 bl 8003fa6 dj.dir[DIR_Attr] = AM_ARC; /* Reset attribute */ 80062fa: 6bbb ldr r3, [r7, #56] ; 0x38 80062fc: 330b adds r3, #11 80062fe: 2220 movs r2, #32 8006300: 701a strb r2, [r3, #0] cl = ld_clust(fs, dj.dir); /* Get cluster chain */ 8006302: 697b ldr r3, [r7, #20] 8006304: 6bba ldr r2, [r7, #56] ; 0x38 8006306: 4611 mov r1, r2 8006308: 4618 mov r0, r3 800630a: f7fe fe16 bl 8004f3a 800630e: 6578 str r0, [r7, #84] ; 0x54 st_clust(fs, dj.dir, 0); /* Reset file allocation info */ 8006310: 697b ldr r3, [r7, #20] 8006312: 6bb9 ldr r1, [r7, #56] ; 0x38 8006314: 2200 movs r2, #0 8006316: 4618 mov r0, r3 8006318: f7fe fe2e bl 8004f78 st_dword(dj.dir + DIR_FileSize, 0); 800631c: 6bbb ldr r3, [r7, #56] ; 0x38 800631e: 331c adds r3, #28 8006320: 2100 movs r1, #0 8006322: 4618 mov r0, r3 8006324: f7fd fe3f bl 8003fa6 fs->wflag = 1; 8006328: 697b ldr r3, [r7, #20] 800632a: 2201 movs r2, #1 800632c: 70da strb r2, [r3, #3] if (cl) { /* Remove the cluster chain if exist */ 800632e: 6d7b ldr r3, [r7, #84] ; 0x54 8006330: 2b00 cmp r3, #0 8006332: d037 beq.n 80063a4 dw = fs->winsect; 8006334: 697b ldr r3, [r7, #20] 8006336: 6b5b ldr r3, [r3, #52] ; 0x34 8006338: 65bb str r3, [r7, #88] ; 0x58 res = remove_chain(&dj.obj, cl, 0); 800633a: f107 0318 add.w r3, r7, #24 800633e: 2200 movs r2, #0 8006340: 6d79 ldr r1, [r7, #84] ; 0x54 8006342: 4618 mov r0, r3 8006344: f7fe fb1f bl 8004986 8006348: 4603 mov r3, r0 800634a: f887 3067 strb.w r3, [r7, #103] ; 0x67 if (res == FR_OK) { 800634e: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 8006352: 2b00 cmp r3, #0 8006354: d126 bne.n 80063a4 res = move_window(fs, dw); 8006356: 697b ldr r3, [r7, #20] 8006358: 6db9 ldr r1, [r7, #88] ; 0x58 800635a: 4618 mov r0, r3 800635c: f7fe f870 bl 8004440 8006360: 4603 mov r3, r0 8006362: f887 3067 strb.w r3, [r7, #103] ; 0x67 fs->last_clst = cl - 1; /* Reuse the cluster hole */ 8006366: 697b ldr r3, [r7, #20] 8006368: 6d7a ldr r2, [r7, #84] ; 0x54 800636a: 3a01 subs r2, #1 800636c: 615a str r2, [r3, #20] 800636e: e019 b.n 80063a4 } } } } else { /* Open an existing file */ if (res == FR_OK) { /* Following succeeded */ 8006370: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 8006374: 2b00 cmp r3, #0 8006376: d115 bne.n 80063a4 if (dj.obj.attr & AM_DIR) { /* It is a directory */ 8006378: 7fbb ldrb r3, [r7, #30] 800637a: f003 0310 and.w r3, r3, #16 800637e: 2b00 cmp r3, #0 8006380: d003 beq.n 800638a res = FR_NO_FILE; 8006382: 2304 movs r3, #4 8006384: f887 3067 strb.w r3, [r7, #103] ; 0x67 8006388: e00c b.n 80063a4 } else { if ((mode & FA_WRITE) && (dj.obj.attr & AM_RDO)) { /* R/O violation */ 800638a: 79fb ldrb r3, [r7, #7] 800638c: f003 0302 and.w r3, r3, #2 8006390: 2b00 cmp r3, #0 8006392: d007 beq.n 80063a4 8006394: 7fbb ldrb r3, [r7, #30] 8006396: f003 0301 and.w r3, r3, #1 800639a: 2b00 cmp r3, #0 800639c: d002 beq.n 80063a4 res = FR_DENIED; 800639e: 2307 movs r3, #7 80063a0: f887 3067 strb.w r3, [r7, #103] ; 0x67 } } } } if (res == FR_OK) { 80063a4: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 80063a8: 2b00 cmp r3, #0 80063aa: d128 bne.n 80063fe if (mode & FA_CREATE_ALWAYS) /* Set file change flag if created or overwritten */ 80063ac: 79fb ldrb r3, [r7, #7] 80063ae: f003 0308 and.w r3, r3, #8 80063b2: 2b00 cmp r3, #0 80063b4: d003 beq.n 80063be mode |= FA_MODIFIED; 80063b6: 79fb ldrb r3, [r7, #7] 80063b8: f043 0340 orr.w r3, r3, #64 ; 0x40 80063bc: 71fb strb r3, [r7, #7] fp->dir_sect = fs->winsect; /* Pointer to the directory entry */ 80063be: 697b ldr r3, [r7, #20] 80063c0: 6b5a ldr r2, [r3, #52] ; 0x34 80063c2: 68fb ldr r3, [r7, #12] 80063c4: 625a str r2, [r3, #36] ; 0x24 fp->dir_ptr = dj.dir; 80063c6: 6bba ldr r2, [r7, #56] ; 0x38 80063c8: 68fb ldr r3, [r7, #12] 80063ca: 629a str r2, [r3, #40] ; 0x28 #if _FS_LOCK != 0 fp->obj.lockid = inc_lock(&dj, (mode & ~FA_READ) ? 1 : 0); 80063cc: 79fb ldrb r3, [r7, #7] 80063ce: f023 0301 bic.w r3, r3, #1 80063d2: 2b00 cmp r3, #0 80063d4: bf14 ite ne 80063d6: 2301 movne r3, #1 80063d8: 2300 moveq r3, #0 80063da: b2db uxtb r3, r3 80063dc: 461a mov r2, r3 80063de: f107 0318 add.w r3, r7, #24 80063e2: 4611 mov r1, r2 80063e4: 4618 mov r0, r3 80063e6: f7fd fefd bl 80041e4 80063ea: 4602 mov r2, r0 80063ec: 68fb ldr r3, [r7, #12] 80063ee: 611a str r2, [r3, #16] if (!fp->obj.lockid) res = FR_INT_ERR; 80063f0: 68fb ldr r3, [r7, #12] 80063f2: 691b ldr r3, [r3, #16] 80063f4: 2b00 cmp r3, #0 80063f6: d102 bne.n 80063fe 80063f8: 2302 movs r3, #2 80063fa: f887 3067 strb.w r3, [r7, #103] ; 0x67 } } } #endif if (res == FR_OK) { 80063fe: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 8006402: 2b00 cmp r3, #0 8006404: f040 80a3 bne.w 800654e fp->obj.objsize = ld_qword(fs->dirbuf + XDIR_FileSize); fp->obj.stat = fs->dirbuf[XDIR_GenFlags] & 2; } else #endif { fp->obj.sclust = ld_clust(fs, dj.dir); /* Get object allocation info */ 8006408: 697b ldr r3, [r7, #20] 800640a: 6bba ldr r2, [r7, #56] ; 0x38 800640c: 4611 mov r1, r2 800640e: 4618 mov r0, r3 8006410: f7fe fd93 bl 8004f3a 8006414: 4602 mov r2, r0 8006416: 68fb ldr r3, [r7, #12] 8006418: 609a str r2, [r3, #8] fp->obj.objsize = ld_dword(dj.dir + DIR_FileSize); 800641a: 6bbb ldr r3, [r7, #56] ; 0x38 800641c: 331c adds r3, #28 800641e: 4618 mov r0, r3 8006420: f7fd fd85 bl 8003f2e 8006424: 4602 mov r2, r0 8006426: 68fb ldr r3, [r7, #12] 8006428: 60da str r2, [r3, #12] } #if _USE_FASTSEEK fp->cltbl = 0; /* Disable fast seek mode */ 800642a: 68fb ldr r3, [r7, #12] 800642c: 2200 movs r2, #0 800642e: 62da str r2, [r3, #44] ; 0x2c #endif fp->obj.fs = fs; /* Validate the file object */ 8006430: 697a ldr r2, [r7, #20] 8006432: 68fb ldr r3, [r7, #12] 8006434: 601a str r2, [r3, #0] fp->obj.id = fs->id; 8006436: 697b ldr r3, [r7, #20] 8006438: 88da ldrh r2, [r3, #6] 800643a: 68fb ldr r3, [r7, #12] 800643c: 809a strh r2, [r3, #4] fp->flag = mode; /* Set file access mode */ 800643e: 68fb ldr r3, [r7, #12] 8006440: 79fa ldrb r2, [r7, #7] 8006442: 751a strb r2, [r3, #20] fp->err = 0; /* Clear error flag */ 8006444: 68fb ldr r3, [r7, #12] 8006446: 2200 movs r2, #0 8006448: 755a strb r2, [r3, #21] fp->sect = 0; /* Invalidate current data sector */ 800644a: 68fb ldr r3, [r7, #12] 800644c: 2200 movs r2, #0 800644e: 621a str r2, [r3, #32] fp->fptr = 0; /* Set file pointer top of the file */ 8006450: 68fb ldr r3, [r7, #12] 8006452: 2200 movs r2, #0 8006454: 619a str r2, [r3, #24] #if !_FS_READONLY #if !_FS_TINY mem_set(fp->buf, 0, _MAX_SS); /* Clear sector buffer */ 8006456: 68fb ldr r3, [r7, #12] 8006458: 3330 adds r3, #48 ; 0x30 800645a: f44f 5280 mov.w r2, #4096 ; 0x1000 800645e: 2100 movs r1, #0 8006460: 4618 mov r0, r3 8006462: f7fd fdeb bl 800403c #endif if ((mode & FA_SEEKEND) && fp->obj.objsize > 0) { /* Seek to end of file if FA_OPEN_APPEND is specified */ 8006466: 79fb ldrb r3, [r7, #7] 8006468: f003 0320 and.w r3, r3, #32 800646c: 2b00 cmp r3, #0 800646e: d06e beq.n 800654e 8006470: 68fb ldr r3, [r7, #12] 8006472: 68db ldr r3, [r3, #12] 8006474: 2b00 cmp r3, #0 8006476: d06a beq.n 800654e fp->fptr = fp->obj.objsize; /* Offset to seek */ 8006478: 68fb ldr r3, [r7, #12] 800647a: 68da ldr r2, [r3, #12] 800647c: 68fb ldr r3, [r7, #12] 800647e: 619a str r2, [r3, #24] bcs = (DWORD)fs->csize * SS(fs); /* Cluster size in byte */ 8006480: 697b ldr r3, [r7, #20] 8006482: 895b ldrh r3, [r3, #10] 8006484: 461a mov r2, r3 8006486: 697b ldr r3, [r7, #20] 8006488: 899b ldrh r3, [r3, #12] 800648a: fb03 f302 mul.w r3, r3, r2 800648e: 653b str r3, [r7, #80] ; 0x50 clst = fp->obj.sclust; /* Follow the cluster chain */ 8006490: 68fb ldr r3, [r7, #12] 8006492: 689b ldr r3, [r3, #8] 8006494: 663b str r3, [r7, #96] ; 0x60 for (ofs = fp->obj.objsize; res == FR_OK && ofs > bcs; ofs -= bcs) { 8006496: 68fb ldr r3, [r7, #12] 8006498: 68db ldr r3, [r3, #12] 800649a: 65fb str r3, [r7, #92] ; 0x5c 800649c: e016 b.n 80064cc clst = get_fat(&fp->obj, clst); 800649e: 68fb ldr r3, [r7, #12] 80064a0: 6e39 ldr r1, [r7, #96] ; 0x60 80064a2: 4618 mov r0, r3 80064a4: f7fe f888 bl 80045b8 80064a8: 6638 str r0, [r7, #96] ; 0x60 if (clst <= 1) res = FR_INT_ERR; 80064aa: 6e3b ldr r3, [r7, #96] ; 0x60 80064ac: 2b01 cmp r3, #1 80064ae: d802 bhi.n 80064b6 80064b0: 2302 movs r3, #2 80064b2: f887 3067 strb.w r3, [r7, #103] ; 0x67 if (clst == 0xFFFFFFFF) res = FR_DISK_ERR; 80064b6: 6e3b ldr r3, [r7, #96] ; 0x60 80064b8: f1b3 3fff cmp.w r3, #4294967295 80064bc: d102 bne.n 80064c4 80064be: 2301 movs r3, #1 80064c0: f887 3067 strb.w r3, [r7, #103] ; 0x67 for (ofs = fp->obj.objsize; res == FR_OK && ofs > bcs; ofs -= bcs) { 80064c4: 6dfa ldr r2, [r7, #92] ; 0x5c 80064c6: 6d3b ldr r3, [r7, #80] ; 0x50 80064c8: 1ad3 subs r3, r2, r3 80064ca: 65fb str r3, [r7, #92] ; 0x5c 80064cc: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 80064d0: 2b00 cmp r3, #0 80064d2: d103 bne.n 80064dc 80064d4: 6dfa ldr r2, [r7, #92] ; 0x5c 80064d6: 6d3b ldr r3, [r7, #80] ; 0x50 80064d8: 429a cmp r2, r3 80064da: d8e0 bhi.n 800649e } fp->clust = clst; 80064dc: 68fb ldr r3, [r7, #12] 80064de: 6e3a ldr r2, [r7, #96] ; 0x60 80064e0: 61da str r2, [r3, #28] if (res == FR_OK && ofs % SS(fs)) { /* Fill sector buffer if not on the sector boundary */ 80064e2: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 80064e6: 2b00 cmp r3, #0 80064e8: d131 bne.n 800654e 80064ea: 697b ldr r3, [r7, #20] 80064ec: 899b ldrh r3, [r3, #12] 80064ee: 461a mov r2, r3 80064f0: 6dfb ldr r3, [r7, #92] ; 0x5c 80064f2: fbb3 f1f2 udiv r1, r3, r2 80064f6: fb02 f201 mul.w r2, r2, r1 80064fa: 1a9b subs r3, r3, r2 80064fc: 2b00 cmp r3, #0 80064fe: d026 beq.n 800654e if ((sc = clust2sect(fs, clst)) == 0) { 8006500: 697b ldr r3, [r7, #20] 8006502: 6e39 ldr r1, [r7, #96] ; 0x60 8006504: 4618 mov r0, r3 8006506: f7fe f839 bl 800457c 800650a: 64f8 str r0, [r7, #76] ; 0x4c 800650c: 6cfb ldr r3, [r7, #76] ; 0x4c 800650e: 2b00 cmp r3, #0 8006510: d103 bne.n 800651a res = FR_INT_ERR; 8006512: 2302 movs r3, #2 8006514: f887 3067 strb.w r3, [r7, #103] ; 0x67 8006518: e019 b.n 800654e } else { fp->sect = sc + (DWORD)(ofs / SS(fs)); 800651a: 697b ldr r3, [r7, #20] 800651c: 899b ldrh r3, [r3, #12] 800651e: 461a mov r2, r3 8006520: 6dfb ldr r3, [r7, #92] ; 0x5c 8006522: fbb3 f2f2 udiv r2, r3, r2 8006526: 6cfb ldr r3, [r7, #76] ; 0x4c 8006528: 441a add r2, r3 800652a: 68fb ldr r3, [r7, #12] 800652c: 621a str r2, [r3, #32] #if !_FS_TINY if (disk_read(fs->drv, fp->buf, fp->sect, 1) != RES_OK) res = FR_DISK_ERR; 800652e: 697b ldr r3, [r7, #20] 8006530: 7858 ldrb r0, [r3, #1] 8006532: 68fb ldr r3, [r7, #12] 8006534: f103 0130 add.w r1, r3, #48 ; 0x30 8006538: 68fb ldr r3, [r7, #12] 800653a: 6a1a ldr r2, [r3, #32] 800653c: 2301 movs r3, #1 800653e: f7fd fc81 bl 8003e44 8006542: 4603 mov r3, r0 8006544: 2b00 cmp r3, #0 8006546: d002 beq.n 800654e 8006548: 2301 movs r3, #1 800654a: f887 3067 strb.w r3, [r7, #103] ; 0x67 } FREE_NAMBUF(); } if (res != FR_OK) fp->obj.fs = 0; /* Invalidate file object on error */ 800654e: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 8006552: 2b00 cmp r3, #0 8006554: d002 beq.n 800655c 8006556: 68fb ldr r3, [r7, #12] 8006558: 2200 movs r2, #0 800655a: 601a str r2, [r3, #0] LEAVE_FF(fs, res); 800655c: f897 3067 ldrb.w r3, [r7, #103] ; 0x67 } 8006560: 4618 mov r0, r3 8006562: 3768 adds r7, #104 ; 0x68 8006564: 46bd mov sp, r7 8006566: bd80 pop {r7, pc} 08006568 : FIL* fp, /* Pointer to the file object */ const void* buff, /* Pointer to the data to be written */ UINT btw, /* Number of bytes to write */ UINT* bw /* Pointer to number of bytes written */ ) { 8006568: b580 push {r7, lr} 800656a: b08c sub sp, #48 ; 0x30 800656c: af00 add r7, sp, #0 800656e: 60f8 str r0, [r7, #12] 8006570: 60b9 str r1, [r7, #8] 8006572: 607a str r2, [r7, #4] 8006574: 603b str r3, [r7, #0] FRESULT res; FATFS *fs; DWORD clst, sect; UINT wcnt, cc, csect; const BYTE *wbuff = (const BYTE*)buff; 8006576: 68bb ldr r3, [r7, #8] 8006578: 61fb str r3, [r7, #28] *bw = 0; /* Clear write byte counter */ 800657a: 683b ldr r3, [r7, #0] 800657c: 2200 movs r2, #0 800657e: 601a str r2, [r3, #0] res = validate(&fp->obj, &fs); /* Check validity of the file object */ 8006580: 68fb ldr r3, [r7, #12] 8006582: f107 0210 add.w r2, r7, #16 8006586: 4611 mov r1, r2 8006588: 4618 mov r0, r3 800658a: f7ff fda5 bl 80060d8 800658e: 4603 mov r3, r0 8006590: f887 302f strb.w r3, [r7, #47] ; 0x2f if (res != FR_OK || (res = (FRESULT)fp->err) != FR_OK) LEAVE_FF(fs, res); /* Check validity */ 8006594: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 8006598: 2b00 cmp r3, #0 800659a: d107 bne.n 80065ac 800659c: 68fb ldr r3, [r7, #12] 800659e: 7d5b ldrb r3, [r3, #21] 80065a0: f887 302f strb.w r3, [r7, #47] ; 0x2f 80065a4: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 80065a8: 2b00 cmp r3, #0 80065aa: d002 beq.n 80065b2 80065ac: f897 302f ldrb.w r3, [r7, #47] ; 0x2f 80065b0: e16a b.n 8006888 if (!(fp->flag & FA_WRITE)) LEAVE_FF(fs, FR_DENIED); /* Check access mode */ 80065b2: 68fb ldr r3, [r7, #12] 80065b4: 7d1b ldrb r3, [r3, #20] 80065b6: f003 0302 and.w r3, r3, #2 80065ba: 2b00 cmp r3, #0 80065bc: d101 bne.n 80065c2 80065be: 2307 movs r3, #7 80065c0: e162 b.n 8006888 /* Check fptr wrap-around (file size cannot reach 4GiB on FATxx) */ if ((!_FS_EXFAT || fs->fs_type != FS_EXFAT) && (DWORD)(fp->fptr + btw) < (DWORD)fp->fptr) { 80065c2: 68fb ldr r3, [r7, #12] 80065c4: 699a ldr r2, [r3, #24] 80065c6: 687b ldr r3, [r7, #4] 80065c8: 441a add r2, r3 80065ca: 68fb ldr r3, [r7, #12] 80065cc: 699b ldr r3, [r3, #24] 80065ce: 429a cmp r2, r3 80065d0: f080 814c bcs.w 800686c btw = (UINT)(0xFFFFFFFF - (DWORD)fp->fptr); 80065d4: 68fb ldr r3, [r7, #12] 80065d6: 699b ldr r3, [r3, #24] 80065d8: 43db mvns r3, r3 80065da: 607b str r3, [r7, #4] } for ( ; btw; /* Repeat until all data written */ 80065dc: e146 b.n 800686c wbuff += wcnt, fp->fptr += wcnt, fp->obj.objsize = (fp->fptr > fp->obj.objsize) ? fp->fptr : fp->obj.objsize, *bw += wcnt, btw -= wcnt) { if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */ 80065de: 68fb ldr r3, [r7, #12] 80065e0: 699b ldr r3, [r3, #24] 80065e2: 693a ldr r2, [r7, #16] 80065e4: 8992 ldrh r2, [r2, #12] 80065e6: fbb3 f1f2 udiv r1, r3, r2 80065ea: fb02 f201 mul.w r2, r2, r1 80065ee: 1a9b subs r3, r3, r2 80065f0: 2b00 cmp r3, #0 80065f2: f040 80f1 bne.w 80067d8 csect = (UINT)(fp->fptr / SS(fs)) & (fs->csize - 1); /* Sector offset in the cluster */ 80065f6: 68fb ldr r3, [r7, #12] 80065f8: 699b ldr r3, [r3, #24] 80065fa: 693a ldr r2, [r7, #16] 80065fc: 8992 ldrh r2, [r2, #12] 80065fe: fbb3 f3f2 udiv r3, r3, r2 8006602: 693a ldr r2, [r7, #16] 8006604: 8952 ldrh r2, [r2, #10] 8006606: 3a01 subs r2, #1 8006608: 4013 ands r3, r2 800660a: 61bb str r3, [r7, #24] if (csect == 0) { /* On the cluster boundary? */ 800660c: 69bb ldr r3, [r7, #24] 800660e: 2b00 cmp r3, #0 8006610: d143 bne.n 800669a if (fp->fptr == 0) { /* On the top of the file? */ 8006612: 68fb ldr r3, [r7, #12] 8006614: 699b ldr r3, [r3, #24] 8006616: 2b00 cmp r3, #0 8006618: d10c bne.n 8006634 clst = fp->obj.sclust; /* Follow from the origin */ 800661a: 68fb ldr r3, [r7, #12] 800661c: 689b ldr r3, [r3, #8] 800661e: 62bb str r3, [r7, #40] ; 0x28 if (clst == 0) { /* If no cluster is allocated, */ 8006620: 6abb ldr r3, [r7, #40] ; 0x28 8006622: 2b00 cmp r3, #0 8006624: d11a bne.n 800665c clst = create_chain(&fp->obj, 0); /* create a new cluster chain */ 8006626: 68fb ldr r3, [r7, #12] 8006628: 2100 movs r1, #0 800662a: 4618 mov r0, r3 800662c: f7fe fa10 bl 8004a50 8006630: 62b8 str r0, [r7, #40] ; 0x28 8006632: e013 b.n 800665c } } else { /* On the middle or end of the file */ #if _USE_FASTSEEK if (fp->cltbl) { 8006634: 68fb ldr r3, [r7, #12] 8006636: 6adb ldr r3, [r3, #44] ; 0x2c 8006638: 2b00 cmp r3, #0 800663a: d007 beq.n 800664c clst = clmt_clust(fp, fp->fptr); /* Get cluster# from the CLMT */ 800663c: 68fb ldr r3, [r7, #12] 800663e: 699b ldr r3, [r3, #24] 8006640: 4619 mov r1, r3 8006642: 68f8 ldr r0, [r7, #12] 8006644: f7fe fa9c bl 8004b80 8006648: 62b8 str r0, [r7, #40] ; 0x28 800664a: e007 b.n 800665c } else #endif { clst = create_chain(&fp->obj, fp->clust); /* Follow or stretch cluster chain on the FAT */ 800664c: 68fa ldr r2, [r7, #12] 800664e: 68fb ldr r3, [r7, #12] 8006650: 69db ldr r3, [r3, #28] 8006652: 4619 mov r1, r3 8006654: 4610 mov r0, r2 8006656: f7fe f9fb bl 8004a50 800665a: 62b8 str r0, [r7, #40] ; 0x28 } } if (clst == 0) break; /* Could not allocate a new cluster (disk full) */ 800665c: 6abb ldr r3, [r7, #40] ; 0x28 800665e: 2b00 cmp r3, #0 8006660: f000 8109 beq.w 8006876 if (clst == 1) ABORT(fs, FR_INT_ERR); 8006664: 6abb ldr r3, [r7, #40] ; 0x28 8006666: 2b01 cmp r3, #1 8006668: d104 bne.n 8006674 800666a: 68fb ldr r3, [r7, #12] 800666c: 2202 movs r2, #2 800666e: 755a strb r2, [r3, #21] 8006670: 2302 movs r3, #2 8006672: e109 b.n 8006888 if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR); 8006674: 6abb ldr r3, [r7, #40] ; 0x28 8006676: f1b3 3fff cmp.w r3, #4294967295 800667a: d104 bne.n 8006686 800667c: 68fb ldr r3, [r7, #12] 800667e: 2201 movs r2, #1 8006680: 755a strb r2, [r3, #21] 8006682: 2301 movs r3, #1 8006684: e100 b.n 8006888 fp->clust = clst; /* Update current cluster */ 8006686: 68fb ldr r3, [r7, #12] 8006688: 6aba ldr r2, [r7, #40] ; 0x28 800668a: 61da str r2, [r3, #28] if (fp->obj.sclust == 0) fp->obj.sclust = clst; /* Set start cluster if the first write */ 800668c: 68fb ldr r3, [r7, #12] 800668e: 689b ldr r3, [r3, #8] 8006690: 2b00 cmp r3, #0 8006692: d102 bne.n 800669a 8006694: 68fb ldr r3, [r7, #12] 8006696: 6aba ldr r2, [r7, #40] ; 0x28 8006698: 609a str r2, [r3, #8] } #if _FS_TINY if (fs->winsect == fp->sect && sync_window(fs) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Write-back sector cache */ #else if (fp->flag & FA_DIRTY) { /* Write-back sector cache */ 800669a: 68fb ldr r3, [r7, #12] 800669c: 7d1b ldrb r3, [r3, #20] 800669e: b25b sxtb r3, r3 80066a0: 2b00 cmp r3, #0 80066a2: da18 bge.n 80066d6 if (disk_write(fs->drv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); 80066a4: 693b ldr r3, [r7, #16] 80066a6: 7858 ldrb r0, [r3, #1] 80066a8: 68fb ldr r3, [r7, #12] 80066aa: f103 0130 add.w r1, r3, #48 ; 0x30 80066ae: 68fb ldr r3, [r7, #12] 80066b0: 6a1a ldr r2, [r3, #32] 80066b2: 2301 movs r3, #1 80066b4: f7fd fbe6 bl 8003e84 80066b8: 4603 mov r3, r0 80066ba: 2b00 cmp r3, #0 80066bc: d004 beq.n 80066c8 80066be: 68fb ldr r3, [r7, #12] 80066c0: 2201 movs r2, #1 80066c2: 755a strb r2, [r3, #21] 80066c4: 2301 movs r3, #1 80066c6: e0df b.n 8006888 fp->flag &= (BYTE)~FA_DIRTY; 80066c8: 68fb ldr r3, [r7, #12] 80066ca: 7d1b ldrb r3, [r3, #20] 80066cc: f003 037f and.w r3, r3, #127 ; 0x7f 80066d0: b2da uxtb r2, r3 80066d2: 68fb ldr r3, [r7, #12] 80066d4: 751a strb r2, [r3, #20] } #endif sect = clust2sect(fs, fp->clust); /* Get current sector */ 80066d6: 693a ldr r2, [r7, #16] 80066d8: 68fb ldr r3, [r7, #12] 80066da: 69db ldr r3, [r3, #28] 80066dc: 4619 mov r1, r3 80066de: 4610 mov r0, r2 80066e0: f7fd ff4c bl 800457c 80066e4: 6178 str r0, [r7, #20] if (!sect) ABORT(fs, FR_INT_ERR); 80066e6: 697b ldr r3, [r7, #20] 80066e8: 2b00 cmp r3, #0 80066ea: d104 bne.n 80066f6 80066ec: 68fb ldr r3, [r7, #12] 80066ee: 2202 movs r2, #2 80066f0: 755a strb r2, [r3, #21] 80066f2: 2302 movs r3, #2 80066f4: e0c8 b.n 8006888 sect += csect; 80066f6: 697a ldr r2, [r7, #20] 80066f8: 69bb ldr r3, [r7, #24] 80066fa: 4413 add r3, r2 80066fc: 617b str r3, [r7, #20] cc = btw / SS(fs); /* When remaining bytes >= sector size, */ 80066fe: 693b ldr r3, [r7, #16] 8006700: 899b ldrh r3, [r3, #12] 8006702: 461a mov r2, r3 8006704: 687b ldr r3, [r7, #4] 8006706: fbb3 f3f2 udiv r3, r3, r2 800670a: 623b str r3, [r7, #32] if (cc) { /* Write maximum contiguous sectors directly */ 800670c: 6a3b ldr r3, [r7, #32] 800670e: 2b00 cmp r3, #0 8006710: d043 beq.n 800679a if (csect + cc > fs->csize) { /* Clip at cluster boundary */ 8006712: 69ba ldr r2, [r7, #24] 8006714: 6a3b ldr r3, [r7, #32] 8006716: 4413 add r3, r2 8006718: 693a ldr r2, [r7, #16] 800671a: 8952 ldrh r2, [r2, #10] 800671c: 4293 cmp r3, r2 800671e: d905 bls.n 800672c cc = fs->csize - csect; 8006720: 693b ldr r3, [r7, #16] 8006722: 895b ldrh r3, [r3, #10] 8006724: 461a mov r2, r3 8006726: 69bb ldr r3, [r7, #24] 8006728: 1ad3 subs r3, r2, r3 800672a: 623b str r3, [r7, #32] } if (disk_write(fs->drv, wbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR); 800672c: 693b ldr r3, [r7, #16] 800672e: 7858 ldrb r0, [r3, #1] 8006730: 6a3b ldr r3, [r7, #32] 8006732: 697a ldr r2, [r7, #20] 8006734: 69f9 ldr r1, [r7, #28] 8006736: f7fd fba5 bl 8003e84 800673a: 4603 mov r3, r0 800673c: 2b00 cmp r3, #0 800673e: d004 beq.n 800674a 8006740: 68fb ldr r3, [r7, #12] 8006742: 2201 movs r2, #1 8006744: 755a strb r2, [r3, #21] 8006746: 2301 movs r3, #1 8006748: e09e b.n 8006888 if (fs->winsect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */ mem_cpy(fs->win, wbuff + ((fs->winsect - sect) * SS(fs)), SS(fs)); fs->wflag = 0; } #else if (fp->sect - sect < cc) { /* Refill sector cache if it gets invalidated by the direct write */ 800674a: 68fb ldr r3, [r7, #12] 800674c: 6a1a ldr r2, [r3, #32] 800674e: 697b ldr r3, [r7, #20] 8006750: 1ad3 subs r3, r2, r3 8006752: 6a3a ldr r2, [r7, #32] 8006754: 429a cmp r2, r3 8006756: d918 bls.n 800678a mem_cpy(fp->buf, wbuff + ((fp->sect - sect) * SS(fs)), SS(fs)); 8006758: 68fb ldr r3, [r7, #12] 800675a: f103 0030 add.w r0, r3, #48 ; 0x30 800675e: 68fb ldr r3, [r7, #12] 8006760: 6a1a ldr r2, [r3, #32] 8006762: 697b ldr r3, [r7, #20] 8006764: 1ad3 subs r3, r2, r3 8006766: 693a ldr r2, [r7, #16] 8006768: 8992 ldrh r2, [r2, #12] 800676a: fb02 f303 mul.w r3, r2, r3 800676e: 69fa ldr r2, [r7, #28] 8006770: 18d1 adds r1, r2, r3 8006772: 693b ldr r3, [r7, #16] 8006774: 899b ldrh r3, [r3, #12] 8006776: 461a mov r2, r3 8006778: f7fd fc40 bl 8003ffc fp->flag &= (BYTE)~FA_DIRTY; 800677c: 68fb ldr r3, [r7, #12] 800677e: 7d1b ldrb r3, [r3, #20] 8006780: f003 037f and.w r3, r3, #127 ; 0x7f 8006784: b2da uxtb r2, r3 8006786: 68fb ldr r3, [r7, #12] 8006788: 751a strb r2, [r3, #20] } #endif #endif wcnt = SS(fs) * cc; /* Number of bytes transferred */ 800678a: 693b ldr r3, [r7, #16] 800678c: 899b ldrh r3, [r3, #12] 800678e: 461a mov r2, r3 8006790: 6a3b ldr r3, [r7, #32] 8006792: fb02 f303 mul.w r3, r2, r3 8006796: 627b str r3, [r7, #36] ; 0x24 continue; 8006798: e04b b.n 8006832 if (fp->fptr >= fp->obj.objsize) { /* Avoid silly cache filling on the growing edge */ if (sync_window(fs) != FR_OK) ABORT(fs, FR_DISK_ERR); fs->winsect = sect; } #else if (fp->sect != sect && /* Fill sector cache with file data */ 800679a: 68fb ldr r3, [r7, #12] 800679c: 6a1b ldr r3, [r3, #32] 800679e: 697a ldr r2, [r7, #20] 80067a0: 429a cmp r2, r3 80067a2: d016 beq.n 80067d2 fp->fptr < fp->obj.objsize && 80067a4: 68fb ldr r3, [r7, #12] 80067a6: 699a ldr r2, [r3, #24] 80067a8: 68fb ldr r3, [r7, #12] 80067aa: 68db ldr r3, [r3, #12] if (fp->sect != sect && /* Fill sector cache with file data */ 80067ac: 429a cmp r2, r3 80067ae: d210 bcs.n 80067d2 disk_read(fs->drv, fp->buf, sect, 1) != RES_OK) { 80067b0: 693b ldr r3, [r7, #16] 80067b2: 7858 ldrb r0, [r3, #1] 80067b4: 68fb ldr r3, [r7, #12] 80067b6: f103 0130 add.w r1, r3, #48 ; 0x30 80067ba: 2301 movs r3, #1 80067bc: 697a ldr r2, [r7, #20] 80067be: f7fd fb41 bl 8003e44 80067c2: 4603 mov r3, r0 fp->fptr < fp->obj.objsize && 80067c4: 2b00 cmp r3, #0 80067c6: d004 beq.n 80067d2 ABORT(fs, FR_DISK_ERR); 80067c8: 68fb ldr r3, [r7, #12] 80067ca: 2201 movs r2, #1 80067cc: 755a strb r2, [r3, #21] 80067ce: 2301 movs r3, #1 80067d0: e05a b.n 8006888 } #endif fp->sect = sect; 80067d2: 68fb ldr r3, [r7, #12] 80067d4: 697a ldr r2, [r7, #20] 80067d6: 621a str r2, [r3, #32] } wcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes left in the sector */ 80067d8: 693b ldr r3, [r7, #16] 80067da: 899b ldrh r3, [r3, #12] 80067dc: 4618 mov r0, r3 80067de: 68fb ldr r3, [r7, #12] 80067e0: 699b ldr r3, [r3, #24] 80067e2: 693a ldr r2, [r7, #16] 80067e4: 8992 ldrh r2, [r2, #12] 80067e6: fbb3 f1f2 udiv r1, r3, r2 80067ea: fb02 f201 mul.w r2, r2, r1 80067ee: 1a9b subs r3, r3, r2 80067f0: 1ac3 subs r3, r0, r3 80067f2: 627b str r3, [r7, #36] ; 0x24 if (wcnt > btw) wcnt = btw; /* Clip it by btw if needed */ 80067f4: 6a7a ldr r2, [r7, #36] ; 0x24 80067f6: 687b ldr r3, [r7, #4] 80067f8: 429a cmp r2, r3 80067fa: d901 bls.n 8006800 80067fc: 687b ldr r3, [r7, #4] 80067fe: 627b str r3, [r7, #36] ; 0x24 #if _FS_TINY if (move_window(fs, fp->sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window */ mem_cpy(fs->win + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */ fs->wflag = 1; #else mem_cpy(fp->buf + fp->fptr % SS(fs), wbuff, wcnt); /* Fit data to the sector */ 8006800: 68fb ldr r3, [r7, #12] 8006802: f103 0130 add.w r1, r3, #48 ; 0x30 8006806: 68fb ldr r3, [r7, #12] 8006808: 699b ldr r3, [r3, #24] 800680a: 693a ldr r2, [r7, #16] 800680c: 8992 ldrh r2, [r2, #12] 800680e: fbb3 f0f2 udiv r0, r3, r2 8006812: fb02 f200 mul.w r2, r2, r0 8006816: 1a9b subs r3, r3, r2 8006818: 440b add r3, r1 800681a: 6a7a ldr r2, [r7, #36] ; 0x24 800681c: 69f9 ldr r1, [r7, #28] 800681e: 4618 mov r0, r3 8006820: f7fd fbec bl 8003ffc fp->flag |= FA_DIRTY; 8006824: 68fb ldr r3, [r7, #12] 8006826: 7d1b ldrb r3, [r3, #20] 8006828: f063 037f orn r3, r3, #127 ; 0x7f 800682c: b2da uxtb r2, r3 800682e: 68fb ldr r3, [r7, #12] 8006830: 751a strb r2, [r3, #20] wbuff += wcnt, fp->fptr += wcnt, fp->obj.objsize = (fp->fptr > fp->obj.objsize) ? fp->fptr : fp->obj.objsize, *bw += wcnt, btw -= wcnt) { 8006832: 69fa ldr r2, [r7, #28] 8006834: 6a7b ldr r3, [r7, #36] ; 0x24 8006836: 4413 add r3, r2 8006838: 61fb str r3, [r7, #28] 800683a: 68fb ldr r3, [r7, #12] 800683c: 699a ldr r2, [r3, #24] 800683e: 6a7b ldr r3, [r7, #36] ; 0x24 8006840: 441a add r2, r3 8006842: 68fb ldr r3, [r7, #12] 8006844: 619a str r2, [r3, #24] 8006846: 68fb ldr r3, [r7, #12] 8006848: 68da ldr r2, [r3, #12] 800684a: 68fb ldr r3, [r7, #12] 800684c: 699b ldr r3, [r3, #24] 800684e: 429a cmp r2, r3 8006850: bf38 it cc 8006852: 461a movcc r2, r3 8006854: 68fb ldr r3, [r7, #12] 8006856: 60da str r2, [r3, #12] 8006858: 683b ldr r3, [r7, #0] 800685a: 681a ldr r2, [r3, #0] 800685c: 6a7b ldr r3, [r7, #36] ; 0x24 800685e: 441a add r2, r3 8006860: 683b ldr r3, [r7, #0] 8006862: 601a str r2, [r3, #0] 8006864: 687a ldr r2, [r7, #4] 8006866: 6a7b ldr r3, [r7, #36] ; 0x24 8006868: 1ad3 subs r3, r2, r3 800686a: 607b str r3, [r7, #4] for ( ; btw; /* Repeat until all data written */ 800686c: 687b ldr r3, [r7, #4] 800686e: 2b00 cmp r3, #0 8006870: f47f aeb5 bne.w 80065de 8006874: e000 b.n 8006878 if (clst == 0) break; /* Could not allocate a new cluster (disk full) */ 8006876: bf00 nop #endif } fp->flag |= FA_MODIFIED; /* Set file change flag */ 8006878: 68fb ldr r3, [r7, #12] 800687a: 7d1b ldrb r3, [r3, #20] 800687c: f043 0340 orr.w r3, r3, #64 ; 0x40 8006880: b2da uxtb r2, r3 8006882: 68fb ldr r3, [r7, #12] 8006884: 751a strb r2, [r3, #20] LEAVE_FF(fs, FR_OK); 8006886: 2300 movs r3, #0 } 8006888: 4618 mov r0, r3 800688a: 3730 adds r7, #48 ; 0x30 800688c: 46bd mov sp, r7 800688e: bd80 pop {r7, pc} 08006890 : /*-----------------------------------------------------------------------*/ FRESULT f_sync ( FIL* fp /* Pointer to the file object */ ) { 8006890: b580 push {r7, lr} 8006892: b086 sub sp, #24 8006894: af00 add r7, sp, #0 8006896: 6078 str r0, [r7, #4] #if _FS_EXFAT DIR dj; DEF_NAMBUF #endif res = validate(&fp->obj, &fs); /* Check validity of the file object */ 8006898: 687b ldr r3, [r7, #4] 800689a: f107 0208 add.w r2, r7, #8 800689e: 4611 mov r1, r2 80068a0: 4618 mov r0, r3 80068a2: f7ff fc19 bl 80060d8 80068a6: 4603 mov r3, r0 80068a8: 75fb strb r3, [r7, #23] if (res == FR_OK) { 80068aa: 7dfb ldrb r3, [r7, #23] 80068ac: 2b00 cmp r3, #0 80068ae: d168 bne.n 8006982 if (fp->flag & FA_MODIFIED) { /* Is there any change to the file? */ 80068b0: 687b ldr r3, [r7, #4] 80068b2: 7d1b ldrb r3, [r3, #20] 80068b4: f003 0340 and.w r3, r3, #64 ; 0x40 80068b8: 2b00 cmp r3, #0 80068ba: d062 beq.n 8006982 #if !_FS_TINY if (fp->flag & FA_DIRTY) { /* Write-back cached data if needed */ 80068bc: 687b ldr r3, [r7, #4] 80068be: 7d1b ldrb r3, [r3, #20] 80068c0: b25b sxtb r3, r3 80068c2: 2b00 cmp r3, #0 80068c4: da15 bge.n 80068f2 if (disk_write(fs->drv, fp->buf, fp->sect, 1) != RES_OK) LEAVE_FF(fs, FR_DISK_ERR); 80068c6: 68bb ldr r3, [r7, #8] 80068c8: 7858 ldrb r0, [r3, #1] 80068ca: 687b ldr r3, [r7, #4] 80068cc: f103 0130 add.w r1, r3, #48 ; 0x30 80068d0: 687b ldr r3, [r7, #4] 80068d2: 6a1a ldr r2, [r3, #32] 80068d4: 2301 movs r3, #1 80068d6: f7fd fad5 bl 8003e84 80068da: 4603 mov r3, r0 80068dc: 2b00 cmp r3, #0 80068de: d001 beq.n 80068e4 80068e0: 2301 movs r3, #1 80068e2: e04f b.n 8006984 fp->flag &= (BYTE)~FA_DIRTY; 80068e4: 687b ldr r3, [r7, #4] 80068e6: 7d1b ldrb r3, [r3, #20] 80068e8: f003 037f and.w r3, r3, #127 ; 0x7f 80068ec: b2da uxtb r2, r3 80068ee: 687b ldr r3, [r7, #4] 80068f0: 751a strb r2, [r3, #20] } #endif /* Update the directory entry */ tm = GET_FATTIME(); /* Modified time */ 80068f2: f7fd fa0b bl 8003d0c 80068f6: 6138 str r0, [r7, #16] FREE_NAMBUF(); } } else #endif { res = move_window(fs, fp->dir_sect); 80068f8: 68ba ldr r2, [r7, #8] 80068fa: 687b ldr r3, [r7, #4] 80068fc: 6a5b ldr r3, [r3, #36] ; 0x24 80068fe: 4619 mov r1, r3 8006900: 4610 mov r0, r2 8006902: f7fd fd9d bl 8004440 8006906: 4603 mov r3, r0 8006908: 75fb strb r3, [r7, #23] if (res == FR_OK) { 800690a: 7dfb ldrb r3, [r7, #23] 800690c: 2b00 cmp r3, #0 800690e: d138 bne.n 8006982 dir = fp->dir_ptr; 8006910: 687b ldr r3, [r7, #4] 8006912: 6a9b ldr r3, [r3, #40] ; 0x28 8006914: 60fb str r3, [r7, #12] dir[DIR_Attr] |= AM_ARC; /* Set archive bit */ 8006916: 68fb ldr r3, [r7, #12] 8006918: 330b adds r3, #11 800691a: 781a ldrb r2, [r3, #0] 800691c: 68fb ldr r3, [r7, #12] 800691e: 330b adds r3, #11 8006920: f042 0220 orr.w r2, r2, #32 8006924: b2d2 uxtb r2, r2 8006926: 701a strb r2, [r3, #0] st_clust(fp->obj.fs, dir, fp->obj.sclust); /* Update file allocation info */ 8006928: 687b ldr r3, [r7, #4] 800692a: 6818 ldr r0, [r3, #0] 800692c: 687b ldr r3, [r7, #4] 800692e: 689b ldr r3, [r3, #8] 8006930: 461a mov r2, r3 8006932: 68f9 ldr r1, [r7, #12] 8006934: f7fe fb20 bl 8004f78 st_dword(dir + DIR_FileSize, (DWORD)fp->obj.objsize); /* Update file size */ 8006938: 68fb ldr r3, [r7, #12] 800693a: f103 021c add.w r2, r3, #28 800693e: 687b ldr r3, [r7, #4] 8006940: 68db ldr r3, [r3, #12] 8006942: 4619 mov r1, r3 8006944: 4610 mov r0, r2 8006946: f7fd fb2e bl 8003fa6 st_dword(dir + DIR_ModTime, tm); /* Update modified time */ 800694a: 68fb ldr r3, [r7, #12] 800694c: 3316 adds r3, #22 800694e: 6939 ldr r1, [r7, #16] 8006950: 4618 mov r0, r3 8006952: f7fd fb28 bl 8003fa6 st_word(dir + DIR_LstAccDate, 0); 8006956: 68fb ldr r3, [r7, #12] 8006958: 3312 adds r3, #18 800695a: 2100 movs r1, #0 800695c: 4618 mov r0, r3 800695e: f7fd fb08 bl 8003f72 fs->wflag = 1; 8006962: 68bb ldr r3, [r7, #8] 8006964: 2201 movs r2, #1 8006966: 70da strb r2, [r3, #3] res = sync_fs(fs); /* Restore it to the directory */ 8006968: 68bb ldr r3, [r7, #8] 800696a: 4618 mov r0, r3 800696c: f7fd fd96 bl 800449c 8006970: 4603 mov r3, r0 8006972: 75fb strb r3, [r7, #23] fp->flag &= (BYTE)~FA_MODIFIED; 8006974: 687b ldr r3, [r7, #4] 8006976: 7d1b ldrb r3, [r3, #20] 8006978: f023 0340 bic.w r3, r3, #64 ; 0x40 800697c: b2da uxtb r2, r3 800697e: 687b ldr r3, [r7, #4] 8006980: 751a strb r2, [r3, #20] } } } } LEAVE_FF(fs, res); 8006982: 7dfb ldrb r3, [r7, #23] } 8006984: 4618 mov r0, r3 8006986: 3718 adds r7, #24 8006988: 46bd mov sp, r7 800698a: bd80 pop {r7, pc} 0800698c : /*-----------------------------------------------------------------------*/ FRESULT f_close ( FIL* fp /* Pointer to the file object to be closed */ ) { 800698c: b580 push {r7, lr} 800698e: b084 sub sp, #16 8006990: af00 add r7, sp, #0 8006992: 6078 str r0, [r7, #4] FRESULT res; FATFS *fs; #if !_FS_READONLY res = f_sync(fp); /* Flush cached data */ 8006994: 6878 ldr r0, [r7, #4] 8006996: f7ff ff7b bl 8006890 800699a: 4603 mov r3, r0 800699c: 73fb strb r3, [r7, #15] if (res == FR_OK) 800699e: 7bfb ldrb r3, [r7, #15] 80069a0: 2b00 cmp r3, #0 80069a2: d118 bne.n 80069d6 #endif { res = validate(&fp->obj, &fs); /* Lock volume */ 80069a4: 687b ldr r3, [r7, #4] 80069a6: f107 0208 add.w r2, r7, #8 80069aa: 4611 mov r1, r2 80069ac: 4618 mov r0, r3 80069ae: f7ff fb93 bl 80060d8 80069b2: 4603 mov r3, r0 80069b4: 73fb strb r3, [r7, #15] if (res == FR_OK) { 80069b6: 7bfb ldrb r3, [r7, #15] 80069b8: 2b00 cmp r3, #0 80069ba: d10c bne.n 80069d6 #if _FS_LOCK != 0 res = dec_lock(fp->obj.lockid); /* Decrement file open counter */ 80069bc: 687b ldr r3, [r7, #4] 80069be: 691b ldr r3, [r3, #16] 80069c0: 4618 mov r0, r3 80069c2: f7fd fc9d bl 8004300 80069c6: 4603 mov r3, r0 80069c8: 73fb strb r3, [r7, #15] if (res == FR_OK) 80069ca: 7bfb ldrb r3, [r7, #15] 80069cc: 2b00 cmp r3, #0 80069ce: d102 bne.n 80069d6 #endif { fp->obj.fs = 0; /* Invalidate file object */ 80069d0: 687b ldr r3, [r7, #4] 80069d2: 2200 movs r2, #0 80069d4: 601a str r2, [r3, #0] #if _FS_REENTRANT unlock_fs(fs, FR_OK); /* Unlock volume */ #endif } } return res; 80069d6: 7bfb ldrb r3, [r7, #15] } 80069d8: 4618 mov r0, r3 80069da: 3710 adds r7, #16 80069dc: 46bd mov sp, r7 80069de: bd80 pop {r7, pc} 080069e0 : static void putc_bfd ( /* Buffered write with code conversion */ putbuff* pb, TCHAR c ) { 80069e0: b580 push {r7, lr} 80069e2: b084 sub sp, #16 80069e4: af00 add r7, sp, #0 80069e6: 6078 str r0, [r7, #4] 80069e8: 460b mov r3, r1 80069ea: 70fb strb r3, [r7, #3] UINT bw; int i; if (_USE_STRFUNC == 2 && c == '\n') { /* LF -> CRLF conversion */ 80069ec: 78fb ldrb r3, [r7, #3] 80069ee: 2b0a cmp r3, #10 80069f0: d103 bne.n 80069fa putc_bfd(pb, '\r'); 80069f2: 210d movs r1, #13 80069f4: 6878 ldr r0, [r7, #4] 80069f6: f7ff fff3 bl 80069e0 } i = pb->idx; /* Write index of pb->buf[] */ 80069fa: 687b ldr r3, [r7, #4] 80069fc: 685b ldr r3, [r3, #4] 80069fe: 60fb str r3, [r7, #12] if (i < 0) return; 8006a00: 68fb ldr r3, [r7, #12] 8006a02: 2b00 cmp r3, #0 8006a04: db25 blt.n 8006a52 if (c >= 0x100) pb->buf[i++] = (BYTE)(c >> 8); pb->buf[i++] = (BYTE)c; #endif #else /* Write a character without conversion */ pb->buf[i++] = (BYTE)c; 8006a06: 68fb ldr r3, [r7, #12] 8006a08: 1c5a adds r2, r3, #1 8006a0a: 60fa str r2, [r7, #12] 8006a0c: 687a ldr r2, [r7, #4] 8006a0e: 4413 add r3, r2 8006a10: 78fa ldrb r2, [r7, #3] 8006a12: 731a strb r2, [r3, #12] #endif if (i >= (int)(sizeof pb->buf) - 3) { /* Write buffered characters to the file */ 8006a14: 68fb ldr r3, [r7, #12] 8006a16: 2b3c cmp r3, #60 ; 0x3c 8006a18: dd12 ble.n 8006a40 f_write(pb->fp, pb->buf, (UINT)i, &bw); 8006a1a: 687b ldr r3, [r7, #4] 8006a1c: 6818 ldr r0, [r3, #0] 8006a1e: 687b ldr r3, [r7, #4] 8006a20: f103 010c add.w r1, r3, #12 8006a24: 68fa ldr r2, [r7, #12] 8006a26: f107 0308 add.w r3, r7, #8 8006a2a: f7ff fd9d bl 8006568 i = (bw == (UINT)i) ? 0 : -1; 8006a2e: 68ba ldr r2, [r7, #8] 8006a30: 68fb ldr r3, [r7, #12] 8006a32: 429a cmp r2, r3 8006a34: d101 bne.n 8006a3a 8006a36: 2300 movs r3, #0 8006a38: e001 b.n 8006a3e 8006a3a: f04f 33ff mov.w r3, #4294967295 8006a3e: 60fb str r3, [r7, #12] } pb->idx = i; 8006a40: 687b ldr r3, [r7, #4] 8006a42: 68fa ldr r2, [r7, #12] 8006a44: 605a str r2, [r3, #4] pb->nchr++; 8006a46: 687b ldr r3, [r7, #4] 8006a48: 689b ldr r3, [r3, #8] 8006a4a: 1c5a adds r2, r3, #1 8006a4c: 687b ldr r3, [r7, #4] 8006a4e: 609a str r2, [r3, #8] 8006a50: e000 b.n 8006a54 if (i < 0) return; 8006a52: bf00 nop } 8006a54: 3710 adds r7, #16 8006a56: 46bd mov sp, r7 8006a58: bd80 pop {r7, pc} 08006a5a : static int putc_flush ( /* Flush left characters in the buffer */ putbuff* pb ) { 8006a5a: b580 push {r7, lr} 8006a5c: b084 sub sp, #16 8006a5e: af00 add r7, sp, #0 8006a60: 6078 str r0, [r7, #4] UINT nw; if ( pb->idx >= 0 /* Flush buffered characters to the file */ 8006a62: 687b ldr r3, [r7, #4] 8006a64: 685b ldr r3, [r3, #4] 8006a66: 2b00 cmp r3, #0 8006a68: db17 blt.n 8006a9a && f_write(pb->fp, pb->buf, (UINT)pb->idx, &nw) == FR_OK 8006a6a: 687b ldr r3, [r7, #4] 8006a6c: 6818 ldr r0, [r3, #0] 8006a6e: 687b ldr r3, [r7, #4] 8006a70: f103 010c add.w r1, r3, #12 8006a74: 687b ldr r3, [r7, #4] 8006a76: 685b ldr r3, [r3, #4] 8006a78: 461a mov r2, r3 8006a7a: f107 030c add.w r3, r7, #12 8006a7e: f7ff fd73 bl 8006568 8006a82: 4603 mov r3, r0 8006a84: 2b00 cmp r3, #0 8006a86: d108 bne.n 8006a9a && (UINT)pb->idx == nw) return pb->nchr; 8006a88: 687b ldr r3, [r7, #4] 8006a8a: 685b ldr r3, [r3, #4] 8006a8c: 461a mov r2, r3 8006a8e: 68fb ldr r3, [r7, #12] 8006a90: 429a cmp r2, r3 8006a92: d102 bne.n 8006a9a 8006a94: 687b ldr r3, [r7, #4] 8006a96: 689b ldr r3, [r3, #8] 8006a98: e001 b.n 8006a9e return EOF; 8006a9a: f04f 33ff mov.w r3, #4294967295 } 8006a9e: 4618 mov r0, r3 8006aa0: 3710 adds r7, #16 8006aa2: 46bd mov sp, r7 8006aa4: bd80 pop {r7, pc} 08006aa6 : static void putc_init ( /* Initialize write buffer */ putbuff* pb, FIL* fp ) { 8006aa6: b480 push {r7} 8006aa8: b083 sub sp, #12 8006aaa: af00 add r7, sp, #0 8006aac: 6078 str r0, [r7, #4] 8006aae: 6039 str r1, [r7, #0] pb->fp = fp; 8006ab0: 687b ldr r3, [r7, #4] 8006ab2: 683a ldr r2, [r7, #0] 8006ab4: 601a str r2, [r3, #0] pb->nchr = pb->idx = 0; 8006ab6: 687b ldr r3, [r7, #4] 8006ab8: 2200 movs r2, #0 8006aba: 605a str r2, [r3, #4] 8006abc: 687b ldr r3, [r7, #4] 8006abe: 685a ldr r2, [r3, #4] 8006ac0: 687b ldr r3, [r7, #4] 8006ac2: 609a str r2, [r3, #8] } 8006ac4: bf00 nop 8006ac6: 370c adds r7, #12 8006ac8: 46bd mov sp, r7 8006aca: bc80 pop {r7} 8006acc: 4770 bx lr 08006ace : int f_puts ( const TCHAR* str, /* Pointer to the string to be output */ FIL* fp /* Pointer to the file object */ ) { 8006ace: b580 push {r7, lr} 8006ad0: b096 sub sp, #88 ; 0x58 8006ad2: af00 add r7, sp, #0 8006ad4: 6078 str r0, [r7, #4] 8006ad6: 6039 str r1, [r7, #0] putbuff pb; putc_init(&pb, fp); 8006ad8: f107 030c add.w r3, r7, #12 8006adc: 6839 ldr r1, [r7, #0] 8006ade: 4618 mov r0, r3 8006ae0: f7ff ffe1 bl 8006aa6 while (*str) putc_bfd(&pb, *str++); /* Put the string */ 8006ae4: e009 b.n 8006afa 8006ae6: 687b ldr r3, [r7, #4] 8006ae8: 1c5a adds r2, r3, #1 8006aea: 607a str r2, [r7, #4] 8006aec: 781a ldrb r2, [r3, #0] 8006aee: f107 030c add.w r3, r7, #12 8006af2: 4611 mov r1, r2 8006af4: 4618 mov r0, r3 8006af6: f7ff ff73 bl 80069e0 8006afa: 687b ldr r3, [r7, #4] 8006afc: 781b ldrb r3, [r3, #0] 8006afe: 2b00 cmp r3, #0 8006b00: d1f1 bne.n 8006ae6 return putc_flush(&pb); 8006b02: f107 030c add.w r3, r7, #12 8006b06: 4618 mov r0, r3 8006b08: f7ff ffa7 bl 8006a5a 8006b0c: 4603 mov r3, r0 } 8006b0e: 4618 mov r0, r3 8006b10: 3758 adds r7, #88 ; 0x58 8006b12: 46bd mov sp, r7 8006b14: bd80 pop {r7, pc} ... 08006b18 : int f_printf ( FIL* fp, /* Pointer to the file object */ const TCHAR* fmt, /* Pointer to the format string */ ... /* Optional arguments... */ ) { 8006b18: b40e push {r1, r2, r3} 8006b1a: b580 push {r7, lr} 8006b1c: b0a7 sub sp, #156 ; 0x9c 8006b1e: af00 add r7, sp, #0 8006b20: 6078 str r0, [r7, #4] UINT i, j, w; DWORD v; TCHAR c, d, str[32], *p; putc_init(&pb, fp); 8006b22: f107 032c add.w r3, r7, #44 ; 0x2c 8006b26: 6879 ldr r1, [r7, #4] 8006b28: 4618 mov r0, r3 8006b2a: f7ff ffbc bl 8006aa6 va_start(arp, fmt); 8006b2e: f107 03a8 add.w r3, r7, #168 ; 0xa8 8006b32: 67bb str r3, [r7, #120] ; 0x78 for (;;) { c = *fmt++; 8006b34: f8d7 30a4 ldr.w r3, [r7, #164] ; 0xa4 8006b38: 1c5a adds r2, r3, #1 8006b3a: f8c7 20a4 str.w r2, [r7, #164] ; 0xa4 8006b3e: 781b ldrb r3, [r3, #0] 8006b40: f887 3083 strb.w r3, [r7, #131] ; 0x83 if (c == 0) break; /* End of string */ 8006b44: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006b48: 2b00 cmp r3, #0 8006b4a: f000 81f4 beq.w 8006f36 if (c != '%') { /* Non escape character */ 8006b4e: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006b52: 2b25 cmp r3, #37 ; 0x25 8006b54: d008 beq.n 8006b68 putc_bfd(&pb, c); 8006b56: f897 2083 ldrb.w r2, [r7, #131] ; 0x83 8006b5a: f107 032c add.w r3, r7, #44 ; 0x2c 8006b5e: 4611 mov r1, r2 8006b60: 4618 mov r0, r3 8006b62: f7ff ff3d bl 80069e0 continue; 8006b66: e1e5 b.n 8006f34 } w = f = 0; 8006b68: 2300 movs r3, #0 8006b6a: f887 3097 strb.w r3, [r7, #151] ; 0x97 8006b6e: 2300 movs r3, #0 8006b70: f8c7 3088 str.w r3, [r7, #136] ; 0x88 c = *fmt++; 8006b74: f8d7 30a4 ldr.w r3, [r7, #164] ; 0xa4 8006b78: 1c5a adds r2, r3, #1 8006b7a: f8c7 20a4 str.w r2, [r7, #164] ; 0xa4 8006b7e: 781b ldrb r3, [r3, #0] 8006b80: f887 3083 strb.w r3, [r7, #131] ; 0x83 if (c == '0') { /* Flag: '0' padding */ 8006b84: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006b88: 2b30 cmp r3, #48 ; 0x30 8006b8a: d10b bne.n 8006ba4 f = 1; c = *fmt++; 8006b8c: 2301 movs r3, #1 8006b8e: f887 3097 strb.w r3, [r7, #151] ; 0x97 8006b92: f8d7 30a4 ldr.w r3, [r7, #164] ; 0xa4 8006b96: 1c5a adds r2, r3, #1 8006b98: f8c7 20a4 str.w r2, [r7, #164] ; 0xa4 8006b9c: 781b ldrb r3, [r3, #0] 8006b9e: f887 3083 strb.w r3, [r7, #131] ; 0x83 8006ba2: e024 b.n 8006bee } else { if (c == '-') { /* Flag: left justified */ 8006ba4: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006ba8: 2b2d cmp r3, #45 ; 0x2d 8006baa: d120 bne.n 8006bee f = 2; c = *fmt++; 8006bac: 2302 movs r3, #2 8006bae: f887 3097 strb.w r3, [r7, #151] ; 0x97 8006bb2: f8d7 30a4 ldr.w r3, [r7, #164] ; 0xa4 8006bb6: 1c5a adds r2, r3, #1 8006bb8: f8c7 20a4 str.w r2, [r7, #164] ; 0xa4 8006bbc: 781b ldrb r3, [r3, #0] 8006bbe: f887 3083 strb.w r3, [r7, #131] ; 0x83 } } while (IsDigit(c)) { /* Precision */ 8006bc2: e014 b.n 8006bee w = w * 10 + c - '0'; 8006bc4: f8d7 2088 ldr.w r2, [r7, #136] ; 0x88 8006bc8: 4613 mov r3, r2 8006bca: 009b lsls r3, r3, #2 8006bcc: 4413 add r3, r2 8006bce: 005b lsls r3, r3, #1 8006bd0: 461a mov r2, r3 8006bd2: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006bd6: 4413 add r3, r2 8006bd8: 3b30 subs r3, #48 ; 0x30 8006bda: f8c7 3088 str.w r3, [r7, #136] ; 0x88 c = *fmt++; 8006bde: f8d7 30a4 ldr.w r3, [r7, #164] ; 0xa4 8006be2: 1c5a adds r2, r3, #1 8006be4: f8c7 20a4 str.w r2, [r7, #164] ; 0xa4 8006be8: 781b ldrb r3, [r3, #0] 8006bea: f887 3083 strb.w r3, [r7, #131] ; 0x83 while (IsDigit(c)) { /* Precision */ 8006bee: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006bf2: 2b2f cmp r3, #47 ; 0x2f 8006bf4: d903 bls.n 8006bfe 8006bf6: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006bfa: 2b39 cmp r3, #57 ; 0x39 8006bfc: d9e2 bls.n 8006bc4 } if (c == 'l' || c == 'L') { /* Prefix: Size is long int */ 8006bfe: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006c02: 2b6c cmp r3, #108 ; 0x6c 8006c04: d003 beq.n 8006c0e 8006c06: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006c0a: 2b4c cmp r3, #76 ; 0x4c 8006c0c: d10d bne.n 8006c2a f |= 4; c = *fmt++; 8006c0e: f897 3097 ldrb.w r3, [r7, #151] ; 0x97 8006c12: f043 0304 orr.w r3, r3, #4 8006c16: f887 3097 strb.w r3, [r7, #151] ; 0x97 8006c1a: f8d7 30a4 ldr.w r3, [r7, #164] ; 0xa4 8006c1e: 1c5a adds r2, r3, #1 8006c20: f8c7 20a4 str.w r2, [r7, #164] ; 0xa4 8006c24: 781b ldrb r3, [r3, #0] 8006c26: f887 3083 strb.w r3, [r7, #131] ; 0x83 } if (!c) break; 8006c2a: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006c2e: 2b00 cmp r3, #0 8006c30: f000 8183 beq.w 8006f3a d = c; 8006c34: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006c38: f887 3082 strb.w r3, [r7, #130] ; 0x82 if (IsLower(d)) d -= 0x20; 8006c3c: f897 3082 ldrb.w r3, [r7, #130] ; 0x82 8006c40: 2b60 cmp r3, #96 ; 0x60 8006c42: d908 bls.n 8006c56 8006c44: f897 3082 ldrb.w r3, [r7, #130] ; 0x82 8006c48: 2b7a cmp r3, #122 ; 0x7a 8006c4a: d804 bhi.n 8006c56 8006c4c: f897 3082 ldrb.w r3, [r7, #130] ; 0x82 8006c50: 3b20 subs r3, #32 8006c52: f887 3082 strb.w r3, [r7, #130] ; 0x82 switch (d) { /* Type is... */ 8006c56: f897 3082 ldrb.w r3, [r7, #130] ; 0x82 8006c5a: 3b42 subs r3, #66 ; 0x42 8006c5c: 2b16 cmp r3, #22 8006c5e: f200 8098 bhi.w 8006d92 8006c62: a201 add r2, pc, #4 ; (adr r2, 8006c68 ) 8006c64: f852 f023 ldr.w pc, [r2, r3, lsl #2] 8006c68: 08006d73 .word 0x08006d73 8006c6c: 08006d5b .word 0x08006d5b 8006c70: 08006d83 .word 0x08006d83 8006c74: 08006d93 .word 0x08006d93 8006c78: 08006d93 .word 0x08006d93 8006c7c: 08006d93 .word 0x08006d93 8006c80: 08006d93 .word 0x08006d93 8006c84: 08006d93 .word 0x08006d93 8006c88: 08006d93 .word 0x08006d93 8006c8c: 08006d93 .word 0x08006d93 8006c90: 08006d93 .word 0x08006d93 8006c94: 08006d93 .word 0x08006d93 8006c98: 08006d93 .word 0x08006d93 8006c9c: 08006d7b .word 0x08006d7b 8006ca0: 08006d93 .word 0x08006d93 8006ca4: 08006d93 .word 0x08006d93 8006ca8: 08006d93 .word 0x08006d93 8006cac: 08006cc5 .word 0x08006cc5 8006cb0: 08006d93 .word 0x08006d93 8006cb4: 08006d83 .word 0x08006d83 8006cb8: 08006d93 .word 0x08006d93 8006cbc: 08006d93 .word 0x08006d93 8006cc0: 08006d8b .word 0x08006d8b case 'S' : /* String */ p = va_arg(arp, TCHAR*); 8006cc4: 6fbb ldr r3, [r7, #120] ; 0x78 8006cc6: 1d1a adds r2, r3, #4 8006cc8: 67ba str r2, [r7, #120] ; 0x78 8006cca: 681b ldr r3, [r3, #0] 8006ccc: 67fb str r3, [r7, #124] ; 0x7c for (j = 0; p[j]; j++) ; 8006cce: 2300 movs r3, #0 8006cd0: f8c7 308c str.w r3, [r7, #140] ; 0x8c 8006cd4: e004 b.n 8006ce0 8006cd6: f8d7 308c ldr.w r3, [r7, #140] ; 0x8c 8006cda: 3301 adds r3, #1 8006cdc: f8c7 308c str.w r3, [r7, #140] ; 0x8c 8006ce0: 6ffa ldr r2, [r7, #124] ; 0x7c 8006ce2: f8d7 308c ldr.w r3, [r7, #140] ; 0x8c 8006ce6: 4413 add r3, r2 8006ce8: 781b ldrb r3, [r3, #0] 8006cea: 2b00 cmp r3, #0 8006cec: d1f3 bne.n 8006cd6 if (!(f & 2)) { 8006cee: f897 3097 ldrb.w r3, [r7, #151] ; 0x97 8006cf2: f003 0302 and.w r3, r3, #2 8006cf6: 2b00 cmp r3, #0 8006cf8: d11a bne.n 8006d30 while (j++ < w) putc_bfd(&pb, ' '); 8006cfa: e005 b.n 8006d08 8006cfc: f107 032c add.w r3, r7, #44 ; 0x2c 8006d00: 2120 movs r1, #32 8006d02: 4618 mov r0, r3 8006d04: f7ff fe6c bl 80069e0 8006d08: f8d7 308c ldr.w r3, [r7, #140] ; 0x8c 8006d0c: 1c5a adds r2, r3, #1 8006d0e: f8c7 208c str.w r2, [r7, #140] ; 0x8c 8006d12: f8d7 2088 ldr.w r2, [r7, #136] ; 0x88 8006d16: 429a cmp r2, r3 8006d18: d8f0 bhi.n 8006cfc } while (*p) putc_bfd(&pb, *p++); 8006d1a: e009 b.n 8006d30 8006d1c: 6ffb ldr r3, [r7, #124] ; 0x7c 8006d1e: 1c5a adds r2, r3, #1 8006d20: 67fa str r2, [r7, #124] ; 0x7c 8006d22: 781a ldrb r2, [r3, #0] 8006d24: f107 032c add.w r3, r7, #44 ; 0x2c 8006d28: 4611 mov r1, r2 8006d2a: 4618 mov r0, r3 8006d2c: f7ff fe58 bl 80069e0 8006d30: 6ffb ldr r3, [r7, #124] ; 0x7c 8006d32: 781b ldrb r3, [r3, #0] 8006d34: 2b00 cmp r3, #0 8006d36: d1f1 bne.n 8006d1c while (j++ < w) putc_bfd(&pb, ' '); 8006d38: e005 b.n 8006d46 8006d3a: f107 032c add.w r3, r7, #44 ; 0x2c 8006d3e: 2120 movs r1, #32 8006d40: 4618 mov r0, r3 8006d42: f7ff fe4d bl 80069e0 8006d46: f8d7 308c ldr.w r3, [r7, #140] ; 0x8c 8006d4a: 1c5a adds r2, r3, #1 8006d4c: f8c7 208c str.w r2, [r7, #140] ; 0x8c 8006d50: f8d7 2088 ldr.w r2, [r7, #136] ; 0x88 8006d54: 429a cmp r2, r3 8006d56: d8f0 bhi.n 8006d3a continue; 8006d58: e0ec b.n 8006f34 case 'C' : /* Character */ putc_bfd(&pb, (TCHAR)va_arg(arp, int)); continue; 8006d5a: 6fbb ldr r3, [r7, #120] ; 0x78 8006d5c: 1d1a adds r2, r3, #4 8006d5e: 67ba str r2, [r7, #120] ; 0x78 8006d60: 681b ldr r3, [r3, #0] 8006d62: b2da uxtb r2, r3 8006d64: f107 032c add.w r3, r7, #44 ; 0x2c 8006d68: 4611 mov r1, r2 8006d6a: 4618 mov r0, r3 8006d6c: f7ff fe38 bl 80069e0 8006d70: e0e0 b.n 8006f34 case 'B' : /* Binary */ r = 2; break; 8006d72: 2302 movs r3, #2 8006d74: f887 3096 strb.w r3, [r7, #150] ; 0x96 8006d78: e014 b.n 8006da4 case 'O' : /* Octal */ r = 8; break; 8006d7a: 2308 movs r3, #8 8006d7c: f887 3096 strb.w r3, [r7, #150] ; 0x96 8006d80: e010 b.n 8006da4 case 'D' : /* Signed decimal */ case 'U' : /* Unsigned decimal */ r = 10; break; 8006d82: 230a movs r3, #10 8006d84: f887 3096 strb.w r3, [r7, #150] ; 0x96 8006d88: e00c b.n 8006da4 case 'X' : /* Hexdecimal */ r = 16; break; 8006d8a: 2310 movs r3, #16 8006d8c: f887 3096 strb.w r3, [r7, #150] ; 0x96 8006d90: e008 b.n 8006da4 default: /* Unknown type (pass-through) */ putc_bfd(&pb, c); continue; 8006d92: f897 2083 ldrb.w r2, [r7, #131] ; 0x83 8006d96: f107 032c add.w r3, r7, #44 ; 0x2c 8006d9a: 4611 mov r1, r2 8006d9c: 4618 mov r0, r3 8006d9e: f7ff fe1f bl 80069e0 8006da2: e0c7 b.n 8006f34 } /* Get an argument and put it in numeral */ v = (f & 4) ? (DWORD)va_arg(arp, long) : ((d == 'D') ? (DWORD)(long)va_arg(arp, int) : (DWORD)va_arg(arp, unsigned int)); 8006da4: f897 3097 ldrb.w r3, [r7, #151] ; 0x97 8006da8: f003 0304 and.w r3, r3, #4 8006dac: 2b00 cmp r3, #0 8006dae: d004 beq.n 8006dba 8006db0: 6fbb ldr r3, [r7, #120] ; 0x78 8006db2: 1d1a adds r2, r3, #4 8006db4: 67ba str r2, [r7, #120] ; 0x78 8006db6: 681b ldr r3, [r3, #0] 8006db8: e00c b.n 8006dd4 8006dba: f897 3082 ldrb.w r3, [r7, #130] ; 0x82 8006dbe: 2b44 cmp r3, #68 ; 0x44 8006dc0: d104 bne.n 8006dcc 8006dc2: 6fbb ldr r3, [r7, #120] ; 0x78 8006dc4: 1d1a adds r2, r3, #4 8006dc6: 67ba str r2, [r7, #120] ; 0x78 8006dc8: 681b ldr r3, [r3, #0] 8006dca: e003 b.n 8006dd4 8006dcc: 6fbb ldr r3, [r7, #120] ; 0x78 8006dce: 1d1a adds r2, r3, #4 8006dd0: 67ba str r2, [r7, #120] ; 0x78 8006dd2: 681b ldr r3, [r3, #0] 8006dd4: f8c7 3084 str.w r3, [r7, #132] ; 0x84 if (d == 'D' && (v & 0x80000000)) { 8006dd8: f897 3082 ldrb.w r3, [r7, #130] ; 0x82 8006ddc: 2b44 cmp r3, #68 ; 0x44 8006dde: d10e bne.n 8006dfe 8006de0: f8d7 3084 ldr.w r3, [r7, #132] ; 0x84 8006de4: 2b00 cmp r3, #0 8006de6: da0a bge.n 8006dfe v = 0 - v; 8006de8: f8d7 3084 ldr.w r3, [r7, #132] ; 0x84 8006dec: 425b negs r3, r3 8006dee: f8c7 3084 str.w r3, [r7, #132] ; 0x84 f |= 8; 8006df2: f897 3097 ldrb.w r3, [r7, #151] ; 0x97 8006df6: f043 0308 orr.w r3, r3, #8 8006dfa: f887 3097 strb.w r3, [r7, #151] ; 0x97 } i = 0; 8006dfe: 2300 movs r3, #0 8006e00: f8c7 3090 str.w r3, [r7, #144] ; 0x90 do { d = (TCHAR)(v % r); v /= r; 8006e04: f897 2096 ldrb.w r2, [r7, #150] ; 0x96 8006e08: f8d7 3084 ldr.w r3, [r7, #132] ; 0x84 8006e0c: fbb3 f1f2 udiv r1, r3, r2 8006e10: fb02 f201 mul.w r2, r2, r1 8006e14: 1a9b subs r3, r3, r2 8006e16: f887 3082 strb.w r3, [r7, #130] ; 0x82 8006e1a: f897 3096 ldrb.w r3, [r7, #150] ; 0x96 8006e1e: f8d7 2084 ldr.w r2, [r7, #132] ; 0x84 8006e22: fbb2 f3f3 udiv r3, r2, r3 8006e26: f8c7 3084 str.w r3, [r7, #132] ; 0x84 if (d > 9) d += (c == 'x') ? 0x27 : 0x07; 8006e2a: f897 3082 ldrb.w r3, [r7, #130] ; 0x82 8006e2e: 2b09 cmp r3, #9 8006e30: d90b bls.n 8006e4a 8006e32: f897 3083 ldrb.w r3, [r7, #131] ; 0x83 8006e36: 2b78 cmp r3, #120 ; 0x78 8006e38: d101 bne.n 8006e3e 8006e3a: 2227 movs r2, #39 ; 0x27 8006e3c: e000 b.n 8006e40 8006e3e: 2207 movs r2, #7 8006e40: f897 3082 ldrb.w r3, [r7, #130] ; 0x82 8006e44: 4413 add r3, r2 8006e46: f887 3082 strb.w r3, [r7, #130] ; 0x82 str[i++] = d + '0'; 8006e4a: f8d7 3090 ldr.w r3, [r7, #144] ; 0x90 8006e4e: 1c5a adds r2, r3, #1 8006e50: f8c7 2090 str.w r2, [r7, #144] ; 0x90 8006e54: f897 2082 ldrb.w r2, [r7, #130] ; 0x82 8006e58: 3230 adds r2, #48 ; 0x30 8006e5a: b2d2 uxtb r2, r2 8006e5c: f107 0198 add.w r1, r7, #152 ; 0x98 8006e60: 440b add r3, r1 8006e62: f803 2c8c strb.w r2, [r3, #-140] } while (v && i < sizeof str / sizeof str[0]); 8006e66: f8d7 3084 ldr.w r3, [r7, #132] ; 0x84 8006e6a: 2b00 cmp r3, #0 8006e6c: d003 beq.n 8006e76 8006e6e: f8d7 3090 ldr.w r3, [r7, #144] ; 0x90 8006e72: 2b1f cmp r3, #31 8006e74: d9c6 bls.n 8006e04 if (f & 8) str[i++] = '-'; 8006e76: f897 3097 ldrb.w r3, [r7, #151] ; 0x97 8006e7a: f003 0308 and.w r3, r3, #8 8006e7e: 2b00 cmp r3, #0 8006e80: d00a beq.n 8006e98 8006e82: f8d7 3090 ldr.w r3, [r7, #144] ; 0x90 8006e86: 1c5a adds r2, r3, #1 8006e88: f8c7 2090 str.w r2, [r7, #144] ; 0x90 8006e8c: f107 0298 add.w r2, r7, #152 ; 0x98 8006e90: 4413 add r3, r2 8006e92: 222d movs r2, #45 ; 0x2d 8006e94: f803 2c8c strb.w r2, [r3, #-140] j = i; d = (f & 1) ? '0' : ' '; 8006e98: f8d7 3090 ldr.w r3, [r7, #144] ; 0x90 8006e9c: f8c7 308c str.w r3, [r7, #140] ; 0x8c 8006ea0: f897 3097 ldrb.w r3, [r7, #151] ; 0x97 8006ea4: f003 0301 and.w r3, r3, #1 8006ea8: 2b00 cmp r3, #0 8006eaa: d001 beq.n 8006eb0 8006eac: 2330 movs r3, #48 ; 0x30 8006eae: e000 b.n 8006eb2 8006eb0: 2320 movs r3, #32 8006eb2: f887 3082 strb.w r3, [r7, #130] ; 0x82 while (!(f & 2) && j++ < w) putc_bfd(&pb, d); 8006eb6: e007 b.n 8006ec8 8006eb8: f897 2082 ldrb.w r2, [r7, #130] ; 0x82 8006ebc: f107 032c add.w r3, r7, #44 ; 0x2c 8006ec0: 4611 mov r1, r2 8006ec2: 4618 mov r0, r3 8006ec4: f7ff fd8c bl 80069e0 8006ec8: f897 3097 ldrb.w r3, [r7, #151] ; 0x97 8006ecc: f003 0302 and.w r3, r3, #2 8006ed0: 2b00 cmp r3, #0 8006ed2: d108 bne.n 8006ee6 8006ed4: f8d7 308c ldr.w r3, [r7, #140] ; 0x8c 8006ed8: 1c5a adds r2, r3, #1 8006eda: f8c7 208c str.w r2, [r7, #140] ; 0x8c 8006ede: f8d7 2088 ldr.w r2, [r7, #136] ; 0x88 8006ee2: 429a cmp r2, r3 8006ee4: d8e8 bhi.n 8006eb8 do { putc_bfd(&pb, str[--i]); 8006ee6: f8d7 3090 ldr.w r3, [r7, #144] ; 0x90 8006eea: 3b01 subs r3, #1 8006eec: f8c7 3090 str.w r3, [r7, #144] ; 0x90 8006ef0: f107 020c add.w r2, r7, #12 8006ef4: f8d7 3090 ldr.w r3, [r7, #144] ; 0x90 8006ef8: 4413 add r3, r2 8006efa: 781a ldrb r2, [r3, #0] 8006efc: f107 032c add.w r3, r7, #44 ; 0x2c 8006f00: 4611 mov r1, r2 8006f02: 4618 mov r0, r3 8006f04: f7ff fd6c bl 80069e0 } while (i); 8006f08: f8d7 3090 ldr.w r3, [r7, #144] ; 0x90 8006f0c: 2b00 cmp r3, #0 8006f0e: d1ea bne.n 8006ee6 while (j++ < w) putc_bfd(&pb, d); 8006f10: e007 b.n 8006f22 8006f12: f897 2082 ldrb.w r2, [r7, #130] ; 0x82 8006f16: f107 032c add.w r3, r7, #44 ; 0x2c 8006f1a: 4611 mov r1, r2 8006f1c: 4618 mov r0, r3 8006f1e: f7ff fd5f bl 80069e0 8006f22: f8d7 308c ldr.w r3, [r7, #140] ; 0x8c 8006f26: 1c5a adds r2, r3, #1 8006f28: f8c7 208c str.w r2, [r7, #140] ; 0x8c 8006f2c: f8d7 2088 ldr.w r2, [r7, #136] ; 0x88 8006f30: 429a cmp r2, r3 8006f32: d8ee bhi.n 8006f12 c = *fmt++; 8006f34: e5fe b.n 8006b34 if (c == 0) break; /* End of string */ 8006f36: bf00 nop 8006f38: e000 b.n 8006f3c if (!c) break; 8006f3a: bf00 nop } va_end(arp); return putc_flush(&pb); 8006f3c: f107 032c add.w r3, r7, #44 ; 0x2c 8006f40: 4618 mov r0, r3 8006f42: f7ff fd8a bl 8006a5a 8006f46: 4603 mov r3, r0 } 8006f48: 4618 mov r0, r3 8006f4a: 379c adds r7, #156 ; 0x9c 8006f4c: 46bd mov sp, r7 8006f4e: e8bd 4080 ldmia.w sp!, {r7, lr} 8006f52: b003 add sp, #12 8006f54: 4770 bx lr 8006f56: bf00 nop 08006f58 : * @param lun : only used for USB Key Disk to add multi-lun management else the parameter must be equal to 0 * @retval Returns 0 in case of success, otherwise 1. */ uint8_t FATFS_LinkDriverEx(const Diskio_drvTypeDef *drv, char *path, uint8_t lun) { 8006f58: b480 push {r7} 8006f5a: b087 sub sp, #28 8006f5c: af00 add r7, sp, #0 8006f5e: 60f8 str r0, [r7, #12] 8006f60: 60b9 str r1, [r7, #8] 8006f62: 4613 mov r3, r2 8006f64: 71fb strb r3, [r7, #7] uint8_t ret = 1; 8006f66: 2301 movs r3, #1 8006f68: 75fb strb r3, [r7, #23] uint8_t DiskNum = 0; 8006f6a: 2300 movs r3, #0 8006f6c: 75bb strb r3, [r7, #22] if(disk.nbr < _VOLUMES) 8006f6e: 4b1e ldr r3, [pc, #120] ; (8006fe8 ) 8006f70: 7a5b ldrb r3, [r3, #9] 8006f72: b2db uxtb r3, r3 8006f74: 2b00 cmp r3, #0 8006f76: d131 bne.n 8006fdc { disk.is_initialized[disk.nbr] = 0; 8006f78: 4b1b ldr r3, [pc, #108] ; (8006fe8 ) 8006f7a: 7a5b ldrb r3, [r3, #9] 8006f7c: b2db uxtb r3, r3 8006f7e: 461a mov r2, r3 8006f80: 4b19 ldr r3, [pc, #100] ; (8006fe8 ) 8006f82: 2100 movs r1, #0 8006f84: 5499 strb r1, [r3, r2] disk.drv[disk.nbr] = drv; 8006f86: 4b18 ldr r3, [pc, #96] ; (8006fe8 ) 8006f88: 7a5b ldrb r3, [r3, #9] 8006f8a: b2db uxtb r3, r3 8006f8c: 4a16 ldr r2, [pc, #88] ; (8006fe8 ) 8006f8e: 009b lsls r3, r3, #2 8006f90: 4413 add r3, r2 8006f92: 68fa ldr r2, [r7, #12] 8006f94: 605a str r2, [r3, #4] disk.lun[disk.nbr] = lun; 8006f96: 4b14 ldr r3, [pc, #80] ; (8006fe8 ) 8006f98: 7a5b ldrb r3, [r3, #9] 8006f9a: b2db uxtb r3, r3 8006f9c: 461a mov r2, r3 8006f9e: 4b12 ldr r3, [pc, #72] ; (8006fe8 ) 8006fa0: 4413 add r3, r2 8006fa2: 79fa ldrb r2, [r7, #7] 8006fa4: 721a strb r2, [r3, #8] DiskNum = disk.nbr++; 8006fa6: 4b10 ldr r3, [pc, #64] ; (8006fe8 ) 8006fa8: 7a5b ldrb r3, [r3, #9] 8006faa: b2db uxtb r3, r3 8006fac: 1c5a adds r2, r3, #1 8006fae: b2d1 uxtb r1, r2 8006fb0: 4a0d ldr r2, [pc, #52] ; (8006fe8 ) 8006fb2: 7251 strb r1, [r2, #9] 8006fb4: 75bb strb r3, [r7, #22] path[0] = DiskNum + '0'; 8006fb6: 7dbb ldrb r3, [r7, #22] 8006fb8: 3330 adds r3, #48 ; 0x30 8006fba: b2da uxtb r2, r3 8006fbc: 68bb ldr r3, [r7, #8] 8006fbe: 701a strb r2, [r3, #0] path[1] = ':'; 8006fc0: 68bb ldr r3, [r7, #8] 8006fc2: 3301 adds r3, #1 8006fc4: 223a movs r2, #58 ; 0x3a 8006fc6: 701a strb r2, [r3, #0] path[2] = '/'; 8006fc8: 68bb ldr r3, [r7, #8] 8006fca: 3302 adds r3, #2 8006fcc: 222f movs r2, #47 ; 0x2f 8006fce: 701a strb r2, [r3, #0] path[3] = 0; 8006fd0: 68bb ldr r3, [r7, #8] 8006fd2: 3303 adds r3, #3 8006fd4: 2200 movs r2, #0 8006fd6: 701a strb r2, [r3, #0] ret = 0; 8006fd8: 2300 movs r3, #0 8006fda: 75fb strb r3, [r7, #23] } return ret; 8006fdc: 7dfb ldrb r3, [r7, #23] } 8006fde: 4618 mov r0, r3 8006fe0: 371c adds r7, #28 8006fe2: 46bd mov sp, r7 8006fe4: bc80 pop {r7} 8006fe6: 4770 bx lr 8006fe8: 200002d4 .word 0x200002d4 08006fec : * @param drv: pointer to the disk IO Driver structure * @param path: pointer to the logical drive path * @retval Returns 0 in case of success, otherwise 1. */ uint8_t FATFS_LinkDriver(const Diskio_drvTypeDef *drv, char *path) { 8006fec: b580 push {r7, lr} 8006fee: b082 sub sp, #8 8006ff0: af00 add r7, sp, #0 8006ff2: 6078 str r0, [r7, #4] 8006ff4: 6039 str r1, [r7, #0] return FATFS_LinkDriverEx(drv, path, 0); 8006ff6: 2200 movs r2, #0 8006ff8: 6839 ldr r1, [r7, #0] 8006ffa: 6878 ldr r0, [r7, #4] 8006ffc: f7ff ffac bl 8006f58 8007000: 4603 mov r3, r0 } 8007002: 4618 mov r0, r3 8007004: 3708 adds r7, #8 8007006: 46bd mov sp, r7 8007008: bd80 pop {r7, pc} ... 0800700c : WCHAR ff_convert ( /* Converted character, Returns zero on error */ WCHAR chr, /* Character code to be converted */ UINT dir /* 0: Unicode to OEM code, 1: OEM code to Unicode */ ) { 800700c: b480 push {r7} 800700e: b085 sub sp, #20 8007010: af00 add r7, sp, #0 8007012: 4603 mov r3, r0 8007014: 6039 str r1, [r7, #0] 8007016: 80fb strh r3, [r7, #6] WCHAR c; if (chr < 0x80) { /* ASCII */ 8007018: 88fb ldrh r3, [r7, #6] 800701a: 2b7f cmp r3, #127 ; 0x7f 800701c: d802 bhi.n 8007024 c = chr; 800701e: 88fb ldrh r3, [r7, #6] 8007020: 81fb strh r3, [r7, #14] 8007022: e025 b.n 8007070 } else { if (dir) { /* OEM code to Unicode */ 8007024: 683b ldr r3, [r7, #0] 8007026: 2b00 cmp r3, #0 8007028: d00b beq.n 8007042 c = (chr >= 0x100) ? 0 : Tbl[chr - 0x80]; 800702a: 88fb ldrh r3, [r7, #6] 800702c: 2bff cmp r3, #255 ; 0xff 800702e: d805 bhi.n 800703c 8007030: 88fb ldrh r3, [r7, #6] 8007032: 3b80 subs r3, #128 ; 0x80 8007034: 4a11 ldr r2, [pc, #68] ; (800707c ) 8007036: f832 3013 ldrh.w r3, [r2, r3, lsl #1] 800703a: e000 b.n 800703e 800703c: 2300 movs r3, #0 800703e: 81fb strh r3, [r7, #14] 8007040: e016 b.n 8007070 } else { /* Unicode to OEM code */ for (c = 0; c < 0x80; c++) { 8007042: 2300 movs r3, #0 8007044: 81fb strh r3, [r7, #14] 8007046: e009 b.n 800705c if (chr == Tbl[c]) break; 8007048: 89fb ldrh r3, [r7, #14] 800704a: 4a0c ldr r2, [pc, #48] ; (800707c ) 800704c: f832 3013 ldrh.w r3, [r2, r3, lsl #1] 8007050: 88fa ldrh r2, [r7, #6] 8007052: 429a cmp r2, r3 8007054: d006 beq.n 8007064 for (c = 0; c < 0x80; c++) { 8007056: 89fb ldrh r3, [r7, #14] 8007058: 3301 adds r3, #1 800705a: 81fb strh r3, [r7, #14] 800705c: 89fb ldrh r3, [r7, #14] 800705e: 2b7f cmp r3, #127 ; 0x7f 8007060: d9f2 bls.n 8007048 8007062: e000 b.n 8007066 if (chr == Tbl[c]) break; 8007064: bf00 nop } c = (c + 0x80) & 0xFF; 8007066: 89fb ldrh r3, [r7, #14] 8007068: 3380 adds r3, #128 ; 0x80 800706a: b29b uxth r3, r3 800706c: b2db uxtb r3, r3 800706e: 81fb strh r3, [r7, #14] } } return c; 8007070: 89fb ldrh r3, [r7, #14] } 8007072: 4618 mov r0, r3 8007074: 3714 adds r7, #20 8007076: 46bd mov sp, r7 8007078: bc80 pop {r7} 800707a: 4770 bx lr 800707c: 08007c14 .word 0x08007c14 08007080 : WCHAR ff_wtoupper ( /* Returns upper converted character */ WCHAR chr /* Unicode character to be upper converted (BMP only) */ ) { 8007080: b480 push {r7} 8007082: b087 sub sp, #28 8007084: af00 add r7, sp, #0 8007086: 4603 mov r3, r0 8007088: 80fb strh r3, [r7, #6] }; const WCHAR *p; WCHAR bc, nc, cmd; p = chr < 0x1000 ? cvt1 : cvt2; 800708a: 88fb ldrh r3, [r7, #6] 800708c: f5b3 5f80 cmp.w r3, #4096 ; 0x1000 8007090: d201 bcs.n 8007096 8007092: 4b3d ldr r3, [pc, #244] ; (8007188 ) 8007094: e000 b.n 8007098 8007096: 4b3d ldr r3, [pc, #244] ; (800718c ) 8007098: 617b str r3, [r7, #20] for (;;) { bc = *p++; /* Get block base */ 800709a: 697b ldr r3, [r7, #20] 800709c: 1c9a adds r2, r3, #2 800709e: 617a str r2, [r7, #20] 80070a0: 881b ldrh r3, [r3, #0] 80070a2: 827b strh r3, [r7, #18] if (!bc || chr < bc) break; 80070a4: 8a7b ldrh r3, [r7, #18] 80070a6: 2b00 cmp r3, #0 80070a8: d068 beq.n 800717c 80070aa: 88fa ldrh r2, [r7, #6] 80070ac: 8a7b ldrh r3, [r7, #18] 80070ae: 429a cmp r2, r3 80070b0: d364 bcc.n 800717c nc = *p++; cmd = nc >> 8; nc &= 0xFF; /* Get processing command and block size */ 80070b2: 697b ldr r3, [r7, #20] 80070b4: 1c9a adds r2, r3, #2 80070b6: 617a str r2, [r7, #20] 80070b8: 881b ldrh r3, [r3, #0] 80070ba: 823b strh r3, [r7, #16] 80070bc: 8a3b ldrh r3, [r7, #16] 80070be: 0a1b lsrs r3, r3, #8 80070c0: 81fb strh r3, [r7, #14] 80070c2: 8a3b ldrh r3, [r7, #16] 80070c4: b2db uxtb r3, r3 80070c6: 823b strh r3, [r7, #16] if (chr < bc + nc) { /* In the block? */ 80070c8: 88fa ldrh r2, [r7, #6] 80070ca: 8a79 ldrh r1, [r7, #18] 80070cc: 8a3b ldrh r3, [r7, #16] 80070ce: 440b add r3, r1 80070d0: 429a cmp r2, r3 80070d2: da49 bge.n 8007168 switch (cmd) { 80070d4: 89fb ldrh r3, [r7, #14] 80070d6: 2b08 cmp r3, #8 80070d8: d84f bhi.n 800717a 80070da: a201 add r2, pc, #4 ; (adr r2, 80070e0 ) 80070dc: f852 f023 ldr.w pc, [r2, r3, lsl #2] 80070e0: 08007105 .word 0x08007105 80070e4: 08007117 .word 0x08007117 80070e8: 0800712d .word 0x0800712d 80070ec: 08007135 .word 0x08007135 80070f0: 0800713d .word 0x0800713d 80070f4: 08007145 .word 0x08007145 80070f8: 0800714d .word 0x0800714d 80070fc: 08007155 .word 0x08007155 8007100: 0800715d .word 0x0800715d case 0: chr = p[chr - bc]; break; /* Table conversion */ 8007104: 88fa ldrh r2, [r7, #6] 8007106: 8a7b ldrh r3, [r7, #18] 8007108: 1ad3 subs r3, r2, r3 800710a: 005b lsls r3, r3, #1 800710c: 697a ldr r2, [r7, #20] 800710e: 4413 add r3, r2 8007110: 881b ldrh r3, [r3, #0] 8007112: 80fb strh r3, [r7, #6] 8007114: e027 b.n 8007166 case 1: chr -= (chr - bc) & 1; break; /* Case pairs */ 8007116: 88fa ldrh r2, [r7, #6] 8007118: 8a7b ldrh r3, [r7, #18] 800711a: 1ad3 subs r3, r2, r3 800711c: b29b uxth r3, r3 800711e: f003 0301 and.w r3, r3, #1 8007122: b29b uxth r3, r3 8007124: 88fa ldrh r2, [r7, #6] 8007126: 1ad3 subs r3, r2, r3 8007128: 80fb strh r3, [r7, #6] 800712a: e01c b.n 8007166 case 2: chr -= 16; break; /* Shift -16 */ 800712c: 88fb ldrh r3, [r7, #6] 800712e: 3b10 subs r3, #16 8007130: 80fb strh r3, [r7, #6] 8007132: e018 b.n 8007166 case 3: chr -= 32; break; /* Shift -32 */ 8007134: 88fb ldrh r3, [r7, #6] 8007136: 3b20 subs r3, #32 8007138: 80fb strh r3, [r7, #6] 800713a: e014 b.n 8007166 case 4: chr -= 48; break; /* Shift -48 */ 800713c: 88fb ldrh r3, [r7, #6] 800713e: 3b30 subs r3, #48 ; 0x30 8007140: 80fb strh r3, [r7, #6] 8007142: e010 b.n 8007166 case 5: chr -= 26; break; /* Shift -26 */ 8007144: 88fb ldrh r3, [r7, #6] 8007146: 3b1a subs r3, #26 8007148: 80fb strh r3, [r7, #6] 800714a: e00c b.n 8007166 case 6: chr += 8; break; /* Shift +8 */ 800714c: 88fb ldrh r3, [r7, #6] 800714e: 3308 adds r3, #8 8007150: 80fb strh r3, [r7, #6] 8007152: e008 b.n 8007166 case 7: chr -= 80; break; /* Shift -80 */ 8007154: 88fb ldrh r3, [r7, #6] 8007156: 3b50 subs r3, #80 ; 0x50 8007158: 80fb strh r3, [r7, #6] 800715a: e004 b.n 8007166 case 8: chr -= 0x1C60; break; /* Shift -0x1C60 */ 800715c: 88fb ldrh r3, [r7, #6] 800715e: f5a3 53e3 sub.w r3, r3, #7264 ; 0x1c60 8007162: 80fb strh r3, [r7, #6] 8007164: bf00 nop } break; 8007166: e008 b.n 800717a } if (!cmd) p += nc; 8007168: 89fb ldrh r3, [r7, #14] 800716a: 2b00 cmp r3, #0 800716c: d195 bne.n 800709a 800716e: 8a3b ldrh r3, [r7, #16] 8007170: 005b lsls r3, r3, #1 8007172: 697a ldr r2, [r7, #20] 8007174: 4413 add r3, r2 8007176: 617b str r3, [r7, #20] bc = *p++; /* Get block base */ 8007178: e78f b.n 800709a break; 800717a: bf00 nop } return chr; 800717c: 88fb ldrh r3, [r7, #6] } 800717e: 4618 mov r0, r3 8007180: 371c adds r7, #28 8007182: 46bd mov sp, r7 8007184: bc80 pop {r7} 8007186: 4770 bx lr 8007188: 08007d14 .word 0x08007d14 800718c: 08007f08 .word 0x08007f08 08007190 <__errno>: 8007190: 4b01 ldr r3, [pc, #4] ; (8007198 <__errno+0x8>) 8007192: 6818 ldr r0, [r3, #0] 8007194: 4770 bx lr 8007196: bf00 nop 8007198: 20000024 .word 0x20000024 0800719c <__libc_init_array>: 800719c: b570 push {r4, r5, r6, lr} 800719e: 2500 movs r5, #0 80071a0: 4e0c ldr r6, [pc, #48] ; (80071d4 <__libc_init_array+0x38>) 80071a2: 4c0d ldr r4, [pc, #52] ; (80071d8 <__libc_init_array+0x3c>) 80071a4: 1ba4 subs r4, r4, r6 80071a6: 10a4 asrs r4, r4, #2 80071a8: 42a5 cmp r5, r4 80071aa: d109 bne.n 80071c0 <__libc_init_array+0x24> 80071ac: f000 fc44 bl 8007a38 <_init> 80071b0: 2500 movs r5, #0 80071b2: 4e0a ldr r6, [pc, #40] ; (80071dc <__libc_init_array+0x40>) 80071b4: 4c0a ldr r4, [pc, #40] ; (80071e0 <__libc_init_array+0x44>) 80071b6: 1ba4 subs r4, r4, r6 80071b8: 10a4 asrs r4, r4, #2 80071ba: 42a5 cmp r5, r4 80071bc: d105 bne.n 80071ca <__libc_init_array+0x2e> 80071be: bd70 pop {r4, r5, r6, pc} 80071c0: f856 3025 ldr.w r3, [r6, r5, lsl #2] 80071c4: 4798 blx r3 80071c6: 3501 adds r5, #1 80071c8: e7ee b.n 80071a8 <__libc_init_array+0xc> 80071ca: f856 3025 ldr.w r3, [r6, r5, lsl #2] 80071ce: 4798 blx r3 80071d0: 3501 adds r5, #1 80071d2: e7f2 b.n 80071ba <__libc_init_array+0x1e> 80071d4: 08008000 .word 0x08008000 80071d8: 08008000 .word 0x08008000 80071dc: 08008000 .word 0x08008000 80071e0: 08008004 .word 0x08008004 080071e4 : 80071e4: 4603 mov r3, r0 80071e6: 4402 add r2, r0 80071e8: 4293 cmp r3, r2 80071ea: d100 bne.n 80071ee 80071ec: 4770 bx lr 80071ee: f803 1b01 strb.w r1, [r3], #1 80071f2: e7f9 b.n 80071e8 080071f4 : 80071f4: b40e push {r1, r2, r3} 80071f6: f06f 4100 mvn.w r1, #2147483648 ; 0x80000000 80071fa: b500 push {lr} 80071fc: b09c sub sp, #112 ; 0x70 80071fe: ab1d add r3, sp, #116 ; 0x74 8007200: 9002 str r0, [sp, #8] 8007202: 9006 str r0, [sp, #24] 8007204: 9107 str r1, [sp, #28] 8007206: 9104 str r1, [sp, #16] 8007208: 4808 ldr r0, [pc, #32] ; (800722c ) 800720a: 4909 ldr r1, [pc, #36] ; (8007230 ) 800720c: f853 2b04 ldr.w r2, [r3], #4 8007210: 9105 str r1, [sp, #20] 8007212: 6800 ldr r0, [r0, #0] 8007214: a902 add r1, sp, #8 8007216: 9301 str r3, [sp, #4] 8007218: f000 f876 bl 8007308 <_svfiprintf_r> 800721c: 2200 movs r2, #0 800721e: 9b02 ldr r3, [sp, #8] 8007220: 701a strb r2, [r3, #0] 8007222: b01c add sp, #112 ; 0x70 8007224: f85d eb04 ldr.w lr, [sp], #4 8007228: b003 add sp, #12 800722a: 4770 bx lr 800722c: 20000024 .word 0x20000024 8007230: ffff0208 .word 0xffff0208 08007234 : 8007234: 4603 mov r3, r0 8007236: b510 push {r4, lr} 8007238: 781a ldrb r2, [r3, #0] 800723a: 1c5c adds r4, r3, #1 800723c: b93a cbnz r2, 800724e 800723e: 3b01 subs r3, #1 8007240: f811 2b01 ldrb.w r2, [r1], #1 8007244: f803 2f01 strb.w r2, [r3, #1]! 8007248: 2a00 cmp r2, #0 800724a: d1f9 bne.n 8007240 800724c: bd10 pop {r4, pc} 800724e: 4623 mov r3, r4 8007250: e7f2 b.n 8007238 08007252 <__ssputs_r>: 8007252: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr} 8007256: 688e ldr r6, [r1, #8] 8007258: 4682 mov sl, r0 800725a: 429e cmp r6, r3 800725c: 460c mov r4, r1 800725e: 4690 mov r8, r2 8007260: 4699 mov r9, r3 8007262: d837 bhi.n 80072d4 <__ssputs_r+0x82> 8007264: 898a ldrh r2, [r1, #12] 8007266: f412 6f90 tst.w r2, #1152 ; 0x480 800726a: d031 beq.n 80072d0 <__ssputs_r+0x7e> 800726c: 2302 movs r3, #2 800726e: 6825 ldr r5, [r4, #0] 8007270: 6909 ldr r1, [r1, #16] 8007272: 1a6f subs r7, r5, r1 8007274: 6965 ldr r5, [r4, #20] 8007276: eb05 0545 add.w r5, r5, r5, lsl #1 800727a: fb95 f5f3 sdiv r5, r5, r3 800727e: f109 0301 add.w r3, r9, #1 8007282: 443b add r3, r7 8007284: 429d cmp r5, r3 8007286: bf38 it cc 8007288: 461d movcc r5, r3 800728a: 0553 lsls r3, r2, #21 800728c: d530 bpl.n 80072f0 <__ssputs_r+0x9e> 800728e: 4629 mov r1, r5 8007290: f000 fb38 bl 8007904 <_malloc_r> 8007294: 4606 mov r6, r0 8007296: b950 cbnz r0, 80072ae <__ssputs_r+0x5c> 8007298: 230c movs r3, #12 800729a: f04f 30ff mov.w r0, #4294967295 800729e: f8ca 3000 str.w r3, [sl] 80072a2: 89a3 ldrh r3, [r4, #12] 80072a4: f043 0340 orr.w r3, r3, #64 ; 0x40 80072a8: 81a3 strh r3, [r4, #12] 80072aa: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc} 80072ae: 463a mov r2, r7 80072b0: 6921 ldr r1, [r4, #16] 80072b2: f000 fab7 bl 8007824 80072b6: 89a3 ldrh r3, [r4, #12] 80072b8: f423 6390 bic.w r3, r3, #1152 ; 0x480 80072bc: f043 0380 orr.w r3, r3, #128 ; 0x80 80072c0: 81a3 strh r3, [r4, #12] 80072c2: 6126 str r6, [r4, #16] 80072c4: 443e add r6, r7 80072c6: 6026 str r6, [r4, #0] 80072c8: 464e mov r6, r9 80072ca: 6165 str r5, [r4, #20] 80072cc: 1bed subs r5, r5, r7 80072ce: 60a5 str r5, [r4, #8] 80072d0: 454e cmp r6, r9 80072d2: d900 bls.n 80072d6 <__ssputs_r+0x84> 80072d4: 464e mov r6, r9 80072d6: 4632 mov r2, r6 80072d8: 4641 mov r1, r8 80072da: 6820 ldr r0, [r4, #0] 80072dc: f000 faad bl 800783a 80072e0: 68a3 ldr r3, [r4, #8] 80072e2: 2000 movs r0, #0 80072e4: 1b9b subs r3, r3, r6 80072e6: 60a3 str r3, [r4, #8] 80072e8: 6823 ldr r3, [r4, #0] 80072ea: 441e add r6, r3 80072ec: 6026 str r6, [r4, #0] 80072ee: e7dc b.n 80072aa <__ssputs_r+0x58> 80072f0: 462a mov r2, r5 80072f2: f000 fb61 bl 80079b8 <_realloc_r> 80072f6: 4606 mov r6, r0 80072f8: 2800 cmp r0, #0 80072fa: d1e2 bne.n 80072c2 <__ssputs_r+0x70> 80072fc: 6921 ldr r1, [r4, #16] 80072fe: 4650 mov r0, sl 8007300: f000 fab4 bl 800786c <_free_r> 8007304: e7c8 b.n 8007298 <__ssputs_r+0x46> ... 08007308 <_svfiprintf_r>: 8007308: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} 800730c: 461d mov r5, r3 800730e: 898b ldrh r3, [r1, #12] 8007310: b09d sub sp, #116 ; 0x74 8007312: 061f lsls r7, r3, #24 8007314: 4680 mov r8, r0 8007316: 460c mov r4, r1 8007318: 4616 mov r6, r2 800731a: d50f bpl.n 800733c <_svfiprintf_r+0x34> 800731c: 690b ldr r3, [r1, #16] 800731e: b96b cbnz r3, 800733c <_svfiprintf_r+0x34> 8007320: 2140 movs r1, #64 ; 0x40 8007322: f000 faef bl 8007904 <_malloc_r> 8007326: 6020 str r0, [r4, #0] 8007328: 6120 str r0, [r4, #16] 800732a: b928 cbnz r0, 8007338 <_svfiprintf_r+0x30> 800732c: 230c movs r3, #12 800732e: f8c8 3000 str.w r3, [r8] 8007332: f04f 30ff mov.w r0, #4294967295 8007336: e0c8 b.n 80074ca <_svfiprintf_r+0x1c2> 8007338: 2340 movs r3, #64 ; 0x40 800733a: 6163 str r3, [r4, #20] 800733c: 2300 movs r3, #0 800733e: 9309 str r3, [sp, #36] ; 0x24 8007340: 2320 movs r3, #32 8007342: f88d 3029 strb.w r3, [sp, #41] ; 0x29 8007346: 2330 movs r3, #48 ; 0x30 8007348: f04f 0b01 mov.w fp, #1 800734c: f88d 302a strb.w r3, [sp, #42] ; 0x2a 8007350: 9503 str r5, [sp, #12] 8007352: 4637 mov r7, r6 8007354: 463d mov r5, r7 8007356: f815 3b01 ldrb.w r3, [r5], #1 800735a: b10b cbz r3, 8007360 <_svfiprintf_r+0x58> 800735c: 2b25 cmp r3, #37 ; 0x25 800735e: d13e bne.n 80073de <_svfiprintf_r+0xd6> 8007360: ebb7 0a06 subs.w sl, r7, r6 8007364: d00b beq.n 800737e <_svfiprintf_r+0x76> 8007366: 4653 mov r3, sl 8007368: 4632 mov r2, r6 800736a: 4621 mov r1, r4 800736c: 4640 mov r0, r8 800736e: f7ff ff70 bl 8007252 <__ssputs_r> 8007372: 3001 adds r0, #1 8007374: f000 80a4 beq.w 80074c0 <_svfiprintf_r+0x1b8> 8007378: 9b09 ldr r3, [sp, #36] ; 0x24 800737a: 4453 add r3, sl 800737c: 9309 str r3, [sp, #36] ; 0x24 800737e: 783b ldrb r3, [r7, #0] 8007380: 2b00 cmp r3, #0 8007382: f000 809d beq.w 80074c0 <_svfiprintf_r+0x1b8> 8007386: 2300 movs r3, #0 8007388: f04f 32ff mov.w r2, #4294967295 800738c: e9cd 2305 strd r2, r3, [sp, #20] 8007390: 9304 str r3, [sp, #16] 8007392: 9307 str r3, [sp, #28] 8007394: f88d 3053 strb.w r3, [sp, #83] ; 0x53 8007398: 931a str r3, [sp, #104] ; 0x68 800739a: 462f mov r7, r5 800739c: 2205 movs r2, #5 800739e: f817 1b01 ldrb.w r1, [r7], #1 80073a2: 4850 ldr r0, [pc, #320] ; (80074e4 <_svfiprintf_r+0x1dc>) 80073a4: f000 fa30 bl 8007808 80073a8: 9b04 ldr r3, [sp, #16] 80073aa: b9d0 cbnz r0, 80073e2 <_svfiprintf_r+0xda> 80073ac: 06d9 lsls r1, r3, #27 80073ae: bf44 itt mi 80073b0: 2220 movmi r2, #32 80073b2: f88d 2053 strbmi.w r2, [sp, #83] ; 0x53 80073b6: 071a lsls r2, r3, #28 80073b8: bf44 itt mi 80073ba: 222b movmi r2, #43 ; 0x2b 80073bc: f88d 2053 strbmi.w r2, [sp, #83] ; 0x53 80073c0: 782a ldrb r2, [r5, #0] 80073c2: 2a2a cmp r2, #42 ; 0x2a 80073c4: d015 beq.n 80073f2 <_svfiprintf_r+0xea> 80073c6: 462f mov r7, r5 80073c8: 2000 movs r0, #0 80073ca: 250a movs r5, #10 80073cc: 9a07 ldr r2, [sp, #28] 80073ce: 4639 mov r1, r7 80073d0: f811 3b01 ldrb.w r3, [r1], #1 80073d4: 3b30 subs r3, #48 ; 0x30 80073d6: 2b09 cmp r3, #9 80073d8: d94d bls.n 8007476 <_svfiprintf_r+0x16e> 80073da: b1b8 cbz r0, 800740c <_svfiprintf_r+0x104> 80073dc: e00f b.n 80073fe <_svfiprintf_r+0xf6> 80073de: 462f mov r7, r5 80073e0: e7b8 b.n 8007354 <_svfiprintf_r+0x4c> 80073e2: 4a40 ldr r2, [pc, #256] ; (80074e4 <_svfiprintf_r+0x1dc>) 80073e4: 463d mov r5, r7 80073e6: 1a80 subs r0, r0, r2 80073e8: fa0b f000 lsl.w r0, fp, r0 80073ec: 4318 orrs r0, r3 80073ee: 9004 str r0, [sp, #16] 80073f0: e7d3 b.n 800739a <_svfiprintf_r+0x92> 80073f2: 9a03 ldr r2, [sp, #12] 80073f4: 1d11 adds r1, r2, #4 80073f6: 6812 ldr r2, [r2, #0] 80073f8: 9103 str r1, [sp, #12] 80073fa: 2a00 cmp r2, #0 80073fc: db01 blt.n 8007402 <_svfiprintf_r+0xfa> 80073fe: 9207 str r2, [sp, #28] 8007400: e004 b.n 800740c <_svfiprintf_r+0x104> 8007402: 4252 negs r2, r2 8007404: f043 0302 orr.w r3, r3, #2 8007408: 9207 str r2, [sp, #28] 800740a: 9304 str r3, [sp, #16] 800740c: 783b ldrb r3, [r7, #0] 800740e: 2b2e cmp r3, #46 ; 0x2e 8007410: d10c bne.n 800742c <_svfiprintf_r+0x124> 8007412: 787b ldrb r3, [r7, #1] 8007414: 2b2a cmp r3, #42 ; 0x2a 8007416: d133 bne.n 8007480 <_svfiprintf_r+0x178> 8007418: 9b03 ldr r3, [sp, #12] 800741a: 3702 adds r7, #2 800741c: 1d1a adds r2, r3, #4 800741e: 681b ldr r3, [r3, #0] 8007420: 9203 str r2, [sp, #12] 8007422: 2b00 cmp r3, #0 8007424: bfb8 it lt 8007426: f04f 33ff movlt.w r3, #4294967295 800742a: 9305 str r3, [sp, #20] 800742c: 4d2e ldr r5, [pc, #184] ; (80074e8 <_svfiprintf_r+0x1e0>) 800742e: 2203 movs r2, #3 8007430: 7839 ldrb r1, [r7, #0] 8007432: 4628 mov r0, r5 8007434: f000 f9e8 bl 8007808 8007438: b138 cbz r0, 800744a <_svfiprintf_r+0x142> 800743a: 2340 movs r3, #64 ; 0x40 800743c: 1b40 subs r0, r0, r5 800743e: fa03 f000 lsl.w r0, r3, r0 8007442: 9b04 ldr r3, [sp, #16] 8007444: 3701 adds r7, #1 8007446: 4303 orrs r3, r0 8007448: 9304 str r3, [sp, #16] 800744a: 7839 ldrb r1, [r7, #0] 800744c: 2206 movs r2, #6 800744e: 4827 ldr r0, [pc, #156] ; (80074ec <_svfiprintf_r+0x1e4>) 8007450: 1c7e adds r6, r7, #1 8007452: f88d 1028 strb.w r1, [sp, #40] ; 0x28 8007456: f000 f9d7 bl 8007808 800745a: 2800 cmp r0, #0 800745c: d038 beq.n 80074d0 <_svfiprintf_r+0x1c8> 800745e: 4b24 ldr r3, [pc, #144] ; (80074f0 <_svfiprintf_r+0x1e8>) 8007460: bb13 cbnz r3, 80074a8 <_svfiprintf_r+0x1a0> 8007462: 9b03 ldr r3, [sp, #12] 8007464: 3307 adds r3, #7 8007466: f023 0307 bic.w r3, r3, #7 800746a: 3308 adds r3, #8 800746c: 9303 str r3, [sp, #12] 800746e: 9b09 ldr r3, [sp, #36] ; 0x24 8007470: 444b add r3, r9 8007472: 9309 str r3, [sp, #36] ; 0x24 8007474: e76d b.n 8007352 <_svfiprintf_r+0x4a> 8007476: fb05 3202 mla r2, r5, r2, r3 800747a: 2001 movs r0, #1 800747c: 460f mov r7, r1 800747e: e7a6 b.n 80073ce <_svfiprintf_r+0xc6> 8007480: 2300 movs r3, #0 8007482: 250a movs r5, #10 8007484: 4619 mov r1, r3 8007486: 3701 adds r7, #1 8007488: 9305 str r3, [sp, #20] 800748a: 4638 mov r0, r7 800748c: f810 2b01 ldrb.w r2, [r0], #1 8007490: 3a30 subs r2, #48 ; 0x30 8007492: 2a09 cmp r2, #9 8007494: d903 bls.n 800749e <_svfiprintf_r+0x196> 8007496: 2b00 cmp r3, #0 8007498: d0c8 beq.n 800742c <_svfiprintf_r+0x124> 800749a: 9105 str r1, [sp, #20] 800749c: e7c6 b.n 800742c <_svfiprintf_r+0x124> 800749e: fb05 2101 mla r1, r5, r1, r2 80074a2: 2301 movs r3, #1 80074a4: 4607 mov r7, r0 80074a6: e7f0 b.n 800748a <_svfiprintf_r+0x182> 80074a8: ab03 add r3, sp, #12 80074aa: 9300 str r3, [sp, #0] 80074ac: 4622 mov r2, r4 80074ae: 4b11 ldr r3, [pc, #68] ; (80074f4 <_svfiprintf_r+0x1ec>) 80074b0: a904 add r1, sp, #16 80074b2: 4640 mov r0, r8 80074b4: f3af 8000 nop.w 80074b8: f1b0 3fff cmp.w r0, #4294967295 80074bc: 4681 mov r9, r0 80074be: d1d6 bne.n 800746e <_svfiprintf_r+0x166> 80074c0: 89a3 ldrh r3, [r4, #12] 80074c2: 065b lsls r3, r3, #25 80074c4: f53f af35 bmi.w 8007332 <_svfiprintf_r+0x2a> 80074c8: 9809 ldr r0, [sp, #36] ; 0x24 80074ca: b01d add sp, #116 ; 0x74 80074cc: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc} 80074d0: ab03 add r3, sp, #12 80074d2: 9300 str r3, [sp, #0] 80074d4: 4622 mov r2, r4 80074d6: 4b07 ldr r3, [pc, #28] ; (80074f4 <_svfiprintf_r+0x1ec>) 80074d8: a904 add r1, sp, #16 80074da: 4640 mov r0, r8 80074dc: f000 f882 bl 80075e4 <_printf_i> 80074e0: e7ea b.n 80074b8 <_svfiprintf_r+0x1b0> 80074e2: bf00 nop 80074e4: 08007fc4 .word 0x08007fc4 80074e8: 08007fca .word 0x08007fca 80074ec: 08007fce .word 0x08007fce 80074f0: 00000000 .word 0x00000000 80074f4: 08007253 .word 0x08007253 080074f8 <_printf_common>: 80074f8: e92d 47f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, lr} 80074fc: 4691 mov r9, r2 80074fe: 461f mov r7, r3 8007500: 688a ldr r2, [r1, #8] 8007502: 690b ldr r3, [r1, #16] 8007504: 4606 mov r6, r0 8007506: 4293 cmp r3, r2 8007508: bfb8 it lt 800750a: 4613 movlt r3, r2 800750c: f8c9 3000 str.w r3, [r9] 8007510: f891 2043 ldrb.w r2, [r1, #67] ; 0x43 8007514: 460c mov r4, r1 8007516: f8dd 8020 ldr.w r8, [sp, #32] 800751a: b112 cbz r2, 8007522 <_printf_common+0x2a> 800751c: 3301 adds r3, #1 800751e: f8c9 3000 str.w r3, [r9] 8007522: 6823 ldr r3, [r4, #0] 8007524: 0699 lsls r1, r3, #26 8007526: bf42 ittt mi 8007528: f8d9 3000 ldrmi.w r3, [r9] 800752c: 3302 addmi r3, #2 800752e: f8c9 3000 strmi.w r3, [r9] 8007532: 6825 ldr r5, [r4, #0] 8007534: f015 0506 ands.w r5, r5, #6 8007538: d107 bne.n 800754a <_printf_common+0x52> 800753a: f104 0a19 add.w sl, r4, #25 800753e: 68e3 ldr r3, [r4, #12] 8007540: f8d9 2000 ldr.w r2, [r9] 8007544: 1a9b subs r3, r3, r2 8007546: 42ab cmp r3, r5 8007548: dc29 bgt.n 800759e <_printf_common+0xa6> 800754a: f894 3043 ldrb.w r3, [r4, #67] ; 0x43 800754e: 6822 ldr r2, [r4, #0] 8007550: 3300 adds r3, #0 8007552: bf18 it ne 8007554: 2301 movne r3, #1 8007556: 0692 lsls r2, r2, #26 8007558: d42e bmi.n 80075b8 <_printf_common+0xc0> 800755a: f104 0243 add.w r2, r4, #67 ; 0x43 800755e: 4639 mov r1, r7 8007560: 4630 mov r0, r6 8007562: 47c0 blx r8 8007564: 3001 adds r0, #1 8007566: d021 beq.n 80075ac <_printf_common+0xb4> 8007568: 6823 ldr r3, [r4, #0] 800756a: 68e5 ldr r5, [r4, #12] 800756c: f003 0306 and.w r3, r3, #6 8007570: 2b04 cmp r3, #4 8007572: bf18 it ne 8007574: 2500 movne r5, #0 8007576: f8d9 2000 ldr.w r2, [r9] 800757a: f04f 0900 mov.w r9, #0 800757e: bf08 it eq 8007580: 1aad subeq r5, r5, r2 8007582: 68a3 ldr r3, [r4, #8] 8007584: 6922 ldr r2, [r4, #16] 8007586: bf08 it eq 8007588: ea25 75e5 biceq.w r5, r5, r5, asr #31 800758c: 4293 cmp r3, r2 800758e: bfc4 itt gt 8007590: 1a9b subgt r3, r3, r2 8007592: 18ed addgt r5, r5, r3 8007594: 341a adds r4, #26 8007596: 454d cmp r5, r9 8007598: d11a bne.n 80075d0 <_printf_common+0xd8> 800759a: 2000 movs r0, #0 800759c: e008 b.n 80075b0 <_printf_common+0xb8> 800759e: 2301 movs r3, #1 80075a0: 4652 mov r2, sl 80075a2: 4639 mov r1, r7 80075a4: 4630 mov r0, r6 80075a6: 47c0 blx r8 80075a8: 3001 adds r0, #1 80075aa: d103 bne.n 80075b4 <_printf_common+0xbc> 80075ac: f04f 30ff mov.w r0, #4294967295 80075b0: e8bd 87f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, pc} 80075b4: 3501 adds r5, #1 80075b6: e7c2 b.n 800753e <_printf_common+0x46> 80075b8: 2030 movs r0, #48 ; 0x30 80075ba: 18e1 adds r1, r4, r3 80075bc: f881 0043 strb.w r0, [r1, #67] ; 0x43 80075c0: 1c5a adds r2, r3, #1 80075c2: f894 1045 ldrb.w r1, [r4, #69] ; 0x45 80075c6: 4422 add r2, r4 80075c8: 3302 adds r3, #2 80075ca: f882 1043 strb.w r1, [r2, #67] ; 0x43 80075ce: e7c4 b.n 800755a <_printf_common+0x62> 80075d0: 2301 movs r3, #1 80075d2: 4622 mov r2, r4 80075d4: 4639 mov r1, r7 80075d6: 4630 mov r0, r6 80075d8: 47c0 blx r8 80075da: 3001 adds r0, #1 80075dc: d0e6 beq.n 80075ac <_printf_common+0xb4> 80075de: f109 0901 add.w r9, r9, #1 80075e2: e7d8 b.n 8007596 <_printf_common+0x9e> 080075e4 <_printf_i>: 80075e4: e92d 43f0 stmdb sp!, {r4, r5, r6, r7, r8, r9, lr} 80075e8: f101 0c43 add.w ip, r1, #67 ; 0x43 80075ec: 460c mov r4, r1 80075ee: 7e09 ldrb r1, [r1, #24] 80075f0: b085 sub sp, #20 80075f2: 296e cmp r1, #110 ; 0x6e 80075f4: 4617 mov r7, r2 80075f6: 4606 mov r6, r0 80075f8: 4698 mov r8, r3 80075fa: 9a0c ldr r2, [sp, #48] ; 0x30 80075fc: f000 80b3 beq.w 8007766 <_printf_i+0x182> 8007600: d822 bhi.n 8007648 <_printf_i+0x64> 8007602: 2963 cmp r1, #99 ; 0x63 8007604: d036 beq.n 8007674 <_printf_i+0x90> 8007606: d80a bhi.n 800761e <_printf_i+0x3a> 8007608: 2900 cmp r1, #0 800760a: f000 80b9 beq.w 8007780 <_printf_i+0x19c> 800760e: 2958 cmp r1, #88 ; 0x58 8007610: f000 8083 beq.w 800771a <_printf_i+0x136> 8007614: f104 0542 add.w r5, r4, #66 ; 0x42 8007618: f884 1042 strb.w r1, [r4, #66] ; 0x42 800761c: e032 b.n 8007684 <_printf_i+0xa0> 800761e: 2964 cmp r1, #100 ; 0x64 8007620: d001 beq.n 8007626 <_printf_i+0x42> 8007622: 2969 cmp r1, #105 ; 0x69 8007624: d1f6 bne.n 8007614 <_printf_i+0x30> 8007626: 6820 ldr r0, [r4, #0] 8007628: 6813 ldr r3, [r2, #0] 800762a: 0605 lsls r5, r0, #24 800762c: f103 0104 add.w r1, r3, #4 8007630: d52a bpl.n 8007688 <_printf_i+0xa4> 8007632: 681b ldr r3, [r3, #0] 8007634: 6011 str r1, [r2, #0] 8007636: 2b00 cmp r3, #0 8007638: da03 bge.n 8007642 <_printf_i+0x5e> 800763a: 222d movs r2, #45 ; 0x2d 800763c: 425b negs r3, r3 800763e: f884 2043 strb.w r2, [r4, #67] ; 0x43 8007642: 486f ldr r0, [pc, #444] ; (8007800 <_printf_i+0x21c>) 8007644: 220a movs r2, #10 8007646: e039 b.n 80076bc <_printf_i+0xd8> 8007648: 2973 cmp r1, #115 ; 0x73 800764a: f000 809d beq.w 8007788 <_printf_i+0x1a4> 800764e: d808 bhi.n 8007662 <_printf_i+0x7e> 8007650: 296f cmp r1, #111 ; 0x6f 8007652: d020 beq.n 8007696 <_printf_i+0xb2> 8007654: 2970 cmp r1, #112 ; 0x70 8007656: d1dd bne.n 8007614 <_printf_i+0x30> 8007658: 6823 ldr r3, [r4, #0] 800765a: f043 0320 orr.w r3, r3, #32 800765e: 6023 str r3, [r4, #0] 8007660: e003 b.n 800766a <_printf_i+0x86> 8007662: 2975 cmp r1, #117 ; 0x75 8007664: d017 beq.n 8007696 <_printf_i+0xb2> 8007666: 2978 cmp r1, #120 ; 0x78 8007668: d1d4 bne.n 8007614 <_printf_i+0x30> 800766a: 2378 movs r3, #120 ; 0x78 800766c: 4865 ldr r0, [pc, #404] ; (8007804 <_printf_i+0x220>) 800766e: f884 3045 strb.w r3, [r4, #69] ; 0x45 8007672: e055 b.n 8007720 <_printf_i+0x13c> 8007674: 6813 ldr r3, [r2, #0] 8007676: f104 0542 add.w r5, r4, #66 ; 0x42 800767a: 1d19 adds r1, r3, #4 800767c: 681b ldr r3, [r3, #0] 800767e: 6011 str r1, [r2, #0] 8007680: f884 3042 strb.w r3, [r4, #66] ; 0x42 8007684: 2301 movs r3, #1 8007686: e08c b.n 80077a2 <_printf_i+0x1be> 8007688: 681b ldr r3, [r3, #0] 800768a: f010 0f40 tst.w r0, #64 ; 0x40 800768e: 6011 str r1, [r2, #0] 8007690: bf18 it ne 8007692: b21b sxthne r3, r3 8007694: e7cf b.n 8007636 <_printf_i+0x52> 8007696: 6813 ldr r3, [r2, #0] 8007698: 6825 ldr r5, [r4, #0] 800769a: 1d18 adds r0, r3, #4 800769c: 6010 str r0, [r2, #0] 800769e: 0628 lsls r0, r5, #24 80076a0: d501 bpl.n 80076a6 <_printf_i+0xc2> 80076a2: 681b ldr r3, [r3, #0] 80076a4: e002 b.n 80076ac <_printf_i+0xc8> 80076a6: 0668 lsls r0, r5, #25 80076a8: d5fb bpl.n 80076a2 <_printf_i+0xbe> 80076aa: 881b ldrh r3, [r3, #0] 80076ac: 296f cmp r1, #111 ; 0x6f 80076ae: bf14 ite ne 80076b0: 220a movne r2, #10 80076b2: 2208 moveq r2, #8 80076b4: 4852 ldr r0, [pc, #328] ; (8007800 <_printf_i+0x21c>) 80076b6: 2100 movs r1, #0 80076b8: f884 1043 strb.w r1, [r4, #67] ; 0x43 80076bc: 6865 ldr r5, [r4, #4] 80076be: 2d00 cmp r5, #0 80076c0: 60a5 str r5, [r4, #8] 80076c2: f2c0 8095 blt.w 80077f0 <_printf_i+0x20c> 80076c6: 6821 ldr r1, [r4, #0] 80076c8: f021 0104 bic.w r1, r1, #4 80076cc: 6021 str r1, [r4, #0] 80076ce: 2b00 cmp r3, #0 80076d0: d13d bne.n 800774e <_printf_i+0x16a> 80076d2: 2d00 cmp r5, #0 80076d4: f040 808e bne.w 80077f4 <_printf_i+0x210> 80076d8: 4665 mov r5, ip 80076da: 2a08 cmp r2, #8 80076dc: d10b bne.n 80076f6 <_printf_i+0x112> 80076de: 6823 ldr r3, [r4, #0] 80076e0: 07db lsls r3, r3, #31 80076e2: d508 bpl.n 80076f6 <_printf_i+0x112> 80076e4: 6923 ldr r3, [r4, #16] 80076e6: 6862 ldr r2, [r4, #4] 80076e8: 429a cmp r2, r3 80076ea: bfde ittt le 80076ec: 2330 movle r3, #48 ; 0x30 80076ee: f805 3c01 strble.w r3, [r5, #-1] 80076f2: f105 35ff addle.w r5, r5, #4294967295 80076f6: ebac 0305 sub.w r3, ip, r5 80076fa: 6123 str r3, [r4, #16] 80076fc: f8cd 8000 str.w r8, [sp] 8007700: 463b mov r3, r7 8007702: aa03 add r2, sp, #12 8007704: 4621 mov r1, r4 8007706: 4630 mov r0, r6 8007708: f7ff fef6 bl 80074f8 <_printf_common> 800770c: 3001 adds r0, #1 800770e: d14d bne.n 80077ac <_printf_i+0x1c8> 8007710: f04f 30ff mov.w r0, #4294967295 8007714: b005 add sp, #20 8007716: e8bd 83f0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, pc} 800771a: 4839 ldr r0, [pc, #228] ; (8007800 <_printf_i+0x21c>) 800771c: f884 1045 strb.w r1, [r4, #69] ; 0x45 8007720: 6813 ldr r3, [r2, #0] 8007722: 6821 ldr r1, [r4, #0] 8007724: 1d1d adds r5, r3, #4 8007726: 681b ldr r3, [r3, #0] 8007728: 6015 str r5, [r2, #0] 800772a: 060a lsls r2, r1, #24 800772c: d50b bpl.n 8007746 <_printf_i+0x162> 800772e: 07ca lsls r2, r1, #31 8007730: bf44 itt mi 8007732: f041 0120 orrmi.w r1, r1, #32 8007736: 6021 strmi r1, [r4, #0] 8007738: b91b cbnz r3, 8007742 <_printf_i+0x15e> 800773a: 6822 ldr r2, [r4, #0] 800773c: f022 0220 bic.w r2, r2, #32 8007740: 6022 str r2, [r4, #0] 8007742: 2210 movs r2, #16 8007744: e7b7 b.n 80076b6 <_printf_i+0xd2> 8007746: 064d lsls r5, r1, #25 8007748: bf48 it mi 800774a: b29b uxthmi r3, r3 800774c: e7ef b.n 800772e <_printf_i+0x14a> 800774e: 4665 mov r5, ip 8007750: fbb3 f1f2 udiv r1, r3, r2 8007754: fb02 3311 mls r3, r2, r1, r3 8007758: 5cc3 ldrb r3, [r0, r3] 800775a: f805 3d01 strb.w r3, [r5, #-1]! 800775e: 460b mov r3, r1 8007760: 2900 cmp r1, #0 8007762: d1f5 bne.n 8007750 <_printf_i+0x16c> 8007764: e7b9 b.n 80076da <_printf_i+0xf6> 8007766: 6813 ldr r3, [r2, #0] 8007768: 6825 ldr r5, [r4, #0] 800776a: 1d18 adds r0, r3, #4 800776c: 6961 ldr r1, [r4, #20] 800776e: 6010 str r0, [r2, #0] 8007770: 0628 lsls r0, r5, #24 8007772: 681b ldr r3, [r3, #0] 8007774: d501 bpl.n 800777a <_printf_i+0x196> 8007776: 6019 str r1, [r3, #0] 8007778: e002 b.n 8007780 <_printf_i+0x19c> 800777a: 066a lsls r2, r5, #25 800777c: d5fb bpl.n 8007776 <_printf_i+0x192> 800777e: 8019 strh r1, [r3, #0] 8007780: 2300 movs r3, #0 8007782: 4665 mov r5, ip 8007784: 6123 str r3, [r4, #16] 8007786: e7b9 b.n 80076fc <_printf_i+0x118> 8007788: 6813 ldr r3, [r2, #0] 800778a: 1d19 adds r1, r3, #4 800778c: 6011 str r1, [r2, #0] 800778e: 681d ldr r5, [r3, #0] 8007790: 6862 ldr r2, [r4, #4] 8007792: 2100 movs r1, #0 8007794: 4628 mov r0, r5 8007796: f000 f837 bl 8007808 800779a: b108 cbz r0, 80077a0 <_printf_i+0x1bc> 800779c: 1b40 subs r0, r0, r5 800779e: 6060 str r0, [r4, #4] 80077a0: 6863 ldr r3, [r4, #4] 80077a2: 6123 str r3, [r4, #16] 80077a4: 2300 movs r3, #0 80077a6: f884 3043 strb.w r3, [r4, #67] ; 0x43 80077aa: e7a7 b.n 80076fc <_printf_i+0x118> 80077ac: 6923 ldr r3, [r4, #16] 80077ae: 462a mov r2, r5 80077b0: 4639 mov r1, r7 80077b2: 4630 mov r0, r6 80077b4: 47c0 blx r8 80077b6: 3001 adds r0, #1 80077b8: d0aa beq.n 8007710 <_printf_i+0x12c> 80077ba: 6823 ldr r3, [r4, #0] 80077bc: 079b lsls r3, r3, #30 80077be: d413 bmi.n 80077e8 <_printf_i+0x204> 80077c0: 68e0 ldr r0, [r4, #12] 80077c2: 9b03 ldr r3, [sp, #12] 80077c4: 4298 cmp r0, r3 80077c6: bfb8 it lt 80077c8: 4618 movlt r0, r3 80077ca: e7a3 b.n 8007714 <_printf_i+0x130> 80077cc: 2301 movs r3, #1 80077ce: 464a mov r2, r9 80077d0: 4639 mov r1, r7 80077d2: 4630 mov r0, r6 80077d4: 47c0 blx r8 80077d6: 3001 adds r0, #1 80077d8: d09a beq.n 8007710 <_printf_i+0x12c> 80077da: 3501 adds r5, #1 80077dc: 68e3 ldr r3, [r4, #12] 80077de: 9a03 ldr r2, [sp, #12] 80077e0: 1a9b subs r3, r3, r2 80077e2: 42ab cmp r3, r5 80077e4: dcf2 bgt.n 80077cc <_printf_i+0x1e8> 80077e6: e7eb b.n 80077c0 <_printf_i+0x1dc> 80077e8: 2500 movs r5, #0 80077ea: f104 0919 add.w r9, r4, #25 80077ee: e7f5 b.n 80077dc <_printf_i+0x1f8> 80077f0: 2b00 cmp r3, #0 80077f2: d1ac bne.n 800774e <_printf_i+0x16a> 80077f4: 7803 ldrb r3, [r0, #0] 80077f6: f104 0542 add.w r5, r4, #66 ; 0x42 80077fa: f884 3042 strb.w r3, [r4, #66] ; 0x42 80077fe: e76c b.n 80076da <_printf_i+0xf6> 8007800: 08007fd5 .word 0x08007fd5 8007804: 08007fe6 .word 0x08007fe6 08007808 : 8007808: b510 push {r4, lr} 800780a: b2c9 uxtb r1, r1 800780c: 4402 add r2, r0 800780e: 4290 cmp r0, r2 8007810: 4603 mov r3, r0 8007812: d101 bne.n 8007818 8007814: 2300 movs r3, #0 8007816: e003 b.n 8007820 8007818: 781c ldrb r4, [r3, #0] 800781a: 3001 adds r0, #1 800781c: 428c cmp r4, r1 800781e: d1f6 bne.n 800780e 8007820: 4618 mov r0, r3 8007822: bd10 pop {r4, pc} 08007824 : 8007824: b510 push {r4, lr} 8007826: 1e43 subs r3, r0, #1 8007828: 440a add r2, r1 800782a: 4291 cmp r1, r2 800782c: d100 bne.n 8007830 800782e: bd10 pop {r4, pc} 8007830: f811 4b01 ldrb.w r4, [r1], #1 8007834: f803 4f01 strb.w r4, [r3, #1]! 8007838: e7f7 b.n 800782a 0800783a : 800783a: 4288 cmp r0, r1 800783c: b510 push {r4, lr} 800783e: eb01 0302 add.w r3, r1, r2 8007842: d807 bhi.n 8007854 8007844: 1e42 subs r2, r0, #1 8007846: 4299 cmp r1, r3 8007848: d00a beq.n 8007860 800784a: f811 4b01 ldrb.w r4, [r1], #1 800784e: f802 4f01 strb.w r4, [r2, #1]! 8007852: e7f8 b.n 8007846 8007854: 4283 cmp r3, r0 8007856: d9f5 bls.n 8007844 8007858: 1881 adds r1, r0, r2 800785a: 1ad2 subs r2, r2, r3 800785c: 42d3 cmn r3, r2 800785e: d100 bne.n 8007862 8007860: bd10 pop {r4, pc} 8007862: f813 4d01 ldrb.w r4, [r3, #-1]! 8007866: f801 4d01 strb.w r4, [r1, #-1]! 800786a: e7f7 b.n 800785c 0800786c <_free_r>: 800786c: b538 push {r3, r4, r5, lr} 800786e: 4605 mov r5, r0 8007870: 2900 cmp r1, #0 8007872: d043 beq.n 80078fc <_free_r+0x90> 8007874: f851 3c04 ldr.w r3, [r1, #-4] 8007878: 1f0c subs r4, r1, #4 800787a: 2b00 cmp r3, #0 800787c: bfb8 it lt 800787e: 18e4 addlt r4, r4, r3 8007880: f000 f8d0 bl 8007a24 <__malloc_lock> 8007884: 4a1e ldr r2, [pc, #120] ; (8007900 <_free_r+0x94>) 8007886: 6813 ldr r3, [r2, #0] 8007888: 4610 mov r0, r2 800788a: b933 cbnz r3, 800789a <_free_r+0x2e> 800788c: 6063 str r3, [r4, #4] 800788e: 6014 str r4, [r2, #0] 8007890: 4628 mov r0, r5 8007892: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr} 8007896: f000 b8c6 b.w 8007a26 <__malloc_unlock> 800789a: 42a3 cmp r3, r4 800789c: d90b bls.n 80078b6 <_free_r+0x4a> 800789e: 6821 ldr r1, [r4, #0] 80078a0: 1862 adds r2, r4, r1 80078a2: 4293 cmp r3, r2 80078a4: bf01 itttt eq 80078a6: 681a ldreq r2, [r3, #0] 80078a8: 685b ldreq r3, [r3, #4] 80078aa: 1852 addeq r2, r2, r1 80078ac: 6022 streq r2, [r4, #0] 80078ae: 6063 str r3, [r4, #4] 80078b0: 6004 str r4, [r0, #0] 80078b2: e7ed b.n 8007890 <_free_r+0x24> 80078b4: 4613 mov r3, r2 80078b6: 685a ldr r2, [r3, #4] 80078b8: b10a cbz r2, 80078be <_free_r+0x52> 80078ba: 42a2 cmp r2, r4 80078bc: d9fa bls.n 80078b4 <_free_r+0x48> 80078be: 6819 ldr r1, [r3, #0] 80078c0: 1858 adds r0, r3, r1 80078c2: 42a0 cmp r0, r4 80078c4: d10b bne.n 80078de <_free_r+0x72> 80078c6: 6820 ldr r0, [r4, #0] 80078c8: 4401 add r1, r0 80078ca: 1858 adds r0, r3, r1 80078cc: 4282 cmp r2, r0 80078ce: 6019 str r1, [r3, #0] 80078d0: d1de bne.n 8007890 <_free_r+0x24> 80078d2: 6810 ldr r0, [r2, #0] 80078d4: 6852 ldr r2, [r2, #4] 80078d6: 4401 add r1, r0 80078d8: 6019 str r1, [r3, #0] 80078da: 605a str r2, [r3, #4] 80078dc: e7d8 b.n 8007890 <_free_r+0x24> 80078de: d902 bls.n 80078e6 <_free_r+0x7a> 80078e0: 230c movs r3, #12 80078e2: 602b str r3, [r5, #0] 80078e4: e7d4 b.n 8007890 <_free_r+0x24> 80078e6: 6820 ldr r0, [r4, #0] 80078e8: 1821 adds r1, r4, r0 80078ea: 428a cmp r2, r1 80078ec: bf01 itttt eq 80078ee: 6811 ldreq r1, [r2, #0] 80078f0: 6852 ldreq r2, [r2, #4] 80078f2: 1809 addeq r1, r1, r0 80078f4: 6021 streq r1, [r4, #0] 80078f6: 6062 str r2, [r4, #4] 80078f8: 605c str r4, [r3, #4] 80078fa: e7c9 b.n 8007890 <_free_r+0x24> 80078fc: bd38 pop {r3, r4, r5, pc} 80078fe: bf00 nop 8007900: 200002e0 .word 0x200002e0 08007904 <_malloc_r>: 8007904: b570 push {r4, r5, r6, lr} 8007906: 1ccd adds r5, r1, #3 8007908: f025 0503 bic.w r5, r5, #3 800790c: 3508 adds r5, #8 800790e: 2d0c cmp r5, #12 8007910: bf38 it cc 8007912: 250c movcc r5, #12 8007914: 2d00 cmp r5, #0 8007916: 4606 mov r6, r0 8007918: db01 blt.n 800791e <_malloc_r+0x1a> 800791a: 42a9 cmp r1, r5 800791c: d903 bls.n 8007926 <_malloc_r+0x22> 800791e: 230c movs r3, #12 8007920: 6033 str r3, [r6, #0] 8007922: 2000 movs r0, #0 8007924: bd70 pop {r4, r5, r6, pc} 8007926: f000 f87d bl 8007a24 <__malloc_lock> 800792a: 4a21 ldr r2, [pc, #132] ; (80079b0 <_malloc_r+0xac>) 800792c: 6814 ldr r4, [r2, #0] 800792e: 4621 mov r1, r4 8007930: b991 cbnz r1, 8007958 <_malloc_r+0x54> 8007932: 4c20 ldr r4, [pc, #128] ; (80079b4 <_malloc_r+0xb0>) 8007934: 6823 ldr r3, [r4, #0] 8007936: b91b cbnz r3, 8007940 <_malloc_r+0x3c> 8007938: 4630 mov r0, r6 800793a: f000 f863 bl 8007a04 <_sbrk_r> 800793e: 6020 str r0, [r4, #0] 8007940: 4629 mov r1, r5 8007942: 4630 mov r0, r6 8007944: f000 f85e bl 8007a04 <_sbrk_r> 8007948: 1c43 adds r3, r0, #1 800794a: d124 bne.n 8007996 <_malloc_r+0x92> 800794c: 230c movs r3, #12 800794e: 4630 mov r0, r6 8007950: 6033 str r3, [r6, #0] 8007952: f000 f868 bl 8007a26 <__malloc_unlock> 8007956: e7e4 b.n 8007922 <_malloc_r+0x1e> 8007958: 680b ldr r3, [r1, #0] 800795a: 1b5b subs r3, r3, r5 800795c: d418 bmi.n 8007990 <_malloc_r+0x8c> 800795e: 2b0b cmp r3, #11 8007960: d90f bls.n 8007982 <_malloc_r+0x7e> 8007962: 600b str r3, [r1, #0] 8007964: 18cc adds r4, r1, r3 8007966: 50cd str r5, [r1, r3] 8007968: 4630 mov r0, r6 800796a: f000 f85c bl 8007a26 <__malloc_unlock> 800796e: f104 000b add.w r0, r4, #11 8007972: 1d23 adds r3, r4, #4 8007974: f020 0007 bic.w r0, r0, #7 8007978: 1ac3 subs r3, r0, r3 800797a: d0d3 beq.n 8007924 <_malloc_r+0x20> 800797c: 425a negs r2, r3 800797e: 50e2 str r2, [r4, r3] 8007980: e7d0 b.n 8007924 <_malloc_r+0x20> 8007982: 684b ldr r3, [r1, #4] 8007984: 428c cmp r4, r1 8007986: bf16 itet ne 8007988: 6063 strne r3, [r4, #4] 800798a: 6013 streq r3, [r2, #0] 800798c: 460c movne r4, r1 800798e: e7eb b.n 8007968 <_malloc_r+0x64> 8007990: 460c mov r4, r1 8007992: 6849 ldr r1, [r1, #4] 8007994: e7cc b.n 8007930 <_malloc_r+0x2c> 8007996: 1cc4 adds r4, r0, #3 8007998: f024 0403 bic.w r4, r4, #3 800799c: 42a0 cmp r0, r4 800799e: d005 beq.n 80079ac <_malloc_r+0xa8> 80079a0: 1a21 subs r1, r4, r0 80079a2: 4630 mov r0, r6 80079a4: f000 f82e bl 8007a04 <_sbrk_r> 80079a8: 3001 adds r0, #1 80079aa: d0cf beq.n 800794c <_malloc_r+0x48> 80079ac: 6025 str r5, [r4, #0] 80079ae: e7db b.n 8007968 <_malloc_r+0x64> 80079b0: 200002e0 .word 0x200002e0 80079b4: 200002e4 .word 0x200002e4 080079b8 <_realloc_r>: 80079b8: b5f8 push {r3, r4, r5, r6, r7, lr} 80079ba: 4607 mov r7, r0 80079bc: 4614 mov r4, r2 80079be: 460e mov r6, r1 80079c0: b921 cbnz r1, 80079cc <_realloc_r+0x14> 80079c2: e8bd 40f8 ldmia.w sp!, {r3, r4, r5, r6, r7, lr} 80079c6: 4611 mov r1, r2 80079c8: f7ff bf9c b.w 8007904 <_malloc_r> 80079cc: b922 cbnz r2, 80079d8 <_realloc_r+0x20> 80079ce: f7ff ff4d bl 800786c <_free_r> 80079d2: 4625 mov r5, r4 80079d4: 4628 mov r0, r5 80079d6: bdf8 pop {r3, r4, r5, r6, r7, pc} 80079d8: f000 f826 bl 8007a28 <_malloc_usable_size_r> 80079dc: 42a0 cmp r0, r4 80079de: d20f bcs.n 8007a00 <_realloc_r+0x48> 80079e0: 4621 mov r1, r4 80079e2: 4638 mov r0, r7 80079e4: f7ff ff8e bl 8007904 <_malloc_r> 80079e8: 4605 mov r5, r0 80079ea: 2800 cmp r0, #0 80079ec: d0f2 beq.n 80079d4 <_realloc_r+0x1c> 80079ee: 4631 mov r1, r6 80079f0: 4622 mov r2, r4 80079f2: f7ff ff17 bl 8007824 80079f6: 4631 mov r1, r6 80079f8: 4638 mov r0, r7 80079fa: f7ff ff37 bl 800786c <_free_r> 80079fe: e7e9 b.n 80079d4 <_realloc_r+0x1c> 8007a00: 4635 mov r5, r6 8007a02: e7e7 b.n 80079d4 <_realloc_r+0x1c> 08007a04 <_sbrk_r>: 8007a04: b538 push {r3, r4, r5, lr} 8007a06: 2300 movs r3, #0 8007a08: 4c05 ldr r4, [pc, #20] ; (8007a20 <_sbrk_r+0x1c>) 8007a0a: 4605 mov r5, r0 8007a0c: 4608 mov r0, r1 8007a0e: 6023 str r3, [r4, #0] 8007a10: f7f9 fdd8 bl 80015c4 <_sbrk> 8007a14: 1c43 adds r3, r0, #1 8007a16: d102 bne.n 8007a1e <_sbrk_r+0x1a> 8007a18: 6823 ldr r3, [r4, #0] 8007a1a: b103 cbz r3, 8007a1e <_sbrk_r+0x1a> 8007a1c: 602b str r3, [r5, #0] 8007a1e: bd38 pop {r3, r4, r5, pc} 8007a20: 20004550 .word 0x20004550 08007a24 <__malloc_lock>: 8007a24: 4770 bx lr 08007a26 <__malloc_unlock>: 8007a26: 4770 bx lr 08007a28 <_malloc_usable_size_r>: 8007a28: f851 3c04 ldr.w r3, [r1, #-4] 8007a2c: 1f18 subs r0, r3, #4 8007a2e: 2b00 cmp r3, #0 8007a30: bfbc itt lt 8007a32: 580b ldrlt r3, [r1, r0] 8007a34: 18c0 addlt r0, r0, r3 8007a36: 4770 bx lr 08007a38 <_init>: 8007a38: b5f8 push {r3, r4, r5, r6, r7, lr} 8007a3a: bf00 nop 8007a3c: bcf8 pop {r3, r4, r5, r6, r7} 8007a3e: bc08 pop {r3} 8007a40: 469e mov lr, r3 8007a42: 4770 bx lr 08007a44 <_fini>: 8007a44: b5f8 push {r3, r4, r5, r6, r7, lr} 8007a46: bf00 nop 8007a48: bcf8 pop {r3, r4, r5, r6, r7} 8007a4a: bc08 pop {r3} 8007a4c: 469e mov lr, r3 8007a4e: 4770 bx lr