AT%KEYGEN=16842753,2,0 stack overflow from AT command shell

Hi, 


I stumbled into a problem when generating CSR

I follow the procedure located here https://github.com/nRFCloud/utils/blob/main/README.md

I have issues generating this using my own application, but I can reproduce the same result using the "location sample".

I'm using the location sample found here: github.com/.../location

when the device is trying to generate the private key + csr the device stop responding. 

device_credentials_installer -d --ca *_ca.pem --ca-key *_prv.pem --coap --verify

I've tested this on both the nRF9151DK and the Thingy91x

the following output is from nRF9151DK using SDK 3.0.2

After a bit of investigation I found out that when I run: AT%KEYGEN=16842753,2,0 I get:

*** Booting nRF Connect SDK v3.0.2-89ba1294ac9b ***
*** Using Zephyr OS v4.0.99-f791c49f492c ***
Location sample started

Connecting to LTE...
> AT+CFUN=4
+CEREG: 0
OK
> AT%CMNG=3,16842753,2
OK
> AT%KEYGEN=16842753,2,0
[00:00:17.626,800] <err> os: ***** USAGE FAULT *****
[00:00:17.632,476] <err> os:   Stack overflow (context area not valid)
[00:00:17.639,801] <err> os: r0/a1:  0x00008f5c  r1/a2:  0x61000200  r2/a3:  0xc5397d57
[00:00:17.648,590] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x0000000f
[00:00:17.657,348] <err> os:  xpsr:  0x00000000
[00:00:17.662,658] <err> os: s[ 0]:  0x00000000  s[ 1]:  0x0002b6d2  s[ 2]:  0x00000000  s[ 3]:  0x000215b7
[00:00:17.673,217] <err> os: s[ 4]:  0x00000000  s[ 5]:  0x000270e0  s[ 6]:  0x000270e0  s[ 7]:  0x0000ccbb
[00:00:17.683,776] <err> os: s[ 8]:  0xfbc67de2  s[ 9]:  0xed05e62a  s[10]:  0x65dc77ef  s[11]:  0x50386034
[00:00:17.694,335] <err> os: s[12]:  0xc378c17f  s[13]:  0x6a41501a  s[14]:  0xd2770d7f  s[15]:  0x413afb0f
[00:00:17.704,833] <err> os: fpscr:  0x2001211d
[00:00:17.710,144] <err> os: Faulting instruction address (r15/pc): 0x0000000f
[00:00:17.718,139] <err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
[00:00:17.726,135] <err> os: Current thread: 0x2000cdd0 (unknown)
[00:00:17.732,971] <err> os: Halting system

If I try the same procedure with the at_client sample I get a more desired output:

https://github.com/nrfconnect/sdk-nrf/tree/main/samples/cellular/at_client

*** Booting nRF Connect SDK v3.0.2-89ba1294ac9b ***
*** Using Zephyr OS v4.0.99-f791c49f492c ***
The AT host sample started
Ready
> AT+CFUN=4
OK
> AT%CMNG=3,16842753,2
OK
> AT%KEYGEN=16842753,2,0
%KEYGEN: "MI.........A"
OK

Related