新手上路
- 积分
- 37
- 金钱
- 37
- 注册时间
- 2023-1-16
- 在线时间
- 9 小时
|
1金钱
正在学习UBoot,编译修改了Uboot 5.4版本运行在 IMX6ULL开发板上。当使用nfs命令加载裸机测试程序时,要不重启,要不就是无响应?有没有大佬解惑的
裸机程序就是实现定时器延时后,LED灯闪烁,并且串口输出相应的闪烁次数。
当裸机单独写入SD卡时运行正常,LED灯闪烁,串口输出正确的次数
使用官方的LDS与启动文件,如下:
lds链接文件
/* Memory region from [0x80000000-0x80001FFF] is reserved for ROM code */
/* Entry Point */
ENTRY(Reset_Handler)
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
ISTACK_SIZE = DEFINED(__irq_stack_size__) ? __irq_stack_size__ : 0x0400;
CSTACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
RSTACK_SIZE = DEFINED(__resume_stack_size__) ? __resume_stack_size__ : 0x0400;
/* Specify the memory areas */
MEMORY
{
m_ocram (RWX) : ORIGIN = 0x00900000, LENGTH = 0x00020000
m_interrupts (RX) : ORIGIN = 0x80002000, LENGTH = 0x00000040
m_text (RX) : ORIGIN = 0x80002040, LENGTH = 0x043FDFC0
m_data (RW) : ORIGIN = 0x84400000, LENGTH = 0x00800000
}
/* Define output sections */
SECTIONS
{
/* The startup code goes first into DDR RAM */
.interrupts :
{
__VECTOR_TABLE = .;
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} > m_interrupts
/* The program code and other data goes into DDR RAM */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
} > m_text
以下省略。。
启动汇编文件startup_MCIMX6Y2.S如下:
.syntax unified .arch armv7-a .section .isr_vector, "a" .align 2 .globl __isr_vector__isr_vector: ldr pc, =Reset_Handler /* Reset */ ldr pc, =Undefined_Handler /* Undefined instructions */ ldr pc, =SVC_Handler /* Supervisor Call */ ldr pc, =PrefAbort_Handler /* Prefetch abort */ ldr pc, =DataAbort_Handler /* Data abort */ .word 0 /* RESERVED */ ldr pc, =IRQ_Handler /* IRQ interrupt */ ldr pc, =FIQ_Handler /* FIQ interrupt */ .size __isr_vector, . - __isr_vector .text .arm/* Reset Handler */ .arm .align 2 .globl Reset_Handler .weak Reset_Handler .type Reset_Handler, %functionReset_Handler: cpsid i /* Mask interrupts */ /* Reset SCTlr Settings */ mrc p15, 0, r0, c1, c0, 0 /* Read CP15 System Control register */ bic r0, r0, #(0x1 << 12) /* Clear I bit 12 to disable I Cache */ bic r0, r0, #(0x1 << 2) /* Clear C bit 2 to disable D Cache */ bic r0, r0, #0x2 /* Clear A bit 1 to disable strict alignment */ bic r0, r0, #(0x1 << 11) /* Clear Z bit 11 to disable branch prediction */ bic r0, r0, #0x1 /* Clear M bit 0 to disable MMU */ mcr p15, 0, r0, c1, c0, 0 /* Write value back to CP15 System Control register */ /* Set up stack for IRQ, System/User and Supervisor Modes */ cps #0x12 /* Enter IRQ mode */ ldr sp, =__IStackTop /* Set up IRQ handler stack */ cps #0x1F /* Enter System mode */ ldr sp, =__CStackTop /* Set up System/User Mode stack */ cps #0x13 /* Enter Supervisor mode */ ldr sp, =__CStackTop /* Set up Supervisor Mode stack */#ifndef __NO_SYSTEM_INIT ldr r0,=SystemInit blx r0#endif cpsie i /* Unmask interrupts *//* Loop to copy data from read only memory to RAM. The ranges * of copy from/to are specified by following symbols evaluated in * linker script. * __etext: End of code section, i.e., begin of data sections to copy from. * __data_start__/__data_end__: RAM address range that data should be * copied to. Both must be aligned to 4 bytes boundary. */ ldr r1, =__etext/* Here are two copies of loop implemenations. First one favors code size * and the second one favors performance. Default uses the first one. * Change to "#if 0" to use the second one */#ifdef __STARTUP_INITIALIZE_NONCACHEDATA ldr r2, =__noncachedata_start__ ldr r3, =__noncachedata_end__#if 1.LC0: cmp r2, r3 ittt lt ldrlt r0, [r1], #4 strlt r0, [r2], #4 blt .LC0#else subs r3, r2 ble .LC1.LC0: subs r3, #4 ldr r0, [r1, r3] str r0, [r2, r3] bgt .LC0.LC1:#endif ldr r1,=__DATA_ROM#endif /* __STARTUP_INITIALIZE_NONCACHEDATA */ ldr r2, =__data_start__ ldr r3, =__data_end__#if 1.LC2: cmp r2, r3 ittt lt ldrlt r0, [r1], #4 strlt r0, [r2], #4 blt .LC2#else subs r3, r2 ble .LC3.LC2: subs r3, #4 ldr r0, [r1, r3] str r0, [r2, r3] bgt .LC2.LC3:#endif/* Loop to copy ocram data from read only memory to ocram. The ranges * of copy from/to are specified by following symbols evaluated in * linker script. * __ocram_data_start__/__ocram_data_end__: OCRAM address range that data should be * copied to. Both must be aligned to 4 bytes boundary. */ ldr r2, =__ocram_data_start__ ldr r3, =__ocram_data_end__#if 1.LC4: cmp r2, r3 ittt lt ldrlt r0, [r1], #4 strlt r0, [r2], #4 blt .LC4#else subs r3, r2 ble .LC1.LC4: subs r3, #4 ldr r0, [r1, r3] str r0, [r2, r3] bgt .LC4.LC5:#endif#ifdef __STARTUP_CLEAR_BSS/* This part of work usually is done in C library startup code. Otherwise, * define this macro to enable it in this startup. * * Loop to zero out BSS section, which uses following symbols * in linker script: * __bss_start__: start of BSS section. Must align to 4 * __bss_end__: end of BSS section. Must align to 4 */ ldr r1, =__bss_start__ ldr r2, =__bss_end__ movs r0, 0.LC6: cmp r1, r2 itt lt strlt r0, [r1], #4 blt .LC6#endif /* __STARTUP_CLEAR_BSS */#ifndef __START#define __START _start#endif#ifndef __ATOLLIC__ ldr r0,=__START blx r0#else ldr r0,=__libc_init_array blx r0 ldr r0,=main bx r0#endif .pool .size Reset_Handler, . - Reset_Handler .align 2 .arm .weak Undefined_Handler .type Undefined_Handler, %functionUndefined_Handler: b Undefined_Handler .size Undefined_Handler, . - Undefined_Handler .align 2 .arm .weak SVC_Handler .type SVC_Handler, %functionSVC_Handler: ldr r0,=SVC_Handler bx r0 .size SVC_Handler, . - SVC_Handler .align 2 .arm .weak PrefAbort_Handler .type PrefAbort_Handler, %functionPrefAbort_Handler: ldr r0,=PrefAbort_Handler bx r0 .size PrefAbort_Handler, . - PrefAbort_Handler .align 2 .arm .weak DataAbort_Handler .type DataAbort_Handler, %functionDataAbort_Handler: ldr r0,=DataAbort_Handler bx r0 .size DataAbort_Handler, . - DataAbort_Handler .align 2 .arm .weak IRQ_Handler .type IRQ_Handler, %functionIRQ_Handler: push {lr} /* Save return address+4 */ push {r0-r3, r12} /* Push caller save registers */ MRS r0, spsr /* Save SPRS to allow interrupt reentry */ push {r0} MRC P15, 4, r1, C15, C0, 0 /* Get GIC base address */ ADD r1, r1, #0x2000 /* r1: GICC base address */ LDR r0, [r1, #0xC] /* r0: IAR */ push {r0, r1} CPS #0x13 /* Change to Supervisor mode to allow interrupt reentry */ push {lr} /* Save Supervisor lr */ LDR r2, =SystemIrqHandler BLX r2 /* Call SystemIrqHandler with param GCC */ POP {lr} CPS #0x12 /* Back to IRQ mode */ POP {r0, r1} STR r0, [r1, #0x10] /* Now IRQ handler finished: write to EOIR */ POP {r0} MSR spsr_cxsf, r0 POP {r0-r3, r12} POP {lr} SUBS pc, lr, #4 .size IRQ_Handler, . - IRQ_Handler .align 2 .arm .weak FIQ_Handler .type FIQ_Handler, %functionFIQ_Handler: ldr r0,=FIQ_Handler bx r0 .size FIQ_Handler, . - FIQ_Handler .end
UBoot启动后,加载BIN文件后
Filename '/home/wss/nfsroot/LCD_SDK.bin'.Load address: 0x80000000Loading: ############doneBytes transferred = 56816 (ddf0 hex)=> md.b 80000000 2080000000: 18 f0 9f e5 18 f0 9f e5 18 f0 9f e5 18 f0 9f e5 ................80000010: 18 f0 9f e5 00 00 00 00 14 f0 9f e5 14 f0 9f e5 ................=> go 80002000## Starting application at 0x80002000 ...undefined instructionpc : [<80002000>] lr : [<9ef7b2c7>]reloc pc : [<6888b000>] lr : [<878042c7>]sp : 9df6c698 ip : 00000000 fp : 00000002r10: 9df77620 r9 : 9df74ed0 r8 : 9efe4d54r7 : 9ef8c031 r6 : 00000002 r5 : 80002000 r4 : 9df77624r3 : 80002000 r2 : 9df77624 r1 : 9df77624 r0 : 00000001Flags: nzCv IRQs off FIQs off Mode SVC_32Code: f2c00300 f8c70390 f44f30e0 f8c70320 (f44f30dc)Resetting CPU ...resetting ...=> nfs 80000000 192.168.3.138:/home/wss/nfsroot/LCD_SDK.binUsing ethernet@20b4000 deviceFile transfer via NFS from server 192.168.3.138; our IP address is 192.168.3.199Filename '/home/wss/nfsroot/LCD_SDK.bin'.Load address: 0x80000000Loading: ############doneBytes transferred = 56816 (ddf0 hex)=> go 80000000## Starting application at 0x80000000 ...
加载后,内存0x80000000与BIN文件头是一致的。如果从0x80000000启动,就会卡死;如果从0x80002000启动,CPU就会重启。
按照正点原子教程里30章节里,只要拷贝 .bin 文件,不需要在前面添加 IVT 信息,因为 uboot 已经初始化好了 DDR 了。
我猜测,是不是初始化汇编程序里出错了,但不确定哪里出错了。
反汇编文件如下:
E:/Study/LCD_SDK/armgcc/debug/LCD_SDK.elf: file format elf32-littlearmSections:Idx Name Size VMA LMA File off Algn 0 .interrupts 0000003c 80002000 80002000 00002000 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 1 .text 00009630 80002040 80002040 00002040 2**3 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .ARM 00000008 8000b670 8000b670 0000b670 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .init_array 00000004 8000b678 8000b678 0000b678 2**2 CONTENTS, ALLOC, LOAD, DATA 4 .fini_array 00000004 8000b67c 8000b67c 0000b67c 2**2 CONTENTS, ALLOC, LOAD, DATA 5 .ncache 00000000 80400000 80400000 00200000 2**20 CONTENTS 6 .data 00000070 80400000 8000b680 00100000 2**20 CONTENTS, ALLOC, LOAD, DATA 7 OcramData 00004700 00900000 8000b6f0 00110000 2**14 CONTENTS, ALLOC, LOAD, CODE 8 .bss 000005a0 80400070 8000b6f0 00120070 2**2 ALLOC 9 .heap 00000400 80400610 8000bc90 00120070 2**0 ALLOC 10 .stack 00000800 80400a10 8000c090 00120070 2**0 ALLOC 11 .ARM.attributes 0000002d 00000000 00000000 00200000 2**0 CONTENTS, READONLY 12 .rstack 00000400 00904700 8000fdf0 00114700 2**0 ALLOC 13 .debug_line 000056e4 00000000 00000000 0020002d 2**0 CONTENTS, READONLY, DEBUGGING 14 .debug_info 0001ec71 00000000 00000000 00205711 2**0 CONTENTS, READONLY, DEBUGGING 15 .debug_abbrev 0000408a 00000000 00000000 00224382 2**0 CONTENTS, READONLY, DEBUGGING 16 .debug_aranges 00000ae0 00000000 00000000 00228410 2**3 CONTENTS, READONLY, DEBUGGING 17 .debug_ranges 00000978 00000000 00000000 00228ef0 2**3 CONTENTS, READONLY, DEBUGGING 18 .debug_str 00006c63 00000000 00000000 00229868 2**0 CONTENTS, READONLY, DEBUGGING 19 .comment 0000007f 00000000 00000000 002304cb 2**0 CONTENTS, READONLY 20 .debug_frame 00002ee4 00000000 00000000 0023054c 2**2 CONTENTS, READONLY, DEBUGGINGDisassembly of section .interrupts:80002000 <__isr_vector>: .section .isr_vector, "a" .align 2 .globl __isr_vector__isr_vector: ldr pc, =Reset_Handler /* Reset */80002000: e59ff018 ldr pc, [pc, #24] ; 80002020 <__isr_vector+0x20> ldr pc, =Undefined_Handler /* Undefined instructions */80002004: e59ff018 ldr pc, [pc, #24] ; 80002024 <__isr_vector+0x24> ldr pc, =SVC_Handler /* Supervisor Call */80002008: e59ff018 ldr pc, [pc, #24] ; 80002028 <__isr_vector+0x28> ldr pc, =PrefAbort_Handler /* Prefetch abort */8000200c: e59ff018 ldr pc, [pc, #24] ; 8000202c <__isr_vector+0x2c> ldr pc, =DataAbort_Handler /* Data abort */80002010: e59ff018 ldr pc, [pc, #24] ; 80002030 <__isr_vector+0x30>80002014: 00000000 andeq r0, r0, r0 .word 0 /* RESERVED */ ldr pc, =IRQ_Handler /* IRQ interrupt */80002018: e59ff014 ldr pc, [pc, #20] ; 80002034 <__isr_vector+0x34> ldr pc, =FIQ_Handler /* FIQ interrupt */8000201c: e59ff014 ldr pc, [pc, #20] ; 80002038 <__isr_vector+0x38> ldr pc, =Reset_Handler /* Reset */80002020: 8000213c andhi r2, r0, ip, lsr r1 ldr pc, =Undefined_Handler /* Undefined instructions */80002024: 80002228 andhi r2, r0, r8, lsr #4 ldr pc, =SVC_Handler /* Supervisor Call */80002028: 8000222c andhi r2, r0, ip, lsr #4 ldr pc, =PrefAbort_Handler /* Prefetch abort */8000202c: 80002234 andhi r2, r0, r4, lsr r2 ldr pc, =DataAbort_Handler /* Data abort */80002030: 8000223c andhi r2, r0, ip, lsr r2 ldr pc, =IRQ_Handler /* IRQ interrupt */80002034: 80002244 andhi r2, r0, r4, asr #4 ldr pc, =FIQ_Handler /* FIQ interrupt */80002038: 80002298 mulhi r0, r8, r2Disassembly of section .text:80002040 <__do_global_dtors_aux>:80002040: b510 push {r4, lr}80002042: f240 0470 movw r4, #112 ; 0x7080002046: f2c8 0440 movt r4, #32832 ; 0x80408000204a: 7823 ldrb r3, [r4, #0]8000204c: b963 cbnz r3, 80002068 <__do_global_dtors_aux+0x28>8000204e: f240 0300 movw r3, #080002052: f2c0 0300 movt r3, #080002056: b12b cbz r3, 80002064 <__do_global_dtors_aux+0x24>80002058: f24b 604c movw r0, #46668 ; 0xb64c8000205c: f2c8 0000 movt r0, #32768 ; 0x800080002060: f3af 8000 nop.w80002064: 2301 movs r3, #180002066: 7023 strb r3, [r4, #0]80002068: bd10 pop {r4, pc}8000206a: bf00 nop8000206c <frame_dummy>:8000206c: f240 0300 movw r3, #080002070: f2c0 0300 movt r3, #080002074: b18b cbz r3, 8000209a <frame_dummy+0x2e>80002076: b510 push {r4, lr}80002078: f240 0174 movw r1, #116 ; 0x748000207c: f24b 604c movw r0, #46668 ; 0xb64c80002080: f2c8 0140 movt r1, #32832 ; 0x804080002084: f2c8 0000 movt r0, #32768 ; 0x800080002088: f3af 8000 nop.w8000208c: f240 006c movw r0, #108 ; 0x6c80002090: f2c8 0040 movt r0, #32832 ; 0x804080002094: 6803 ldr r3, [r0, #0]80002096: b93b cbnz r3, 800020a8 <frame_dummy+0x3c>80002098: bd10 pop {r4, pc}8000209a: f240 006c movw r0, #108 ; 0x6c8000209e: f2c8 0040 movt r0, #32832 ; 0x8040800020a2: 6803 ldr r3, [r0, #0]800020a4: b94b cbnz r3, 800020ba <frame_dummy+0x4e>800020a6: 4770 bx lr800020a8: f240 0300 movw r3, #0800020ac: f2c0 0300 movt r3, #0800020b0: 2b00 cmp r3, #0800020b2: d0f1 beq.n 80002098 <frame_dummy+0x2c>800020b4: e8bd 4010 ldmia.w sp!, {r4, lr}800020b8: 4718 bx r3800020ba: f240 0300 movw r3, #0800020be: f2c0 0300 movt r3, #0800020c2: 2b00 cmp r3, #0800020c4: d0ef beq.n 800020a6 <frame_dummy+0x3a>800020c6: 4718 bx r3800020c8 <_mainCRTStartup>:800020c8: 4b15 ldr r3, [pc, #84] ; (80002120 <_mainCRTStartup+0x58>)800020ca: 2b00 cmp r3, #0800020cc: bf08 it eq800020ce: 4b13 ldreq r3, [pc, #76] ; (8000211c <_mainCRTStartup+0x54>)800020d0: 469d mov sp, r3800020d2: f5a3 3a80 sub.w sl, r3, #65536 ; 0x10000800020d6: 2100 movs r1, #0800020d8: 468b mov fp, r1800020da: 460f mov r7, r1800020dc: 4813 ldr r0, [pc, #76] ; (8000212c <_mainCRTStartup+0x64>)800020de: 4a14 ldr r2, [pc, #80] ; (80002130 <_mainCRTStartup+0x68>)800020e0: 1a12 subs r2, r2, r0800020e2: f008 fb51 bl 8000a788 <memset>800020e6: 4b0f ldr r3, [pc, #60] ; (80002124 <_mainCRTStartup+0x5c>)800020e8: 2b00 cmp r3, #0800020ea: d000 beq.n 800020ee <_mainCRTStartup+0x26>800020ec: 4798 blx r3800020ee: 4b0e ldr r3, [pc, #56] ; (80002128 <_mainCRTStartup+0x60>)800020f0: 2b00 cmp r3, #0800020f2: d000 beq.n 800020f6 <_mainCRTStartup+0x2e>800020f4: 4798 blx r3800020f6: 2000 movs r0, #0800020f8: 2100 movs r1, #0800020fa: 0004 movs r4, r0800020fc: 000d movs r5, r1800020fe: 480d ldr r0, [pc, #52] ; (80002134 <_mainCRTStartup+0x6c>)80002100: 2800 cmp r0, #080002102: d002 beq.n 8000210a <_mainCRTStartup+0x42>80002104: 480c ldr r0, [pc, #48] ; (80002138 <_mainCRTStartup+0x70>)80002106: f3af 8000 nop.w8000210a: f008 fb19 bl 8000a740 <__libc_init_array>8000210e: 0020 movs r0, r480002110: 0029 movs r1, r580002112: f001 fbcf bl 800038b4 <main>80002116: f008 faff bl 8000a718 <exit>8000211a: bf00 nop8000211c: 00080000 andeq r0, r8, r080002120: 807ffc00 rsbshi pc, pc, r0, lsl #24 ...8000212c: 80400070 subhi r0, r0, r0, ror r080002130: 80400610 subhi r0, r0, r0, lsl r6 ...8000213c <Reset_Handler>: .align 2 .globl Reset_Handler .weak Reset_Handler .type Reset_Handler, %functionReset_Handler: cpsid i /* Mask interrupts */8000213c: f10c0080 cpsid i /* Reset SCTlr Settings */ mrc p15, 0, r0, c1, c0, 0 /* Read CP15 System Control register */80002140: ee110f10 mrc 15, 0, r0, cr1, cr0, {0} bic r0, r0, #(0x1 << 12) /* Clear I bit 12 to disable I Cache */80002144: e3c00a01 bic r0, r0, #4096 ; 0x1000 bic r0, r0, #(0x1 << 2) /* Clear C bit 2 to disable D Cache */80002148: e3c00004 bic r0, r0, #4 bic r0, r0, #0x2 /* Clear A bit 1 to disable strict alignment */8000214c: e3c00002 bic r0, r0, #2 bic r0, r0, #(0x1 << 11) /* Clear Z bit 11 to disable branch prediction */80002150: e3c00b02 bic r0, r0, #2048 ; 0x800 bic r0, r0, #0x1 /* Clear M bit 0 to disable MMU */80002154: e3c00001 bic r0, r0, #1 mcr p15, 0, r0, c1, c0, 0 /* Write value back to CP15 System Control register */80002158: ee010f10 mcr 15, 0, r0, cr1, cr0, {0} /* Set up stack for IRQ, System/User and Supervisor Modes */ cps #0x12 /* Enter IRQ mode */8000215c: f1020012 cps #18 ldr sp, =__IStackTop /* Set up IRQ handler stack */80002160: e59fd088 ldr sp, [pc, #136] ; 800021f0 <Reset_Handler+0xb4> cps #0x1F /* Enter System mode */80002164: f102001f cps #31 ldr sp, =__CStackTop /* Set up System/User Mode stack */80002168: e59fd084 ldr sp, [pc, #132] ; 800021f4 <Reset_Handler+0xb8> cps #0x13 /* Enter Supervisor mode */8000216c: f1020013 cps #19 ldr sp, =__CStackTop /* Set up Supervisor Mode stack */80002170: e59fd07c ldr sp, [pc, #124] ; 800021f4 <Reset_Handler+0xb8>#ifndef __NO_SYSTEM_INIT ldr r0,=SystemInit80002174: e59f007c ldr r0, [pc, #124] ; 800021f8 <Reset_Handler+0xbc> blx r080002178: e12fff30 blx r0#endif cpsie i /* Unmask interrupts */8000217c: f1080080 cpsie i * linker script. * __etext: End of code section, i.e., begin of data sections to copy from. * __data_start__/__data_end__: RAM address range that data should be * copied to. Both must be aligned to 4 bytes boundary. */ ldr r1, =__etext80002180: e59f1074 ldr r1, [pc, #116] ; 800021fc <Reset_Handler+0xc0>/* Here are two copies of loop implemenations. First one favors code size * and the second one favors performance. Default uses the first one. * Change to "#if 0" to use the second one */#ifdef __STARTUP_INITIALIZE_NONCACHEDATA ldr r2, =__noncachedata_start__80002184: e59f2074 ldr r2, [pc, #116] ; 80002200 <Reset_Handler+0xc4> ldr r3, =__noncachedata_end__80002188: e59f3074 ldr r3, [pc, #116] ; 80002204 <Reset_Handler+0xc8>#if 1.LC0: cmp r2, r38000218c: e1520003 cmp r2, r3 ittt lt ldrlt r0, [r1], #480002190: b4910004 ldrlt r0, [r1], #4 strlt r0, [r2], #480002194: b4820004 strlt r0, [r2], #4 blt .LC080002198: bafffffb blt 8000218c <Reset_Handler+0x50> ldr r0, [r1, r3] str r0, [r2, r3] bgt .LC0.LC1:#endif ldr r1,=__DATA_ROM8000219c: e59f1064 ldr r1, [pc, #100] ; 80002208 <Reset_Handler+0xcc>#endif /* __STARTUP_INITIALIZE_NONCACHEDATA */ ldr r2, =__data_start__800021a0: e59f2064 ldr r2, [pc, #100] ; 8000220c <Reset_Handler+0xd0> ldr r3, =__data_end__800021a4: e59f3064 ldr r3, [pc, #100] ; 80002210 <Reset_Handler+0xd4>#if 1.LC2: cmp r2, r3800021a8: e1520003 cmp r2, r3 ittt lt ldrlt r0, [r1], #4800021ac: b4910004 ldrlt r0, [r1], #4 strlt r0, [r2], #4800021b0: b4820004 strlt r0, [r2], #4 blt .LC2800021b4: bafffffb blt 800021a8 <Reset_Handler+0x6c> * of copy from/to are specified by following symbols evaluated in * linker script. * __ocram_data_start__/__ocram_data_end__: OCRAM address range that data should be * copied to. Both must be aligned to 4 bytes boundary. */ ldr r2, =__ocram_data_start__800021b8: e59f2054 ldr r2, [pc, #84] ; 80002214 <Reset_Handler+0xd8> ldr r3, =__ocram_data_end__800021bc: e59f3054 ldr r3, [pc, #84] ; 80002218 <Reset_Handler+0xdc>#if 1.LC4: cmp r2, r3800021c0: e1520003 cmp r2, r3 ittt lt ldrlt r0, [r1], #4800021c4: b4910004 ldrlt r0, [r1], #4 strlt r0, [r2], #4800021c8: b4820004 strlt r0, [r2], #4 blt .LC4800021cc: bafffffb blt 800021c0 <Reset_Handler+0x84> * Loop to zero out BSS section, which uses following symbols * in linker script: * __bss_start__: start of BSS section. Must align to 4 * __bss_end__: end of BSS section. Must align to 4 */ ldr r1, =__bss_start__800021d0: e59f1044 ldr r1, [pc, #68] ; 8000221c <Reset_Handler+0xe0> ldr r2, =__bss_end__800021d4: e59f2044 ldr r2, [pc, #68] ; 80002220 <Reset_Handler+0xe4> movs r0, 0800021d8: e3b00000 movs r0, #0.LC6: cmp r1, r2800021dc: e1510002 cmp r1, r2 itt lt strlt r0, [r1], #4800021e0: b4810004 strlt r0, [r1], #4 blt .LC6800021e4: bafffffc blt 800021dc <Reset_Handler+0xa0>#ifndef __START#define __START _start#endif#ifndef __ATOLLIC__ ldr r0,=__START800021e8: e59f0034 ldr r0, [pc, #52] ; 80002224 <Reset_Handler+0xe8> blx r0800021ec: e12fff30 blx r0 ldr sp, =__IStackTop /* Set up IRQ handler stack */800021f0: 80800000 addhi r0, r0, r0 ldr sp, =__CStackTop /* Set up System/User Mode stack */800021f4: 807ffc00 rsbshi pc, pc, r0, lsl #24 ldr r0,=SystemInit800021f8: 8000702f andhi r7, r0, pc, lsr #32 ldr r1, =__etext800021fc: 8000b680 andhi fp, r0, r0, lsl #13 ldr r2, =__noncachedata_start__80002200: 80400000 subhi r0, r0, r0 ldr r3, =__noncachedata_end__80002204: 80400000 subhi r0, r0, r0 ldr r1,=__DATA_ROM80002208: 8000b680 andhi fp, r0, r0, lsl #13 ldr r2, =__data_start__8000220c: 80400000 subhi r0, r0, r0 ldr r3, =__data_end__80002210: 80400070 subhi r0, r0, r0, ror r0 ldr r2, =__ocram_data_start__80002214: 00900000 addseq r0, r0, r0 ldr r3, =__ocram_data_end__80002218: 00904700 addseq r4, r0, r0, lsl #14 ldr r1, =__bss_start__8000221c: 80400070 subhi r0, r0, r0, ror r0 ldr r2, =__bss_end__80002220: 80400610 subhi r0, r0, r0, lsl r6 ldr r0,=__START80002224: 800020c9 andhi r2, r0, r9, asr #180002228 <Undefined_Handler>: .align 2 .arm .weak Undefined_Handler .type Undefined_Handler, %functionUndefined_Handler: b Undefined_Handler80002228: eafffffe b 80002228 <Undefined_Handler>8000222c <SVC_Handler>: .align 2 .arm .weak SVC_Handler .type SVC_Handler, %functionSVC_Handler: ldr r0,=SVC_Handler8000222c: e59f006c ldr r0, [pc, #108] ; 800022a0 <FIQ_Handler+0x8> bx r080002230: e12fff10 bx r080002234 <PrefAbort_Handler>: .align 2 .arm .weak PrefAbort_Handler .type PrefAbort_Handler, %functionPrefAbort_Handler: ldr r0,=PrefAbort_Handler80002234: e59f0068 ldr r0, [pc, #104] ; 800022a4 <FIQ_Handler+0xc> bx r080002238: e12fff10 bx r08000223c <DataAbort_Handler>: .align 2 .arm .weak DataAbort_Handler .type DataAbort_Handler, %functionDataAbort_Handler: ldr r0,=DataAbort_Handler8000223c: e59f0064 ldr r0, [pc, #100] ; 800022a8 <FIQ_Handler+0x10> bx r080002240: e12fff10 bx r080002244 <IRQ_Handler>: .align 2 .arm .weak IRQ_Handler .type IRQ_Handler, %functionIRQ_Handler: push {lr} /* Save return address+4 */80002244: e52de004 push {lr} ; (str lr, [sp, #-4]!) push {r0-r3, r12} /* Push caller save registers */80002248: e92d100f push {r0, r1, r2, r3, ip} MRS r0, spsr /* Save SPRS to allow interrupt reentry */8000224c: e14f0000 mrs r0, SPSR push {r0}80002250: e52d0004 push {r0} ; (str r0, [sp, #-4]!) MRC P15, 4, r1, C15, C0, 0 /* Get GIC base address */80002254: ee9f1f10 mrc 15, 4, r1, cr15, cr0, {0} ADD r1, r1, #0x2000 /* r1: GICC base address */80002258: e2811a02 add r1, r1, #8192 ; 0x2000 LDR r0, [r1, #0xC] /* r0: IAR */8000225c: e591000c ldr r0, [r1, #12] push {r0, r1}80002260: e92d0003 push {r0, r1} CPS #0x13 /* Change to Supervisor mode to allow interrupt reentry */80002264: f1020013 cps #19 push {lr} /* Save Supervisor lr */80002268: e52de004 push {lr} ; (str lr, [sp, #-4]!) LDR r2, =SystemIrqHandler8000226c: e59f2038 ldr r2, [pc, #56] ; 800022ac <FIQ_Handler+0x14> BLX r2 /* Call SystemIrqHandler with param GCC */80002270: e12fff32 blx r2 POP {lr}80002274: e49de004 pop {lr} ; (ldr lr, [sp], #4) CPS #0x12 /* Back to IRQ mode */80002278: f1020012 cps #18 POP {r0, r1}8000227c: e8bd0003 pop {r0, r1} STR r0, [r1, #0x10] /* Now IRQ handler finished: write to EOIR */80002280: e5810010 str r0, [r1, #16] POP {r0}80002284: e49d0004 pop {r0} ; (ldr r0, [sp], #4) MSR spsr_cxsf, r080002288: e16ff000 msr SPSR_fsxc, r0 POP {r0-r3, r12}8000228c: e8bd100f pop {r0, r1, r2, r3, ip} POP {lr}80002290: e49de004 pop {lr} ; (ldr lr, [sp], #4) SUBS pc, lr, #480002294: e25ef004 subs pc, lr, #480002298 <FIQ_Handler>: .align 2 .arm .weak FIQ_Handler .type FIQ_Handler, %functionFIQ_Handler: ldr r0,=FIQ_Handler80002298: e59f0010 ldr r0, [pc, #16] ; 800022b0 <FIQ_Handler+0x18> bx r08000229c: e12fff10 bx r0 ldr r0,=SVC_Handler800022a0: 8000222c andhi r2, r0, ip, lsr #4 ldr r0,=PrefAbort_Handler800022a4: 80002234 andhi r2, r0, r4, lsr r2 ldr r0,=DataAbort_Handler800022a8: 8000223c andhi r2, r0, ip, lsr r2 LDR r2, =SystemIrqHandler800022ac: 80007687 andhi r7, r0, r7, lsl #13 ldr r0,=FIQ_Handler800022b0: 80002298 mulhi r0, r8, r2
****省略了**
800038b4 <main>:/*! * @brief Main function */int main(void){800038b4: b590 push {r4, r7, lr}800038b6: b091 sub sp, #68 ; 0x44800038b8: af00 add r7, sp, #0
省略****
请大佬们解惑!
|
|