main.o: file format elf32-littlearm Disassembly of section .text.main: 00000000
: const char *pcTextForTask2 = "Task 2 is running, ulIdleCycleCount = "; /*-----------------------------------------------------------*/ int main( void ) { 0: b580 push {r7, lr} 2: b084 sub sp, #16 4: af02 add r7, sp, #8 GlobalVar |= 0x01; 6: 2301 movs r3, #1 8: 603b str r3, [r7, #0] a: 683b ldr r3, [r7, #0] c: 4619 mov r1, r3 e: 4b14 ldr r3, [pc, #80] @ (60 ) 10: f3bf 8f5b dmb ish 14: e853 2f00 ldrex r2, [r3] 18: ea42 0201 orr.w r2, r2, r1 1c: e843 2000 strex r0, r2, [r3] 20: 2800 cmp r0, #0 22: d1f7 bne.n 14 24: f3bf 8f5b dmb ish 28: 4613 mov r3, r2 2a: 607b str r3, [r7, #4] /* Create the first task at priority 1... */ xTaskCreate( vTaskFunction, "Task 1", 240, (void*)pcTextForTask1, 1, NULL ); 2c: 4b0d ldr r3, [pc, #52] @ (64 ) 2e: 681b ldr r3, [r3, #0] 30: 2200 movs r2, #0 32: 9201 str r2, [sp, #4] 34: 2201 movs r2, #1 36: 9200 str r2, [sp, #0] 38: 22f0 movs r2, #240 @ 0xf0 3a: 490b ldr r1, [pc, #44] @ (68 ) 3c: 480b ldr r0, [pc, #44] @ (6c ) 3e: f7ff fffe bl 0 /* ... and the second task at priority 2. The priority is the second to last parameter. */ xTaskCreate( vTaskFunction, "Task 2", 240, (void*)pcTextForTask2, 2, NULL ); 42: 4b0b ldr r3, [pc, #44] @ (70 ) 44: 681b ldr r3, [r3, #0] 46: 2200 movs r2, #0 48: 9201 str r2, [sp, #4] 4a: 2202 movs r2, #2 4c: 9200 str r2, [sp, #0] 4e: 22f0 movs r2, #240 @ 0xf0 50: 4908 ldr r1, [pc, #32] @ (74 ) 52: 4806 ldr r0, [pc, #24] @ (6c ) 54: f7ff fffe bl 0 /* Start the scheduler so our tasks start executing. */ vTaskStartScheduler(); 58: f7ff fffe bl 0 for( ;; ); 5c: e7fe b.n 5c 5e: bf00 nop ... 68: 00000050 .word 0x00000050 ... 74: 00000058 .word 0x00000058 Disassembly of section .text.vTaskFunction: 00000000 : return 0; } /*-----------------------------------------------------------*/ void vTaskFunction( void *pvParameters ) { 0: b580 push {r7, lr} 2: b084 sub sp, #16 4: af00 add r7, sp, #0 6: 6078 str r0, [r7, #4] char *pcTaskName; /* The string to print out is passed in via the parameter. Cast this to a character pointer. */ pcTaskName = ( char * ) pvParameters; 8: 687b ldr r3, [r7, #4] a: 60fb str r3, [r7, #12] /* As per most tasks, this task is implemented in an infinite loop. */ for( ;; ) { /* Print out the name of this task AND the number of times ulIdleCycleCount has been incremented. */ vPrintStringAndNumber( pcTaskName, ulIdleCycleCount ); c: 4b07 ldr r3, [pc, #28] @ (2c ) e: f3bf 8f5b dmb ish 12: 681b ldr r3, [r3, #0] 14: f3bf 8f5b dmb ish 18: 60bb str r3, [r7, #8] 1a: 68bb ldr r3, [r7, #8] 1c: 4619 mov r1, r3 1e: 68f8 ldr r0, [r7, #12] 20: f7ff fffe bl 0 /* Delay for a period. This time we use a call to vTaskDelay() which puts the task into the Blocked state until the delay period has expired. The delay period is specified in 'ticks'. */ vTaskDelay( 250 / portTICK_RATE_MS ); 24: 20fa movs r0, #250 @ 0xfa 26: f7ff fffe bl 0 vPrintStringAndNumber( pcTaskName, ulIdleCycleCount ); 2a: e7ef b.n c 2c: 00000000 .word 0x00000000 Disassembly of section .text.vApplicationIdleHook: 00000000 : /*-----------------------------------------------------------*/ /* Idle hook functions MUST be called vApplicationIdleHook(), take no parameters, and return void. */ void vApplicationIdleHook( void ) { 0: b490 push {r4, r7} 2: b082 sub sp, #8 4: af00 add r7, sp, #0 /* This hook function does nothing but increment a counter. */ ulIdleCycleCount++; 6: 2301 movs r3, #1 8: 603b str r3, [r7, #0] a: 683b ldr r3, [r7, #0] c: 4619 mov r1, r3 e: 4b09 ldr r3, [pc, #36] @ (34 ) 10: f3bf 8f5b dmb ish 14: e853 2f00 ldrex r2, [r3] 18: eb02 0001 add.w r0, r2, r1 1c: e843 0400 strex r4, r0, [r3] 20: 2c00 cmp r4, #0 22: d1f7 bne.n 14 24: f3bf 8f5b dmb ish 28: 607a str r2, [r7, #4] } 2a: bf00 nop 2c: 3708 adds r7, #8 2e: 46bd mov sp, r7 30: bc90 pop {r4, r7} 32: 4770 bx lr 34: 00000000 .word 0x00000000 Disassembly of section .text.vApplicationMallocFailedHook: 00000000 : /*-----------------------------------------------------------*/ void vApplicationMallocFailedHook( void ) { 0: b480 push {r7} 2: af00 add r7, sp, #0 /* This function will only be called if an API call to create a task, queue or semaphore fails because there is too little heap RAM remaining. */ for( ;; ); 4: e7fe b.n 4 Disassembly of section .text.vApplicationStackOverflowHook: 00000000 : } /*-----------------------------------------------------------*/ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ) { 0: b480 push {r7} 2: b083 sub sp, #12 4: af00 add r7, sp, #0 6: 6078 str r0, [r7, #4] 8: 6039 str r1, [r7, #0] /* This function will only be called if a task overflows its stack. Note that stack overflow checking does slow down the context switch implementation. */ for( ;; ); a: e7fe b.n a Disassembly of section .text.vApplicationTickHook: 00000000 : } /*-----------------------------------------------------------*/ void vApplicationTickHook( void ) { 0: b480 push {r7} 2: af00 add r7, sp, #0 /* This example does not use the tick hook to perform any processing. */ } 4: bf00 nop 6: 46bd mov sp, r7 8: bc80 pop {r7} a: 4770 bx lr