nRF Connect SDK with External GSM 7600 with nRF52840

Hi,
I am working on nRF52840. Previously I was using the nRF SDK as there was no library available for external GSM(MQTT) so I am moving to nRF Connect SDK. I have successfully set up the environment now I want to communicate nRF52840 with external GSM(SIMCOM 7600G) and send data over the MQTT library. How can I start? Is there any tutorial? 

Parents Reply Children
  • Did you also add the overlay for your modem?

    Yes, I have added as below.

    What does the full log state?

  • The log shows that the network interface isn't initialized. Have you tried using the gsm modem sample as a base and adding network related libraries to that instead?

     

    Kind regards,

    Håkon

  • Hi  ,

    I have added the network-related libraries but getting the following errors Disappointed

    /*
     * Copyright (c) 2017 Intel Corporation
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    #include <zephyr/logging/log.h>
    LOG_MODULE_REGISTER(net_mqtt_publisher_sample, LOG_LEVEL_DBG);
    
    #include <zephyr/zephyr.h>
    #include <zephyr/net/socket.h>
    #include <zephyr/net/mqtt.h>
    #include <zephyr/random/rand32.h>
    
    #include <string.h>
    #include <errno.h>
    
    #include "config.h"
    
    
    /////////////////////////////////////////////////////////////////// GSM
    
    
    #include <zephyr/zephyr.h>
    #include <zephyr/sys/printk.h>
    #include <zephyr/shell/shell.h>
    #include <zephyr/drivers/uart.h>
    #include <zephyr/net/net_mgmt.h>
    #include <zephyr/net/net_event.h>
    #include <zephyr/net/net_conn_mgr.h>
    #include <zephyr/drivers/modem/gsm_ppp.h>
    #include <zephyr/devicetree.h>
    
    #include <zephyr/logging/log.h>
    // LOG_MODULE_REGISTER(sample_gsm_ppp, LOG_LEVEL_DBG);
    
    #define GSM_MODEM_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(zephyr_gsm_ppp)
    #define UART_NODE DT_BUS(GSM_MODEM_NODE)
    
    static const struct device *gsm_dev;
    static struct net_mgmt_event_callback mgmt_cb;
    static bool starting = IS_ENABLED(CONFIG_GSM_PPP_AUTOSTART);
    
    
    /////////////////////////////////////////////////////////////////// GSM
    
    
    
    
    #if defined(CONFIG_USERSPACE)
    #include <zephyr/app_memory/app_memdomain.h>
    K_APPMEM_PARTITION_DEFINE(app_partition);
    struct k_mem_domain app_domain;
    #define APP_BMEM K_APP_BMEM(app_partition)
    #define APP_DMEM K_APP_DMEM(app_partition)
    #else
    #define APP_BMEM
    #define APP_DMEM
    #endif
    
    /* Buffers for MQTT client. */
    static APP_BMEM uint8_t rx_buffer[APP_MQTT_BUFFER_SIZE];
    static APP_BMEM uint8_t tx_buffer[APP_MQTT_BUFFER_SIZE];
    
    #if defined(CONFIG_MQTT_LIB_WEBSOCKET)
    /* Making RX buffer large enough that the full IPv6 packet can fit into it */
    #define MQTT_LIB_WEBSOCKET_RECV_BUF_LEN 1280
    
    /* Websocket needs temporary buffer to store partial packets */
    static APP_BMEM uint8_t temp_ws_rx_buf[MQTT_LIB_WEBSOCKET_RECV_BUF_LEN];
    #endif
    
    /* The mqtt client struct */
    static APP_BMEM struct mqtt_client client_ctx;
    
    /* MQTT Broker details. */
    static APP_BMEM struct sockaddr_storage broker;
    
    #if defined(CONFIG_SOCKS)
    static APP_BMEM struct sockaddr socks5_proxy;
    #endif
    
    static APP_BMEM struct zsock_pollfd fds[1];
    static APP_BMEM int nfds;
    
    static APP_BMEM bool connected;
    
    #if defined(CONFIG_MQTT_LIB_TLS)
    
    #include "test_certs.h"
    
    #define TLS_SNI_HOSTNAME "localhost"
    #define APP_CA_CERT_TAG 1
    #define APP_PSK_TAG 2
    
    static APP_DMEM sec_tag_t m_sec_tags[] = {
    #if defined(MBEDTLS_X509_CRT_PARSE_C) || defined(CONFIG_NET_SOCKETS_OFFLOAD)
    		APP_CA_CERT_TAG,
    #endif
    #if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED)
    		APP_PSK_TAG,
    #endif
    };
    
    
    /////////////////////////////////////////////////////////////////// GSM
    static int cmd_sample_modem_suspend(const struct shell *shell,
    				    size_t argc, char *argv[])
    {
    	ARG_UNUSED(argc);
    	ARG_UNUSED(argv);
    
    	if (!starting) {
    		shell_fprintf(shell, SHELL_NORMAL, "Modem is already stopped.\n");
    		return -ENOEXEC;
    	}
    
    	gsm_ppp_stop(gsm_dev);
    	starting = false;
    
    	return 0;
    }
    
    static int cmd_sample_modem_resume(const struct shell *shell,
    				   size_t argc, char *argv[])
    {
    	ARG_UNUSED(argc);
    	ARG_UNUSED(argv);
    
    	if (starting) {
    		shell_fprintf(shell, SHELL_NORMAL, "Modem is already started.\n");
    		return -ENOEXEC;
    	}
    
    	gsm_ppp_start(gsm_dev);
    	starting = true;
    
    	return 0;
    }
    
    SHELL_STATIC_SUBCMD_SET_CREATE(sample_commands,
    	SHELL_CMD(resume, NULL,
    		  "Resume the modem\n",
    		  cmd_sample_modem_resume),
    	SHELL_CMD(suspend, NULL,
    		  "Suspend the modem\n",
    		  cmd_sample_modem_suspend),
    	SHELL_SUBCMD_SET_END
    );
    
    SHELL_CMD_REGISTER(sample, &sample_commands,
    		   "Sample application commands", NULL);
    
    
    static void event_handler(struct net_mgmt_event_callback *cb,
    			  uint32_t mgmt_event, struct net_if *iface)
    {
    	ARG_UNUSED(cb);
    	ARG_UNUSED(iface);
    
    	if ((mgmt_event & (NET_EVENT_L4_CONNECTED
    			   | NET_EVENT_L4_DISCONNECTED)) != mgmt_event) {
    		return;
    	}
    
    	if (mgmt_event == NET_EVENT_L4_CONNECTED) {
    		LOG_INF("Network connected");
    		return;
    	}
    
    	if (mgmt_event == NET_EVENT_L4_DISCONNECTED) {
    		LOG_INF("Network disconnected");
    		return;
    	}
    }
    
    static void modem_on_cb(const struct device *dev, void *user_data)
    {
    	ARG_UNUSED(dev);
    	ARG_UNUSED(user_data);
    
    	LOG_INF("GSM modem on callback fired");
    }
    
    static void modem_off_cb(const struct device *dev, void *user_data)
    {
    	ARG_UNUSED(dev);
    	ARG_UNUSED(user_data);
    
    	LOG_INF("GSM modem off callback fired");
    }
    
    /////////////////////////////////////////////////////////////////// GSM
    
    static int tls_init(void)
    {
    	int err = -EINVAL;
    
    #if defined(MBEDTLS_X509_CRT_PARSE_C) || defined(CONFIG_NET_SOCKETS_OFFLOAD)
    	err = tls_credential_add(APP_CA_CERT_TAG, TLS_CREDENTIAL_CA_CERTIFICATE,
    				 ca_certificate, sizeof(ca_certificate));
    	if (err < 0) {
    		LOG_ERR("Failed to register public certificate: %d", err);
    		return err;
    	}
    #endif
    
    #if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED)
    	err = tls_credential_add(APP_PSK_TAG, TLS_CREDENTIAL_PSK,
    				 client_psk, sizeof(client_psk));
    	if (err < 0) {
    		LOG_ERR("Failed to register PSK: %d", err);
    		return err;
    	}
    
    	err = tls_credential_add(APP_PSK_TAG, TLS_CREDENTIAL_PSK_ID,
    				 client_psk_id, sizeof(client_psk_id) - 1);
    	if (err < 0) {
    		LOG_ERR("Failed to register PSK ID: %d", err);
    	}
    #endif
    
    	return err;
    }
    
    #endif /* CONFIG_MQTT_LIB_TLS */
    
    static void prepare_fds(struct mqtt_client *client)
    {
    	if (client->transport.type == MQTT_TRANSPORT_NON_SECURE) {
    		fds[0].fd = client->transport.tcp.sock;
    	}
    #if defined(CONFIG_MQTT_LIB_TLS)
    	else if (client->transport.type == MQTT_TRANSPORT_SECURE) {
    		fds[0].fd = client->transport.tls.sock;
    	}
    #endif
    
    	fds[0].events = ZSOCK_POLLIN;
    	nfds = 1;
    }
    
    
    
    
    
    
    
    static void clear_fds(void)
    {
    	nfds = 0;
    }
    
    static int wait(int timeout)
    {
    	int ret = 0;
    
    	if (nfds > 0) {
    		ret = zsock_poll(fds, nfds, timeout);
    		if (ret < 0) {
    			LOG_ERR("poll error: %d", errno);
    		}
    	}
    
    	return ret;
    }
    
    void mqtt_evt_handler(struct mqtt_client *const client,
    		      const struct mqtt_evt *evt)
    {
    	int err;
    
    	switch (evt->type) {
    	case MQTT_EVT_CONNACK:
    		if (evt->result != 0) {
    			LOG_ERR("MQTT connect failed %d", evt->result);
    			break;
    		}
    
    		connected = true;
    		LOG_INF("MQTT client connected!");
    
    		break;
    
    	case MQTT_EVT_DISCONNECT:
    		LOG_INF("MQTT client disconnected %d", evt->result);
    
    		connected = false;
    		clear_fds();
    
    		break;
    
    	case MQTT_EVT_PUBACK:
    		if (evt->result != 0) {
    			LOG_ERR("MQTT PUBACK error %d", evt->result);
    			break;
    		}
    
    		LOG_INF("PUBACK packet id: %u", evt->param.puback.message_id);
    
    		break;
    
    	case MQTT_EVT_PUBREC:
    		if (evt->result != 0) {
    			LOG_ERR("MQTT PUBREC error %d", evt->result);
    			break;
    		}
    
    		LOG_INF("PUBREC packet id: %u", evt->param.pubrec.message_id);
    
    		const struct mqtt_pubrel_param rel_param = {
    			.message_id = evt->param.pubrec.message_id
    		};
    
    		err = mqtt_publish_qos2_release(client, &rel_param);
    		if (err != 0) {
    			LOG_ERR("Failed to send MQTT PUBREL: %d", err);
    		}
    
    		break;
    
    	case MQTT_EVT_PUBCOMP:
    		if (evt->result != 0) {
    			LOG_ERR("MQTT PUBCOMP error %d", evt->result);
    			break;
    		}
    
    		LOG_INF("PUBCOMP packet id: %u",
    			evt->param.pubcomp.message_id);
    
    		break;
    
    	case MQTT_EVT_PINGRESP:
    		LOG_INF("PINGRESP packet");
    		break;
    
    	default:
    		break;
    	}
    }
    
    static char *get_mqtt_payload(enum mqtt_qos qos)
    {
    #if APP_BLUEMIX_TOPIC
    	static APP_BMEM char payload[30];
    
    	snprintk(payload, sizeof(payload), "{d:{temperature:%d}}",
    		 (uint8_t)sys_rand32_get());
    #else
    	static APP_DMEM char payload[] = "DOORS:OPEN_QoSx";
    
    	payload[strlen(payload) - 1] = '0' + qos;
    #endif
    
    	return payload;
    }
    
    static char *get_mqtt_topic(void)
    {
    #if APP_BLUEMIX_TOPIC
    	return "iot-2/type/"BLUEMIX_DEVTYPE"/id/"BLUEMIX_DEVID
    	       "/evt/"BLUEMIX_EVENT"/fmt/"BLUEMIX_FORMAT;
    #else
    	return "sensors";
    #endif
    }
    
    static int publish(struct mqtt_client *client, enum mqtt_qos qos)
    {
    	struct mqtt_publish_param param;
    
    	param.message.topic.qos = qos;
    	param.message.topic.topic.utf8 = (uint8_t *)get_mqtt_topic();
    	param.message.topic.topic.size =
    			strlen(param.message.topic.topic.utf8);
    	param.message.payload.data = get_mqtt_payload(qos);
    	param.message.payload.len =
    			strlen(param.message.payload.data);
    	param.message_id = sys_rand32_get();
    	param.dup_flag = 0U;
    	param.retain_flag = 0U;
    
    	return mqtt_publish(client, &param);
    }
    
    #define RC_STR(rc) ((rc) == 0 ? "OK" : "ERROR")
    
    #define PRINT_RESULT(func, rc) \
    	LOG_INF("%s: %d <%s>", (func), rc, RC_STR(rc))
    
    static void broker_init(void)
    {
    #if defined(CONFIG_NET_IPV6)
    	struct sockaddr_in6 *broker6 = (struct sockaddr_in6 *)&broker;
    
    	broker6->sin6_family = AF_INET6;
    	broker6->sin6_port = htons(SERVER_PORT);
    	zsock_inet_pton(AF_INET6, SERVER_ADDR, &broker6->sin6_addr);
    
    #if defined(CONFIG_SOCKS)
    	struct sockaddr_in6 *proxy6 = (struct sockaddr_in6 *)&socks5_proxy;
    
    	proxy6->sin6_family = AF_INET6;
    	proxy6->sin6_port = htons(SOCKS5_PROXY_PORT);
    	zsock_inet_pton(AF_INET6, SOCKS5_PROXY_ADDR, &proxy6->sin6_addr);
    #endif
    #else
    	struct sockaddr_in *broker4 = (struct sockaddr_in *)&broker;
    
    	broker4->sin_family = AF_INET;
    	broker4->sin_port = htons(SERVER_PORT);
    	zsock_inet_pton(AF_INET, SERVER_ADDR, &broker4->sin_addr);
    #if defined(CONFIG_SOCKS)
    	struct sockaddr_in *proxy4 = (struct sockaddr_in *)&socks5_proxy;
    
    	proxy4->sin_family = AF_INET;
    	proxy4->sin_port = htons(SOCKS5_PROXY_PORT);
    	zsock_inet_pton(AF_INET, SOCKS5_PROXY_ADDR, &proxy4->sin_addr);
    #endif
    #endif
    }
    
    static void client_init(struct mqtt_client *client)
    {
    
    struct mqtt_utf8 pass,name;
    
    pass.size = strlen("dnTdLm8qndcg");
    pass.utf8 = (uint8_t*)"dnTdLm8qndcg";
    name.size = strlen("nnrhlnnv");
    name.utf8 = (uint8_t *)"nnrhlnnv";
    
    
    	mqtt_client_init(client);
    
    	broker_init();
    
    	/* MQTT client configuration */
    	client->broker = (uint8_t*)"driver.cloudmqtt.com"; //&broker;
    	client->evt_cb = mqtt_evt_handler;
    	client->client_id.utf8 = (uint8_t *)MQTT_CLIENTID;
    	client->client_id.size = strlen(MQTT_CLIENTID);
    	client->password = &pass;
    	client->user_name = &name;
    
    	// client->password = "dnTdLm8qndcg";
    	// client->user_name = "nnrhlnnv";
    	client->protocol_version = MQTT_VERSION_3_1_1;
    
    	/* MQTT buffers configuration */
    	client->rx_buf = rx_buffer;
    	client->rx_buf_size = sizeof(rx_buffer);
    	client->tx_buf = tx_buffer;
    	client->tx_buf_size = sizeof(tx_buffer);
    
    	/* MQTT transport configuration */
    #if defined(CONFIG_MQTT_LIB_TLS)
    #if defined(CONFIG_MQTT_LIB_WEBSOCKET)
    	client->transport.type = MQTT_TRANSPORT_SECURE_WEBSOCKET;
    #else
    	client->transport.type = MQTT_TRANSPORT_SECURE;
    #endif
    
    	struct mqtt_sec_config *tls_config = &client->transport.tls.config;
    
    	tls_config->peer_verify = TLS_PEER_VERIFY_REQUIRED;
    	tls_config->cipher_list = NULL;
    	tls_config->sec_tag_list = m_sec_tags;
    	tls_config->sec_tag_count = ARRAY_SIZE(m_sec_tags);
    #if defined(MBEDTLS_X509_CRT_PARSE_C) || defined(CONFIG_NET_SOCKETS_OFFLOAD)
    	tls_config->hostname = TLS_SNI_HOSTNAME;
    #else
    	tls_config->hostname = NULL;
    #endif
    
    #else
    #if defined(CONFIG_MQTT_LIB_WEBSOCKET)
    	client->transport.type = MQTT_TRANSPORT_NON_SECURE_WEBSOCKET;
    #else
    	client->transport.type = MQTT_TRANSPORT_NON_SECURE;
    #endif
    #endif
    
    #if defined(CONFIG_MQTT_LIB_WEBSOCKET)
    	client->transport.websocket.config.host = SERVER_ADDR;
    	client->transport.websocket.config.url = "/mqtt";
    	client->transport.websocket.config.tmp_buf = temp_ws_rx_buf;
    	client->transport.websocket.config.tmp_buf_len =
    						sizeof(temp_ws_rx_buf);
    	client->transport.websocket.timeout = 5 * MSEC_PER_SEC;
    #endif
    
    #if defined(CONFIG_SOCKS)
    	mqtt_client_set_proxy(client, &socks5_proxy,
    			      socks5_proxy.sa_family == AF_INET ?
    			      sizeof(struct sockaddr_in) :
    			      sizeof(struct sockaddr_in6));
    #endif
    }
    
    /* In this routine we block until the connected variable is 1 */
    static int try_to_connect(struct mqtt_client *client)
    {
    	int rc, i = 0;
    
    	while (i++ < APP_CONNECT_TRIES && !connected) {
    
    		client_init(client);
    
    		rc = mqtt_connect(client);
    		if (rc != 0) {
    			PRINT_RESULT("mqtt_connect", rc);
    			k_sleep(K_MSEC(APP_SLEEP_MSECS));
    			continue;
    		}
    
    		prepare_fds(client);
    
    		if (wait(APP_CONNECT_TIMEOUT_MS)) {
    			mqtt_input(client);
    		}
    
    		if (!connected) {
    			mqtt_abort(client);
    		}
    	}
    
    	if (connected) {
    		return 0;
    	}
    
    	return -EINVAL;
    }
    
    static int process_mqtt_and_sleep(struct mqtt_client *client, int timeout)
    {
    	int64_t remaining = timeout;
    	int64_t start_time = k_uptime_get();
    	int rc;
    
    	while (remaining > 0 && connected) {
    		if (wait(remaining)) {
    			rc = mqtt_input(client);
    			if (rc != 0) {
    				PRINT_RESULT("mqtt_input", rc);
    				return rc;
    			}
    		}
    
    		rc = mqtt_live(client);
    		if (rc != 0 && rc != -EAGAIN) {
    			PRINT_RESULT("mqtt_live", rc);
    			return rc;
    		} else if (rc == 0) {
    			rc = mqtt_input(client);
    			if (rc != 0) {
    				PRINT_RESULT("mqtt_input", rc);
    				return rc;
    			}
    		}
    
    		remaining = timeout + start_time - k_uptime_get();
    	}
    
    	return 0;
    }
    
    #define SUCCESS_OR_EXIT(rc) { if (rc != 0) { return 1; } }
    #define SUCCESS_OR_BREAK(rc) { if (rc != 0) { break; } }
    
    static int publisher(void)
    {
    	int i, rc, r = 0;
    
    	LOG_INF("attempting to connect: ");
    	rc = try_to_connect(&client_ctx);
    	PRINT_RESULT("try_to_connect", rc);
    	SUCCESS_OR_EXIT(rc);
    
    	i = 0;
    	while (i++ < CONFIG_NET_SAMPLE_APP_MAX_ITERATIONS && connected) {
    		r = -1;
    
    		rc = mqtt_ping(&client_ctx);
    		PRINT_RESULT("mqtt_ping", rc);
    		SUCCESS_OR_BREAK(rc);
    
    		rc = process_mqtt_and_sleep(&client_ctx, APP_SLEEP_MSECS);
    		SUCCESS_OR_BREAK(rc);
    
    		rc = publish(&client_ctx, MQTT_QOS_0_AT_MOST_ONCE);
    		PRINT_RESULT("mqtt_publish", rc);
    		SUCCESS_OR_BREAK(rc);
    
    		rc = process_mqtt_and_sleep(&client_ctx, APP_SLEEP_MSECS);
    		SUCCESS_OR_BREAK(rc);
    
    		rc = publish(&client_ctx, MQTT_QOS_1_AT_LEAST_ONCE);
    		PRINT_RESULT("mqtt_publish", rc);
    		SUCCESS_OR_BREAK(rc);
    
    		rc = process_mqtt_and_sleep(&client_ctx, APP_SLEEP_MSECS);
    		SUCCESS_OR_BREAK(rc);
    
    		rc = publish(&client_ctx, MQTT_QOS_2_EXACTLY_ONCE);
    		PRINT_RESULT("mqtt_publish", rc);
    		SUCCESS_OR_BREAK(rc);
    
    		rc = process_mqtt_and_sleep(&client_ctx, APP_SLEEP_MSECS);
    		SUCCESS_OR_BREAK(rc);
    
    		r = 0;
    	}
    
    	rc = mqtt_disconnect(&client_ctx);
    	PRINT_RESULT("mqtt_disconnect", rc);
    
    	LOG_INF("Bye!");
    
    	return r;
    }
    
    static int start_app(void)
    {
    	int r = 0, i = 0;
    
    	while (!CONFIG_NET_SAMPLE_APP_MAX_CONNECTIONS ||
    	       i++ < CONFIG_NET_SAMPLE_APP_MAX_CONNECTIONS) {
    		r = publisher();
    
    		if (!CONFIG_NET_SAMPLE_APP_MAX_CONNECTIONS) {
    			k_sleep(K_MSEC(5000));
    		}
    	}
    
    	return r;
    }
    
    #if defined(CONFIG_USERSPACE)
    #define STACK_SIZE 2048
    
    #if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
    #define THREAD_PRIORITY K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
    #else
    #define THREAD_PRIORITY K_PRIO_PREEMPT(8)
    #endif
    
    K_THREAD_DEFINE(app_thread, STACK_SIZE,
    		start_app, NULL, NULL, NULL,
    		THREAD_PRIORITY, K_USER, -1);
    
    static K_HEAP_DEFINE(app_mem_pool, 1024 * 2);
    #endif
    
    void main(void)
    {
    
    ////////////////////////////////////////////////////////////////////////////// GSM
    
    	const struct device *uart_dev = DEVICE_DT_GET(UART_NODE);
    
    	gsm_dev = DEVICE_DT_GET(GSM_MODEM_NODE);
    
    	/* Optional register modem power callbacks */
    	gsm_ppp_register_modem_power_callback(gsm_dev, modem_on_cb, modem_off_cb, NULL);
    
    	LOG_INF("Board '%s' APN '%s' UART '%s' device %p (%s)",
    		CONFIG_BOARD, CONFIG_MODEM_GSM_APN,
    		uart_dev->name, uart_dev, gsm_dev->name);
    
    	net_mgmt_init_event_callback(&mgmt_cb, event_handler,
    				     NET_EVENT_L4_CONNECTED |
    				     NET_EVENT_L4_DISCONNECTED);
    	net_mgmt_add_event_callback(&mgmt_cb);
    ////////////////////////////////////////////////////////////////////////////// GSM
    
    
    
    #if defined(CONFIG_MQTT_LIB_TLS)
    	int rc;
    
    	rc = tls_init();
    	PRINT_RESULT("tls_init", rc);
    #endif
    
    #if defined(CONFIG_USERSPACE)
    	int ret;
    
    	struct k_mem_partition *parts[] = {
    #if Z_LIBC_PARTITION_EXISTS
    		&z_libc_partition,
    #endif
    		&app_partition
    	};
    
    	ret = k_mem_domain_init(&app_domain, ARRAY_SIZE(parts), parts);
    	__ASSERT(ret == 0, "k_mem_domain_init() failed %d", ret);
    	ARG_UNUSED(ret);
    
    	k_mem_domain_add_thread(&app_domain, app_thread);
    	k_thread_heap_assign(app_thread, &app_mem_pool);
    
    	k_thread_start(app_thread);
    	k_thread_join(app_thread, K_FOREVER);
    #else
    	exit(start_app());
    #endif
    }
    

     *  Executing task: nRF Connect: Build [pristine]: mqtt_publisher_test/build (active) 
    
    Building mqtt_publisher_test
    west build --build-dir f:\Development\nordicsemi\Myapps\mqtt_publisher_test\build f:\Development\nordicsemi\Myapps\mqtt_publisher_test --pristine --board nrf52840dk_nrf52840 -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="f:/Development/nordicsemi/Myapps/peripheral_test;f:/Development/nordicsemi/Myapps/gsm_modem_test;f:/Development/nordicsemi/Myapps/mqtt_publisher_test" -DCONFIG_DEBUG_OPTIMIZATIONS:STRING="y" -DCONFIG_DEBUG_THREAD_INFO:STRING="y" -DDTC_OVERLAY_FILE:STRING="f:/Development/nordicsemi/Myapps/mqtt_publisher_test/nrf52840dk_nrf52840.overlay" -DCONF_FILE:STRING="f:/Development/nordicsemi/Myapps/mqtt_publisher_test/prj.conf"
    
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: F:/Development/nordicsemi/Myapps/mqtt_publisher_test
    -- Found Python3: F:/Development/nordicsemi/toolchains/v2.1.2/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Cache files will be written to: F:/Development/nordicsemi/v2.1.2/zephyr/.cache
    -- Zephyr version: 3.1.99 (F:/Development/nordicsemi/v2.1.2/zephyr)
    -- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
    -- Board: nrf52840dk_nrf52840
    -- Found host-tools: zephyr 0.14.1 (F:/Development/nordicsemi/toolchains/v2.1.2/opt/zephyr-sdk)
    -- Found dtc: F:/Development/nordicsemi/toolchains/v2.1.2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: zephyr 0.14.1 (F:/Development/nordicsemi/toolchains/v2.1.2/opt/zephyr-sdk)
    -- Found BOARD.dts: F:/Development/nordicsemi/v2.1.2/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Found devicetree overlay: f:/Development/nordicsemi/Myapps/mqtt_publisher_test/nrf52840dk_nrf52840.overlay
    -- Generated zephyr.dts: F:/Development/nordicsemi/Myapps/mqtt_publisher_test/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: F:/Development/nordicsemi/Myapps/mqtt_publisher_test/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: F:/Development/nordicsemi/Myapps/mqtt_publisher_test/build/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: F:/Development/nordicsemi/Myapps/mqtt_publisher_test/build/zephyr/dts.cmake
    Parsing F:/Development/nordicsemi/Myapps/mqtt_publisher_test/Kconfig
    Loaded configuration 'F:/Development/nordicsemi/v2.1.2/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration 'f:/Development/nordicsemi/Myapps/mqtt_publisher_test/prj.conf'
    Merged configuration 'F:/Development/nordicsemi/Myapps/mqtt_publisher_test/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'F:/Development/nordicsemi/Myapps/mqtt_publisher_test/build/zephyr/.config'
    Kconfig header saved to 'F:/Development/nordicsemi/Myapps/mqtt_publisher_test/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 10.3.0
    -- The CXX compiler identification is GNU 10.3.0
    -- The ASM compiler identification is GNU
    -- Found assembler: F:/Development/nordicsemi/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: F:/Development/nordicsemi/Myapps/mqtt_publisher_test/build
    -- west build: building application
    [1/334] Generating include/generated/version.h
    -- Zephyr version: 3.1.99 (F:/Development/nordicsemi/v2.1.2/zephyr), build: v3.1.99-ncs1-1
    [2/334] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
    [3/334] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
    [4/334] Generating include/generated/driver-validation.h
    [5/334] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
    [6/334] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
    [7/334] Generating include/generated/offsets.h
    [8/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell_help.c.obj
    [9/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell_cmds.c.obj
    [10/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell_log_backend.c.obj
    [11/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell_utils.c.obj
    [12/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/modules/devmem_service.c.obj
    [13/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/modules/kernel_service.c.obj
    [14/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/modules/device_service.c.obj
    [15/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/backends/shell_uart.c.obj
    [16/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell_ops.c.obj
    [17/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell.c.obj
    [18/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/state.c.obj
    [19/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell_history.c.obj
    [20/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell_fprintf.c.obj
    [21/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/policy.c.obj
    [22/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
    [23/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/pm.c.obj
    [24/334] Building C object zephyr/CMakeFiles/zephyr.dir/F_/Development/nordicsemi/v2.1.2/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_abort_zephyr.c.obj
    [25/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/shell/shell_wildcard.c.obj
    [26/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/sockets/sockets_select.c.obj
    [27/334] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
    [28/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/utils/addr_utils.c.obj
    [29/334] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
    [30/334] Building C object zephyr/CMakeFiles/zephyr.dir/F_/Development/nordicsemi/v2.1.2/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_mutex_zephyr.c.obj
    [31/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/sockets/sockets_misc.c.obj
    [32/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/sockets/getnameinfo.c.obj
    [33/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/sockets/getaddrinfo.c.obj
    [34/334] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
    [35/334] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
    [36/334] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
    [37/334] Generating linker_zephyr_pre1.cmd
    [38/334] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
    [39/334] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
    [40/334] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
    [41/334] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/sockets/sockets.c.obj
    [42/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/psa_crypto_ecp.c.obj
    [43/334] Building C object modules/segger/CMakeFiles/modules__segger.dir/F_/Development/nordicsemi/v2.1.2/modules/debug/segger/SEGGER/SEGGER_RTT.c.obj
    [44/334] Generating linker_zephyr_pre0.cmd
    [45/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/psa_crypto_client.c.obj
    [46/334] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
    [47/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/psa_crypto_mac.c.obj
    [48/334] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
    [49/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/psa_crypto_hash.c.obj
    [50/334] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
    [51/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/psa_crypto_slot_management.c.obj
    [52/334] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
    [53/334] Building C object modules/segger/CMakeFiles/modules__segger.dir/SEGGER_RTT_zephyr.c.obj
    [54/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/psa_crypto_se.c.obj
    [55/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/psa_its_file.c.obj
    [56/334] Linking C static library zephyr\arch\common\libisr_tables.a
    [57/334] Linking C static library zephyr\arch\arch\arm\core\aarch32\libarch__arm__core__aarch32.a
    [58/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/psa_crypto_rsa.c.obj
    [59/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/psa_crypto_storage.c.obj
    [60/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ripemd160.c.obj
    [61/334] Linking C static library modules\segger\libmodules__segger.a
    [62/334] Linking C static library zephyr\arch\common\libarch__common.a
    [63/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_cache.c.obj
    [64/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/sha256.c.obj
    [65/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_cookie.c.obj
    [66/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/sha1.c.obj
    [67/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/rsa_alt_helpers.c.obj
    [68/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/psa_crypto_driver_wrappers.c.obj
    [69/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/sha512.c.obj
    [70/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_ticket.c.obj
    [71/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_tls13_client.c.obj
    [72/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_debug_helpers_generated.c.obj
    [73/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_tls13_server.c.obj
    [74/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_tls13_generic.c.obj
    [75/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_ciphersuites.c.obj
    [76/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/rsa.c.obj
    [77/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/threading.c.obj
    [78/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_tls13_keys.c.obj
    [79/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/x509_create.c.obj
    [80/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/x509_crl.c.obj
    [81/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_cli.c.obj
    [82/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/version.c.obj
    [83/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/timing.c.obj
    [84/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/version_features.c.obj
    [85/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/x509write_csr.c.obj
    [86/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/x509write_crt.c.obj
    [87/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_srv.c.obj
    [88/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/x509_csr.c.obj
    [89/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_msg.c.obj
    [90/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/x509.c.obj
    [91/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/ssl_tls.c.obj
    [92/334] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/nrfx_glue.c.obj
    [93/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
    [94/334] Building C object modules/mbedtls/CMakeFiles/modules__mbedtls.dir/F_/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/library/x509_crt.c.obj
    [95/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
    [96/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
    [97/334] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/F_/Development/nordicsemi/v2.1.2/modules/hal/nordic/nrfx/mdk/system_nrf52840.c.obj
    [98/334] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/F_/Development/nordicsemi/v2.1.2/modules/hal/nordic/nrfx/drivers/src/nrfx_ppi.c.obj
    [99/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
    [100/334] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/F_/Development/nordicsemi/v2.1.2/modules/hal/nordic/nrfx/helpers/nrfx_flag32_allocator.c.obj
    [101/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
    [102/334] Building C object CMakeFiles/app.dir/src/main.c.obj
    FAILED: CMakeFiles/app.dir/src/main.c.obj 
    F:\Development\nordicsemi\toolchains\v2.1.2\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DMBEDTLS_CONFIG_FILE=\"config-tls-generic.h\" -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=0 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IF:/Development/nordicsemi/v2.1.2/zephyr/include/zephyr -IF:/Development/nordicsemi/v2.1.2/zephyr/include -Izephyr/include/generated -IF:/Development/nordicsemi/v2.1.2/zephyr/soc/arm/nordic_nrf/nrf52 -IF:/Development/nordicsemi/v2.1.2/zephyr/lib/util/fnmatch/. -IF:/Development/nordicsemi/v2.1.2/zephyr/soc/arm/nordic_nrf/common/. -IF:/Development/nordicsemi/v2.1.2/zephyr/subsys/net/lib/sockets/. -IF:/Development/nordicsemi/v2.1.2/nrf/include -IF:/Development/nordicsemi/v2.1.2/modules/hal/cmsis/CMSIS/Core/Include -IF:/Development/nordicsemi/v2.1.2/modules/hal/nordic/nrfx -IF:/Development/nordicsemi/v2.1.2/modules/hal/nordic/nrfx/drivers/include -IF:/Development/nordicsemi/v2.1.2/modules/hal/nordic/nrfx/mdk -IF:/Development/nordicsemi/v2.1.2/zephyr/modules/hal_nordic/nrfx/. -IF:/Development/nordicsemi/v2.1.2/modules/debug/segger/SEGGER -IF:/Development/nordicsemi/v2.1.2/modules/debug/segger/Config -IF:/Development/nordicsemi/v2.1.2/zephyr/modules/segger/. -IF:/Development/nordicsemi/v2.1.2/modules/crypto/mbedtls/include -IF:/Development/nordicsemi/v2.1.2/zephyr/modules/mbedtls/configs -isystem F:/Development/nordicsemi/v2.1.2/zephyr/lib/libc/minimal/include -isystem f:/development/nordicsemi/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include -isystem f:/development/nordicsemi/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include-fixed -isystem F:/Development/nordicsemi/v2.1.2/nrfxlib/crypto/nrf_cc310_platform/include -Og -imacros F:/Development/nordicsemi/Myapps/mqtt_publisher_test/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=F:/Development/nordicsemi/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros F:/Development/nordicsemi/v2.1.2/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=F:/Development/nordicsemi/Myapps/mqtt_publisher_test=CMAKE_SOURCE_DIR -fmacro-prefix-map=F:/Development/nordicsemi/v2.1.2/zephyr=ZEPHYR_BASE -fmacro-prefix-map=F:/Development/nordicsemi/v2.1.2=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -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 ../src/main.c
    ../src/main.c: In function 'main':
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:665:49: error: 'modem_on_cb' undeclared (first use in this function)
      665 |  gsm_ppp_register_modem_power_callback(gsm_dev, modem_on_cb, modem_off_cb, NULL);
          |                                                 ^~~~~~~~~~~
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:665:49: note: each undeclared identifier is reported only once for each function it appears in
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:665:62: error: 'modem_off_cb' undeclared (first use in this function)
      665 |  gsm_ppp_register_modem_power_callback(gsm_dev, modem_on_cb, modem_off_cb, NULL);
          |                                                              ^~~~~~~~~~~~
    In file included from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log.h:11,
                     from f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:7:
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:668:17: error: 'CONFIG_MODEM_GSM_APN' undeclared (first use in this function)
      668 |   CONFIG_BOARD, CONFIG_MODEM_GSM_APN,
          |                 ^~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:167:11: note: in definition of macro 'Z_LOG_TO_PRINTK'
      167 |         ##__VA_ARGS__); \
          |           ^~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:252:2: note: in expansion of macro 'Z_LOG2'
      252 |  Z_LOG2(_level, 0, __log_current_const_data, __log_current_dynamic_data, __VA_ARGS__)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log.h:61:24: note: in expansion of macro 'Z_LOG'
       61 | #define LOG_INF(...)   Z_LOG(LOG_LEVEL_INF, __VA_ARGS__)
          |                        ^~~~~
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:667:2: note: in expansion of macro 'LOG_INF'
      667 |  LOG_INF("Board '%s' APN '%s' UART '%s' device %p (%s)",
          |  ^~~~~~~
    In file included from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_macro.h:34,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util.h:17,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:15,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf.h:100,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:11,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:9,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log.h:11,
                     from f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:7:
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:430:65: error: '_v2' undeclared (first use in this function); did you mean '_v5'?
      430 | #define Z_LOG_LOCAL_ARG_NAME(idx, arg) COND_CODE_0(idx, (arg), (_v##idx))
          |                                                                 ^~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_internal.h:67:26: note: in definition of macro '__DEBRACKET'
       67 | #define __DEBRACKET(...) __VA_ARGS__
          |                          ^~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_internal.h:59:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
       59 |  __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
          |  ^~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_internal.h:56:2: note: in expansion of macro '__COND_CODE'
       56 |  __COND_CODE(_ZZZZ##_flag, _if_0_code, _else_code)
          |  ^~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_macro.h:173:2: note: in expansion of macro 'Z_COND_CODE_0'
      173 |  Z_COND_CODE_0(_flag, _if_0_code, _else_code)
          |  ^~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:132:2: note: in expansion of macro 'COND_CODE_0'
      132 |  COND_CODE_0(NUM_VA_ARGS_LESS_1(__VA_ARGS__), \
          |  ^~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:118:7: note: in expansion of macro 'Z_CBPRINTF_IS_PCHAR'
      118 |   0 : Z_CBPRINTF_IS_PCHAR(x, flags))
          |       ^~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1055:2: note: in expansion of macro 'Z_CBPRINTF_IS_X_PCHAR'
     1055 |  fixed_arg0(idx, x, fixed_arg1)
          |  ^~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:33:2: note: in expansion of macro 'Z_FOR_EACH_IDX_FIXED_ARG_EXEC'
       33 |  z_call(1, x, fixed_arg0, fixed_arg1)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:36:2: note: in expansion of macro 'Z_FOR_LOOP_2'
       36 |  Z_FOR_LOOP_2(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:41:2: note: in expansion of macro 'Z_FOR_LOOP_3'
       41 |  Z_FOR_LOOP_3(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:46:2: note: in expansion of macro 'Z_FOR_LOOP_4'
       46 |  Z_FOR_LOOP_4(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:23:53: note: in expansion of macro 'Z_FOR_LOOP_5'
       23 |     _57, _58, _59, _60, _61, _62, _63, _64, N, ...) N
          |                                                     ^
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1058:2: note: in expansion of macro 'Z_FOR_EACH_ENGINE'
     1058 |  Z_FOR_EACH_ENGINE(Z_FOR_EACH_IDX_FIXED_ARG_EXEC, sep, \
          |  ^~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_macro.h:562:2: note: in expansion of macro 'Z_FOR_EACH_IDX_FIXED_ARG'
      562 |  Z_FOR_EACH_IDX_FIXED_ARG(F, sep, fixed_arg, REVERSE_ARGS(__VA_ARGS__))
          |  ^~~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1075:2: note: in expansion of macro 'Z_BYPASS'
     1075 |  fixed_arg0(x)
          |  ^~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:43:2: note: in expansion of macro 'Z_FOR_EACH_EXEC'
       43 |  z_call(3, x, fixed_arg0, fixed_arg1)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:46:2: note: in expansion of macro 'Z_FOR_LOOP_4'
       46 |  Z_FOR_LOOP_4(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:23:53: note: in expansion of macro 'Z_FOR_LOOP_5'
       23 |     _57, _58, _59, _60, _61, _62, _63, _64, N, ...) N
          |                                                     ^
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_macro.h:569:2: note: in expansion of macro 'Z_FOR_EACH_ENGINE'
      569 |  Z_FOR_EACH_ENGINE(Z_FOR_EACH_EXEC, (,), Z_BYPASS, _, __VA_ARGS__)
          |  ^~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_macro.h:562:46: note: in expansion of macro 'REVERSE_ARGS'
      562 |  Z_FOR_EACH_IDX_FIXED_ARG(F, sep, fixed_arg, REVERSE_ARGS(__VA_ARGS__))
          |                                              ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:129:3: note: in expansion of macro 'FOR_EACH_IDX_FIXED_ARG'
      129 |  (FOR_EACH_IDX_FIXED_ARG(Z_CBPRINTF_IS_X_PCHAR, (+), flags, __VA_ARGS__))
          |   ^~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:134:8: note: in expansion of macro 'Z_CBPRINTF_HAS_PCHAR_ARGS'
      134 |       (Z_CBPRINTF_HAS_PCHAR_ARGS(flags, __VA_ARGS__)))
          |        ^~~~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:152:9: note: in expansion of macro 'Z_CBPRINTF_PCHAR_COUNT'
      152 |   _rv = Z_CBPRINTF_PCHAR_COUNT(flags, __VA_ARGS__) > 0 ? 1 : 0; \
          |         ^~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf.h:302:2: note: in expansion of macro 'Z_CBPRINTF_MUST_RUNTIME_PACKAGE'
      302 |  Z_CBPRINTF_MUST_RUNTIME_PACKAGE(flags, __VA_ARGS__)
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:404:20: note: in expansion of macro 'CBPRINTF_MUST_RUNTIME_PACKAGE'
      404 |  bool has_rw_str = CBPRINTF_MUST_RUNTIME_PACKAGE( \
          |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:447:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE3'
      447 |  Z_LOG_MSG2_CREATE3(_try_0cpy, _mode,  _cstr_cnt, _domain_id, _source,\
          |  ^~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_internal.h:64:53: note: in expansion of macro '__DEBRACKET'
       64 | #define __GET_ARG2_DEBRACKET(ignore_this, val, ...) __DEBRACKET val
          |                                                     ^~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_internal.h:59:2: note: in expansion of macro '__GET_ARG2_DEBRACKET'
       59 |  __GET_ARG2_DEBRACKET(one_or_two_args _if_code, _else_code)
          |  ^~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_internal.h:56:2: note: in expansion of macro '__COND_CODE'
       56 |  __COND_CODE(_ZZZZ##_flag, _if_0_code, _else_code)
          |  ^~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_macro.h:173:2: note: in expansion of macro 'Z_COND_CODE_0'
      173 |  Z_COND_CODE_0(_flag, _if_0_code, _else_code)
          |  ^~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:430:40: note: in expansion of macro 'COND_CODE_0'
      430 | #define Z_LOG_LOCAL_ARG_NAME(idx, arg) COND_CODE_0(idx, (arg), (_v##idx))
          |                                        ^~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1069:2: note: in expansion of macro 'Z_LOG_LOCAL_ARG_NAME'
     1069 |  fixed_arg0(idx, x)
          |  ^~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:38:2: note: in expansion of macro 'Z_FOR_EACH_IDX_EXEC'
       38 |  z_call(2, x, fixed_arg0, fixed_arg1)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:41:2: note: in expansion of macro 'Z_FOR_LOOP_3'
       41 |  Z_FOR_LOOP_3(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:46:2: note: in expansion of macro 'Z_FOR_LOOP_4'
       46 |  Z_FOR_LOOP_4(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:51:2: note: in expansion of macro 'Z_FOR_LOOP_5'
       51 |  Z_FOR_LOOP_5(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:23:53: note: in expansion of macro 'Z_FOR_LOOP_6'
       23 |     _57, _58, _59, _60, _61, _62, _63, _64, N, ...) N
          |                                                     ^
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1072:2: note: in expansion of macro 'Z_FOR_EACH_ENGINE'
     1072 |  Z_FOR_EACH_ENGINE(Z_FOR_EACH_IDX_EXEC, sep, F, _, __VA_ARGS__)
          |  ^~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_macro.h:506:2: note: in expansion of macro 'Z_FOR_EACH_IDX'
      506 |  Z_FOR_EACH_IDX(F, sep, REVERSE_ARGS(__VA_ARGS__))
          |  ^~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:449:7: note: in expansion of macro 'FOR_EACH_IDX'
      449 |       FOR_EACH_IDX(Z_LOG_LOCAL_ARG_NAME, (,), __VA_ARGS__)); \
          |       ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:458:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE2'
      458 |  Z_LOG_MSG2_CREATE2(_try_0cpy, _mode, UTIL_CAT(Z_LOG_FUNC_PREFIX_, _level), \
          |  ^~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:240:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE'
      240 |  Z_LOG_MSG2_CREATE(UTIL_NOT(IS_ENABLED(CONFIG_USERSPACE)), _mode, \
          |  ^~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:252:2: note: in expansion of macro 'Z_LOG2'
      252 |  Z_LOG2(_level, 0, __log_current_const_data, __log_current_dynamic_data, __VA_ARGS__)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log.h:61:24: note: in expansion of macro 'Z_LOG'
       61 | #define LOG_INF(...)   Z_LOG(LOG_LEVEL_INF, __VA_ARGS__)
          |                        ^~~~~
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:667:2: note: in expansion of macro 'LOG_INF'
      667 |  LOG_INF("Board '%s' APN '%s' UART '%s' device %p (%s)",
          |  ^~~~~~~
    In file included from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\toolchain.h:50,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\lib\libc\minimal\include\string.h:13,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\mpsc_packet.h:9,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:10,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:9,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log.h:11,
                     from f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:7:
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:290:15: error: expression in static assertion is not an integer
      290 |  BUILD_ASSERT(!((sizeof(double) < VA_STACK_ALIGN(long double)) && \
          |               ^
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:333:2: note: in expansion of macro 'Z_CBPRINTF_PACK_ARG2'
      333 |  Z_CBPRINTF_PACK_ARG2(arg_idx, _pbuf, _pkg_len, _pkg_offset, _pmax, arg)
          |  ^~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1069:2: note: in expansion of macro 'Z_CBPRINTF_PACK_ARG'
     1069 |  fixed_arg0(idx, x)
          |  ^~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:38:2: note: in expansion of macro 'Z_FOR_EACH_IDX_EXEC'
       38 |  z_call(2, x, fixed_arg0, fixed_arg1)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:41:2: note: in expansion of macro 'Z_FOR_LOOP_3'
       41 |  Z_FOR_LOOP_3(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:46:2: note: in expansion of macro 'Z_FOR_LOOP_4'
       46 |  Z_FOR_LOOP_4(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:51:2: note: in expansion of macro 'Z_FOR_LOOP_5'
       51 |  Z_FOR_LOOP_5(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:23:53: note: in expansion of macro 'Z_FOR_LOOP_6'
       23 |     _57, _58, _59, _60, _61, _62, _63, _64, N, ...) N
          |                                                     ^
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1072:2: note: in expansion of macro 'Z_FOR_EACH_ENGINE'
     1072 |  Z_FOR_EACH_ENGINE(Z_FOR_EACH_IDX_EXEC, sep, F, _, __VA_ARGS__)
          |  ^~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_macro.h:506:2: note: in expansion of macro 'Z_FOR_EACH_IDX'
      506 |  Z_FOR_EACH_IDX(F, sep, REVERSE_ARGS(__VA_ARGS__))
          |  ^~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:440:2: note: in expansion of macro 'FOR_EACH_IDX'
      440 |  FOR_EACH_IDX(Z_CBPRINTF_PACK_ARG, (;), __VA_ARGS__);\
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:477:2: note: in expansion of macro 'Z_CBPRINTF_STATIC_PACKAGE_GENERIC'
      477 |  Z_CBPRINTF_STATIC_PACKAGE_GENERIC(packaged, inlen, outlen, \
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf.h:335:2: note: in expansion of macro 'Z_CBPRINTF_STATIC_PACKAGE'
      335 |  Z_CBPRINTF_STATIC_PACKAGE(packaged, inlen, outlen, \
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:220:3: note: in expansion of macro 'CBPRINTF_STATIC_PACKAGE'
      220 |   CBPRINTF_STATIC_PACKAGE(NULL, 0, _plen, Z_LOG_MSG2_ALIGN_OFFSET, flags, \
          |   ^~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:414:3: note: in expansion of macro 'Z_LOG_MSG2_STACK_CREATE'
      414 |   Z_LOG_MSG2_STACK_CREATE(_cstr_cnt, _domain_id, _source, _level, _data, \
          |   ^~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:447:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE3'
      447 |  Z_LOG_MSG2_CREATE3(_try_0cpy, _mode,  _cstr_cnt, _domain_id, _source,\
          |  ^~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:458:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE2'
      458 |  Z_LOG_MSG2_CREATE2(_try_0cpy, _mode, UTIL_CAT(Z_LOG_FUNC_PREFIX_, _level), \
          |  ^~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:240:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE'
      240 |  Z_LOG_MSG2_CREATE(UTIL_NOT(IS_ENABLED(CONFIG_USERSPACE)), _mode, \
          |  ^~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:252:2: note: in expansion of macro 'Z_LOG2'
      252 |  Z_LOG2(_level, 0, __log_current_const_data, __log_current_dynamic_data, __VA_ARGS__)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log.h:61:24: note: in expansion of macro 'Z_LOG'
       61 | #define LOG_INF(...)   Z_LOG(LOG_LEVEL_INF, __VA_ARGS__)
          |                        ^~~~~
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:667:2: note: in expansion of macro 'LOG_INF'
      667 |  LOG_INF("Board '%s' APN '%s' UART '%s' device %p (%s)",
          |  ^~~~~~~
    In file included from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf.h:100,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:11,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:9,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log.h:11,
                     from f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:7:
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:176:8: error: '_v' undeclared (first use in this function); did you mean '_v5'?
      176 |  (void)_v; \
          |        ^~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:298:23: note: in expansion of macro 'Z_CBPRINTF_ARG_SIZE'
      298 |  uint32_t _arg_size = Z_CBPRINTF_ARG_SIZE(_arg); \
          |                       ^~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:333:2: note: in expansion of macro 'Z_CBPRINTF_PACK_ARG2'
      333 |  Z_CBPRINTF_PACK_ARG2(arg_idx, _pbuf, _pkg_len, _pkg_offset, _pmax, arg)
          |  ^~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1069:2: note: in expansion of macro 'Z_CBPRINTF_PACK_ARG'
     1069 |  fixed_arg0(idx, x)
          |  ^~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:38:2: note: in expansion of macro 'Z_FOR_EACH_IDX_EXEC'
       38 |  z_call(2, x, fixed_arg0, fixed_arg1)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:41:2: note: in expansion of macro 'Z_FOR_LOOP_3'
       41 |  Z_FOR_LOOP_3(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:46:2: note: in expansion of macro 'Z_FOR_LOOP_4'
       46 |  Z_FOR_LOOP_4(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:51:2: note: in expansion of macro 'Z_FOR_LOOP_5'
       51 |  Z_FOR_LOOP_5(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:23:53: note: in expansion of macro 'Z_FOR_LOOP_6'
       23 |     _57, _58, _59, _60, _61, _62, _63, _64, N, ...) N
          |                                                     ^
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1072:2: note: in expansion of macro 'Z_FOR_EACH_ENGINE'
     1072 |  Z_FOR_EACH_ENGINE(Z_FOR_EACH_IDX_EXEC, sep, F, _, __VA_ARGS__)
          |  ^~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_macro.h:506:2: note: in expansion of macro 'Z_FOR_EACH_IDX'
      506 |  Z_FOR_EACH_IDX(F, sep, REVERSE_ARGS(__VA_ARGS__))
          |  ^~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:440:2: note: in expansion of macro 'FOR_EACH_IDX'
      440 |  FOR_EACH_IDX(Z_CBPRINTF_PACK_ARG, (;), __VA_ARGS__);\
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:477:2: note: in expansion of macro 'Z_CBPRINTF_STATIC_PACKAGE_GENERIC'
      477 |  Z_CBPRINTF_STATIC_PACKAGE_GENERIC(packaged, inlen, outlen, \
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf.h:335:2: note: in expansion of macro 'Z_CBPRINTF_STATIC_PACKAGE'
      335 |  Z_CBPRINTF_STATIC_PACKAGE(packaged, inlen, outlen, \
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:220:3: note: in expansion of macro 'CBPRINTF_STATIC_PACKAGE'
      220 |   CBPRINTF_STATIC_PACKAGE(NULL, 0, _plen, Z_LOG_MSG2_ALIGN_OFFSET, flags, \
          |   ^~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:414:3: note: in expansion of macro 'Z_LOG_MSG2_STACK_CREATE'
      414 |   Z_LOG_MSG2_STACK_CREATE(_cstr_cnt, _domain_id, _source, _level, _data, \
          |   ^~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:447:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE3'
      447 |  Z_LOG_MSG2_CREATE3(_try_0cpy, _mode,  _cstr_cnt, _domain_id, _source,\
          |  ^~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:458:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE2'
      458 |  Z_LOG_MSG2_CREATE2(_try_0cpy, _mode, UTIL_CAT(Z_LOG_FUNC_PREFIX_, _level), \
          |  ^~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:240:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE'
      240 |  Z_LOG_MSG2_CREATE(UTIL_NOT(IS_ENABLED(CONFIG_USERSPACE)), _mode, \
          |  ^~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:252:2: note: in expansion of macro 'Z_LOG2'
      252 |  Z_LOG2(_level, 0, __log_current_const_data, __log_current_dynamic_data, __VA_ARGS__)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log.h:61:24: note: in expansion of macro 'Z_LOG'
       61 | #define LOG_INF(...)   Z_LOG(LOG_LEVEL_INF, __VA_ARGS__)
          |                        ^~~~~
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:667:2: note: in expansion of macro 'LOG_INF'
      667 |  LOG_INF("Board '%s' APN '%s' UART '%s' device %p (%s)",
          |  ^~~~~~~
    In file included from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\toolchain.h:50,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\lib\libc\minimal\include\string.h:13,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\mpsc_packet.h:9,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:10,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:9,
                     from F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log.h:11,
                     from f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:7:
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:290:15: error: expression in static assertion is not an integer
      290 |  BUILD_ASSERT(!((sizeof(double) < VA_STACK_ALIGN(long double)) && \
          |               ^
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:333:2: note: in expansion of macro 'Z_CBPRINTF_PACK_ARG2'
      333 |  Z_CBPRINTF_PACK_ARG2(arg_idx, _pbuf, _pkg_len, _pkg_offset, _pmax, arg)
          |  ^~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1069:2: note: in expansion of macro 'Z_CBPRINTF_PACK_ARG'
     1069 |  fixed_arg0(idx, x)
          |  ^~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:38:2: note: in expansion of macro 'Z_FOR_EACH_IDX_EXEC'
       38 |  z_call(2, x, fixed_arg0, fixed_arg1)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:41:2: note: in expansion of macro 'Z_FOR_LOOP_3'
       41 |  Z_FOR_LOOP_3(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:46:2: note: in expansion of macro 'Z_FOR_LOOP_4'
       46 |  Z_FOR_LOOP_4(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:51:2: note: in expansion of macro 'Z_FOR_LOOP_5'
       51 |  Z_FOR_LOOP_5(z_call, sep, fixed_arg0, fixed_arg1, ##__VA_ARGS__) \
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:23:53: note: in expansion of macro 'Z_FOR_LOOP_6'
       23 |     _57, _58, _59, _60, _61, _62, _63, _64, N, ...) N
          |                                                     ^
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_loops.h:1072:2: note: in expansion of macro 'Z_FOR_EACH_ENGINE'
     1072 |  Z_FOR_EACH_ENGINE(Z_FOR_EACH_IDX_EXEC, sep, F, _, __VA_ARGS__)
          |  ^~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\util_macro.h:506:2: note: in expansion of macro 'Z_FOR_EACH_IDX'
      506 |  Z_FOR_EACH_IDX(F, sep, REVERSE_ARGS(__VA_ARGS__))
          |  ^~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:440:2: note: in expansion of macro 'FOR_EACH_IDX'
      440 |  FOR_EACH_IDX(Z_CBPRINTF_PACK_ARG, (;), __VA_ARGS__);\
          |  ^~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf_internal.h:477:2: note: in expansion of macro 'Z_CBPRINTF_STATIC_PACKAGE_GENERIC'
      477 |  Z_CBPRINTF_STATIC_PACKAGE_GENERIC(packaged, inlen, outlen, \
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\sys\cbprintf.h:335:2: note: in expansion of macro 'Z_CBPRINTF_STATIC_PACKAGE'
      335 |  Z_CBPRINTF_STATIC_PACKAGE(packaged, inlen, outlen, \
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:227:3: note: in expansion of macro 'CBPRINTF_STATIC_PACKAGE'
      227 |   CBPRINTF_STATIC_PACKAGE(_msg->data, _plen, \
          |   ^~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:414:3: note: in expansion of macro 'Z_LOG_MSG2_STACK_CREATE'
      414 |   Z_LOG_MSG2_STACK_CREATE(_cstr_cnt, _domain_id, _source, _level, _data, \
          |   ^~~~~~~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:447:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE3'
      447 |  Z_LOG_MSG2_CREATE3(_try_0cpy, _mode,  _cstr_cnt, _domain_id, _source,\
          |  ^~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_msg.h:458:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE2'
      458 |  Z_LOG_MSG2_CREATE2(_try_0cpy, _mode, UTIL_CAT(Z_LOG_FUNC_PREFIX_, _level), \
          |  ^~~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:240:2: note: in expansion of macro 'Z_LOG_MSG2_CREATE'
      240 |  Z_LOG_MSG2_CREATE(UTIL_NOT(IS_ENABLED(CONFIG_USERSPACE)), _mode, \
          |  ^~~~~~~~~~~~~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log_core.h:252:2: note: in expansion of macro 'Z_LOG2'
      252 |  Z_LOG2(_level, 0, __log_current_const_data, __log_current_dynamic_data, __VA_ARGS__)
          |  ^~~~~~
    F:\Development\nordicsemi\v2.1.2\zephyr\include\zephyr\logging\log.h:61:24: note: in expansion of macro 'Z_LOG'
       61 | #define LOG_INF(...)   Z_LOG(LOG_LEVEL_INF, __VA_ARGS__)
          |                        ^~~~~
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:667:2: note: in expansion of macro 'LOG_INF'
      667 |  LOG_INF("Board '%s' APN '%s' UART '%s' device %p (%s)",
          |  ^~~~~~~
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:671:41: error: 'event_handler' undeclared (first use in this function); did you mean 'mqtt_evt_handler'?
      671 |  net_mgmt_init_event_callback(&mgmt_cb, event_handler,
          |                                         ^~~~~~~~~~~~~
          |                                         mqtt_evt_handler
    At top level:
    f:\Development\nordicsemi\Myapps\mqtt_publisher_test\src\main.c:42:13: warning: 'starting' defined but not used [-Wunused-variable]
       42 | static bool starting = IS_ENABLED(CONFIG_GSM_PPP_AUTOSTART);
          |             ^~~~~~~~
    [103/334] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/F_/Development/nordicsemi/v2.1.2/modules/hal/nordic/nrfx/drivers/src/nrfx_clock.c.obj
    [104/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
    [105/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
    [106/334] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/F_/Development/nordicsemi/v2.1.2/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
    [107/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
    [108/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
    [109/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
    [110/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
    [111/334] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'f:\Development\nordicsemi\toolchains\v2.1.2\opt\bin\cmake.EXE' --build 'f:\Development\nordicsemi\Myapps\mqtt_publisher_test\build'
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 

  • The compiler states that modem_on_cb and modem_off_cb is not defined.

    You seem to have guarded these functions with "#if defined(CONFIG_MQTT_LIB_TLS)" - is this symbol defined at your end?

     

    Kind regards,

    Håkon

Related