HTTPS sample does not work on nRF9161DK

I'm trying to run the vanilla HTTPS sample on the nRF9161 DK: sdk-nrf/samples/net/https_client/README.rst at 4b9841a28e97e9d61b93f8981375d644b9d04ea0 · nrfconnect/sdk-nrf

The sample does not compile. In fact, I get a lot of the same issues as described in this thread:
(7) TLS on Thingy91 not working - Nordic Q&A - Nordic DevZone - Nordic DevZone

After tweaking the sample to add in some missing config (CONFIG_TLS_CREDENTIALS=y and CONFIG_MODEM_KEY_MGMT=y), it compiles, but gets an overflow exception:

Connecting to the network
+CGEV: EXCE STATUS 0
+CEREG: 2,"4128","03437E10",7
+CSCON: 1
+CGEV: ME PDN ACT 0,0
+CNEC_ESM: 50,0
+CEREG: 5,"4128","03437E10",7,,,"11100000","11100000"
+CEDRXP: 4,"1001","1001","0001"
%XTIME: "4A","4211810065224A","00"
[00:00:09.527,191] <err> os: ***** USAGE FAULT *****
[00:00:09.535,095] <err> os:   Stack overflow (context area not valid)
[00:00:09.544,616] <err> os: r0/a1:  0xaaaaaaaa  r1/a2:  0xaaaaaaaa  r2/a3:  0x0002b37e
[00:00:09.555,603] <err> os: r3/a4:  0x01000000 r12/ip:  0xaaaaaaaa r14/lr:  0xaaaaaaaa
[00:00:09.566,558] <err> os:  xpsr:  0xaaaaaa00
[00:00:09.574,066] <err> os: s[ 0]:  0xaaaaaaaa  s[ 1]:  0xaaaaaaaa  s[ 2]:  0xaaaaaaaa  s[ 3]:  0x00000001
[00:00:09.586,822] <err> os: s[ 4]:  0x00032e38  s[ 5]:  0x00032e38  s[ 6]:  0x0000004e  s[ 7]:  0x20020118
[00:00:09.599,578] <err> os: s[ 8]:  0x00000000  s[ 9]:  0x0002be1f  s[10]:  0x0000004e  s[11]:  0x0002af7b
[00:00:09.612,335] <err> os: s[12]:  0x0000004e  s[13]:  0x4e032e38  s[14]:  0x20020228  s[15]:  0x0002af9b
[00:00:09.625,030] <err> os: fpscr:  0x0002af83
[00:00:09.632,507] <err> os: Faulting instruction address (r15/pc): 0xaaaaaaaa
[00:00:09.642,700] <err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
[00:00:09.652,893] <err> os: Current thread: 0x2000ea38 (net_mgmt)
[00:00:09.662,017] <err> os: Halting system

I am on SDK v2.7 and firmware mfw_nrf91x1_2.0.1.

I have spent the last 16 hours trying to get a basic HTTPS request through. I tried the sample included in the nRF SDK to no avail, I've tried the various http_get, http_client, websocket, etc. samples in the Zephyr SDK, I've tried using socket offloading and also native network + mbedTLS, I've tried both the POSIX version of the APIs and the Zephyr versions, etc. -- I can't get any of them to succeed. A normal plaintext/HTTP connection works fine. However, I can't get any of the HTTPS samples in vanilla form to successfully run on the nRF9161 DK without hanging, crashing, or straight up failing to compile. I tried swapping them all over to my domain and my domain's CA certificate to no avail either. Can anyone point me to a working example of HTTPS?

Better yet, is there any higher-level API where I don't have to manually manage sockets, do DNS lookups (getaddrinfo), or manually set up TLS options just to make a basic REST API call? I had hoped that this stuff would've been abstracted out by the underlying libraries.

Parents Reply
  • I see. Does it still fail in the same way in that case? If so, can you share the full build log? (The full log also include the build command which may be relevant). I see you used a vanilla (unmodifed) sample project, but did you do any other changes in the SDK? (I am tryign to figure out what the difference can be as I am only able to reproduce this when buildign a secure mode application).

Children
  • Novice question, but when I hit "Build" on the nRF VS Code extension, it outputs the logs to a terminal window which rolls the logs. Is there another place I can find the full build logs? I tried running the "west" command manually but seems my path env is off as it can't find that command.

  • Hi,

    Normally the intergrated scrolblack in the VS Code temrinal should be enough (default is 1000 lines). Bu tyou can increase it by going into settings and adjusting the setting named terminal.integrated.scrollback.

    If you want to build with the toolchain from the command line, the simplest is to use the nRF Connect Toolchain Manager and click the error to the left of the toolchain and select "Open Terminal". With that, you should be able to navigate to your project and build with west.

Related