Error in Cellular IoT Fundamentals Course Lesson 3 Exercise 1 - Project will not build. Solution provided includes CONFIG_POSIX_API=y in prj.conf which is not mentioned in the tutorial.

I have followed the instructions in the DevAcademy Cellular IoT Fundamentals Lesson 3 Exercise 1 exactly, (whilist filling in the gaps from the cloned cell-fund repo) and I receive build errors after configuring the build configuration file and attempting to build the project. All build errors seem to be related to the socket API fxns. 

One thing I have noticed is that the solution code has CONFIG_POSIX_API=y included in the application configuration file (prj.conf) but this is never mentioned in the tutorial walk through. I am able to build the l3_e1_sol project fine, but when I run the example, my nRF9151DK never log prints the 'Data received...' message. Which makes me think that this example is not working properly.

I suspect this project doesn't work (server never recevies message) when CONFIG_POSIX_API=y is set, because the socket offloading is not working properly and thus the BSD socket fxn calls are using the traditional BSD socket library.

Attempted solution:

  • I have tried using the verbose prefixed  'z_sock...' socket functions and not including the CONFIG_POSIX_API=y config line. The project builds now, but the server still never prints the log 'data recevied ....'

Context Info:

  • nRF Connect SDK v2.9.99
  • nRF Connect Toolchain v2.9.1
  • cell-fund repo main branch cloned - most recent commit: 0c9ab78441ecda47650d3be45011d9274880bbcc
  • Visual Studio Code v1.98.2
  • Ubuntu 24.04.1  on x86_64 
  • Hardware : 
    • Device: nRF9151DK
    • Hardware Version: 0.9.0

Log of failed build (exact copy of solution code without CONFIG_POSIX_API=y in prj.conf):

 *  Executing task: nRF Connect: Build [pristine]: l3_e1/build (active) 

Building l3_e1
west build --build-dir /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1 --pristine --board nrf9151dk/nrf9151/ns --sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=prj.conf

-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /home/devin/ncs/toolchains/b77d8c1312/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
-- Cache files will be written to: /home/devin/.cache/zephyr
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf9151dk, qualifiers: nrf9151/ns
Parsing /home/devin/ncs/zephyr/share/sysbuild/Kconfig
Loaded configuration '/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/_sysbuild/empty.conf'
Merged configuration '/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/_sysbuild/empty.conf'
Configuration saved to '/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/zephyr/.config'
Kconfig header saved to '/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/_sysbuild/autoconf.h'
-- 
   ***************************
   * Running CMake for l3_e1 *
   ***************************

Loading Zephyr default modules (Zephyr base).
-- Application: /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1
-- CMake version: 3.21.0
-- Found Python3: /home/devin/ncs/toolchains/b77d8c1312/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
-- Cache files will be written to: /home/devin/.cache/zephyr
-- Zephyr version: 4.0.99 (/home/devin/ncs/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf9151dk, qualifiers: nrf9151/ns
-- Found host-tools: zephyr 0.17.0 (/home/devin/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.17.0 (/home/devin/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
-- Found Dtc: /home/devin/ncs/toolchains/b77d8c1312/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/devin/ncs/zephyr/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_ns.dts
-- Generated zephyr.dts: /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/zephyr.dts
-- Generated pickled edt: /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/edt.pickle
-- Generated zephyr.dts: /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/dts.cmake
Parsing /home/devin/ncs/zephyr/Kconfig
Loaded configuration '/home/devin/ncs/zephyr/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_ns_defconfig'
Merged configuration '/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/prj.conf'
Merged configuration '/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/.config.sysbuild'
Configuration saved to '/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/.config'
Kconfig header saved to '/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/devin/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/devin/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
=========== Generating psa_crypto_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Backup: CONFIG_MBEDTLS_THREADING: False
Backup: CONFIG_MBEDTLS_THREADING_ALT: False
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Restore: CONFIG_MBEDTLS_THREADING: False
Restore: CONFIG_MBEDTLS_THREADING_ALT: False
=========== End psa_crypto_config ===============
=========== Generating psa_crypto_library_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Backup: CONFIG_MBEDTLS_THREADING: False
Backup: CONFIG_MBEDTLS_THREADING_ALT: False
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Restore: CONFIG_MBEDTLS_THREADING: False
Restore: CONFIG_MBEDTLS_THREADING_ALT: False
=========== End psa_crypto_library_config ===============
-- Using ccache: /home/devin/ncs/toolchains/b77d8c1312/usr/bin/ccache
-- Configuring done
-- Generating done
-- Build files have been written to: /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1
Dropping partition 'nrf_modem_lib_trace' since its size is 0.
Dropping partition 'nonsecure_storage' since it is empty.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build
-- west build: building application
[1/289] Preparing syscall dependency handling

[6/289] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.0.99 (/home/devin/ncs/zephyr), build: v3.7.99-ncs2-rc1-8095-g8dbca43a6a9d
[12/289] Generating ../../tfm/CMakeCache.txt
-- Found Git: /home/devin/ncs/toolchains/b77d8c1312/usr/local/bin/git (found version "2.37.3") 
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/devin/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Found Python3: /home/devin/ncs/toolchains/b77d8c1312/usr/local/bin/python (found version "3.12.4") found components: Interpreter 
-- Found Python3: /home/devin/ncs/toolchains/b77d8c1312/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter 
-- Cache files will be written to: /home/devin/.cache/zephyr
-- Configuring done
-- Generating done
-- Build files have been written to: /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/tfm
[135/139] Linking C executable bin/tfm_s.axf
Memory region         Used Size  Region Size  %age Used
           FLASH:       32092 B        32 KB     97.94%
             RAM:       10404 B        32 KB     31.75%
[19/289] Performing install step for 'tfm'
-- Install configuration: "MinSizeRel"
----- Installing platform NS -----
[282/289] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: CMakeFiles/app.dir/src/main.c.obj 
ccache /home/devin/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=4096 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DNRF9120_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DTFM_PSA_API -DUSE_PARTITION_MANAGER=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/include/generated/zephyr -I/home/devin/ncs/zephyr/include -I/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/include/generated -I/home/devin/ncs/zephyr/soc/nordic -I/home/devin/ncs/zephyr/soc/nordic/nrf91/. -I/home/devin/ncs/zephyr/soc/nordic/common/. -I/home/devin/ncs/nrf/include -I/home/devin/ncs/nrf/lib/at_parser/include -I/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/tfm/api_ns/interface/include -I/home/devin/ncs/nrf/modules/trusted-firmware-m/. -I/home/devin/ncs/nrf/include/tfm -I/home/devin/ncs/nrf/tests/include -I/home/devin/ncs/modules/hal/cmsis/CMSIS/Core/Include -I/home/devin/ncs/zephyr/modules/cmsis/. -I/home/devin/ncs/nrf/modules/hal_nordic/. -I/home/devin/ncs/modules/hal/nordic/nrfx -I/home/devin/ncs/modules/hal/nordic/nrfx/drivers/include -I/home/devin/ncs/modules/hal/nordic/nrfx/mdk -I/home/devin/ncs/zephyr/modules/hal_nordic/nrfx/. -I/home/devin/ncs/nrfxlib/nrf_modem/include -I/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/generated/interface_nrf_security_psa -I/home/devin/ncs/nrf/subsys/nrf_security/include -I/home/devin/ncs/modules/crypto/oberon-psa-crypto/include -I/home/devin/ncs/nrf/subsys/nrf_security/src/utils -I/home/devin/ncs/modules/crypto/oberon-psa-crypto/library -I/home/devin/ncs/modules/crypto/mbedtls/library -I/home/devin/ncs/modules/crypto/mbedtls/include -I/home/devin/ncs/modules/crypto/mbedtls/include/library -I/home/devin/ncs/nrfxlib/crypto/nrf_oberon/include -I/home/devin/ncs/nrfxlib/crypto/nrf_oberon/include/mbedtls -isystem /home/devin/ncs/zephyr/lib/libc/common/include -fno-strict-aliasing -Os -imacros /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1/zephyr/include/generated/zephyr/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=/home/devin/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/devin/ncs/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/devin/ncs/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/devin/ncs=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c: In function 'server_resolve':
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:43:10: error: variable 'hints' has initializer but incomplete type
   43 |   struct addrinfo hints = {.ai_family = AF_INET, .ai_socktype = SOCK_DGRAM};
      |          ^~~~~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:43:29: error: 'struct addrinfo' has no member named 'ai_family'
   43 |   struct addrinfo hints = {.ai_family = AF_INET, .ai_socktype = SOCK_DGRAM};
      |                             ^~~~~~~~~
In file included from /home/devin/ncs/zephyr/include/zephyr/net/socket.h:31,
                 from /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:16:
/home/devin/ncs/zephyr/include/zephyr/net/net_ip.h:45:25: warning: excess elements in struct initializer
   45 | #define PF_INET         1          /**< IP protocol family version 4. */
      |                         ^
/home/devin/ncs/zephyr/include/zephyr/net/net_ip.h:55:24: note: in expansion of macro 'PF_INET'
   55 | #define AF_INET        PF_INET     /**< IP protocol family version 4. */
      |                        ^~~~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:43:41: note: in expansion of macro 'AF_INET'
   43 |   struct addrinfo hints = {.ai_family = AF_INET, .ai_socktype = SOCK_DGRAM};
      |                                         ^~~~~~~
/home/devin/ncs/zephyr/include/zephyr/net/net_ip.h:45:25: note: (near initialization for 'hints')
   45 | #define PF_INET         1          /**< IP protocol family version 4. */
      |                         ^
/home/devin/ncs/zephyr/include/zephyr/net/net_ip.h:55:24: note: in expansion of macro 'PF_INET'
   55 | #define AF_INET        PF_INET     /**< IP protocol family version 4. */
      |                        ^~~~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:43:41: note: in expansion of macro 'AF_INET'
   43 |   struct addrinfo hints = {.ai_family = AF_INET, .ai_socktype = SOCK_DGRAM};
      |                                         ^~~~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:43:51: error: 'struct addrinfo' has no member named 'ai_socktype'
   43 |   struct addrinfo hints = {.ai_family = AF_INET, .ai_socktype = SOCK_DGRAM};
      |                                                   ^~~~~~~~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:43:65: warning: excess elements in struct initializer
   43 |   struct addrinfo hints = {.ai_family = AF_INET, .ai_socktype = SOCK_DGRAM};
      |                                                                 ^~~~~~~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:43:65: note: (near initialization for 'hints')
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:43:19: error: storage size of 'hints' isn't known
   43 |   struct addrinfo hints = {.ai_family = AF_INET, .ai_socktype = SOCK_DGRAM};
      |                   ^~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:45:9: warning: implicit declaration of function 'getaddrinfo'; did you mean 'net_addr_ntop'? [-Wimplicit-function-declaration]
   45 |   err = getaddrinfo(SERVER_HOSTNAME, SERVER_PORT, &hints, &result);
      |         ^~~~~~~~~~~
      |         net_addr_ntop
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:59:36: error: invalid use of undefined type 'struct addrinfo'
   59 |       ((struct sockaddr_in *)result->ai_addr)->sin_addr.s_addr;
      |                                    ^~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:61:52: error: invalid use of undefined type 'struct addrinfo'
   61 |   server4->sin_port = ((struct sockaddr_in *)result->ai_addr)->sin_port;
      |                                                    ^~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:65:3: warning: implicit declaration of function 'inet_ntop' [-Wimplicit-function-declaration]
   65 |   inet_ntop(AF_INET, &server4->sin_addr.s_addr, ipv4_addr, sizeof(ipv4_addr));
      |   ^~~~~~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:69:3: warning: implicit declaration of function 'freeaddrinfo'; did you mean 'zsock_freeaddrinfo'? [-Wimplicit-function-declaration]
   69 |   freeaddrinfo(result);
      |   ^~~~~~~~~~~~
      |   zsock_freeaddrinfo
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:43:19: warning: unused variable 'hints' [-Wunused-variable]
   43 |   struct addrinfo hints = {.ai_family = AF_INET, .ai_socktype = SOCK_DGRAM};
      |                   ^~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c: In function 'server_connect':
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:77:10: warning: implicit declaration of function 'socket' [-Wimplicit-function-declaration]
   77 |   sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
      |          ^~~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:84:9: warning: implicit declaration of function 'connect' [-Wimplicit-function-declaration]
   84 |   err = connect(sock, (struct sockaddr *)&server, sizeof(struct sockaddr_in));
      |         ^~~~~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c: In function 'button_handler':
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:147:17: warning: implicit declaration of function 'send' [-Wimplicit-function-declaration]
  147 |       int err = send(sock, MESSAGE_TO_SEND, SSTRLEN(MESSAGE_TO_SEND), 0);
      |                 ^~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c: In function 'main':
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:190:16: warning: implicit declaration of function 'recv' [-Wimplicit-function-declaration]
  190 |     received = recv(sock, recv_buf, sizeof(recv_buf) - 1, 0);
      |                ^~~~
/home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/src/main.c:203:9: warning: implicit declaration of function 'close'; did you mean 'fclose'? [-Wimplicit-function-declaration]
  203 |   (void)close(sock);
      |         ^~~~~
      |         fclose
ninja: build stopped: subcommand failed.
FAILED: _sysbuild/sysbuild/images/l3_e1-prefix/src/l3_e1-stamp/l3_e1-build /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/_sysbuild/sysbuild/images/l3_e1-prefix/src/l3_e1-stamp/l3_e1-build 
cd /home/devin/mmci/nordic/cell-fund/v2.9.0-v2.7.0/l3/l3_e1/build/l3_e1 && /home/devin/ncs/toolchains/b77d8c1312/usr/local/bin/cmake --build .
ninja: build stopped: subcommand failed.

Serial terminal output after including CONFIG_POSIX_API=y (successful build, but I think offloading is not working):

*** Booting nRF Connect SDK v2.9.99-49c263509c74 ***
*** Using Zephyr OS v4.0.99-8dbca43a6a9d ***
[00:00:00.395,385] <inf> Lesson3_Exercise1: Initializing modem library
[00:00:00.661,010] <inf> Lesson3_Exercise1: Connecting to LTE network
[00:00:02.357,116] <inf> Lesson3_Exercise1: RRC mode: Connected
[00:00:02.696,838] <inf> Lesson3_Exercise1: RRC mode: Idle
[00:00:13.335,144] <inf> Lesson3_Exercise1: RRC mode: Connected
[00:00:20.396,331] <inf> Lesson3_Exercise1: Network registration status: Connected - roaming
[00:00:20.396,423] <inf> Lesson3_Exercise1: Connected to LTE network
[00:00:20.838,226] <inf> Lesson3_Exercise1: IPv4 Address found 20.82.16.164
[00:00:20.838,714] <inf> Lesson3_Exercise1: Successfully connected to server
[00:00:20.838,714] <inf> Lesson3_Exercise1: Press button 1 on your DK or Thingy:91 to send your message
[00:00:27.061,096] <inf> Lesson3_Exercise1: Successfully sent message: Hi from nRF91 Series device
[00:00:37.258,056] <inf> Lesson3_Exercise1: RRC mode: Idle
[00:00:53.547,271] <inf> Lesson3_Exercise1: Successfully sent message: Hi from nRF91 Series device
[00:00:53.636,779] <inf> Lesson3_Exercise1: RRC mode: Connected
[00:01:04.122,222] <inf> Lesson3_Exercise1: RRC mode: Idle

Parents
  • Hello,

    (successful build, but I think offloading is not working

    It looks like you get connected from the log. You can do a modem trace to confirm that the data reaches server.

  • I still have to perform a modem trace and figure out the data path... but for now i've determined my issue with building the provided example code, which uses the original / standard POSIX names for socket API functions! 

    The original BUILD issue I was facing, was related to changes in the KConfig symbol used to allow source code to refer to original POSIX names for socket API functions (without the Zephyr prefix), which appears to have been changed in v2.9.1 

    The old Kconfig was:  CONFIG_NET_SOCKETS_POSIX_NAMES

    The new Kconfig is:   CONFIG_POSIX_API 

    Hoping this helps anyone else with this build issue. It appears the most recent 'BSD Sockets' documentation page was updated as of today to mention the newest Kconfig symbol.  

Reply
  • I still have to perform a modem trace and figure out the data path... but for now i've determined my issue with building the provided example code, which uses the original / standard POSIX names for socket API functions! 

    The original BUILD issue I was facing, was related to changes in the KConfig symbol used to allow source code to refer to original POSIX names for socket API functions (without the Zephyr prefix), which appears to have been changed in v2.9.1 

    The old Kconfig was:  CONFIG_NET_SOCKETS_POSIX_NAMES

    The new Kconfig is:   CONFIG_POSIX_API 

    Hoping this helps anyone else with this build issue. It appears the most recent 'BSD Sockets' documentation page was updated as of today to mention the newest Kconfig symbol.  

Children
No Data
Related