vouch-opensource / zephyr-nfc08a1

Zephyr app to drive the X-NUCLEO-NFC08A1
Apache License 2.0
2 stars 0 forks source link

Crash on Nucleo #7

Open mfikes opened 1 year ago

mfikes commented 1 year ago

When running on the Nucleo and scanning an NFC card, I get a crash after the scan:

NFCA Passive ISO-DEP device found. UID: 04865372B67280
 Select NDEF Application: OK Data: 6A82
[00:00:00.150,000] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
--- 5 messages dropped ---
[00:00:00.150,000] <err> os: Current thread: 0x200001d8 (unknown)
[00:00:00.168,000] <err> fatal_error: Resetting system*** Booting Zephyr OS build v3.1.99-ncs1  ***

If a small delay is put in the main loop, say via k_sleep(K_MSEC(1)), then the crash goes away.

This crash doesn't occur when targeting the Nordic dev boards.

mfikes commented 1 year ago

Trying to catch it in the debugger yields:

(gdb) bt
#0  arch_system_halt (reason=reason@entry=0) at /Users/mfikes/Projects/vouch-zephyr-nfc08a1/zephyr/kernel/fatal.c:32
#1  0x08006be6 in k_sys_fatal_error_handler (reason=0, reason@entry=8, esf=esf@entry=0x20001a88 <z_interrupt_stacks+448>)
    at /Users/mfikes/Projects/vouch-zephyr-nfc08a1/zephyr/kernel/fatal.c:46
#2  0x08006cb0 in z_fatal_error (reason=8, reason@entry=536877696, esf=esf@entry=0x20001a88 <z_interrupt_stacks+448>) at /Users/mfikes/Projects/vouch-zephyr-nfc08a1/zephyr/kernel/fatal.c:131
#3  0x08001e8c in z_arm_fatal_error (reason=536877696, reason@entry=0, esf=0x20001a88 <z_interrupt_stacks+448>, esf@entry=0x20001aa0 <z_interrupt_stacks+472>)
    at /Users/mfikes/Projects/vouch-zephyr-nfc08a1/zephyr/arch/arm/core/aarch32/fatal.c:63
#4  0x0800214e in z_arm_fault (msp=<optimized out>, psp=<optimized out>, exc_return=<optimized out>, callee_regs=<optimized out>)
    at /Users/mfikes/Projects/vouch-zephyr-nfc08a1/zephyr/arch/arm/core/aarch32/cortex_m/fault.c:1070
#5  0x080021e0 in z_arm_hard_fault () at /Users/mfikes/Projects/vouch-zephyr-nfc08a1/zephyr/arch/arm/core/aarch32/cortex_m/fault_s.S:102
#6  <signal handler called>
#7  0x00003100 in ?? ()
#8  0x08008522 in z_cbprintf_cpy (buf=<optimized out>, len=0, ctx=0x0) at /Users/mfikes/Projects/vouch-zephyr-nfc08a1/zephyr/include/zephyr/sys/cbprintf.h:484
#9  0x0800036e in __udivmoddi4 ()
#10 0x20000120 in log_process_thread_sem ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
RANAROYG commented 1 year ago

I am new to the NFC and I am trying to build and flash this example in the custom board with nRF52840 and the ST25R3916 chip. I have checked the overlay file and also added few required macros for JLinkRTTViewer in the prj.conf file. I also tried by disabling the 'platformSpiSelect()' and 'platformSpiDeselect()' and enabling the ST25R_COM_SINGLETXRX macro as mentioned in the guide. But, the code throws the error of st25r chip not initialized. Kind request to guide me for the required changes in the code to function as intended.

mfikes commented 1 year ago

@RANAROYG Are you seeing the crash reported in this ticket? Or is this a separate question?

RANAROYG commented 1 year ago

I apologise for the above query. I request to resolve the query. I need to create the new ticket.