Application building error

Hello when I build an application on VS Code, the terminal give this error :

warning: UPDATEABLE_IMAGE_NUMBER (defined at
C:/ncs/v2.8.0/nrf\samples\common\mcumgr_bt_ota_dfu/Kconfig:89, subsys/dfu/Kconfig:95) was assigned
the value '1' but got the value ''. Check these unsatisfied dependencies:
(((BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS) && SOC_SERIES_NRF53X &&
NCS_SAMPLE_MCUMGR_BT_OTA_DFU) || (!MCUBOOT && IMG_MANAGER)) (=n). See
docs.zephyrproject.org/.../kconfig.html and/or look up
UPDATEABLE_IMAGE_NUMBER in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.


warning: MCUBOOT_UPDATE_FOOTER_SIZE (defined at subsys/dfu/Kconfig:54) was assigned the value
'0x2000' but got the value ''. Check these unsatisfied dependencies: MCUBOOT_IMG_MANAGER (=n),
IMG_MANAGER (=n). See
docs.zephyrproject.org/.../kconfig.html and/or look up
MCUBOOT_UPDATE_FOOTER_SIZE in the menuconfig/guiconfig interface. The Application Development
Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
might be helpful too.


c:/Users/peyre/Desktop/ProjetNemeus/testsensor/prj.conf:28: warning: attempt to assign the value 'y' to the undefined symbol BOARD_THINGY91_NRF9160NS

error: Aborting due to Kconfig warnings

Parsing C:/ncs/v2.8.0/zephyr/Kconfig
Loaded configuration 'C:/ncs/v2.8.0/nrf/boards/nordic/thingy91/thingy91_nrf9160_defconfig'
Merged configuration 'c:/Users/peyre/Desktop/ProjetNemeus/testsensor/prj.conf'
Merged configuration 'C:/Users/peyre/Desktop/ProjetNemeus/testsensor/build/testsensor/zephyr/.config.sysbuild'
CMake Error at C:/ncs/v2.8.0/zephyr/cmake/modules/kconfig.cmake:396 (message):
command failed with return code: 1
Call Stack (most recent call first):
C:/ncs/v2.8.0/nrf/cmake/modules/kconfig.cmake:29 (include)
C:/ncs/v2.8.0/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
CMakeLists.txt:2 (find_package)


-- Configuring incomplete, errors occurred!
CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
CMake configure failed for Zephyr project: testsensor

Location: C:/Users/peyre/Desktop/ProjetNemeus/testsensor
Call Stack (most recent call first):
cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
cmake/modules/sysbuild_default.cmake:20 (include)
C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
C:/ncs/v2.8.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
template/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/Users/peyre/Desktop/ProjetNemeus/testsensor/build/CMakeFiles/CMakeOutput.log".
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\2d382dcd92\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/2d382dcd92/opt/bin/python.exe '-Bc:\Users\peyre\Desktop\ProjetNemeus\testsensor\build' -GNinja -DBOARD=thingy91/nrf9160 -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=c:/Users/peyre/Desktop/ProjetNemeus/testsensor/prj.conf '-SC:\ncs\v2.8.0\zephyr\share\sysbuild' '-DAPP_DIR:PATH=c:\Users\peyre\Desktop\ProjetNemeus\testsensor'

How can i fix this issue

Best Regards 
Julien from France

  • #include <zephyr/kernel.h>
    #include <zephyr/device.h>
    #include <zephyr/devicetree.h>
    #include <zephyr/drivers/sensor.h>
    #include <zephyr/net/socket.h>
    #include <zephyr/net/http/client.h>
    #include <stdio.h>

    #define SERVER_ADDR "">http://example.com/temp"  // Remplace avec ton URL
    #define HTTP_PORT 80

    static const struct device *temp_sensor = DEVICE_DT_GET_ONE(nordic_nrf_temp);

    void send_temperature(float temp) {
        char request[256];
        snprintf(request, sizeof(request), "POST /temp HTTP/1.1\r\n"
                 "Host: example.com\r\n"
                 "Content-Type: application/json\r\n"
                 "Content-Length: %d\r\n\r\n"
                 "{\"temperature\": %.2f}", 15, temp);

        struct sockaddr_in server;
        int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
        if (sock < 0) {
            printk("Erreur socket\n");
            return;
        }

        server.sin_family = AF_INET;
        server.sin_port = htons(HTTP_PORT);
        inet_pton(AF_INET, SERVER_ADDR, &server.sin_addr);

        if (connect(sock, (struct sockaddr *)&server, sizeof(server)) < 0) {
            printk("Erreur connexion serveur\n");
            close(sock);
            return;
        }

        send(sock, request, strlen(request), 0);
        close(sock);
    }

    void main(void) {
        if (!device_is_ready(temp_sensor)) {
            printk("Capteur température non disponible\n");
            return;
        }

        struct sensor_value temp_value;
        while (1) {
            sensor_sample_fetch(temp_sensor);
            sensor_channel_get(temp_sensor, SENSOR_CHAN_DIE_TEMP, &temp_value);
            float temp = sensor_value_to_double(&temp_value);

            printk("Température: %.2f\n", temp);
            send_temperature(temp);

            k_sleep(K_SECONDS(10));
        }
    }
  • # Activer les logs
    CONFIG_LOG=y
    
    # Activer le support réseau
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_IPV4=y
    CONFIG_NET_TCP=y
    CONFIG_NET_HTTP=y
    
    # Activer le capteur de température intégré
    CONFIG_SENSOR=y
    CONFIG_TEMP_NRF5=y
    
    # Activer le gestionnaire de threads et le mode veille
    CONFIG_THREAD_MONITOR=y
    CONFIG_PM=y
    
    


    Here's my prf.conf file

  • Hello when I build an application on VS Code, the terminal give this error :

    Does this error happen when you build for all applications that you try to build, or is it just this one? It kinda sounds like a toolchain issue, or there is something wrong with the installation of the SDK perhaps.

  • it happen with some applications with a simple hello world it work normally 

  • Megaghosty said:
    it work normally 

    By that you mean that building the hello world application works normally? Did you do any changes to the SDK, like updating to a newer release or something?

Related