From 4fa3dfa0c75e2222663d534a97f1ca62fbdbfe18 Mon Sep 17 00:00:00 2001 From: fj-blanco Date: Wed, 25 Jun 2025 17:08:06 +0200 Subject: [PATCH] Zephyr: add POSIX API support Changes: - Remove duplicate OBSERVE_PERSIST configuration block Improve example build: - Make virtual environment activation optional in Makefile - Remove --fresh flag unsupported in newer west versions - Copy mbedTLS config header to workspace include directory - Add TARGET check for mbedTLS before configuring include directories - Add mbedTLS linking to coap-3 target Add POSIX API support: - Enable CONFIG_POSIX_API=y in examples/zephyr - Replace direct Linux/Windows system calls with Zephyr POSIX API equivalents - Add Zephyr's sys_rand_get() to coap_prng_default() - Define missing network macros (IN_MULTICAST, IN6_IS_ADDR_MULTICAST, etc.) - Add FIONBIO and OPTVAL_T/OPTVAL_GT macro definitions for Zephyr - Add native Zephyr timing functions to replace missing mbedTLS timing support - Fix fd_set mapping using zephyr/net/socket_select.h - Exclude strnlen redefinition conflicts for Zephyr - Add proper IPv6 packet info and address mapped definitions (Patch) Add DNS resolution and net setup to example client: - Enable CONFIG_DNS_RESOLVER for hostname resolution - Add Linux networking setup instructions for native_sim board - Configure static IP gateway and DNS server (8.8.8.8) - Add DHCP vs static IP configuration documentation Co-authored-by: mrdeep1 --- examples/zephyr/Makefile | 9 +++-- examples/zephyr/README | 8 ++++ examples/zephyr/client-src/prj.conf | 19 ++++++++- include/coap3/coap_net.h | 5 +++ include/coap3/libcoap.h | 2 + src/coap_address.c | 26 +++++++++--- src/coap_debug.c | 10 +++-- src/coap_io.c | 24 +++++++++++- src/coap_mbedtls.c | 61 +++++++++++++++++++++++++++++ src/coap_net.c | 9 +++-- src/coap_pdu.c | 3 ++ src/coap_prng.c | 14 ++++++- src/coap_tcp.c | 13 ++++++ zephyr/CMakeLists.txt | 16 +++++--- zephyr/config-mbedtls-libcoap.h | 2 + zephyr/libcoap-mbedtls.conf | 2 +- 16 files changed, 194 insertions(+), 29 deletions(-) diff --git a/examples/zephyr/Makefile b/examples/zephyr/Makefile index 3e4776b0..6ab8e6ce 100644 --- a/examples/zephyr/Makefile +++ b/examples/zephyr/Makefile @@ -4,15 +4,16 @@ all: coap-client coap-client: client-src/src/main.c client-src/* @LIBCOAP_DIR=`pwd`/../.. ;\ - (. $(ZEPHYR_PROJECT)/.venv/bin/activate ;\ + (if [ -f $(ZEPHYR_PROJECT)/.venv/bin/activate ]; then \ + . $(ZEPHYR_PROJECT)/.venv/bin/activate ;\ + fi ;\ + cp $${LIBCOAP_DIR}/zephyr/config-mbedtls-libcoap.h $(ZEPHYR_PROJECT)/zephyr/include/ ;\ cd $(ZEPHYR_PROJECT)/zephyr ;\ west build -p always -b native_sim \ $${LIBCOAP_DIR}/examples/zephyr/client-src -- \ -DCONF_FILE=prj.conf \ -DEXTRA_ZEPHYR_MODULES=$${LIBCOAP_DIR} \ - -DEXTRA_CONF_FILE=$${LIBCOAP_DIR}/zephyr/libcoap-mbedtls.conf \ - --fresh ;\ - deactivate) + -DEXTRA_CONF_FILE=$${LIBCOAP_DIR}/zephyr/libcoap-mbedtls.conf) @cp -f $(ZEPHYR_PROJECT)/zephyr/build/zephyr/zephyr.exe coap-client clean: diff --git a/examples/zephyr/README b/examples/zephyr/README index 0ec393d0..e50022da 100644 --- a/examples/zephyr/README +++ b/examples/zephyr/README @@ -10,3 +10,11 @@ To build the coap-client example, do The executable gets built in ~/zephyrproject/zephyr/build/zephyr/zephyr.exe which is then copied to coap-client . + +For using the native_sim board using Linux, you may need to do something like +the following (ens32 is the external interface name) + + $ sudo iptables -t nat -A POSTROUTING -o ens32 -j MASQUERADE + $ sudo sysctl -w net.ipv4.conf.all.forwarding=1 + +so that ./coap-client is able to get out onto the internet. diff --git a/examples/zephyr/client-src/prj.conf b/examples/zephyr/client-src/prj.conf index 31b42b9d..2bd4f2dc 100644 --- a/examples/zephyr/client-src/prj.conf +++ b/examples/zephyr/client-src/prj.conf @@ -3,7 +3,8 @@ CONFIG_NET_UDP=y CONFIG_NET_TCP=y CONFIG_NET_IPV6=y CONFIG_NET_IPV4=y -#CONFIG_NET_DHCPV4=y +CONFIG_POSIX_API=y +CONFIG_DNS_RESOLVER=y CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y @@ -28,10 +29,24 @@ CONFIG_NET_SHELL=y CONFIG_NET_CONFIG_SETTINGS=y CONFIG_NET_CONFIG_NEED_IPV6=y CONFIG_NET_CONFIG_NEED_IPV4=y + +# +# Either set DHCP or static addresses +# + +# DHCP + +#CONFIG_NET_DHCPV4=y +#CONFIG_NET_DHCPV6=y + +# Static IP & DNS + CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1" CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::2" CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" -CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2" +CONFIG_NET_CONFIG_MY_IPV4_GW="192.0.2.2" +CONFIG_DNS_SERVER_IP_ADDRESSES=y +CONFIG_DNS_SERVER1="8.8.8.8:53" CONFIG_NET_L2_ETHERNET=y diff --git a/include/coap3/coap_net.h b/include/coap3/coap_net.h index 3490fbbb..bb953773 100644 --- a/include/coap3/coap_net.h +++ b/include/coap3/coap_net.h @@ -31,6 +31,11 @@ #include #endif +#if defined(__ZEPHYR__) && !defined(__unix__) && !defined(__linux__) +#include +#define fd_set zsock_fd_set +#endif + #include "coap_io.h" #include "coap_dtls.h" #include "coap_event.h" diff --git a/include/coap3/libcoap.h b/include/coap3/libcoap.h index c434cfb3..d30061af 100644 --- a/include/coap3/libcoap.h +++ b/include/coap3/libcoap.h @@ -38,6 +38,8 @@ typedef USHORT in_port_t; #define _IN_PORT_T_DECLARED #endif #endif /* !defined(__MINGW32__) */ +#elif defined(__ZEPHYR__) +#include #elif !defined (CONTIKI) && !defined (WITH_LWIP) && !defined (RIOT_VERSION) #include #include diff --git a/src/coap_address.c b/src/coap_address.c index 0f1a99ed..1393bdf8 100644 --- a/src/coap_address.c +++ b/src/coap_address.c @@ -16,6 +16,7 @@ #include "coap3/coap_libcoap_build.h" #if !defined(WITH_CONTIKI) && !defined(WITH_LWIP) && !defined(RIOT_VERSION) +#ifndef __ZEPHYR__ #ifdef HAVE_ARPA_INET_H #include #endif @@ -34,6 +35,19 @@ #ifdef HAVE_WS2TCPIP_H #include #endif +#else /* __ZEPHYR__ */ +#ifndef IN_MULTICAST +#define IN_MULTICAST(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000) +#endif +#ifndef IN6_IS_ADDR_MULTICAST +#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) +#endif +#ifndef IN6_IS_ADDR_V4MAPPED +#define IN6_IS_ADDR_V4MAPPED(a) \ + ((((a)->s6_addr32[0]) == 0) && (((a)->s6_addr32[1]) == 0) && \ + (((a)->s6_addr32[2]) == htonl(0xffff))) +#endif +#endif /* __ZEPHYR__ */ #ifdef RIOT_VERSION /* FIXME */ @@ -159,20 +173,20 @@ coap_is_mcast(const coap_address_t *a) { #define COAP_BCST_REFRESH_SECS 30 #endif /* COAP_BCST_REFRESH_SECS */ -#if COAP_IPV4_SUPPORT && defined(HAVE_IFADDRS_H) +#if COAP_IPV4_SUPPORT && defined(HAVE_IFADDRS_H) && !defined(__ZEPHYR__) static int bcst_cnt = -1; static coap_tick_t last_refresh; static struct in_addr b_ipv4[COAP_BCST_CNT]; -#endif /* COAP_IPV4_SUPPORT && HAVE_IFADDRS_H */ +#endif /* COAP_IPV4_SUPPORT && HAVE_IFADDRS_H && !defined(__ZEPHYR__) */ int coap_is_bcast(const coap_address_t *a) { #if COAP_IPV4_SUPPORT struct in_addr ipv4; -#if defined(HAVE_IFADDRS_H) +#if defined(HAVE_IFADDRS_H) && !defined(__ZEPHYR__) int i; coap_tick_t now; -#endif /* HAVE_IFADDRS_H */ +#endif /* HAVE_IFADDRS_H && !defined(__ZEPHYR__) */ #endif /* COAP_IPV4_SUPPORT */ if (!a) @@ -205,7 +219,7 @@ coap_is_bcast(const coap_address_t *a) { if (ipv4.s_addr == INADDR_BROADCAST) return 1; -#if defined(HAVE_IFADDRS_H) +#if defined(HAVE_IFADDRS_H) && !defined(__ZEPHYR__) coap_ticks(&now); if (bcst_cnt == -1 || (now - last_refresh) > (COAP_BCST_REFRESH_SECS * COAP_TICKS_PER_SECOND)) { @@ -247,7 +261,7 @@ coap_is_bcast(const coap_address_t *a) { if (ipv4.s_addr == b_ipv4[i].s_addr) return 1; } -#endif /* HAVE_IFADDRS_H */ +#endif /* HAVE_IFADDRS_H && !defined(__ZEPHYR__) */ return 0; #endif /* COAP_IPV4_SUPPORT */ } diff --git a/src/coap_debug.c b/src/coap_debug.c index 6ab6adae..b8ed3828 100644 --- a/src/coap_debug.c +++ b/src/coap_debug.c @@ -24,12 +24,14 @@ #include #include +#ifndef __ZEPHYR__ #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif +#endif /* !__ZEPHYR__ */ #ifdef HAVE_TIME_H #include @@ -168,7 +170,7 @@ print_timestamp(char *s, size_t len, coap_tick_t t) { #endif /* HAVE_TIME_H */ -#if !defined(HAVE_STRNLEN) && !defined(__MINGW32__) +#if !defined(HAVE_STRNLEN) && !defined(__MINGW32__) && !defined(__ZEPHYR__) /** * A length-safe strlen() fake. * @@ -184,7 +186,7 @@ strnlen(const char *s, size_t maxlen) { ++n; return n; } -#endif /* HAVE_STRNLEN && !__MINGW32__ */ +#endif /* HAVE_STRNLEN && !__MINGW32__ && !__ZEPHYR__*/ static size_t print_readable(const uint8_t *data, size_t len, @@ -237,7 +239,7 @@ print_readable(const uint8_t *data, size_t len, */ size_t coap_print_addr(const coap_address_t *addr, unsigned char *buf, size_t len) { -#if (defined( HAVE_ARPA_INET_H ) || defined( HAVE_WS2TCPIP_H )) && !defined(RIOT_VERSION) +#if (defined( HAVE_ARPA_INET_H ) || defined( HAVE_WS2TCPIP_H )) && !defined(RIOT_VERSION) || defined(__ZEPHYR__) char scratch[INET6_ADDRSTRLEN]; assert(buf); @@ -413,7 +415,7 @@ coap_print_addr(const coap_address_t *addr, unsigned char *buf, size_t len) { */ const char * coap_print_ip_addr(const coap_address_t *addr, char *buf, size_t len) { -#if (defined( HAVE_ARPA_INET_H ) || defined( HAVE_WS2TCPIP_H )) && !defined(RIOT_VERSION) +#if (defined( HAVE_ARPA_INET_H ) || defined( HAVE_WS2TCPIP_H )) && !defined(RIOT_VERSION) || defined(__ZEPHYR__) const void *addrptr = NULL; assert(buf); diff --git a/src/coap_io.c b/src/coap_io.c index e4f7dff9..6b919cea 100644 --- a/src/coap_io.c +++ b/src/coap_io.c @@ -19,6 +19,7 @@ # include #endif +#ifndef __ZEPHYR__ #ifdef HAVE_SYS_SELECT_H # include #endif @@ -56,6 +57,25 @@ #include #endif #endif /* COAP_EPOLL_SUPPORT */ +#else /* __ZEPHYR__ */ +#include +#include +#define OPTVAL_T(t) (const void*)(t) +#define OPTVAL_GT(t) (void*)(t) + +#ifndef IPV6_PKTINFO +#ifdef IPV6_RECVPKTINFO +#define IPV6_PKTINFO IPV6_RECVPKTINFO +#else +#define IPV6_PKTINFO IP_PKTINFO +#endif +#ifndef IN6_IS_ADDR_V4MAPPED +#define IN6_IS_ADDR_V4MAPPED(a) \ + ((((a)->s6_addr32[0]) == 0) && (((a)->s6_addr32[1]) == 0) && \ + (((a)->s6_addr32[2]) == htonl(0xffff))) +#endif +#endif +#endif /* __ZEPHYR__ */ #if !defined(WITH_CONTIKI) && !defined(RIOT_VERSION) && !defined(WITH_LWIP) /* define generic PKTINFO for IPv4 */ @@ -719,7 +739,7 @@ coap_socket_read(coap_socket_t *sock, uint8_t *data, size_t data_len) { #endif /* ! WITH_CONTIKI && ! WITH_LWIP && ! RIOT_VERSION */ -#if !defined(WITH_LWIP) +#if !defined(WITH_LWIP) && !defined(__ZEPHYR__) #if (!defined(WITH_CONTIKI)) != ( defined(HAVE_NETINET_IN_H) || defined(HAVE_WS2TCPIP_H) ) /* define struct in6_pktinfo and struct in_pktinfo if not available FIXME: check with configure @@ -737,7 +757,7 @@ struct in_pktinfo { }; #endif /* ! __MINGW32__ && ! RIOT_VERSION */ #endif -#endif /* ! WITH_LWIP */ +#endif /* ! WITH_LWIP && ! __ZEPHYR__ */ #if !defined(WITH_CONTIKI) && !defined(SOL_IP) /* Solaris expects level IPPROTO_IP for ancillary data. */ diff --git a/src/coap_mbedtls.c b/src/coap_mbedtls.c index e8ef52aa..4f17dffa 100644 --- a/src/coap_mbedtls.c +++ b/src/coap_mbedtls.c @@ -173,6 +173,57 @@ typedef enum coap_enc_method_t { COAP_ENC_ECJPAKE, } coap_enc_method_t; +#ifdef __ZEPHYR__ + +typedef struct { + uint32_t start_time; + uint32_t int_time; + uint32_t fin_time; +} zephyr_timing_delay_context; + +static void +zephyr_timing_set_delay(void *data, uint32_t int_ms, uint32_t fin_ms) { + zephyr_timing_delay_context *ctx = (zephyr_timing_delay_context *)data; + + if (ctx == NULL) { + return; + } + + ctx->start_time = k_uptime_get_32(); + + if (fin_ms != 0) { + ctx->int_time = ctx->start_time + int_ms; + ctx->fin_time = ctx->start_time + fin_ms; + } else { + ctx->int_time = 0; + ctx->fin_time = 0; + } +} + +static int +zephyr_timing_get_delay(void *data) { + zephyr_timing_delay_context *ctx = (zephyr_timing_delay_context *)data; + uint32_t now; + + if (ctx == NULL || ctx->fin_time == 0) { + return -1; + } + + now = k_uptime_get_32(); + + if (now >= ctx->fin_time) { + return 2; + } + + if (now >= ctx->int_time) { + return 1; + } + + return 0; +} + +#endif /* __ZEPHYR__ */ + #ifndef MBEDTLS_2_X_COMPAT /* * mbedtls_ callback functions expect 0 on success, -ve on failure. @@ -1904,9 +1955,15 @@ coap_dtls_new_mbedtls_env(coap_session_t *c_session, mbedtls_ssl_set_hs_ecjpake_password(&m_env->ssl, psk_key->s, psk_key->length); } #endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */ +#ifdef __ZEPHYR__ + mbedtls_ssl_set_timer_cb(&m_env->ssl, &m_env->timer, + zephyr_timing_set_delay, + zephyr_timing_get_delay); +#else mbedtls_ssl_set_timer_cb(&m_env->ssl, &m_env->timer, mbedtls_timing_set_delay, mbedtls_timing_get_delay); +#endif mbedtls_ssl_conf_dbg(&m_env->conf, mbedtls_debug_out, stdout); return m_env; @@ -2371,7 +2428,11 @@ coap_dtls_get_context_timeout(void *dtls_context COAP_UNUSED) { coap_tick_t coap_dtls_get_timeout(coap_session_t *c_session, coap_tick_t now) { coap_mbedtls_env_t *m_env = (coap_mbedtls_env_t *)c_session->tls; +#ifdef __ZEPHYR__ + int ret = zephyr_timing_get_delay(&m_env->timer); +#else int ret = mbedtls_timing_get_delay(&m_env->timer); +#endif unsigned int scalar = 1 << m_env->retry_scalar; assert(c_session->state == COAP_SESSION_STATE_HANDSHAKE); diff --git a/src/coap_net.c b/src/coap_net.c index 273bf006..18a95319 100644 --- a/src/coap_net.c +++ b/src/coap_net.c @@ -21,6 +21,8 @@ #ifdef HAVE_LIMITS_H #include #endif + +#ifndef __ZEPHYR__ #ifdef HAVE_UNISTD_H #include #else @@ -57,6 +59,7 @@ #ifdef HAVE_NETDB_H #include #endif +#endif /* !__ZEPHYR__ */ #ifdef WITH_LWIP #include @@ -5144,7 +5147,7 @@ coap_register_option_lkd(coap_context_t *ctx, uint16_t type) { coap_option_filter_set(&ctx->known_options, type); } -#if ! defined WITH_CONTIKI && ! defined WITH_LWIP && ! defined RIOT_VERSION +#if ! defined WITH_CONTIKI && ! defined WITH_LWIP && ! defined RIOT_VERSION && !defined(__ZEPHYR__) #if COAP_SERVER_SUPPORT COAP_API int coap_join_mcast_group_intf(coap_context_t *ctx, const char *group_name, @@ -5438,7 +5441,7 @@ coap_mcast_set_hops(coap_session_t *session, size_t hops) { } #endif /* COAP_CLIENT_SUPPORT */ -#else /* defined WITH_CONTIKI || defined WITH_LWIP */ +#else /* defined WITH_CONTIKI || defined WITH_LWIP || defined RIOT_VERSION || defined(__ZEPHYR__) */ COAP_API int coap_join_mcast_group_intf(coap_context_t *ctx COAP_UNUSED, const char *group_name COAP_UNUSED, @@ -5455,4 +5458,4 @@ coap_mcast_set_hops(coap_session_t *session COAP_UNUSED, void coap_mcast_per_resource(coap_context_t *context COAP_UNUSED) { } -#endif /* defined WITH_CONTIKI || defined WITH_LWIP */ +#endif /* defined WITH_CONTIKI || defined WITH_LWIP || defined RIOT_VERSION || defined(__ZEPHYR__) */ diff --git a/src/coap_pdu.c b/src/coap_pdu.c index a33948f8..675ad4b3 100644 --- a/src/coap_pdu.c +++ b/src/coap_pdu.c @@ -22,12 +22,15 @@ #include #include #include +#ifndef __ZEPHYR__ #ifdef HAVE_ARPA_INET_H #include #endif #ifdef HAVE_WINSOCK2_H #include #endif +#endif /* !__ZEPHYR__ */ + #include #ifndef min diff --git a/src/coap_prng.c b/src/coap_prng.c index 877ef83a..e343a66d 100644 --- a/src/coap_prng.c +++ b/src/coap_prng.c @@ -16,7 +16,10 @@ #include "coap3/coap_libcoap_build.h" -#ifdef HAVE_GETRANDOM + +#if defined(__ZEPHYR__) +#include +#elif defined(HAVE_GETRANDOM) #include #elif defined(WITH_CONTIKI) #include "lib/csprng.h" @@ -107,6 +110,15 @@ coap_prng_default(void *buf, size_t len) { /* mbedtls_hardware_poll() returns 0 on success */ return (mbedtls_hardware_poll(NULL, buf, len, NULL) ? 0 : 1); +#elif defined(__ZEPHYR__) + /* Use Zephyr's cryptographically secure random number generator */ + if (!buf || len == 0) { + return 0; + } + + sys_rand_get(buf, len); + return 1; + #elif defined(HAVE_GETRANDOM) return (getrandom(buf, len, 0) > 0) ? 1 : 0; diff --git a/src/coap_tcp.c b/src/coap_tcp.c index c07f11e9..a76abd3b 100644 --- a/src/coap_tcp.c +++ b/src/coap_tcp.c @@ -48,6 +48,19 @@ coap_tcp_is_supported(void) { # define CMSG_DATA WSA_CMSG_DATA #endif +#if defined(__ZEPHYR__) +# include +# ifndef OPTVAL_T +# define OPTVAL_T(t) (t) +# endif +# ifndef OPTVAL_GT +# define OPTVAL_GT(t) (t) +# endif +# ifndef FIONBIO +# define FIONBIO 0x5421 +# endif +#endif /* __ZEPHYR__ */ + int coap_socket_connect_tcp1(coap_socket_t *sock, const coap_address_t *local_if, diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 5cbca0cc..3b2e1d0e 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -47,11 +47,6 @@ if(CONFIG_LIBCOAP) else() set (WITH_OBSERVE_PERSIST OFF) endif() - if (CONFIG_LIBCOAP_OBSERVE_PERSIST) - set (WITH_OBSERVE_PERSIST ON) - else() - set (WITH_OBSERVE_PERSIST OFF) - endif() if (CONFIG_LIBCOAP_TCP_SUPPORT) set (ENABLE_TCP ON) else() @@ -101,13 +96,22 @@ if(CONFIG_LIBCOAP) set (ENABLE_THREAD_RECURSIVE_LOCK_CHECK OFF) if(CONFIG_MBEDTLS) - target_include_directories(mbedTLS INTERFACE ${ZEPHYR_LIBCOAP_MODULE_DIR}/include) + if(TARGET mbedTLS) + target_include_directories(mbedTLS INTERFACE ${ZEPHYR_LIBCOAP_MODULE_DIR}/include) + else() + message(WARNING "mbedTLS target not found.") + endif() endif() add_subdirectory(.. build) target_compile_definitions(coap-3 PUBLIC WITH_ZEPHYR) target_compile_definitions(coap-3 PUBLIC COAP_MEMORY_TYPE_TRACK=1) target_link_libraries(coap-3 PUBLIC zephyr_interface) + + if(CONFIG_MBEDTLS AND TARGET mbedTLS) + target_link_libraries(coap-3 PUBLIC mbedTLS) + endif() + set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS coap-3) target_link_libraries(app PUBLIC coap-3) diff --git a/zephyr/config-mbedtls-libcoap.h b/zephyr/config-mbedtls-libcoap.h index a5c1af17..bb7c9102 100644 --- a/zephyr/config-mbedtls-libcoap.h +++ b/zephyr/config-mbedtls-libcoap.h @@ -11,9 +11,11 @@ #ifndef CONFIG_MBEDTLS_LIBCOAP_H #define CONFIG_MBEDTLS_LIBCOAP_H +#if defined(__unix__) || defined(_WIN32) #ifndef MBEDTLS_TIMING_C #define MBEDTLS_TIMING_C #endif /* ! MBEDTLS_TIMING_C */ +#endif /* Unix/Windows platforms */ #ifndef MBEDTLS_VERSION_C #define MBEDTLS_VERSION_C diff --git a/zephyr/libcoap-mbedtls.conf b/zephyr/libcoap-mbedtls.conf index 69ab2f2b..3328f1ad 100644 --- a/zephyr/libcoap-mbedtls.conf +++ b/zephyr/libcoap-mbedtls.conf @@ -12,5 +12,5 @@ CONFIG_NET_BUF_TX_COUNT=80 CONFIG_ZVFS_OPEN_MAX=20 # CONFIG_MBEDTLS_USER_CONFIG_ENABLE=y -CONFIG_MBEDTLS_USER_CONFIG_FILE="../zephyr/config-mbedtls-libcoap.h" +CONFIG_MBEDTLS_USER_CONFIG_FILE="config-mbedtls-libcoap.h" #