@CamilaSouza I did a lot of research about this freezing issue I have.
I came to the conclusion that GNSS does not work with SMP. It causes freezes, crashes or might work. The behavior changes if you modify your code.
I can see that (likely) when receiving data from the GNSS CPU (1). Some random memory gets overwritten with ff. Depending on where this is either freeze, crash or normal behavior happens.
[CPU0] arm_hardfault: PANIC!!! Hard fault: 40000000
[CPU0] up_assert: Assertion failed CPU0 at file:armv7-m/arm_hardfault.c line: 135 task: gnss_receiver
[CPU0] up_registerdump: R0: 000000ff 000000ff 00000000 deadbeef 000000ff 2d0378b0 00000000 2d03089c
[CPU0] up_registerdump: R8: 00000000 00000000 00000000 00000000 0d013bd1 2d03ceb8 0d006413 0d0063d0
[CPU0] up_registerdump: xPSR: 61000000 BASEPRI: 00000080 CONTROL: 00000000
[CPU0] up_registerdump: EXC_RETURN: ffffffe9
[CPU0] up_dumpstate: sp: 2d02a618
[CPU0] up_dumpstate: IRQ stack:
[CPU0] up_dumpstate: base: 2d029e80
[CPU0] up_dumpstate: size: 00000800
[CPU0] up_dumpstate: used: 000001b8
Could you please check?
tools/config.py examples/gnss examples/smp_asmp
# or tools/config.py examples/gnss feature/smp
# or tools/config.py examples/gnss feature/lte_stub_mbedtls feature/smp
make
tools/flash.sh -c /dev/ttyUSB0 nuttx.spk
Play a little with the configurations by modifying them.
This is not necessarily due to parallel running on the CPUs. Pinning all threads to CPU 0 also does not work.
+SMP_NCPUS=1
I even compiled https://github.com/ds-dyad/10n2-app/blob/master/sdk.config. This works. I cannot say what is the difference causing the issue or not. (I have LTE feature active?)
I also tried the GNSS sample some time ago with SMP. I remember it worked.
Like I said it seems random (but reproducible with the same build).
I already spend a lot of time. I do not know how to continue. I am about to close this investigation concluding GNSS @ SMP is not stable on Spresense.
Could you please check if there is anything I could do?
Btw SMP seems to not yet fully ready (It is considered stable, but there are open issues)
https://github.com/apache/nuttx/pull/8383 is not yet in the spresense sdk.
and see here
https://github.com/apache/nuttx/issues/3600
... nuttx/arch/arm/src/cxd56xx/cxd56_cpu1signal.c still uses shed_lock() and this is related with GNSS.