diff --git a/hal/inc/hal_platform.h b/hal/inc/hal_platform.h index 58f32764b5..f09dc78233 100644 --- a/hal/inc/hal_platform.h +++ b/hal/inc/hal_platform.h @@ -142,6 +142,10 @@ #define HAL_PLATFORM_NCP_UPDATABLE (0) #endif /* HAL_PLATFORM_NCP_UPDATABLE */ +#ifndef HAL_PLATFORM_NCP_UPDATES_DISABLED +#define HAL_PLATFORM_NCP_UPDATES_DISABLED (0) +#endif /* HAL_PLATFORM_NCP_UPDATES_DISABLED */ + #ifndef HAL_PLATFORM_MCU_ANY #define HAL_PLATFORM_MCU_ANY (0xFF) #endif // HAL_PLATFORM_MCU_ANY diff --git a/hal/network/ncp/wifi/platform_ncp_update.cpp b/hal/network/ncp/wifi/platform_ncp_update.cpp index 472590999e..1b59900e71 100644 --- a/hal/network/ncp/wifi/platform_ncp_update.cpp +++ b/hal/network/ncp/wifi/platform_ncp_update.cpp @@ -124,6 +124,7 @@ int getWifiNcpFirmwareVersion(uint16_t* ncpVersion) { } // anonymous int platform_ncp_update_module(const hal_module_t* module) { +#if !HAL_PLATFORM_NCP_UPDATES_DISABLED const auto ncpClient = particle::wifiNetworkManager()->ncpClient(); SPARK_ASSERT(ncpClient); OtaUpdateSourceStream::ReadStreamFunc readCallback; @@ -156,6 +157,9 @@ int platform_ncp_update_module(const hal_module_t* module) { LOG(INFO, "ESP32 firmware version updated to version %d", version); } return HAL_UPDATE_APPLIED; +#else + return SYSTEM_ERROR_NOT_SUPPORTED; +#endif // !HAL_PLATFORM_NCP_UPDATES_DISABLED } int platform_ncp_fetch_module_info(hal_module_t* module) { diff --git a/hal/network/ncp_client/esp32/esp32_ncp_client.cpp b/hal/network/ncp_client/esp32/esp32_ncp_client.cpp index 91b4761cda..55ebd48030 100644 --- a/hal/network/ncp_client/esp32/esp32_ncp_client.cpp +++ b/hal/network/ncp_client/esp32/esp32_ncp_client.cpp @@ -296,6 +296,7 @@ int Esp32NcpClient::getFirmwareModuleVersionImpl(uint16_t* ver) { } int Esp32NcpClient::updateFirmware(InputStream* file, size_t size) { +#if !HAL_PLATFORM_NCP_UPDATES_DISABLED const NcpClientLock lock(this); CHECK(checkParser()); auto resp = parser_.sendCommand("AT+FWUPD=%u", (unsigned)size); @@ -351,6 +352,9 @@ int Esp32NcpClient::updateFirmware(InputStream* file, size_t size) { off(); CHECK(on()); return 0; +#else + return SYSTEM_ERROR_NOT_SUPPORTED; +#endif // !HAL_PLATFORM_NCP_UPDATES_DISABLED } void Esp32NcpClient::processEvents() { diff --git a/hal/network/ncp_client/sara/sara_ncp_client.cpp b/hal/network/ncp_client/sara/sara_ncp_client.cpp index 56a3545353..bed3f0b728 100644 --- a/hal/network/ncp_client/sara/sara_ncp_client.cpp +++ b/hal/network/ncp_client/sara/sara_ncp_client.cpp @@ -1999,7 +1999,11 @@ int SaraNcpClient::configureApn(const CellularNetworkConfig& conf) { CHECK_PARSER_OK(setModuleFunctionality(CellularFunctionality::AIRPLANE)); auto resp = parser_.sendCommand("AT+CGDCONT=%d,\"%s\",\"%s%s\"", UBLOX_DEFAULT_CID, UBLOX_DEFAULT_PDP_TYPE, +#if CHAP_SUPPORT (netConf_.hasUser() && netConf_.hasPassword()) ? "CHAP:" : "", +#else + "", +#endif // CHAP_SUPPORT netConf_.hasApn() ? netConf_.apn() : ""); const int r = CHECK_PARSER(resp.readResult()); CHECK_TRUE(r == AtResponse::OK, SYSTEM_ERROR_AT_NOT_OK); diff --git a/hal/src/nRF52840/hal_platform_nrf52840_config.h b/hal/src/nRF52840/hal_platform_nrf52840_config.h index 0922dbb11e..2a36b7d766 100644 --- a/hal/src/nRF52840/hal_platform_nrf52840_config.h +++ b/hal/src/nRF52840/hal_platform_nrf52840_config.h @@ -105,7 +105,7 @@ #define HAL_PLATFORM_RESUMABLE_OTA (1) #ifndef HAL_PLATFORM_ERROR_MESSAGES -#define HAL_PLATFORM_ERROR_MESSAGES (1) +#define HAL_PLATFORM_ERROR_MESSAGES (0) #endif // HAL_PLATFORM_ERROR_MESSAGES #define HAL_PLATFORM_PROHIBIT_XIP (1) diff --git a/hal/src/nRF52840/lwip/lwipopts.h b/hal/src/nRF52840/lwip/lwipopts.h index 3f91c22e04..bd50666ff7 100644 --- a/hal/src/nRF52840/lwip/lwipopts.h +++ b/hal/src/nRF52840/lwip/lwipopts.h @@ -451,14 +451,14 @@ void sys_unlock_tcpip_core(void); * this option does not affect outgoing packet sizes, which can be controlled * via IP_FRAG. */ -#define IP_REASSEMBLY 1 +#define IP_REASSEMBLY (PLATFORM_ID != PLATFORM_TRACKER) /** * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note * that this option does not affect incoming packet sizes, which can be * controlled via IP_REASSEMBLY. */ -#define IP_FRAG 1 +#define IP_FRAG (PLATFORM_ID != PLATFORM_TRACKER) /** * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. @@ -1635,11 +1635,11 @@ void sys_unlock_tcpip_core(void); /** * LWIP_IPV6==1: Enable IPv6 */ -#if PLATFORM_ID != PLATFORM_TRACKER -#define LWIP_IPV6 1 -#else +// #if PLATFORM_ID != PLATFORM_TRACKER +// #define LWIP_IPV6 1 +// #else #define LWIP_IPV6_DEFINES_ONLY 1 -#endif // PLATFORM_ID != PLATFORM_TRACKER +// #endif // PLATFORM_ID != PLATFORM_TRACKER /** * IPV6_REASS_MAXAGE: Maximum time (in multiples of IP6_REASS_TMR_INTERVAL - so seconds, normally) diff --git a/hal/src/nRF52840/lwip/lwippppopts.h b/hal/src/nRF52840/lwip/lwippppopts.h index 404cc432be..df8add6b22 100644 --- a/hal/src/nRF52840/lwip/lwippppopts.h +++ b/hal/src/nRF52840/lwip/lwippppopts.h @@ -176,7 +176,7 @@ /** * CHAP_SUPPORT==1: Support CHAP. */ -#define CHAP_SUPPORT (PLATFORM_ID != PLATFORM_TRACKER) +#define CHAP_SUPPORT 0 /** * MSCHAP_SUPPORT==1: Support MSCHAP. @@ -294,7 +294,7 @@ /** * LWIP_USE_EXTERNAL_MBEDTLS: Use external mbed TLS library */ -#define LWIP_USE_EXTERNAL_MBEDTLS 0 +#define LWIP_USE_EXTERNAL_MBEDTLS 1 /* * PPP Timeouts diff --git a/hal/src/nRF52840/mbedtls/mbedtls_config_platform.h b/hal/src/nRF52840/mbedtls/mbedtls_config_platform.h index 5aa9a9ebbc..6e1d9dee1c 100644 --- a/hal/src/nRF52840/mbedtls/mbedtls_config_platform.h +++ b/hal/src/nRF52840/mbedtls/mbedtls_config_platform.h @@ -2352,7 +2352,7 @@ * * This module is required for SSL/TLS server support. */ -#define MBEDTLS_SSL_SRV_C +//#define MBEDTLS_SSL_SRV_C /** * \def MBEDTLS_SSL_TLS_C diff --git a/hal/src/tracker/hal_platform_config.h b/hal/src/tracker/hal_platform_config.h index 5e92fe3c59..ed75b266e6 100644 --- a/hal/src/tracker/hal_platform_config.h +++ b/hal/src/tracker/hal_platform_config.h @@ -16,6 +16,7 @@ #define HAL_PLATFORM_I2C_BUFFER_SIZE(x) (x == HAL_I2C_INTERFACE2 ? 512 : HAL_PLATFORM_I2C_BUFFER_SIZE_DEFAULT) #define HAL_PLATFORM_USART_NUM (2) #define HAL_PLATFORM_NCP_UPDATABLE (1) +#define HAL_PLATFORM_NCP_UPDATES_DISABLED (1) #define HAL_PLATFORM_ESP32_NCP (1) #define HAL_PLATFORM_PMIC_BQ24195 (1) diff --git a/modules/shared/nRF52840/part1_build.mk b/modules/shared/nRF52840/part1_build.mk index dc725bdc42..179eab8bc3 100644 --- a/modules/shared/nRF52840/part1_build.mk +++ b/modules/shared/nRF52840/part1_build.mk @@ -59,6 +59,9 @@ endif LDFLAGS += -u uxTopUsedPriority -Wl,--wrap=InitSwHash512 -Wl,--wrap=ProcessSwHash512 -Wl,--wrap=FinishSwHash512 +# Disable float support in wiring Print +GLOBAL_DEFINES += PARTICLE_WIRING_PRINT_NO_FLOAT + INCLUDE_DIRS += $(SHARED_MODULAR)/inc/system-part1 SYSTEM_PART1_MODULE_SRC_PATH = $(SYSTEM_PART1_MODULE_PATH)/src diff --git a/modules/shared/system_module_version.mk b/modules/shared/system_module_version.mk index ce05fa7e27..063181959a 100644 --- a/modules/shared/system_module_version.mk +++ b/modules/shared/system_module_version.mk @@ -67,8 +67,12 @@ endif else # There is no need to carry SoftDevice dependency on Tracker, since they are manufactured # with the latest one. Update NCP firmware instead. -ESP32_NCP_DEPENDENCY = 7 -SYSTEM_PART1_MODULE_DEPENDENCY2 ?= ${MODULE_FUNCTION_NCP_FIRMWARE},0,${ESP32_NCP_DEPENDENCY} + +# Since 5.6.0 NCP updates are disabled. Device should be above 3.0.0-alpha.2 (3001) +# to already have latest ESP32 NCP firmware. +# ESP32_NCP_DEPENDENCY = 7 +# SYSTEM_PART1_MODULE_DEPENDENCY2 ?= ${MODULE_FUNCTION_NCP_FIRMWARE},0,${ESP32_NCP_DEPENDENCY} +SYSTEM_PART1_MODULE_DEPENDENCY2 ?= ${MODULE_FUNCTION_SYSTEM_PART},1,3001 endif endif endif # ($(PLATFORM_MCU),nRF52840) diff --git a/third_party/lwip/lwip b/third_party/lwip/lwip index 1001b17868..653a56a023 160000 --- a/third_party/lwip/lwip +++ b/third_party/lwip/lwip @@ -1 +1 @@ -Subproject commit 1001b17868a17cf0d594e069c172794cf0c1416a +Subproject commit 653a56a02379c7b138f8fb7bd3ff55df15bd9fd0 diff --git a/wiring/inc/spark_wiring_print.h b/wiring/inc/spark_wiring_print.h index ef07b6e179..7884a3af4b 100644 --- a/wiring/inc/spark_wiring_print.h +++ b/wiring/inc/spark_wiring_print.h @@ -59,7 +59,9 @@ class Print size_t printNumber(unsigned long, uint8_t); size_t printNumber(unsigned long long, uint8_t); +#ifndef PARTICLE_WIRING_PRINT_NO_FLOAT size_t printFloat(double, uint8_t); +#endif // PARTICLE_WIRING_PRINT_NO_FLOAT protected: void setWriteError(int err = 1) { write_error = err; } @@ -82,8 +84,11 @@ class Print template ::value && (std::is_integral::value || std::is_convertible::value || std::is_convertible::value), int> = 0> size_t print(T, int = DEC); +#ifndef PARTICLE_WIRING_PRINT_NO_FLOAT size_t print(float, int = 2); size_t print(double, int = 2); +#endif // PARTICLE_WIRING_PRINT_NO_FLOAT + size_t print(const Printable&); size_t print(const __FlashStringHelper*); @@ -96,8 +101,10 @@ class Print n += println(); return n; } +#ifndef PARTICLE_WIRING_PRINT_NO_FLOAT size_t println(float, int = 2); size_t println(double, int = 2); +#endif // PARTICLE_WIRING_PRINT_NO_FLOAT size_t println(const Printable&); size_t println(void); size_t println(const __FlashStringHelper*); diff --git a/wiring/src/spark_wiring_print.cpp b/wiring/src/spark_wiring_print.cpp index 7b83c94aef..fe47a07738 100644 --- a/wiring/src/spark_wiring_print.cpp +++ b/wiring/src/spark_wiring_print.cpp @@ -60,6 +60,7 @@ size_t Print::print(char c) return write(c); } +#ifndef PARTICLE_WIRING_PRINT_NO_FLOAT size_t Print::print(float n, int digits) { return printFloat((double)n, digits); @@ -69,6 +70,7 @@ size_t Print::print(double n, int digits) { return printFloat(n, digits); } +#endif // PARTICLE_WIRING_PRINT_NO_FLOAT size_t Print::print(const Printable& x) { @@ -101,6 +103,7 @@ size_t Print::println(char c) return n; } +#ifndef PARTICLE_WIRING_PRINT_NO_FLOAT size_t Print::println(float num, int digits) { return println((double)num, digits); @@ -112,6 +115,7 @@ size_t Print::println(double num, int digits) n += println(); return n; } +#endif // PARTICLE_WIRING_PRINT_NO_FLOAT size_t Print::println(const Printable& x) { @@ -166,6 +170,7 @@ size_t Print::printNumber(unsigned long n, uint8_t base) { return write(str); } +#ifndef PARTICLE_WIRING_PRINT_NO_FLOAT size_t Print::printFloat(double number, uint8_t digits) { size_t n = 0; @@ -210,6 +215,7 @@ size_t Print::printFloat(double number, uint8_t digits) return n; } +#endif // PARTICLE_WIRING_PRINT_NO_FLOAT size_t Print::vprintf(bool newline, const char* format, va_list args) {