static assertion failed: "CONFIG_WIFI_CREDENTIALS_STATIC_SSID required" when building mqtt example with nRF7002 dev board

Hi.

I am new to using VS Code so i am thinking i am doing something wrong. I am using the NCS 2.4, the nrf7002dk_nrf5340  dev board with the MQTT example that is here. 

I am trying to compile the example here https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/net/mqtt/doc/description.html

I have used the below build configuration

But the compile is failing with the following error: 

C:\ncs\v2.4.0\zephyr\include\zephyr\toolchain\gcc.h:81:36: error: static assertion failed: "CONFIG_WIFI_CREDENTIALS_STATIC_SSID required"
81 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
| ^~~~~~~~~~~~~~
C:\ncs\v2.4.0\nrf\subsys\net\lib\wifi_mgmt_ext\wifi_mgmt_ext.c:23:9: note: in expansion of macro 'BUILD_ASSERT'
23 | BUILD_ASSERT(sizeof(CONFIG_WIFI_CREDENTIALS_STATIC_SSID) != 1,
| ^~~~~~~~~~~~

and looking further back into the build log i see:

-- Found assembler: C:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
CMake Warning at C:/ncs/v2.4.0/nrf/subsys/net/lib/mqtt_helper/CMakeLists.txt:12 (message):
Credentials are exposed in non-secure memory. This should be avoided in
production.


CMake Warning at C:/ncs/v2.4.0/zephyr/CMakeLists.txt:838 (message):
No SOURCES given to Zephyr library: lib__libc__common

Excluding target from build.


CMake Warning at C:/ncs/v2.4.0/zephyr/CMakeLists.txt:838 (message):
No SOURCES given to Zephyr library: drivers__ethernet

Excluding target from build.


CMake Warning at C:/ncs/v2.4.0/zephyr/CMakeLists.txt:838 (message):
No SOURCES given to Zephyr library: drivers__wifi

Excluding target from build.


CMake Warning at C:/ncs/v2.4.0/zephyr/CMakeLists.txt:1864 (message):
__ASSERT() statements are globally ENABLED

 I am able to build the provisioning example for the dev board fine. However i cant seem to build this example.

Any ideas?

Mark

  • Hi,

    When rebuilding a project with an existing build directory, the VS Code extension will create the build command based on what is in CMake cache, including for example overlay configurations. There might be some cache in the build directory that is not removed when rebuilding, which could have caused this issue.

    Are you able to run the sample successfully now, or are you still seeing some issues?

    Best regards,
    Marte

  • It is sending messages over MQTT to the server so its working as expected now. 

    I am trying to get the mqtt provisioning example from the blog working now. But it is also crashing but on a different error. https://github.com/AliNordic/mqtt_over_wifi_nrf7002DK This is not built for the 2.4.1 stack and i have been debugging it. 

    So far I have been able to get it provision by looking at added defines and file changes in the provisioning example  for example the below is added now.

    #include <net/wifi_mgmt_ext.h>

    I can get the code to provision but it is crashing on the mqtt_connect(&client); I assume this might be to do with some changes in the SDK and i wanted to see an simple example of the MQTT to figure out how you are supposed to init then connect to the server to figure out how come its panicing.

    <err> os: usage_fault: ***** USAGE FAULT *****
    [00:02:43.536,743] <err> os: usage_fault: Stack overflow (context area not valid)

  • Hi,

    Are you using the latest version of the example? The github repository was updated just two days ago with a patch to make it work in v2.4.0. I just built the example in v2.4.1 and it runs without issues on my side.

    Also make sure to change the MQTT client ID and topics in the project configuration to something unique:

    CONFIG_MQTT_PUB_TOPIC="nRF7002DK/publish/my_unique_topic"
    CONFIG_MQTT_SUB_TOPIC="nRF7002DK/subscribe/my_unique_topic"
    CONFIG_MQTT_CLIENT_ID="my_unique_client_id"

    Best regards,
    Marte

  • Hi Marte,

    Thanks i have pulled the latest from the repo and now its working, i hadn't noticed that it was updated as i only pulled it a few days back. 

Related