nRF Connect 2.6 SDK builds crashes but working fine with nRF Connect SDK 2.43

Hi, I'm having trouble finding out which update caused my application to crash. The build works fine with nRF Connect 2.43, but with the latest version (2.6), it doesn't work and gives an error in the device tree. I've checked the release notes from versions 2.5, 2.5.1, 2.5.2, and 2.6, but I didn't find any relevant changes regarding the overlay.

I'm using Windows Windows 11.

Given error:

/spi-interface/spi-interface.c.obj -c C:/vacas/find-my-bull-fw-main/src/spi-interface/spi-interface.c
C:/vacas/find-my-bull-fw-main/src/spi-interface/spi-interface.c: In function 'init_spi':
C:/vacas/find-my-bull-fw-main/src/spi-interface/spi-interface.c:23:20: error: incompatible types when assigning to type 'struct spi_cs_control' from type 'struct spi_cs_control *'
   23 |     _spi_cfg->cs = cs_cfg;
      |                    ^~~~~~
[22/194] Building C object CMakeFiles/app.dir/src/lora-lib/nvs.c.obj
C:/vacas/find-my-bull-fw-main/src/lora-lib/nvs.c: In function 'nvs_read_init_parameter':
C:/vacas/find-my-bull-fw-main/src/lora-lib/nvs.c:80:14: warning: unused variable 'devnonce' [-Wunused-variable]
   80 |         int *devnonce = (void *)data;
      |              ^~~~~~~~
C:/vacas/find-my-bull-fw-main/src/lora-lib/nvs.c:79:15: warning: unused variable 'array' [-Wunused-variable]
   79 |         char *array = (void *)data;
      |               ^~~~~
C:/vacas/find-my-bull-fw-main/src/lora-lib/nvs.c:77:17: warning: unused variable 'bytes_written' [-Wunused-variable]
   77 |         ssize_t bytes_written;
      |                 ^~~~~~~~~~~~~
[24/194] Building C object CMakeFiles/app.dir/src/modem/modem.c.obj
In file included from C:/ncs/v2.6.0/zephyr/include/zephyr/logging/log.h:11,
                 from C:/vacas/find-my-bull-fw-main/src/modem/modem.c:3:
C:/vacas/find-my-bull-fw-main/src/modem/modem.c: In function 'lte_handler':
C:/vacas/find-my-bull-fw-main/src/modem/modem.c:35:17: warning: format '%d' expects argument of type 'int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=]
   35 |         LOG_INF("TAU pre-warning: Active time: %d", evt->time);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~
      |                                                        |
      |                                                        uint64_t {aka long long unsigned int}
C:/ncs/v2.6.0/zephyr/include/zephyr/logging/log_core.h:245:42: note: in definition of macro 'Z_LOG2'
  245 |                 z_log_printf_arg_checker(__VA_ARGS__); \
      |                                          ^~~~~~~~~~~
C:/ncs/v2.6.0/zephyr/include/zephyr/logging/log.h:63:24: note: in expansion of macro 'Z_LOG'
   63 | #define LOG_INF(...)   Z_LOG(LOG_LEVEL_INF, __VA_ARGS__)
      |                        ^~~~~
C:/vacas/find-my-bull-fw-main/src/modem/modem.c:35:9: note: in expansion of macro 'LOG_INF'
   35 |         LOG_INF("TAU pre-warning: Active time: %d", evt->time);
      |         ^~~~~~~
C:/vacas/find-my-bull-fw-main/src/modem/modem.c:35:49: note: format string is defined here
   35 |         LOG_INF("TAU pre-warning: Active time: %d", evt->time);
      |                                                ~^
      |                                                 |
      |                                                 int
      |                                                %lld
C:/vacas/find-my-bull-fw-main/src/modem/modem.c: In function 'configure_low_power':
C:/vacas/find-my-bull-fw-main/src/modem/modem.c:71:5: warning: 'lte_lc_rai_req' is deprecated [-Wdeprecated-declarations]
   71 |     err = lte_lc_rai_req(true);
      |     ^~~
In file included from C:/vacas/find-my-bull-fw-main/src/modem/modem.c:7:
C:/ncs/v2.6.0/nrf/include/modem/lte_lc.h:1613:18: note: declared here
 1613 | __deprecated int lte_lc_rai_req(bool enable);
      |                  ^~~~~~~~~~~~~~
C:/vacas/find-my-bull-fw-main/src/modem/modem.c: In function 'modem_configure':
C:/vacas/find-my-bull-fw-main/src/modem/modem.c:150:5: warning: 'lte_lc_init_and_connect_async' is deprecated [-Wdeprecated-declarations]
  150 |     err = lte_lc_init_and_connect_async(lte_handler);
      |     ^~~
C:/ncs/v2.6.0/nrf/include/modem/lte_lc.h:1311:18: note: declared here
 1311 | __deprecated int lte_lc_init_and_connect_async(lte_lc_evt_handler_t handler);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[25/194] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/ncs/v2.6.0/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
ninja: build stopped: subcommand failed.

Using the 2.43, no error was given.

Overlay File:

// To get started, press Ctrl+Space (or Option+Esc) to bring up the completion menu and view the available nodes.

// You can also use the buttons in the sidebar to perform actions on nodes.
// Actions currently available include:

// * Enabling / disabling the node
// * Adding the bus to a bus
// * Removing the node
// * Connecting ADC channels

// For more help, browse the DeviceTree documentation at https://docs.zephyrproject.org/latest/guides/dts/index.html
// You can also visit the nRF DeviceTree extension documentation at https://nrfconnect.github.io/vscode-nrf-connect/devicetree/nrfdevicetree.html

lsm6dsx: &spi1 {
    status = "okay";
    pinctrl-0 = <&spi1_default>;
    pinctrl-names = "default";
    cs-gpios = <&gpio0 10 (GPIO_ACTIVE_LOW)>;
};

&pinctrl {

    spi1_default: spi1_default {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 11)>;
        };
    };
};

/delete-node/ &{/pin-controller/spi3_default/group1/};
/delete-node/ &{/pin-controller/spi3_sleep/group1/};

&spi3 {
    status = "disabled";
};

&button2 {
    gpios = <&gpio0 0 0>;
};

&button3 {
    gpios = <&gpio0 1 0>;
};

&spi1_default {
    group1 {
        psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
                <NRF_PSEL(SPIM_MISO, 0, 9)>,
                <NRF_PSEL(SPIM_MOSI, 0, 8)>;
    };
};

/ {
	aliases {
		lora0 = &lora;
	};
};    

&spi3 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    pinctrl-0 = <&spi3_default>;
    cs-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
    lora: sx1276@0 {
		compatible = "semtech,sx1276";
        status = "okay";
		reg = <0>;
		dio-gpios = <&gpio0 22 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, //0
			<&gpio0 21 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, //1
			<&gpio0 20 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, //2
			<&gpio0 25 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, //3
			<&gpio0 24 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, //4
			<&gpio0 23 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; //5
		reset-gpios = <&gpio0 14 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
		spi-max-frequency		 = 	<1000000>;
        power-amplifier-output = "pa-boost";
		// pa-boost-enable-gpios		= <&gpio0 xx GPIO_ACTIVE_HIGH>;
		// power-amplifier-output	 = "rfo";
		// rfo-enable-gpios		 = 	<&gpio0 25 GPIO_ACTIVE_HIGH>;
		// antenna-enable-gpios		= <&gpio0 xx GPIO_ACTIVE_HIGH>;
	};
};

&spi3_default {
	group1 {
		psels = <NRF_PSEL(SPIM_SCK, 0, 16)>,
		  <NRF_PSEL(SPIM_MISO, 0, 18)>,
		  <NRF_PSEL(SPIM_MOSI, 0, 17)>;
	};
};

Parents
  • Hi 

    I don't see anything devicetree related in the error you posted there. which version of the lsm6 are you using as there is different versions found in the Zephyr bindings? 

    For me it also looks like you lack the compatible field for sensor in your devicetree. Below I added a very rough sample of how I expected it to look 

    &spi1 {
        compatible = "nordic,nrf-spi"; 
        status = "okay";
        pinctrl-0 = <&spi1_default>;
        pinctrl-1 = <&spi1_sleep>;
        pinctrl-names = "default", "sleep";
        cs-gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
        lsm6dso: lsm6dso@0 {
        	compatible = "st,lsm6dso";
        	reg = <0>;
    	spi-max-frequency = <125000>; 
        };
    };

    Could you also post the part of the code which throws an error? 

    Regards

    Runar

  • Hi, thanks for the fast response Runar! You're right, the error actually isn't related to the device tree.

    C:/vacas/find-my-bull-fw-main/src/main.c:32:10: fatal error: src/messages/messages.pb.h: No such file or directory
       32 | #include "src/messages/messages.pb.h"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

    I don't know why, but the protobuf files(c and h) aren't being generated during the build. They were causing an error, which I ended up ignoringwas leading to a cascade of other errors.

    Generating the files manually through the terminal, it builds normally.

    Thanks for the help.I hope you can fix the error in this version. Again, thank you for the response, sorry for the inconvenience!

Reply
  • Hi, thanks for the fast response Runar! You're right, the error actually isn't related to the device tree.

    C:/vacas/find-my-bull-fw-main/src/main.c:32:10: fatal error: src/messages/messages.pb.h: No such file or directory
       32 | #include "src/messages/messages.pb.h"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

    I don't know why, but the protobuf files(c and h) aren't being generated during the build. They were causing an error, which I ended up ignoringwas leading to a cascade of other errors.

    Generating the files manually through the terminal, it builds normally.

    Thanks for the help.I hope you can fix the error in this version. Again, thank you for the response, sorry for the inconvenience!

Children
  • Hi, 

    So building with west from CLI included the messages.pb.h while building from VScode build button did not include it? That sounds a bit strange to me

    From what I can see protobuf should include in the toolchain. Did you change toolchain when you changed to NCS 2.6? 

    Regards

    Runar

  • Actually, building both from West and VSCode does not include the messages.pb.h. Making the proto files in the terminal using the nanopb generator commands builds the files, but the application does not locate the file. I'm sending the CMake that i'm using.

    Given Error:

    C:/vacas2.6/find-my-bull-fw-main/src/main.c:32:10: fatal error: messages.pb.h: No such file or directory
    32 | #include "messages.pb.h"

    # SPDX-License-Identifier: Apache-2.0
    
    cmake_minimum_required(VERSION 3.20.0)
    
    find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
    project(cow-sys-fw)
    
    list(APPEND CMAKE_MODULE_PATH ${ZEPHYR_BASE}/modules/nanopb)
    include(nanopb)
    
    zephyr_nanopb_sources(app src/messages/messages.proto)
    
    
    FILE(GLOB app_sources src/main.c)
    FILE(GLOB lib_sources src/**/*.c)
    
    target_sources(app PRIVATE ${app_sources} ${lib_sources})

     

    The old version was like this, but since it wasn't generating the files messages.pb.h and messages.pb.c, I changed it. Using this file and version 2.4.3, it worked.

    # SPDX-License-Identifier: Apache-2.0
    
    cmake_minimum_required(VERSION 3.20.0)
    
    find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
    project(cow-sys-fw)
    
    
    set(NANOPB_OPTIONS "-I${CMAKE_SOURCE_DIR}")
    nanopb_generate_cpp(proto_sources proto_headers RELPATH .
        src/messages/messages.proto
    )
    
    zephyr_library_include_directories(${CMAKE_CURRENT_BINARY_DIR})
    
    FILE(GLOB app_sources src/main.c)
    FILE(GLOB lib_sources src/**/*.c)
    
    target_sources(app PRIVATE ${app_sources} ${proto_sources} ${lib_sources})

     

  • Hi, I changed the project roots and I modified the CMake. The path error was fixed... but another one came up.

    New roots and new CMake:

    root
    |-MainProject
    | |-src
    | | |-main.cpp
    | | |-lib
    | | | |-libraries file
    | | |-messages
    | | | |-messages.ph.h
    | | | |-messages.ph.c
    | | | |-messages.proto
    | '-CMakeLists.txt 
    

    # SPDX-License-Identifier: Apache-2.0
    
    cmake_minimum_required(VERSION 3.20.0)
    
    find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
    project(cow-sys-fw)
    
    list(APPEND CMAKE_MODULE_PATH ${ZEPHYR_BASE}/modules/nanopb)
    include(nanopb)
    
    
    FILE(GLOB proto_sources src/messages/messages.proto)
    FILE(GLOB lib_sources src/lib/**/*.c)
    FILE(GLOB app_sources src/main.c)
    target_sources(app PRIVATE ${app_sources} ${lib_sources} ${proto_sources})
    
    
    
    

    New error given:

    src/lib/spi-interface/spi-interface.c:23:20: error: incompatible types when assigning to type 'struct spi_cs_control' from type 'struct spi_cs_control *'
       23 |     _spi_cfg->cs = cs_cfg;
          |                    ^~~~~~

    spi-interface.c:

    #include <zephyr/kernel.h>
    
    #include <zephyr/drivers/spi.h>
    #include <zephyr/drivers/gpio.h>
    
    #include "spi-interface.h"
    
    struct spi_handle *init_spi(const struct device *spi, const struct device *gpio, uint8_t pin)
    {
        struct gpio_dt_spec cs_gpio =
            {
                .port = gpio,
                .pin = pin,
                .dt_flags = GPIO_ACTIVE_LOW};
    
        struct spi_cs_control *cs_cfg = (struct spi_cs_control *)k_malloc(sizeof(struct spi_cs_control));
        cs_cfg->gpio = cs_gpio;
        cs_cfg->delay = 0;
    
        struct spi_config *_spi_cfg = (struct spi_config *)k_malloc(sizeof(struct spi_config));
        _spi_cfg->frequency = 8000000;
        _spi_cfg->operation = SPI_TRANSFER_MSB | SPI_WORD_SET(8);
        _spi_cfg->cs = cs_cfg;
    
        struct spi_handle *spi_handle = (struct spi_handle *)k_malloc(sizeof(struct spi_handle));
        spi_handle->device = spi;
        spi_handle->config = _spi_cfg;
    
        return spi_handle;
    }
    
    int32_t spi_register_write(void *handle, uint8_t Reg, const uint8_t *Bufp, uint16_t len)
    {
        const struct spi_handle *spi = (const struct spi_handle *)handle;
    
        struct spi_buf tx_buf[2] = {
            {
                .buf = &Reg,
                .len = 1,
            },
            {
                .buf = (uint8_t *)Bufp,
                .len = len,
            }};
    
        const struct spi_buf_set tx = {
            .buffers = tx_buf,
            .count = 2,
        };
    
        return spi_write(spi->device, spi->config, &tx);
    }
    
    int32_t spi_register_read(void *handle, uint8_t Reg, uint8_t *Bufp, uint16_t len)
    {
        const struct spi_handle *spi = (const struct spi_handle *)handle;
        // const struct spi_config *config = spi->device->config;
    
        uint8_t tx_buffer[2] = {Reg | (1 << 7), 0x00};
    
        struct spi_buf tx_buf = {
            .buf = tx_buffer,
            .len = 2};
        const struct spi_buf_set tx = {
            .buffers = &tx_buf,
            .count = 1};
    
        struct spi_buf rx_buf[2] = {
            {.buf = NULL,
             .len = 1},
            {.buf = Bufp,
             .len = len}};
    
        const struct spi_buf_set rx = {
            .buffers = rx_buf,
            .count = 2};
    
        int ret = spi_transceive(spi->device, spi->config, &tx, &rx);
        return ret;
    }
    

    spi-interface.h :100 

    #ifndef SPI_INTERFACE_H
    #define SPI_INTERFACE_H
    
    struct spi_handle
    {
        const struct device *device;
        const struct spi_config *config;
    };
    
    struct spi_handle *init_spi(const struct device *spi, const struct device *gpio, uint8_t pin);
    int32_t spi_register_write(void *handle, uint8_t Reg, const uint8_t *Bufp, uint16_t len);
    int32_t spi_register_read(void *handle, uint8_t Reg, uint8_t *Bufp, uint16_t len);
    
    #endif // SPI_INTERFACE_H

  • Hi

    I suspect the error you are seeing comes from a change in the SPI driver from NCS 2.4 to 2.5 which is described in this ticket 

    Regards

    Runar

  • Hi, thanks for the information. I changed the SPI interface files. It builds, but when I flashed, the Zephyr keeps reinitializing.

    Given error:

    00:00:00.256,072] <err> os: >>> ZEPHYR FATAL ERROR 25: Unknown error on CPU 0
    [00:00:00.256,134] <err> os: Current thread: 0x2000de08 (main)
    [00:00:00.255,828] <err> os: ***** BUS FAULT *****stem
    [00:00:00.255,828] <err> os:   Precise data bus error
    [00:00:00.255,828] <err> os:   BFAR Address: 0x0
    [00:00:00.255,859] <err> os: r0/a1:  0x0003e584  r1/a2:  0x0003e20c  r2/a3:  0x00022670
    [00:00:00.255,859] <err> os: r3/a4:  0x40009000 r12/ip:  0x00000000 r14/lr:  0x00035fd1
    [00:00:00.255,889] <err> os:  xpsr:  0x81000000
    [00:00:00.255,889] <err> os: s[ 0]:  0x000182e4  s[ 1]:  0x0003056f  s[ 2]:  0x00000042  s[ 3]:  0x00035495
    [00:00:00.255,920] <err> os: s[ 4]:  0x00000001  s[ 5]:  0x00035409  s[ 6]:  0x00021ce1  s[ 7]:  0x2000de08
    [00:00:00.255,950] <err> os: s[ 8]:  0x0002be29  s[ 9]:  0x200214d8  s[10]:  0x000182e4  s[11]:  0x00021d0d
    [00:00:00.255,950] <err> os: s[12]:  0x00021ce1  s[13]:  0x000287f3  s[14]:  0x0003752d  s[15]:  0x00037531
    [00:00:00.255,981] <err> os: fpscr:  0x0003752d
    [00:00:00.255,981] <err> os: Faulting instruction address (r15/pc): 0x00022708

    The spi-interface file:

    #include <zephyr/kernel.h>
    #include <zephyr/drivers/spi.h>
    #include <zephyr/drivers/gpio.h>
    
    #include "spi-interface.h"
    
    struct spi_handle *init_spi(const struct device *spi, const struct device *gpio, uint8_t pin)
    {
        struct gpio_dt_spec cs_gpio =
            {
                .port = gpio,
                .pin = pin,
                .dt_flags = GPIO_ACTIVE_LOW};
    
        struct spi_cs_control cs_config;
        cs_config.gpio = cs_gpio;
        cs_config.delay = 0;
    
        struct spi_config _spi_cfg;
        _spi_cfg.frequency = 8000000;
        _spi_cfg.operation = SPI_TRANSFER_MSB | SPI_WORD_SET(8);
        _spi_cfg.operation = SPI_TRANSFER_MSB | SPI_WORD_SET(8);
        _spi_cfg.cs= cs_config;
    
         struct spi_handle *spi_handle = (struct spi_handle *)k_malloc(sizeof(struct spi_handle));
        spi_handle->device=spi;
        spi_handle->config=&_spi_cfg;
        
    
        return spi_handle;
    }
    
    int32_t spi_register_write(void *handle, uint8_t Reg, const uint8_t *Bufp, uint16_t len)
    {
        const struct spi_handle *spi = (const struct spi_handle *)handle;
    
        struct spi_buf tx_buf[2] = {
            {
                .buf = &Reg,
                .len = 1,
            },
            {
                .buf = (uint8_t *)Bufp,
                .len = len,
            }};
    
        const struct spi_buf_set tx = {
            .buffers = tx_buf,
            .count = 2,
        };
    
        return spi_write(spi->device, spi->config, &tx);
    }
    
    int32_t spi_register_read(void *handle, uint8_t Reg, uint8_t *Bufp, uint16_t len)
    {
        const struct spi_handle *spi = (const struct spi_handle *)handle;
        // const struct spi_config *config = spi->device->config;
    
        uint8_t tx_buffer[2] = {Reg | (1 << 7), 0x00};
    
        struct spi_buf tx_buf = {
            .buf = tx_buffer,
            .len = 2};
        const struct spi_buf_set tx = {
            .buffers = &tx_buf,
            .count = 1};
    
        struct spi_buf rx_buf[2] = {
            {.buf = NULL,
             .len = 1},
            {.buf = Bufp,
             .len = len}};
    
        const struct spi_buf_set rx = {
            .buffers = rx_buf,
            .count = 2};
    
        int ret = spi_transceive(spi->device, spi->config, &tx, &rx);
        return ret;
    }
    

    spi-interface.h:

    #ifndef SPI_INTERFACE_H
    #define SPI_INTERFACE_H
    
    struct spi_handle
    {
        const struct device *device;
        const struct spi_config *config;
    };
    
    struct spi_handle *init_spi(const struct device *spi, const struct device *gpio, uint8_t pin);
    int32_t spi_register_write(void *handle, uint8_t Reg, const uint8_t *Bufp, uint16_t len);
    int32_t spi_register_read(void *handle, uint8_t Reg, uint8_t *Bufp, uint16_t len);
    
    #endif // SPI_INTERFACE_H

    I changed the older version

        struct spi_cs_control *cs_cfg = (struct spi_cs_control *)k_malloc(sizeof(struct spi_cs_control));
        cs_cfg->gpio = cs_gpio;
        cs_cfg->delay = 0;

        struct spi_config *_spi_cfg = (struct spi_config *)k_malloc(sizeof(struct spi_config));
        _spi_cfg->frequency = 8000000;
        _spi_cfg->operation = SPI_TRANSFER_MSB | SPI_WORD_SET(8);
        _spi_cfg->cs = cs_cfg;
     
    to :
        struct spi_cs_control cs_config;
        cs_config.gpio = cs_gpio;
        cs_config.delay = 0;

        struct spi_config _spi_cfg;
        _spi_cfg.frequency = 8000000;
        _spi_cfg.operation = SPI_TRANSFER_MSB | SPI_WORD_SET(8);
        _spi_cfg.operation = SPI_TRANSFER_MSB | SPI_WORD_SET(8);
        _spi_cfg.cs= cs_config;

    prj.conf:

    # LOGGING
    CONFIG_LOG=y
    CONFIG_LOG_BACKEND_UART=y
    CONFIG_LOG_INFO_COLOR_GREEN=y
    # CONFIG_LORA_LOG_LEVEL_DBG=y
    CONFIG_LORA_LOG_LEVEL_ERR=y
    # CONFIG_LORAWAN_LOG_LEVEL_DBG=y
    CONFIG_LORAWAN_LOG_LEVEL_ERR=y
    CONFIG_NVS_LOG_LEVEL_ERR=y
    # CONFIG_COAP_UTILS_LOG_LEVEL_DBG=y
    # CONFIG_NET_LOG=y
    # CONFIG_NET_PKT_LOG_LEVEL_DBG=y
    # CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y
    # CONFIG_NET_BUF_LOG=y
    # CONFIG_NET_BUF_SIMPLE_LOG=y
    
    # FPU
    CONFIG_NEWLIB_LIBC=y
    CONFIG_FPU=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    
    # POWER
    CONFIG_REBOOT=y
    # CONFIG_PM=y
    
    # Networking
    CONFIG_NETWORKING=y
    CONFIG_NET_NATIVE=n
    CONFIG_NET_SOCKETS_OFFLOAD=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_SOCKETS_POSIX_NAMES=y
    
    # Memory
    CONFIG_MAIN_STACK_SIZE=8192
    CONFIG_HEAP_MEM_POOL_SIZE=8192
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
    CONFIG_LORAWAN_SERVICES_THREAD_STACK_SIZE=2048
    
    # Modem library
    CONFIG_NRF_MODEM_LIB=y
    CONFIG_MODEM_KEY_MGMT=y
    # CONFIG_NRF_MODEM_LIB_SYS_INIT is deprecated, and kept for compatibility with older NCS versions
    
    # LTE link control
    CONFIG_LTE_LINK_CONTROL=y
    # CONFIG_LTE_AUTO_INIT_AND_CONNECT is deprecated, and kept for compatibility with older NCS versions
    
    # Date-Time Library
    CONFIG_DATE_TIME=y
    # Enables use of modem time
    CONFIG_DATE_TIME_MODEM=y
    # CONFIG_DATE_TIME_NTP=y
    # CONFIG_DATE_TIME_AUTO_UPDATE=y
    
    CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS=y
    CONFIG_GNSS_LOW_ACCURACY=y
    
    ## PSM
    CONFIG_UDP_PSM_ENABLE=y
    CONFIG_LTE_PSM_REQ_RPTAU="00100100"
    CONFIG_LTE_PSM_REQ_RAT="00000101"
    
    ## RAI
    CONFIG_UDP_RAI_ENABLE=y
    CONFIG_LTE_RAI_REQ_VALUE="3"
    
    # Threading
    CONFIG_MAIN_THREAD_PRIORITY=1
    
    # Sensors config 6A e 69
    CONFIG_USE_LSM6DSL=y #6A
    # CONFIG_USE_LSM6DS3=y #69
    
    # reporting
    CONFIG_INTERRUPT_REPORT=y
    # CONFIG_CONTINUOUS_REPORT=y
    
    # Debug pourposes only
    # CONFIG_AT_HOST_LIBRARY=y
    # CONFIG_NRF_MODEM_LIB_TRACE=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    
    # LORA
    CONFIG_LORA=y
    CONFIG_LORA_SX127X=y
    CONFIG_HAS_SEMTECH_RADIO_DRIVERS=y
    
    # LORAWAN
    CONFIG_LORAWAN=y
    CONFIG_LORAMAC_REGION_AU915=y
    CONFIG_LORAWAN_NVM_NONE=y
    CONFIG_LORAWAN_SERVICES=y
    CONFIG_HAS_SEMTECH_LORAMAC=y
    CONFIG_HAS_SEMTECH_SOFT_SE=y
    CONFIG_LORAWAN_SYSTEM_MAX_RX_ERROR=5
    # CONFIG_LORAWAN_APP_CLOCK_SYNC=y
    
    # NVS
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_NVS=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_TEST_RANDOM_GENERATOR=y
    
    # SPI 
    CONFIG_SPI=y
    CONFIG_SPI_ASYNC=y
    
    #Protobuf
    CONFIG_NANOPB=y
    
    CONFIG_FPU=y
    
    # COAP
    CONFIG_COAP=y
    CONFIG_COAP_HOST="servername.com"
    CONFIG_COAP_PORT=3333
    CONFIG_COAP_HOST="servername.com"
    CONFIG_COAP_PORT=3333
    CONFIG_COAP_TLS=n
    # CONFIG_COAP_UPLINK_URI="/ps/uplink"
    
    ### APN 
    # CONFIG_SIMCARD_TIM=y
    CONFIG_PDN=y
    CONFIG_PDN_DEFAULTS_OVERRIDE=y
    CONFIG_PDN_DEFAULT_APN="nbiot.gsim" # "nbiot.gsim" # "inlog.claro.com.br"
    CONFIG_PDN_DEFAULT_AUTH_PAP=y
    CONFIG_PDN_DEFAULT_USERNAME="tim" # "tim" # "datatem"
    CONFIG_PDN_DEFAULT_PASSWORD="tim" # "tim" # "datatem"
    
    # GNSS
    CONFIG_TRACKER_PERIODIC_INTERVAL=3600
    CONFIG_TRACKER_PERIODIC_TIMEOUT=300
    CONFIG_TRACKER_SLEEP_UNTIL_FIX=3600
    CONFIG_TRACKER_SLEEP_IF_FIRST_FIX_TIMEOUT=3600
    CONFIG_MODEM_ANTENNA_AT_MAGPIO="AT%XMAGPIO=1,0,0,1,1,1574,1577"
    CONFIG_MODEM_ANTENNA_AT_COEX0="AT%XCOEX0=1,1,1565,1586"
    CONFIG_TFM_KEY_FILE_S="C:/nrf/v2.4.0/modules/tee/tf-m/trusted-firmware-m/bl2/ext/mcuboot/root-RSA-3072.pem"
    CONFIG_TFM_KEY_FILE_NS="C:/nrf/v2.4.0/modules/tee/tf-m/trusted-firmware-m/bl2/ext/mcuboot/root-RSA-3072_1.pem"
    
    CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=2048
    
    CONFIG_DEBUG_THREAD_INFO=y
    CONFIG_DEBUG_OPTIMIZATIONS=y
    
    CONFIG_COAP_UTILS=y
    
    # CONFIG_NET_TX_STACK_SIZE=2400
    # CONFIG_NET_RX_STACK_SIZE=3000

    Sorry to bother again.

Related