This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf51422 goes in to WFE

Hi all,

I'm developing little project on nrf51 dongle(pca10031). After few succeses now I have big failure which stops my work.

How my environment looks like: Ubuntu 14.04, JLink V5.03h, arm-none-eabi 4.9.3 20141119. 1 week ago everything works fine.

I could not load any software on nrf51. For example here is ble_central/ble_app_hrs_c:

Im loading whole software through gdb:

(gdb) symbol-file ./_build/nrf51422_xxac_s120.out 
Reading symbols from ./_build/nrf51422_xxac_s120.out...done.
(gdb) exec-file ./_build/nrf51422_xxac_s120.hex 
(gdb) target remote localhost:2331
Remote debugging using localhost:2331
0x20000386 in ?? ()
(gdb) monitor halt
(gdb) monitor reset
Resetting target
(gdb) load
Loading section .sec1, size 0x3000 lma 0x1d000
Loading section .sec2, size 0x4510 lma 0x20000
Start address 0x22f60, load size 29968
Transfer rate: 70 KB/sec, 3746 bytes/write.
(gdb) b main
Breakpoint 1 at 0x20f5c: examples/ble_central/ble_app_hrs_c/main.c, line 860.

(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xfffffffe in ?? ()
(gdb) bt
0  0xfffffffe in ?? ()
1  <signal handler called>
2  0x00000c00 in ?? ()
3  0xe7f8461c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

When I look into Jlink:

~ # > sudo JLinkExe -device nrf51822_xxaa -if swd -speed 4000

J-Link>h
PC = FFFFFFFE, CycleCnt = 00000000
R0 = FFFFFFFF, R1 = FFFFFFFF, R2 = FFFFFFFF, R3 = FFFFFFFF
R4 = FFFFFFFF, R5 = FFFFFFFF, R6 = FFFFFFFF, R7 = FFFFFFFF
R8 = FFFFFFFF, R9 = FFFFFFFF, R10= FFFFFFFF, R11= FFFFFFFF
R12= FFFFFFFF
SP(R13)= FFFFFFFC, MSP= FFFFFFFC, PSP= FFFFFFFC, R14(LR) = FFFFFFFF
XPSR = C1000000: APSR = NZcvq, EPSR = 01000000, IPSR = 000 (NoException)
CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
J-Link>r
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
J-Link>s
000006D0:  16 49              LDR     R1, [PC, #+0x58]
J-Link>s
000006D2:  17 4C              LDR     R4, [PC, #+0x5C]
J-Link>s
000006D4:  24 68              LDR     R4, [R4]
J-Link>s
000006D6:  8C 42              CMP     R4, R1
J-Link>s
000006D8:  0B D1              BNE     #+0x16
J-Link>s
000006DA:  16 4B              LDR     R3, [PC, #+0x58]
J-Link>s
000006DC:  1B 68              LDR     R3, [R3]
J-Link>s
000006DE:  99 42              CMP     R1, R3
J-Link>s
000006E0:  0C D1              BNE     #+0x18
J-Link>s
000006E2:  15 4B              LDR     R3, [PC, #+0x54]
J-Link>s
000006E4:  15 4A              LDR     R2, [PC, #+0x54]
J-Link>s
000006E6:  13 60              STR     R3, [R2]
J-Link>s
000006E8:  18 68              LDR     R0, [R3]
J-Link>s
000006EA:  10 49              LDR     R1, [PC, #+0x40]
J-Link>s
000006EC:  88 42              CMP     R0, R1
J-Link>s
000006EE:  ED D0              BEQ     #-0x26
J-Link>s
000006F0:  0A E0              B       #+0x14
J-Link>s
00000708:  80 F3 08 88        MSR     MSP, R0
J-Link>s
0000070C:  0E 49              LDR     R1, [PC, #+0x38]
J-Link>s
0000070E:  88 42              CMP     R0, R1
J-Link>s
00000710:  04 DD              BLE     #+0x08
J-Link>s
0000071C:  5B 68              LDR     R3, [R3, #+0x04]
J-Link>s
0000071E:  18 47              BX      R3
J-Link>s
0001BF94:  12 48              LDR     R0, [PC, #+0x48]
J-Link>s
0001BF96:  13 49              LDR     R1, [PC, #+0x4C]
J-Link>s
0001BF98:  09 68              LDR     R1, [R1]
J-Link>s
0001BF9A:  88 42              CMP     R0, R1
J-Link>s
0001BF9C:  0E D1              BNE     #+0x1C
J-Link>s
0001BF9E:  13 4B              LDR     R3, [PC, #+0x4C]
J-Link>s
0001BFA0:  18 68              LDR     R0, [R3]
J-Link>s
0001BFA2:  0B 49              LDR     R1, [PC, #+0x2C]
J-Link>s
0001BFA4:  88 42              CMP     R0, R1
J-Link>s
0001BFA6:  F3 D0              BEQ     #-0x1A
J-Link>s
0001BF90:  20 BF              WFE
J-Link>s
0001BF92:  FD E7              B       #-0x06
J-Link>s
0001BF90:  20 BF              WFE
J-Link>s
0001BF92:  FD E7              B       #-0x06
J-Link>s
0001BF90:  20 BF              WFE
J-Link>s
0001BF92:  FD E7              B       #-0x06
J-Link>s
0001BF90:  20 BF              WFE
J-Link>s
0001BF92:  FD E7              B       #-0x06
J-Link>

It looks like arm goes to wait for event state.

Does anyone now what can happen?

Regards, M.

Parents
  • I got the same result when I erased the application and only had the SD programmed. Please try the following in Jlink commander to verify that the application vector table is present at 0x1D000:

    jlink > mem32 0x1D000 1 // check if it returns the initial stack pointer.  
    
  • Thanks for reply,

    Here is output of above command:

    J-Link>mem32 0x1D000 1
    0001D000 = FFFFFFFF
    

    I do not know what do you mean by initial stack pointer. Is it defined somewhere? In gcc linker script exist:

    __StackLimit = __StackTop - SIZEOF(.stack_dummy)
    

    Is it the same?

    Is there any way to check inside JLink(I am not familiar with it) from which function nrf51 start If even gdb breakpoint on _start function is not triggered?

    =====UPDATE===== Ok, it started working. Thanks for help!

Reply
  • Thanks for reply,

    Here is output of above command:

    J-Link>mem32 0x1D000 1
    0001D000 = FFFFFFFF
    

    I do not know what do you mean by initial stack pointer. Is it defined somewhere? In gcc linker script exist:

    __StackLimit = __StackTop - SIZEOF(.stack_dummy)
    

    Is it the same?

    Is there any way to check inside JLink(I am not familiar with it) from which function nrf51 start If even gdb breakpoint on _start function is not triggered?

    =====UPDATE===== Ok, it started working. Thanks for help!

Children
No Data
Related