751 lines
28 KiB
Plaintext

task1.elf: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .isr_vector 000001d8 08000000 08000000 00001000 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .text 000004a0 080001d8 080001d8 000011d8 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .rodata 00000000 08000678 08000680 00001680 2**0
CONTENTS, ALLOC, LOAD, DATA
3 .ARM.extab 00000000 08000678 08000678 00001680 2**0
CONTENTS
4 .ARM 00000000 08000678 08000678 00001680 2**0
CONTENTS
5 .preinit_array 00000000 08000678 08000680 00001680 2**0
CONTENTS, ALLOC, LOAD, DATA
6 .init_array 00000004 08000678 08000678 00001678 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .fini_array 00000004 0800067c 0800067c 0000167c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .data 00000000 20000000 20000000 00001680 2**0
CONTENTS, ALLOC, LOAD, DATA
9 .ccmsram 00000000 10000000 10000000 00001680 2**0
CONTENTS
10 .bss 00000020 20000000 20000000 00002000 2**2
ALLOC
11 ._user_heap_stack 00000600 20000020 20000020 00002000 2**0
ALLOC
12 .ARM.attributes 00000030 00000000 00000000 00001680 2**0
CONTENTS, READONLY
13 .debug_info 000007eb 00000000 00000000 000016b0 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
14 .debug_abbrev 00000296 00000000 00000000 00001e9b 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
15 .debug_aranges 00000078 00000000 00000000 00002138 2**3
CONTENTS, READONLY, DEBUGGING, OCTETS
16 .debug_rnglists 0000003a 00000000 00000000 000021b0 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
17 .debug_macro 00013740 00000000 00000000 000021ea 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
18 .debug_line 00000b70 00000000 00000000 0001592a 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
19 .debug_str 0006f819 00000000 00000000 0001649a 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
20 .comment 00000043 00000000 00000000 00085cb3 2**0
CONTENTS, READONLY
21 .debug_frame 000000e4 00000000 00000000 00085cf8 2**2
CONTENTS, READONLY, DEBUGGING, OCTETS
22 .debug_line_str 00000062 00000000 00000000 00085ddc 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
Disassembly of section .text:
080001d8 <__do_global_dtors_aux>:
80001d8: b510 push {r4, lr}
80001da: 4c05 ldr r4, [pc, #20] @ (80001f0 <__do_global_dtors_aux+0x18>)
80001dc: 7823 ldrb r3, [r4, #0]
80001de: b933 cbnz r3, 80001ee <__do_global_dtors_aux+0x16>
80001e0: 4b04 ldr r3, [pc, #16] @ (80001f4 <__do_global_dtors_aux+0x1c>)
80001e2: b113 cbz r3, 80001ea <__do_global_dtors_aux+0x12>
80001e4: 4804 ldr r0, [pc, #16] @ (80001f8 <__do_global_dtors_aux+0x20>)
80001e6: f3af 8000 nop.w
80001ea: 2301 movs r3, #1
80001ec: 7023 strb r3, [r4, #0]
80001ee: bd10 pop {r4, pc}
80001f0: 20000000 .word 0x20000000
80001f4: 00000000 .word 0x00000000
80001f8: 08000660 .word 0x08000660
080001fc <frame_dummy>:
80001fc: b508 push {r3, lr}
80001fe: 4b03 ldr r3, [pc, #12] @ (800020c <frame_dummy+0x10>)
8000200: b11b cbz r3, 800020a <frame_dummy+0xe>
8000202: 4903 ldr r1, [pc, #12] @ (8000210 <frame_dummy+0x14>)
8000204: 4803 ldr r0, [pc, #12] @ (8000214 <frame_dummy+0x18>)
8000206: f3af 8000 nop.w
800020a: bd08 pop {r3, pc}
800020c: 00000000 .word 0x00000000
8000210: 20000004 .word 0x20000004
8000214: 08000660 .word 0x08000660
08000218 <main>:
static void GPIO_init(void);
static void delay(const uint16_t ms);
/* ------------------------------------ M A I N --------------------------------------- */
int main(void)
{
8000218: b580 push {r7, lr}
800021a: b084 sub sp, #16
800021c: af00 add r7, sp, #0
\details Disables IRQ interrupts by setting the I-bit in the CPSR.
Can only be executed in Privileged modes.
*/
__STATIC_FORCEINLINE void __disable_irq(void)
{
__ASM volatile ("cpsid i" : : : "memory");
800021e: b672 cpsid i
}
8000220: bf00 nop
/* --- initialization --- */
__disable_irq(); // disable interrupts globally
GPIO_init();
8000222: f000 f8e5 bl 80003f0 <GPIO_init>
__ASM volatile ("cpsie i" : : : "memory");
8000226: b662 cpsie i
}
8000228: bf00 nop
__enable_irq(); // enable interrupts globally
/* --- one time tasks --- */
//s0 Hilfvariablen auserhalb von while deklarieren
int running = 0; //0 Lauflicht aus, 1 Lauflicht an
800022a: 2300 movs r3, #0
800022c: 60fb str r3, [r7, #12]
int lastButtonState = 1; // Hilfsvariable zur Flankenerkennung
800022e: 2301 movs r3, #1
8000230: 60bb str r3, [r7, #8]
/* --- infinite processing loop --- */
while (1)
{
int buttonState = GPIOB->IDR & (1 << 0);
8000232: 4b6d ldr r3, [pc, #436] @ (80003e8 <main+0x1d0>)
8000234: 691b ldr r3, [r3, #16]
8000236: f003 0301 and.w r3, r3, #1
800023a: 607b str r3, [r7, #4]
// fallende Flanke erkennen
if (lastButtonState && !buttonState)
800023c: 68bb ldr r3, [r7, #8]
800023e: 2b00 cmp r3, #0
8000240: d006 beq.n 8000250 <main+0x38>
8000242: 687b ldr r3, [r7, #4]
8000244: 2b00 cmp r3, #0
8000246: d103 bne.n 8000250 <main+0x38>
{
running ^= 1; // toggle running
8000248: 68fb ldr r3, [r7, #12]
800024a: f083 0301 eor.w r3, r3, #1
800024e: 60fb str r3, [r7, #12]
/* delay(50); // entprellen */
}
lastButtonState = buttonState;
8000250: 687b ldr r3, [r7, #4]
8000252: 60bb str r3, [r7, #8]
if(running)
8000254: 68fb ldr r3, [r7, #12]
8000256: 2b00 cmp r3, #0
8000258: d0eb beq.n 8000232 <main+0x1a>
{
switch (state)
800025a: 4b64 ldr r3, [pc, #400] @ (80003ec <main+0x1d4>)
800025c: 681b ldr r3, [r3, #0]
800025e: 2b05 cmp r3, #5
8000260: dc12 bgt.n 8000288 <main+0x70>
8000262: 2b00 cmp r3, #0
8000264: dbe5 blt.n 8000232 <main+0x1a>
8000266: 2b05 cmp r3, #5
8000268: d8e3 bhi.n 8000232 <main+0x1a>
800026a: a201 add r2, pc, #4 @ (adr r2, 8000270 <main+0x58>)
800026c: f852 f023 ldr.w pc, [r2, r3, lsl #2]
8000270: 08000291 .word 0x08000291
8000274: 080002c5 .word 0x080002c5
8000278: 080002f9 .word 0x080002f9
800027c: 0800032d .word 0x0800032d
8000280: 08000361 .word 0x08000361
8000284: 08000395 .word 0x08000395
8000288: 2b63 cmp r3, #99 @ 0x63
800028a: f000 809b beq.w 80003c4 <main+0x1ac>
800028e: e0aa b.n 80003e6 <main+0x1ce>
{
case 0:
state++;
8000290: 4b56 ldr r3, [pc, #344] @ (80003ec <main+0x1d4>)
8000292: 681b ldr r3, [r3, #0]
8000294: 3301 adds r3, #1
8000296: 4a55 ldr r2, [pc, #340] @ (80003ec <main+0x1d4>)
8000298: 6013 str r3, [r2, #0]
GPIOA->ODR &= ~(1 << 0);
800029a: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800029e: 695b ldr r3, [r3, #20]
80002a0: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80002a4: f023 0301 bic.w r3, r3, #1
80002a8: 6153 str r3, [r2, #20]
delay(WAITTIME);
80002aa: f240 104d movw r0, #333 @ 0x14d
80002ae: f000 f911 bl 80004d4 <delay>
GPIOA->ODR |= (1 << 0);
80002b2: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80002b6: 695b ldr r3, [r3, #20]
80002b8: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80002bc: f043 0301 orr.w r3, r3, #1
80002c0: 6153 str r3, [r2, #20]
break;
80002c2: e090 b.n 80003e6 <main+0x1ce>
case 1:
state++;
80002c4: 4b49 ldr r3, [pc, #292] @ (80003ec <main+0x1d4>)
80002c6: 681b ldr r3, [r3, #0]
80002c8: 3301 adds r3, #1
80002ca: 4a48 ldr r2, [pc, #288] @ (80003ec <main+0x1d4>)
80002cc: 6013 str r3, [r2, #0]
GPIOA->ODR &= ~(1 << 1);
80002ce: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80002d2: 695b ldr r3, [r3, #20]
80002d4: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80002d8: f023 0302 bic.w r3, r3, #2
80002dc: 6153 str r3, [r2, #20]
delay(WAITTIME);
80002de: f240 104d movw r0, #333 @ 0x14d
80002e2: f000 f8f7 bl 80004d4 <delay>
GPIOA->ODR |= (1 << 1);
80002e6: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80002ea: 695b ldr r3, [r3, #20]
80002ec: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80002f0: f043 0302 orr.w r3, r3, #2
80002f4: 6153 str r3, [r2, #20]
break;
80002f6: e076 b.n 80003e6 <main+0x1ce>
case 2:
state++;
80002f8: 4b3c ldr r3, [pc, #240] @ (80003ec <main+0x1d4>)
80002fa: 681b ldr r3, [r3, #0]
80002fc: 3301 adds r3, #1
80002fe: 4a3b ldr r2, [pc, #236] @ (80003ec <main+0x1d4>)
8000300: 6013 str r3, [r2, #0]
GPIOA->ODR &= ~(1 << 2);
8000302: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000306: 695b ldr r3, [r3, #20]
8000308: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800030c: f023 0304 bic.w r3, r3, #4
8000310: 6153 str r3, [r2, #20]
delay(WAITTIME);
8000312: f240 104d movw r0, #333 @ 0x14d
8000316: f000 f8dd bl 80004d4 <delay>
GPIOA->ODR |= (1 << 2);
800031a: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800031e: 695b ldr r3, [r3, #20]
8000320: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000324: f043 0304 orr.w r3, r3, #4
8000328: 6153 str r3, [r2, #20]
break;
800032a: e05c b.n 80003e6 <main+0x1ce>
case 3:
state++;
800032c: 4b2f ldr r3, [pc, #188] @ (80003ec <main+0x1d4>)
800032e: 681b ldr r3, [r3, #0]
8000330: 3301 adds r3, #1
8000332: 4a2e ldr r2, [pc, #184] @ (80003ec <main+0x1d4>)
8000334: 6013 str r3, [r2, #0]
GPIOA->ODR &= ~(1 << 3);
8000336: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800033a: 695b ldr r3, [r3, #20]
800033c: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000340: f023 0308 bic.w r3, r3, #8
8000344: 6153 str r3, [r2, #20]
delay(WAITTIME);
8000346: f240 104d movw r0, #333 @ 0x14d
800034a: f000 f8c3 bl 80004d4 <delay>
GPIOA->ODR |= (1 << 3);
800034e: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000352: 695b ldr r3, [r3, #20]
8000354: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000358: f043 0308 orr.w r3, r3, #8
800035c: 6153 str r3, [r2, #20]
break;
800035e: e042 b.n 80003e6 <main+0x1ce>
case 4:
state++;
8000360: 4b22 ldr r3, [pc, #136] @ (80003ec <main+0x1d4>)
8000362: 681b ldr r3, [r3, #0]
8000364: 3301 adds r3, #1
8000366: 4a21 ldr r2, [pc, #132] @ (80003ec <main+0x1d4>)
8000368: 6013 str r3, [r2, #0]
GPIOA->ODR &= ~(1 << 2);
800036a: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800036e: 695b ldr r3, [r3, #20]
8000370: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000374: f023 0304 bic.w r3, r3, #4
8000378: 6153 str r3, [r2, #20]
delay(WAITTIME);
800037a: f240 104d movw r0, #333 @ 0x14d
800037e: f000 f8a9 bl 80004d4 <delay>
GPIOA->ODR |= (1 << 2);
8000382: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000386: 695b ldr r3, [r3, #20]
8000388: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800038c: f043 0304 orr.w r3, r3, #4
8000390: 6153 str r3, [r2, #20]
break;
8000392: e028 b.n 80003e6 <main+0x1ce>
case 5:
state=0;
8000394: 4b15 ldr r3, [pc, #84] @ (80003ec <main+0x1d4>)
8000396: 2200 movs r2, #0
8000398: 601a str r2, [r3, #0]
GPIOA->ODR &= ~(1 << 1);
800039a: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800039e: 695b ldr r3, [r3, #20]
80003a0: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80003a4: f023 0302 bic.w r3, r3, #2
80003a8: 6153 str r3, [r2, #20]
delay(WAITTIME);
80003aa: f240 104d movw r0, #333 @ 0x14d
80003ae: f000 f891 bl 80004d4 <delay>
GPIOA->ODR |= (1 << 1);
80003b2: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80003b6: 695b ldr r3, [r3, #20]
80003b8: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80003bc: f043 0302 orr.w r3, r3, #2
80003c0: 6153 str r3, [r2, #20]
break;
80003c2: e010 b.n 80003e6 <main+0x1ce>
case 99:
GPIOA->ODR |= MASK_LED_ALL;
80003c4: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80003c8: 695b ldr r3, [r3, #20]
80003ca: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80003ce: f043 030f orr.w r3, r3, #15
80003d2: 6153 str r3, [r2, #20]
while(1){
if((GPIOB->IDR & (1 << 0)) == 0){
80003d4: 4b04 ldr r3, [pc, #16] @ (80003e8 <main+0x1d0>)
80003d6: 691b ldr r3, [r3, #16]
80003d8: f003 0301 and.w r3, r3, #1
80003dc: 2b00 cmp r3, #0
80003de: d1f9 bne.n 80003d4 <main+0x1bc>
state=0;
80003e0: 4b02 ldr r3, [pc, #8] @ (80003ec <main+0x1d4>)
80003e2: 2200 movs r2, #0
80003e4: 601a str r2, [r3, #0]
{
80003e6: e724 b.n 8000232 <main+0x1a>
80003e8: 48000400 .word 0x48000400
80003ec: 2000001c .word 0x2000001c
080003f0 <GPIO_init>:
* requires: - nothing -
* parameters: - none -
* returns: - nothing -
\* ------------------------------------------------------------------------------------ */
static void GPIO_init(void)
{
80003f0: b480 push {r7}
80003f2: af00 add r7, sp, #0
/* enable port clocks */
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN; // LEDs: A
80003f4: 4b35 ldr r3, [pc, #212] @ (80004cc <GPIO_init+0xdc>)
80003f6: 6cdb ldr r3, [r3, #76] @ 0x4c
80003f8: 4a34 ldr r2, [pc, #208] @ (80004cc <GPIO_init+0xdc>)
80003fa: f043 0301 orr.w r3, r3, #1
80003fe: 64d3 str r3, [r2, #76] @ 0x4c
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOBEN; //Taster versuch
8000400: 4b32 ldr r3, [pc, #200] @ (80004cc <GPIO_init+0xdc>)
8000402: 6cdb ldr r3, [r3, #76] @ 0x4c
8000404: 4a31 ldr r2, [pc, #196] @ (80004cc <GPIO_init+0xdc>)
8000406: f043 0302 orr.w r3, r3, #2
800040a: 64d3 str r3, [r2, #76] @ 0x4c
/* --- LEDs --- */
GPIOA->ODR |= MASK_LED_ALL;
800040c: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000410: 695b ldr r3, [r3, #20]
8000412: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000416: f043 030f orr.w r3, r3, #15
800041a: 6153 str r3, [r2, #20]
GPIOA->MODER &= ~(3 << 0);
800041c: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000420: 681b ldr r3, [r3, #0]
8000422: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000426: f023 0303 bic.w r3, r3, #3
800042a: 6013 str r3, [r2, #0]
GPIOA->MODER |= (1 << 0); // set LED pin to output
800042c: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000430: 681b ldr r3, [r3, #0]
8000432: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000436: f043 0301 orr.w r3, r3, #1
800043a: 6013 str r3, [r2, #0]
/* LED1 als Output */
GPIOA->MODER &= ~(3 << 2); // Versuch: LED 1 Mode löschen :klappt so
800043c: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000440: 681b ldr r3, [r3, #0]
8000442: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000446: f023 030c bic.w r3, r3, #12
800044a: 6013 str r3, [r2, #0]
GPIOA->MODER |= (1 << 2); // Versuch: LED 1 PA1 = output :klappt so
800044c: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000450: 681b ldr r3, [r3, #0]
8000452: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000456: f043 0304 orr.w r3, r3, #4
800045a: 6013 str r3, [r2, #0]
/* LED2 als Output */
GPIOA->MODER &= ~(3 << 4); // Versuch: LED 2 Mode löschen :klappt
800045c: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000460: 681b ldr r3, [r3, #0]
8000462: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000466: f023 0330 bic.w r3, r3, #48 @ 0x30
800046a: 6013 str r3, [r2, #0]
GPIOA->MODER |= (1 << 4); // Versuch: LED 2 PA1 = output :klappt
800046c: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000470: 681b ldr r3, [r3, #0]
8000472: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000476: f043 0310 orr.w r3, r3, #16
800047a: 6013 str r3, [r2, #0]
/* LED3 als output */
GPIOA->MODER &= ~(3 << 6);
800047c: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000480: 681b ldr r3, [r3, #0]
8000482: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000486: f023 03c0 bic.w r3, r3, #192 @ 0xc0
800048a: 6013 str r3, [r2, #0]
GPIOA->MODER |= (1 << 6);
800048c: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000490: 681b ldr r3, [r3, #0]
8000492: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000496: f043 0340 orr.w r3, r3, #64 @ 0x40
800049a: 6013 str r3, [r2, #0]
/* s0 (PB0) als Input Versuch */
GPIOB->MODER &= ~(3 << 0);
800049c: 4b0c ldr r3, [pc, #48] @ (80004d0 <GPIO_init+0xe0>)
800049e: 681b ldr r3, [r3, #0]
80004a0: 4a0b ldr r2, [pc, #44] @ (80004d0 <GPIO_init+0xe0>)
80004a2: f023 0303 bic.w r3, r3, #3
80004a6: 6013 str r3, [r2, #0]
/* Pull-Up Aktivieren Versuch */
GPIOB->PUPDR &= ~(3 << 0);
80004a8: 4b09 ldr r3, [pc, #36] @ (80004d0 <GPIO_init+0xe0>)
80004aa: 68db ldr r3, [r3, #12]
80004ac: 4a08 ldr r2, [pc, #32] @ (80004d0 <GPIO_init+0xe0>)
80004ae: f023 0303 bic.w r3, r3, #3
80004b2: 60d3 str r3, [r2, #12]
GPIOB->PUPDR |= (1 << 0); // 01 = Pull-Up
80004b4: 4b06 ldr r3, [pc, #24] @ (80004d0 <GPIO_init+0xe0>)
80004b6: 68db ldr r3, [r3, #12]
80004b8: 4a05 ldr r2, [pc, #20] @ (80004d0 <GPIO_init+0xe0>)
80004ba: f043 0301 orr.w r3, r3, #1
80004be: 60d3 str r3, [r2, #12]
}
80004c0: bf00 nop
80004c2: 46bd mov sp, r7
80004c4: f85d 7b04 ldr.w r7, [sp], #4
80004c8: 4770 bx lr
80004ca: bf00 nop
80004cc: 40021000 .word 0x40021000
80004d0: 48000400 .word 0x48000400
080004d4 <delay>:
* requires: - nothing -
* parameters: ms - delay time in milliseconds
* returns: - nothing -
\* ------------------------------------------------------------------------------------ */
static void delay(const uint16_t ms)
{
80004d4: b480 push {r7}
80004d6: b085 sub sp, #20
80004d8: af00 add r7, sp, #0
80004da: 4603 mov r3, r0
80004dc: 80fb strh r3, [r7, #6]
for (uint16_t i = 0; i < ms; ++i)
80004de: 2300 movs r3, #0
80004e0: 81fb strh r3, [r7, #14]
80004e2: e018 b.n 8000516 <delay+0x42>
{
if((GPIOB->IDR & (1 << 0)) == 0){
80004e4: 4b11 ldr r3, [pc, #68] @ (800052c <delay+0x58>)
80004e6: 691b ldr r3, [r3, #16]
80004e8: f003 0301 and.w r3, r3, #1
80004ec: 2b00 cmp r3, #0
80004ee: d103 bne.n 80004f8 <delay+0x24>
state = 99;
80004f0: 4b0f ldr r3, [pc, #60] @ (8000530 <delay+0x5c>)
80004f2: 2263 movs r2, #99 @ 0x63
80004f4: 601a str r2, [r3, #0]
break;
80004f6: e013 b.n 8000520 <delay+0x4c>
}
for (uint16_t j = 0; j < LOOPS_PER_MS; ++j)
80004f8: 2300 movs r3, #0
80004fa: 81bb strh r3, [r7, #12]
80004fc: e003 b.n 8000506 <delay+0x32>
{
__asm("NOP");
80004fe: bf00 nop
for (uint16_t j = 0; j < LOOPS_PER_MS; ++j)
8000500: 89bb ldrh r3, [r7, #12]
8000502: 3301 adds r3, #1
8000504: 81bb strh r3, [r7, #12]
8000506: 89bb ldrh r3, [r7, #12]
8000508: f240 42db movw r2, #1243 @ 0x4db
800050c: 4293 cmp r3, r2
800050e: d9f6 bls.n 80004fe <delay+0x2a>
for (uint16_t i = 0; i < ms; ++i)
8000510: 89fb ldrh r3, [r7, #14]
8000512: 3301 adds r3, #1
8000514: 81fb strh r3, [r7, #14]
8000516: 89fa ldrh r2, [r7, #14]
8000518: 88fb ldrh r3, [r7, #6]
800051a: 429a cmp r2, r3
800051c: d3e2 bcc.n 80004e4 <delay+0x10>
}
}
}
800051e: bf00 nop
8000520: bf00 nop
8000522: 3714 adds r7, #20
8000524: 46bd mov sp, r7
8000526: f85d 7b04 ldr.w r7, [sp], #4
800052a: 4770 bx lr
800052c: 48000400 .word 0x48000400
8000530: 2000001c .word 0x2000001c
08000534 <ISR_error>:
*
* Default interrupt handler for core interrupts.
* Enables the green and red LED on the STefi Light board.
\* ------------------------------------------------------------------------------------ */
void ISR_error(void)
{
8000534: b480 push {r7}
8000536: af00 add r7, sp, #0
/* init */
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN; // PA: clock on (LEDs)
8000538: 4b10 ldr r3, [pc, #64] @ (800057c <ISR_error+0x48>)
800053a: 6cdb ldr r3, [r3, #76] @ 0x4c
800053c: 4a0f ldr r2, [pc, #60] @ (800057c <ISR_error+0x48>)
800053e: f043 0301 orr.w r3, r3, #1
8000542: 64d3 str r3, [r2, #76] @ 0x4c
GPIOA->ODR |= MASK_LED_ALL;
8000544: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000548: 695b ldr r3, [r3, #20]
800054a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800054e: f043 030f orr.w r3, r3, #15
8000552: 6153 str r3, [r2, #20]
GPIOA->MODER = (GPIOA->MODER & 0xFFFFFF00) | 0x11;
8000554: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000558: 681b ldr r3, [r3, #0]
800055a: f023 03ff bic.w r3, r3, #255 @ 0xff
800055e: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000562: f043 0311 orr.w r3, r3, #17
8000566: 6013 str r3, [r2, #0]
while(1)
{ /* light up the LEDs permanently */
GPIOA->ODR &= ~(MASK_LED_GREEN | MASK_LED_RED);
8000568: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800056c: 695b ldr r3, [r3, #20]
800056e: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000572: f023 0305 bic.w r3, r3, #5
8000576: 6153 str r3, [r2, #20]
8000578: e7f6 b.n 8000568 <ISR_error+0x34>
800057a: bf00 nop
800057c: 40021000 .word 0x40021000
08000580 <ISR_default>:
*
* Default interrupt handler for non-core interrupts.
* Enables the blue and yellow LED on the STefi Light board.
\* ------------------------------------------------------------------------------------ */
void ISR_default(void)
{
8000580: b480 push {r7}
8000582: af00 add r7, sp, #0
/* init */
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN; // PA: clock on (LEDs)
8000584: 4b10 ldr r3, [pc, #64] @ (80005c8 <ISR_default+0x48>)
8000586: 6cdb ldr r3, [r3, #76] @ 0x4c
8000588: 4a0f ldr r2, [pc, #60] @ (80005c8 <ISR_default+0x48>)
800058a: f043 0301 orr.w r3, r3, #1
800058e: 64d3 str r3, [r2, #76] @ 0x4c
GPIOA->ODR |= MASK_LED_ALL;
8000590: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000594: 695b ldr r3, [r3, #20]
8000596: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800059a: f043 030f orr.w r3, r3, #15
800059e: 6153 str r3, [r2, #20]
GPIOA->MODER = (GPIOA->MODER & 0xFFFFFF00) | 0x44;
80005a0: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80005a4: 681b ldr r3, [r3, #0]
80005a6: f023 03ff bic.w r3, r3, #255 @ 0xff
80005aa: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80005ae: f043 0344 orr.w r3, r3, #68 @ 0x44
80005b2: 6013 str r3, [r2, #0]
while(1)
{ /* light up the LEDs permanently */
GPIOA->ODR &= ~(MASK_LED_BLUE | MASK_LED_YELLOW);
80005b4: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80005b8: 695b ldr r3, [r3, #20]
80005ba: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80005be: f023 030a bic.w r3, r3, #10
80005c2: 6153 str r3, [r2, #20]
80005c4: e7f6 b.n 80005b4 <ISR_default+0x34>
80005c6: bf00 nop
80005c8: 40021000 .word 0x40021000
080005cc <Reset_Handler>:
.section .text.Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
ldr r0, =_estack
80005cc: 480c ldr r0, [pc, #48] @ (8000600 <LoopForever+0x2>)
mov sp, r0 /* set stack pointer */
80005ce: 4685 mov sp, r0
/* Call the clock system initialization function.*/
// bl SystemInit
/* Copy the data segment initializers from flash to SRAM */
ldr r0, =_sdata
80005d0: 480c ldr r0, [pc, #48] @ (8000604 <LoopForever+0x6>)
ldr r1, =_edata
80005d2: 490d ldr r1, [pc, #52] @ (8000608 <LoopForever+0xa>)
ldr r2, =_sidata
80005d4: 4a0d ldr r2, [pc, #52] @ (800060c <LoopForever+0xe>)
movs r3, #0
80005d6: 2300 movs r3, #0
b LoopCopyDataInit
80005d8: e002 b.n 80005e0 <LoopCopyDataInit>
080005da <CopyDataInit>:
CopyDataInit:
ldr r4, [r2, r3]
80005da: 58d4 ldr r4, [r2, r3]
str r4, [r0, r3]
80005dc: 50c4 str r4, [r0, r3]
adds r3, r3, #4
80005de: 3304 adds r3, #4
080005e0 <LoopCopyDataInit>:
LoopCopyDataInit:
adds r4, r0, r3
80005e0: 18c4 adds r4, r0, r3
cmp r4, r1
80005e2: 428c cmp r4, r1
bcc CopyDataInit
80005e4: d3f9 bcc.n 80005da <CopyDataInit>
/* Zero fill the bss segment. */
ldr r2, =_sbss
80005e6: 4a0a ldr r2, [pc, #40] @ (8000610 <LoopForever+0x12>)
ldr r4, =_ebss
80005e8: 4c0a ldr r4, [pc, #40] @ (8000614 <LoopForever+0x16>)
movs r3, #0
80005ea: 2300 movs r3, #0
b LoopFillZerobss
80005ec: e001 b.n 80005f2 <LoopFillZerobss>
080005ee <FillZerobss>:
FillZerobss:
str r3, [r2]
80005ee: 6013 str r3, [r2, #0]
adds r2, r2, #4
80005f0: 3204 adds r2, #4
080005f2 <LoopFillZerobss>:
LoopFillZerobss:
cmp r2, r4
80005f2: 42a2 cmp r2, r4
bcc FillZerobss
80005f4: d3fb bcc.n 80005ee <FillZerobss>
/* Call static constructors */
bl __libc_init_array
80005f6: f000 f80f bl 8000618 <__libc_init_array>
/* Call the application's entry point.*/
bl main
80005fa: f7ff fe0d bl 8000218 <main>
080005fe <LoopForever>:
LoopForever:
b LoopForever
80005fe: e7fe b.n 80005fe <LoopForever>
ldr r0, =_estack
8000600: 20008000 .word 0x20008000
ldr r0, =_sdata
8000604: 20000000 .word 0x20000000
ldr r1, =_edata
8000608: 20000000 .word 0x20000000
ldr r2, =_sidata
800060c: 08000680 .word 0x08000680
ldr r2, =_sbss
8000610: 20000000 .word 0x20000000
ldr r4, =_ebss
8000614: 20000020 .word 0x20000020
08000618 <__libc_init_array>:
8000618: b570 push {r4, r5, r6, lr}
800061a: 4d0d ldr r5, [pc, #52] @ (8000650 <__libc_init_array+0x38>)
800061c: 4c0d ldr r4, [pc, #52] @ (8000654 <__libc_init_array+0x3c>)
800061e: 1b64 subs r4, r4, r5
8000620: 10a4 asrs r4, r4, #2
8000622: 2600 movs r6, #0
8000624: 42a6 cmp r6, r4
8000626: d109 bne.n 800063c <__libc_init_array+0x24>
8000628: 4d0b ldr r5, [pc, #44] @ (8000658 <__libc_init_array+0x40>)
800062a: 4c0c ldr r4, [pc, #48] @ (800065c <__libc_init_array+0x44>)
800062c: f000 f818 bl 8000660 <_init>
8000630: 1b64 subs r4, r4, r5
8000632: 10a4 asrs r4, r4, #2
8000634: 2600 movs r6, #0
8000636: 42a6 cmp r6, r4
8000638: d105 bne.n 8000646 <__libc_init_array+0x2e>
800063a: bd70 pop {r4, r5, r6, pc}
800063c: f855 3b04 ldr.w r3, [r5], #4
8000640: 4798 blx r3
8000642: 3601 adds r6, #1
8000644: e7ee b.n 8000624 <__libc_init_array+0xc>
8000646: f855 3b04 ldr.w r3, [r5], #4
800064a: 4798 blx r3
800064c: 3601 adds r6, #1
800064e: e7f2 b.n 8000636 <__libc_init_array+0x1e>
8000650: 08000678 .word 0x08000678
8000654: 08000678 .word 0x08000678
8000658: 08000678 .word 0x08000678
800065c: 0800067c .word 0x0800067c
08000660 <_init>:
8000660: b5f8 push {r3, r4, r5, r6, r7, lr}
8000662: bf00 nop
8000664: bcf8 pop {r3, r4, r5, r6, r7}
8000666: bc08 pop {r3}
8000668: 469e mov lr, r3
800066a: 4770 bx lr
0800066c <_fini>:
800066c: b5f8 push {r3, r4, r5, r6, r7, lr}
800066e: bf00 nop
8000670: bcf8 pop {r3, r4, r5, r6, r7}
8000672: bc08 pop {r3}
8000674: 469e mov lr, r3
8000676: 4770 bx lr