Peripheral example generates a HARD FAULT

Hello, 

I have nrf52DK (nrf52832-PCA10040) and I wanted to test the Peripheral example in the nrf Connect SDK. I have built the project for nrf52DK_nrf52832 and then flashed the code but it gives a hard faults.

I am using nRF Connect SDK v2.02 on Windows machine using nrf52DK (nrf52832-PCA10040-2.1.0)
        

*** Booting Zephyr OS build v3.0.99-ncs1-1 ***
[Bluetooth initialized
0[00:00:00.011,016] <inf> fs_nvs: alloc wra: 0, fe8
[00:00:00.011,047] <inf> fs_nvs: data wra: 0, 0
[00:00:00.011,169] <inf> sdc_hci_driver: SoftDevice Controller build revision:
33 78 2a 18 20 f5 61 61 a6 8b 77 60 62 83 39 2a |3x*. .aa ..w`b.9*
7c f1 14 e4 ||...
[00:00:00.015,441] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.015,472] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.015,472] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 51.10872 Build 1643454488
[00:00:00.016,082] <inf> bt_hci_core: No ID address. App must call settings_load()
[00:00:00.018,096] <err> os: ***** HARD FAULT *****
[00:00:00.018,096] <err> os: Fault escalation (see below)
[00:00:00.018,096] <err> os: ***** MPU FAULT *****
[00:00:00.018,127] <err> os: Stacking error (context area might be not valid)
[00:00:00.018,127] <err> os: Data Access Violation
[00:00:00.018,157] <err> os: MMFAR Address: 0x20005110
[00:00:00.018,157] <err> os: r0/a1: 0x95c3707c r1/a2: 0xdc7d25e8 r2/a3: 0xe97ffd9e
[00:00:00.018,188] <err> os: r3/a4: 0x18a8ca4c r12/ip: 0xa77b66f4 r14/lr: 0x30e6eb39
[00:00:00.018,188] <err> os: xpsr: 0x61000000
[00:00:00.018,188] <err> os: Faulting instruction address (r15/pc): 0x00002e70
[00:00:00.018,218] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:00.018,249] <err> os: Current thread: 0x200023f0 (main)
[00:00:01.525,573] <err> fatal_error: Resetting system

and this is the part of the .map file that corresponds to the address of the fault.
 .text          0x0000000000002a74       0x8c C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
                0x0000000000002a74                sym_ZC6NJBPUISWILQK6OTOBMJVVUT63JRIDGH5WNCY
 .text          0x0000000000002b00       0x68 C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
                0x0000000000002b00                sym_ORUJDMUJV7RZIFXM3X5KLRROPKJ7VPLJ65JMLRQ
 .text          0x0000000000002b68       0x38 C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
                0x0000000000002b68                sym_PITJNQC6YSCEFAH23N5QRORZDKCSKOAUGBUS6GA
 .text          0x0000000000002ba0       0x5c C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
                0x0000000000002ba0                sym_AOU55ZK756JLPLCLZ5TZSSVKOAWWFUNQZATBXUI
 .text          0x0000000000002bfc      0x104 C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
                0x0000000000002bfc                MPSL_IRQ_RTC0_Handler
 .text          0x0000000000002d00      0x100 C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
                0x0000000000002d00                MPSL_IRQ_TIMER0_Handler
 .text          0x0000000000002e00       0x64 C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
 .text          0x0000000000002e64        0xc C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
                0x0000000000002e64                sym_M4DIQOXJAE3BNHQBIUCZXAABSM24CWUEJOCU7DY
 .text          0x0000000000002e70      0x144 C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
                0x0000000000002e70                sym_2ZDZA75WOMRNSQ6XL7IZWAQKYFFSRJOGBGKPTIQ
 .text          0x0000000000002fb4       0xc4 C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
                0x0000000000002fb4                sym_UGOJA475OXR5HR5WFINUK27HP5BRGNWCZXQLKDI
 .text          0x0000000000003078        0xc C:/nordic/v2.0.2/nrfxlib/mpsl/lib/cortex-m4/soft-float/libmpsl.a(libmpsl_debug_soft__obfuscated.elf)
                0x0000000000003078                sym_RUQO26WM5KVVEW7O3OHCXPO7LLLXRBDPIPSWIWY
ً 
And this is the build command:
ً
west build --build-dir c:\nordic\periph\peripheral\build c:\nordic\periph\peripheral 
--pristine --board nrf52dk_nrf52832 -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" 
-DBOARD_ROOT:STRING="c:/nordic/periph/peripheral;c:/nordic/v2.0.2/nrf/boards/arm/nrf52kbd_nrf52832" 
-DCONFIG_DEBUG_OPTIMIZATIONS:STRING="y" -DCONFIG_DEBUG_THREAD_INFO:STRING="y" 
-DCONF_FILE:STRING="c:/nordic/periph/peripheral/prj.conf"
I am really frustrated because I had a lot of issues in building any project, I had tried many solutions to just get the vscode build a nrf connect SDK example!

And then when finally the build is working, the given example does not work! I thought the vendor-provided things should work from the first try without so much hassle.
Best regards,
Ahmed
Parents Reply Children
Related