Closed matthiasbock closed 8 years ago
The double fault is probably related to the warning "cannot find entry symbol Reset_Handler"...
Single-stepping through the code using gdb reveals, that the exception occured, whenever trying to push values to the stack.
Recent commits fix this issue by setting valid stack pointer.
(gdb) load Loading section .text, size 0x27c lma 0x0 Loading section .ARM.exidx, size 0x8 lma 0x27c Loading section .data, size 0x4 lma 0x284 Start address 0x0, load size 648 Transfer rate: 1 KB/sec, 216 bytes/write. (gdb) s Single stepping until exit from function Reset_Handler, which has no line number information. SystemInit () at system_nrf51.c:62 62 { (gdb) i r r0 0xf42400 16000000 r1 0x284 644 r2 0x20000000 536870912 r3 0x0 0 r4 0xffffffff -1 r5 0xffffffff -1 r6 0xffffffff -1 r7 0xffffffff -1 r8 0xffffffff -1 r9 0xffffffff -1 r10 0xffffffff -1 r11 0xffffffff -1 r12 0xffffffff -1 sp 0x480a2100 0x480a2100 lr 0x29 41 pc 0x64 0x64xPSR 0x61000000 1627389952 (gdb) set $sp=0x20002000 (gdb) si 0x00000066 62 { (gdb) disas Dump of assembler code for function SystemInit: 0x00000064 <+0>: push {r7, lr} => 0x00000066 <+2>: add r7, sp, #0 0x00000068 <+4>: bl 0xa8 0x0000006c <+8>: adds r3, r0, #0 0x0000006e <+10>: cmp r3, #0 0x00000070 <+12>: beq.n 0x80 0x00000072 <+14>: ldr r3, [pc, #40] ; (0x9c ) 0x00000074 <+16>: ldr r2, [pc, #40] ; (0xa0 ) 0x00000076 <+18>: str r2, [r3, #0] 0x00000078 <+20>: ldr r3, [pc, #40] ; (0xa4 ) 0x0000007a <+22>: movs r2, #128 ; 0x80 0x0000007c <+24>: lsls r2, r2, #8 0x0000007e <+26>: str r2, [r3, #0] 0x00000080 <+28>: bl 0x128 0x00000084 <+32>: adds r3, r0, #0 0x00000086 <+34>: cmp r3, #0 0x00000088 <+36>: beq.n 0x96 0x0000008a <+38>: movs r3, #128 ; 0x80 0x0000008c <+40>: lsls r2, r3, #23 0x0000008e <+42>: movs r3, #193 ; 0xc1 0x00000090 <+44>: lsls r3, r3, #3 0x00000092 <+46>: movs r1, #1 0x00000094 <+48>: str r1, [r2, r3] 0x00000096 <+50>: mov sp, r7 0x00000098 <+52>: pop {r7, pc} 0x0000009a <+54>: nop ; (mov r8, r8) 0x0000009c <+56>: lsls r4, r0, #20 0x0000009e <+58>: ands r0, r0 0x000000a0 <+60>: vaddl.u16 q14, d15, d7 0x000000a4 <+64>: ldr r0, [r3, #64] ; 0x40 0x000000a6 <+66>: ands r0, r0 End of assembler dump. (gdb)
Meanwhile OpenOCD outputs: