diff --git a/cores/arduino/Serial.h b/cores/arduino/Serial.h index f511256ad..2cdd7c0f4 100644 --- a/cores/arduino/Serial.h +++ b/cores/arduino/Serial.h @@ -76,7 +76,6 @@ class UART : public HardwareSerial { mbed_usb_serial* _usb_serial = NULL; PinName _tx, _rx, _rts, _cts; RingBufferN<256> rx_buffer; - uint8_t intermediate_buf[4]; bool is_usb = false; }; } diff --git a/cores/arduino/mbed/connectivity/drivers/emac/COMPONENT_WHD/interface/WhdSTAInterface.h b/cores/arduino/mbed/connectivity/drivers/emac/COMPONENT_WHD/interface/WhdSTAInterface.h index bfe933bac..8d8f54075 100644 --- a/cores/arduino/mbed/connectivity/drivers/emac/COMPONENT_WHD/interface/WhdSTAInterface.h +++ b/cores/arduino/mbed/connectivity/drivers/emac/COMPONENT_WHD/interface/WhdSTAInterface.h @@ -122,6 +122,7 @@ class WhdSTAInterface : public WiFiInterface, public EMACInterface { nsapi_error_t set_timeout(uint32_t timeout) { _timeout = timeout; + return NSAPI_ERROR_OK; } /** Set blocking status of interface. diff --git a/cores/arduino/mbed/connectivity/drivers/wifi/COMPONENT_WHD/wifi-host-driver/inc/whd_version.h b/cores/arduino/mbed/connectivity/drivers/wifi/COMPONENT_WHD/wifi-host-driver/inc/whd_version.h index 1caef23b6..5f69d8c3e 100755 --- a/cores/arduino/mbed/connectivity/drivers/wifi/COMPONENT_WHD/wifi-host-driver/inc/whd_version.h +++ b/cores/arduino/mbed/connectivity/drivers/wifi/COMPONENT_WHD/wifi-host-driver/inc/whd_version.h @@ -15,6 +15,7 @@ * limitations under the License. */ -#define WHD_VERSION "v1.94.0" +/* This define is used by arduino::WiFiClass::firmwareVersion() do not prepend v */ +#define WHD_VERSION "1.94.0" #define WHD_BRANCH "v1.94.0" #define WHD_DATE "2021-04-27 16:54:34 +0800" diff --git a/cores/arduino/mbed/connectivity/netsocket/include/netsocket/ICMPSocket.h b/cores/arduino/mbed/connectivity/netsocket/include/netsocket/ICMPSocket.h index 1837bc8e0..5e1ee8fb0 100644 --- a/cores/arduino/mbed/connectivity/netsocket/include/netsocket/ICMPSocket.h +++ b/cores/arduino/mbed/connectivity/netsocket/include/netsocket/ICMPSocket.h @@ -37,6 +37,10 @@ class ICMPSocket : public InternetDatagramSocket { */ ICMPSocket(); +#if MBED_CONF_LWIP_RAW_SOCKET_ENABLED + int ping(SocketAddress &socketAddress, uint32_t timeout); +#endif + #if !defined(DOXYGEN_ONLY) protected: diff --git a/libraries/Arduino_H7_Video/src/Arduino_H7_Video.cpp b/libraries/Arduino_H7_Video/src/Arduino_H7_Video.cpp index f6199a18d..460a1793a 100644 --- a/libraries/Arduino_H7_Video/src/Arduino_H7_Video.cpp +++ b/libraries/Arduino_H7_Video/src/Arduino_H7_Video.cpp @@ -89,8 +89,16 @@ int Arduino_H7_Video::begin() { textFont(Font_5x7); #endif +#if defined(ARDUINO_GIGA) + /* Configure SDRAM */ + SDRAM.begin(dsi_getFramebufferEnd()); +#endif + /* Video controller/bridge init */ - _shield->init(_edidMode); + int err_code = _shield->init(_edidMode); + if (err_code < 0) { + return 3; /* Video controller fail init */ + } #if __has_include("lvgl.h") /* Initiliaze LVGL library */ @@ -148,12 +156,13 @@ int Arduino_H7_Video::begin() { } disp_drv.sw_rotate = 1; lv_disp_drv_register(&disp_drv); /* Finally register the driver */ - #endif #endif +#if !defined(ARDUINO_GIGA) /* Configure SDRAM */ SDRAM.begin(dsi_getFramebufferEnd()); //FIXME: SDRAM init after video controller init can cause display glitch at start-up +#endif return 0; } @@ -281,4 +290,4 @@ void lvgl_displayFlushing(lv_disp_drv_t * disp, const lv_area_t * area, lv_color #endif #endif -/**** END OF FILE ****/ \ No newline at end of file +/**** END OF FILE ****/ diff --git a/libraries/Arduino_H7_Video/src/H7DisplayShield.cpp b/libraries/Arduino_H7_Video/src/H7DisplayShield.cpp index 82356a638..e045f5abe 100644 --- a/libraries/Arduino_H7_Video/src/H7DisplayShield.cpp +++ b/libraries/Arduino_H7_Video/src/H7DisplayShield.cpp @@ -31,13 +31,22 @@ int USBCVideoClass::init(int edidmode) { } //Checking HDMI plug event - anx7625_wait_hpd_event(0); + err_code = anx7625_wait_hpd_event(0); + if(err_code < 0) { + return err_code; + } //Read EDID - anx7625_dp_get_edid(0, &recognized_edid); + err_code = anx7625_dp_get_edid(0, &recognized_edid); + if(err_code < 0) { + return err_code; + } //DSI Configuration - anx7625_dp_start(0, &recognized_edid, (enum edid_modes) edidmode); + err_code = anx7625_dp_start(0, &recognized_edid, (enum edid_modes) edidmode); + if(err_code < 0) { + return err_code; + } return 0; } diff --git a/libraries/Arduino_H7_Video/src/anx7625.cpp b/libraries/Arduino_H7_Video/src/anx7625.cpp index 552da163f..5f06e96c7 100644 --- a/libraries/Arduino_H7_Video/src/anx7625.cpp +++ b/libraries/Arduino_H7_Video/src/anx7625.cpp @@ -520,15 +520,21 @@ int anx7625_init(uint8_t bus) { return 0; } -void anx7625_wait_hpd_event(uint8_t bus) { +int anx7625_wait_hpd_event(uint8_t bus) { ANXINFO("Waiting for HDMI hot plug event...\n"); - - while (1) { + + int retry_hpd_change = 10000; + while (--retry_hpd_change) { mdelay(10); int detected = anx7625_hpd_change_detect(bus); - if (detected == 1) - break; + if (detected < 0) + return -1; + if (detected > 0) + return 0; } + + ANXERROR("Timed out to detect HPD change on bus %d.\n", bus); + return -1; } int anx7625_get_cc_status(uint8_t bus, uint8_t *cc_status) { diff --git a/libraries/Arduino_H7_Video/src/anx7625.h b/libraries/Arduino_H7_Video/src/anx7625.h index a1ae467a9..e6f8de7f2 100644 --- a/libraries/Arduino_H7_Video/src/anx7625.h +++ b/libraries/Arduino_H7_Video/src/anx7625.h @@ -20,7 +20,7 @@ extern "C" { int anx7625_dp_start(uint8_t bus, const struct edid *edid, enum edid_modes mode = EDID_MODE_AUTO); int anx7625_dp_get_edid(uint8_t bus, struct edid *out); int anx7625_init(uint8_t bus); -void anx7625_wait_hpd_event(uint8_t bus); +int anx7625_wait_hpd_event(uint8_t bus); int anx7625_get_cc_status(uint8_t bus, uint8_t *cc_status); int anx7625_read_system_status(uint8_t bus, uint8_t *sys_status); bool anx7625_is_power_provider(uint8_t bus); diff --git a/libraries/Ethernet/src/Ethernet.cpp b/libraries/Ethernet/src/Ethernet.cpp index 05d4061fb..ab720fcaf 100644 --- a/libraries/Ethernet/src/Ethernet.cpp +++ b/libraries/Ethernet/src/Ethernet.cpp @@ -24,11 +24,6 @@ int arduino::EthernetClass::_begin(uint8_t *mac, unsigned long timeout, unsigned return (linkStatus() == LinkON ? 1 : 0); } -int arduino::EthernetClass::setHostname(const char* hostname) { - eth_if->set_hostname(hostname); - return 1; -} - int arduino::EthernetClass::begin(uint8_t *mac, IPAddress ip) { IPAddress dns = ip; dns[3] = 1; diff --git a/libraries/Ethernet/src/Ethernet.h b/libraries/Ethernet/src/Ethernet.h index b554b3ef2..8783d651c 100644 --- a/libraries/Ethernet/src/Ethernet.h +++ b/libraries/Ethernet/src/Ethernet.h @@ -56,9 +56,6 @@ class EthernetClass : public MbedSocketClass { EthernetClass(EthernetInterface *_if) : eth_if(_if){}; - // When using DHCP the hostname provided will be used. - int setHostname(const char* hostname); - // Initialise the Ethernet shield to use the provided MAC address and // gain the rest of the configuration through DHCP. // Returns 0 if the DHCP configuration failed, and 1 if it succeeded diff --git a/libraries/GSM/src/GSM.h b/libraries/GSM/src/GSM.h index cf3652c26..0b724f284 100644 --- a/libraries/GSM/src/GSM.h +++ b/libraries/GSM/src/GSM.h @@ -108,9 +108,6 @@ class GSMClass : public MbedSocketClass { void trace(Stream& stream); void setTraceLevel(int trace_level, bool timestamp = false, bool at_trace = false); #endif - int ping(const char* hostname, uint8_t ttl = 128); - int ping(const String& hostname, uint8_t ttl = 128); - int ping(IPAddress host, uint8_t ttl = 128); bool isConnected(); friend class GSMClient; diff --git a/libraries/SE05X/src/SE05X.h b/libraries/SE05X/src/SE05X.h index d4bb1a660..e955491ba 100644 --- a/libraries/SE05X/src/SE05X.h +++ b/libraries/SE05X/src/SE05X.h @@ -80,8 +80,8 @@ class SE05XClass int readSlot(int slot, byte data[], int length); int writeSlot(int slot, const byte data[], int length); inline int locked() { return 1; } - inline int writeConfiguration(const byte data[]); - inline int readConfiguration(byte data[]); + int writeConfiguration(const byte data[]); + int readConfiguration(byte data[]); inline int lock() { return 1; } private: diff --git a/libraries/SocketWrapper/src/SocketHelpers.cpp b/libraries/SocketWrapper/src/SocketHelpers.cpp index ada31434f..b7e39b42c 100644 --- a/libraries/SocketWrapper/src/SocketHelpers.cpp +++ b/libraries/SocketWrapper/src/SocketHelpers.cpp @@ -1,18 +1,28 @@ #include "SocketHelpers.h" +#include uint8_t* arduino::MbedSocketClass::macAddress(uint8_t* mac) { const char* mac_str = getNetwork()->get_mac_address(); for (int b = 0; b < 6; b++) { uint32_t tmp; sscanf(&mac_str[b * 2 + (b)], "%02x", (unsigned int*)&tmp); - mac[5 - b] = (uint8_t)tmp; + mac[b] = (uint8_t)tmp; } - //sscanf(mac_str, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", &mac[5], &mac[4], &mac[3], &mac[2], &mac[1], &mac[0]); return mac; } String arduino::MbedSocketClass::macAddress() { - return String(getNetwork()->get_mac_address()); + const char* mac_str = getNetwork()->get_mac_address(); + if (!mac_str) { + return String("ff:ff:ff:ff:ff:ff"); + } + return String(mac_str); +} + +int arduino::MbedSocketClass::setHostname(const char* hostname) { + NetworkInterface* interface = getNetwork(); + interface->set_hostname(hostname); + return 1; } int arduino::MbedSocketClass::hostByName(const char* aHostname, IPAddress& aResult) { @@ -65,6 +75,24 @@ arduino::IPAddress arduino::MbedSocketClass::dnsIP(int n) { return ipAddressFromSocketAddress(ip); } +int arduino::MbedSocketClass::ping(const char *hostname, uint8_t ttl) +{ + SocketAddress socketAddress; + gethostbyname(getNetwork(),hostname, &socketAddress); + return ping(socketAddress, ttl); +} + +int arduino::MbedSocketClass::ping(const String &hostname, uint8_t ttl) +{ + return ping(hostname.c_str(), ttl); +} + +int arduino::MbedSocketClass::ping(IPAddress host, uint8_t ttl) +{ + SocketAddress socketAddress = socketAddressFromIpAddress(host, 0); + return ping(socketAddress, ttl); +} + void arduino::MbedSocketClass::config(arduino::IPAddress local_ip) { IPAddress dns = local_ip; dns[3] = 1; @@ -110,6 +138,19 @@ void arduino::MbedSocketClass::setDNS(IPAddress dns_server1, IPAddress dns_serve _dnsServer2 = SocketAddress(convertedDNSServer2); } +int arduino::MbedSocketClass::ping(SocketAddress &socketAddress, uint8_t ttl, uint32_t timeout) +{ + /* ttl is not supported by mbed ICMPSocket. Default value used is 255 */ + (void)ttl; + ICMPSocket s; + s.set_timeout(timeout); + s.open(getNetwork()); + int response = s.ping(socketAddress, timeout); + s.close(); + + return response; +} + arduino::IPAddress arduino::MbedSocketClass::ipAddressFromSocketAddress(SocketAddress socketAddress) { nsapi_addr_t address = socketAddress.get_addr(); return IPAddress(address.bytes[0], address.bytes[1], address.bytes[2], address.bytes[3]); @@ -123,7 +164,11 @@ SocketAddress arduino::MbedSocketClass::socketAddressFromIpAddress(arduino::IPAd nsapi_error_t arduino::MbedSocketClass::gethostbyname(NetworkInterface* interface, const char* aHostname, SocketAddress* socketAddress) { char ifname[5] {}; interface->get_interface_name(ifname); - return interface->gethostbyname(aHostname, socketAddress, NSAPI_UNSPEC, ifname); + nsapi_version_t version = NSAPI_IPv4; +#if MBED_CONF_LWIP_IPV6_ENABLED + version = NSAPI_UNSPEC; +#endif + return interface->gethostbyname(aHostname, socketAddress, version, ifname); } // Download helper diff --git a/libraries/SocketWrapper/src/SocketHelpers.h b/libraries/SocketWrapper/src/SocketHelpers.h index c31988fde..e285d166c 100644 --- a/libraries/SocketWrapper/src/SocketHelpers.h +++ b/libraries/SocketWrapper/src/SocketHelpers.h @@ -28,107 +28,140 @@ class MbedSocketClass { void config(IPAddress local_ip); /* Change Ip configuration settings disabling the dhcp client - * - * param local_ip: Static ip configuration as string - */ + * + * param local_ip: Static ip configuration as string + */ void config(const char* local_ip); /* Change Ip configuration settings disabling the dhcp client - * - * param local_ip: Static ip configuration - * param dns_server: IP configuration for DNS server 1 - */ + * + * param local_ip: Static ip configuration + * param dns_server: IP configuration for DNS server 1 + */ void config(IPAddress local_ip, IPAddress dns_server); /* Change Ip configuration settings disabling the dhcp client - * - * param local_ip: Static ip configuration - * param dns_server: IP configuration for DNS server 1 - * param gateway : Static gateway configuration - */ + * + * param local_ip: Static ip configuration + * param dns_server: IP configuration for DNS server 1 + * param gateway : Static gateway configuration + */ void config(IPAddress local_ip, IPAddress dns_server, IPAddress gateway); /* Change Ip configuration settings disabling the dhcp client - * - * param local_ip: Static ip configuration - * param dns_server: IP configuration for DNS server 1 - * param gateway: Static gateway configuration - * param subnet: Static Subnet mask - */ + * + * param local_ip: Static ip configuration + * param dns_server: IP configuration for DNS server 1 + * param gateway: Static gateway configuration + * param subnet: Static Subnet mask + */ void config(IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet); + // When using DHCP the hostname provided will be used. + int setHostname(const char* hostname); + /* Change DNS Ip configuration - * - * param dns_server1: ip configuration for DNS server 1 - */ + * + * param dns_server1: ip configuration for DNS server 1 + */ void setDNS(IPAddress dns_server1); /* Change DNS Ip configuration - * - * param dns_server1: ip configuration for DNS server 1 - * param dns_server2: ip configuration for DNS server 2 - * - */ + * + * param dns_server1: ip configuration for DNS server 1 + * param dns_server2: ip configuration for DNS server 2 + * + */ void setDNS(IPAddress dns_server1, IPAddress dns_server2); /* - * Get the interface IP address. - * - * return: Ip address value - */ + * Get the interface IP address. + * + * return: Ip address value + */ IPAddress localIP(); /* - * Get the interface subnet mask address. - * - * return: subnet mask address value - */ + * Get the interface subnet mask address. + * + * return: subnet mask address value + */ IPAddress subnetMask(); /* - * Get the gateway ip address. - * - * return: gateway ip address value - */ + * Get the gateway ip address. + * + * return: gateway ip address value + */ IPAddress gatewayIP(); /* - * Get the DNS Server ip address. - * - * return: DNS Server ip address value - */ + * Get the DNS Server ip address. + * + * return: DNS Server ip address value + */ IPAddress dnsServerIP(); /* - * Get the DNS Server ip address. - * - * return: DNS Server ip address value - */ + * Get the DNS Server ip address. + * + * return: DNS Server ip address value + */ IPAddress dnsIP(int n = 0); virtual NetworkInterface* getNetwork() = 0; - + + /* + * Ping the specified target. + * + * ttl value is unused, but kept for API compatibility + * + * return: RTT in milliseconds or -1 on error + */ + int ping(const char* hostname, uint8_t ttl = 255); + int ping(const String &hostname, uint8_t ttl = 255); + int ping(IPAddress host, uint8_t ttl = 255); + /* - * Download a file from an HTTP endpoint and save it in the provided `target` location on the fs - * The parameter cbk can be used to perform actions on the buffer before saving on the fs - * - * return: on success the size of the downloaded file, on error -status code - */ + * Download a file from an HTTP endpoint and save it in the provided `target` location on the fs + * The parameter cbk can be used to perform actions on the buffer before saving on the fs + * + * return: on success the size of the downloaded file, on error -status code + */ int download( const char* url, const char* target, bool const is_https = false); /* - * Download a file from an HTTP endpoint and handle the body of the request on a callback - * passed as an argument - * - * return: on success the size of the downloaded file, on error -status code - */ + * Download a file from an HTTP endpoint and handle the body of the request on a callback + * passed as an argument + * + * return: on success the size of the downloaded file, on error -status code + */ int download( const char* url, bool const is_https = false, mbed::Callback cbk = nullptr); int hostByName(const char* aHostname, IPAddress& aResult); + /* + * Get the interface MAC address. + * + * Network interface should be ready to get a valid mac address. + * Call WiFi.begin("",""); or Ethernet.begin(); before issuing a mac address + * request, otherwhise returned value will be ff:ff:ff:ff:ff:ff + * + * return: pointer to uint8_t array with length WL_MAC_ADDR_LENGTH + */ uint8_t* macAddress(uint8_t* mac); + + /* + * Get the interface MAC address String. + * + * Network interface should be ready to get a valid MAC address. + * Call WiFi.begin("",""); or Ethernet.begin(); before issuing a mac address + * request, otherwhise returned value will be ff:ff:ff:ff:ff:ff + * + * return: MAC Address String + */ String macAddress(); void setFeedWatchdogFunc(voidFuncPtr func); @@ -152,6 +185,7 @@ class MbedSocketClass { void body_callback(const char* data, uint32_t data_len); + int ping(SocketAddress &socketAddress, uint8_t ttl, uint32_t timeout = 5000); static arduino::IPAddress ipAddressFromSocketAddress(SocketAddress socketAddress); static SocketAddress socketAddressFromIpAddress(arduino::IPAddress ip, uint16_t port); static nsapi_error_t gethostbyname(NetworkInterface* interface, const char* aHostname, SocketAddress* socketAddress); diff --git a/libraries/WiFi/examples/WiFiPing/WiFiPing.ino b/libraries/WiFi/examples/WiFiPing/WiFiPing.ino new file mode 100644 index 000000000..db81e1ce7 --- /dev/null +++ b/libraries/WiFi/examples/WiFiPing/WiFiPing.ino @@ -0,0 +1,114 @@ +/* + Web ICMP Ping + + This sketch pings a device based on the IP address or the hostname + using the WiFi module. + + This example is written for a network using WPA encryption. For + WEP or WPA, change the WiFi.begin() call accordingly. + + created 14 February 2024 + by paulvha + modified 8 Jenuary 2025 + by fabik111 + + */ + +#include +#include "arduino_secrets.h" + +///////please enter your sensitive data in the Secret tab/arduino_secrets.h +char ssid[] = SECRET_SSID; // your network SSID (name) +char pass[] = SECRET_PASS; // your network password (use for WPA, or use as key for WEP) + +int status = WL_IDLE_STATUS; + +/* -------------------------------------------------------------------------- */ +void setup() { +/* -------------------------------------------------------------------------- */ + //Initialize serial and wait for port to open: + Serial.begin(9600); + while (!Serial) { + ; // wait for serial port to connect. Needed for native USB port only + } + + // check for the WiFi module: + if (WiFi.status() == WL_NO_MODULE) { + Serial.println("Communication with WiFi module failed."); + // don't continue + while (true); + } + + // attempt to connect to WiFi network: + while (status != WL_CONNECTED) { + Serial.print("Attempting to connect to SSID: "); + Serial.println(ssid); + // Connect to WPA/WPA2 network. Change this line if using open or WEP network: + status = WiFi.begin(ssid, pass); + + // wait 3 seconds for connection: + delay(3000); + } + + printWifiStatus(); +} + +/* -------------------------------------------------------------------------- */ +void loop() { +/* -------------------------------------------------------------------------- */ + + // Ping IP + const IPAddress remote_ip(140,82,121,4); + Serial.print("Trying to ping github.com on IP: "); + Serial.println(remote_ip); + + // using default ping count of 1 + int res = WiFi.ping(remote_ip); + + if (res > 0) { + Serial.print("Ping response time: "); + Serial.print(res); + Serial.println(" ms"); + } + else { + Serial.println("Timeout on IP!"); + } + + // Ping Host + const char* remote_host = "www.google.com"; + Serial.print("Trying to ping host: "); + Serial.println(remote_host); + + int res1 = WiFi.ping(remote_host); + + if (res1 > 0) { + Serial.print("Ping response time: "); + Serial.print(res1); + Serial.println(" ms"); + } + else { + Serial.println("Timeout on host!"); + } + + Serial.println(); + delay(5000); +} + +/* -------------------------------------------------------------------------- */ +void printWifiStatus() { +/* -------------------------------------------------------------------------- */ + // print the SSID of the network you're attached to: + Serial.print("SSID: "); + Serial.println(WiFi.SSID()); + + // print your board's IP address: + IPAddress ip = WiFi.localIP(); + Serial.print("IP Address: "); + Serial.println(ip); + + // print the received signal strength: + long rssi = WiFi.RSSI(); + Serial.print("signal strength (RSSI):"); + Serial.print(rssi); + Serial.println(" dBm"); +} diff --git a/libraries/WiFi/examples/WiFiPing/arduino_secrets.h b/libraries/WiFi/examples/WiFiPing/arduino_secrets.h new file mode 100644 index 000000000..0c9fdd556 --- /dev/null +++ b/libraries/WiFi/examples/WiFiPing/arduino_secrets.h @@ -0,0 +1,2 @@ +#define SECRET_SSID "" +#define SECRET_PASS "" diff --git a/libraries/WiFi/src/WiFi.cpp b/libraries/WiFi/src/WiFi.cpp index 957a2966b..6ad89d619 100644 --- a/libraries/WiFi/src/WiFi.cpp +++ b/libraries/WiFi/src/WiFi.cpp @@ -96,11 +96,6 @@ int arduino::WiFiClass::begin(const char* ssid) { return begin(ssid, NULL, ENC_TYPE_NONE); } -int arduino::WiFiClass::setHostname(const char* hostname) { - wifi_if->set_hostname(hostname); - return 1; -} - //Config Wifi to set Static IP && Disable DHCP void arduino::WiFiClass::config(const char* localip, const char* netmask, const char* gateway){ SocketHelpers::config(IPAddress(localip), dnsIP(0), IPAddress(gateway), IPAddress(netmask)); diff --git a/libraries/WiFi/src/WiFi.h b/libraries/WiFi/src/WiFi.h index dd01192a2..a3a8a6ea9 100644 --- a/libraries/WiFi/src/WiFi.h +++ b/libraries/WiFi/src/WiFi.h @@ -55,30 +55,27 @@ class WiFiClass : public MbedSocketClass { : wifi_if(_if){}; /* - * Get firmware version - */ + * Get firmware version + */ static const char* firmwareVersion(); /* Start Wifi connection for OPEN networks - * - * param ssid: Pointer to the SSID string. - */ + * + * param ssid: Pointer to the SSID string. + */ int begin(const char* ssid); - void MACAddress(uint8_t *mac_address); + void MACAddress(uint8_t *mac_address) __attribute__((deprecated("Use macAddress(uint8_t *mac_address)"))); /* Start Wifi connection with passphrase - * the most secure supported mode will be automatically selected - * - * param ssid: Pointer to the SSID string. - * param passphrase: Passphrase. Valid characters in a passphrase - * must be between ASCII 32-126 (decimal). - */ + * the most secure supported mode will be automatically selected + * + * param ssid: Pointer to the SSID string. + * param passphrase: Passphrase. Valid characters in a passphrase + * must be between ASCII 32-126 (decimal). + */ int begin(const char* ssid, const char* passphrase, wl_enc_type security = ENC_TYPE_UNKNOWN); - // When using DHCP the hostname provided will be used. - int setHostname(const char* hostname); - // Inherit config methods from the parent class using MbedSocketClass::config; @@ -87,86 +84,86 @@ class WiFiClass : public MbedSocketClass { int beginAP(const char* ssid, const char* passphrase, uint8_t channel = DEFAULT_AP_CHANNEL); /* - * Disconnect from the network - * - * return: one value of wl_status_t enum - */ + * Disconnect from the network + * + * return: one value of wl_status_t enum + */ int disconnect(void); void end(void); /* - * Return the current SSID associated with the network - * - * return: ssid string - */ + * Return the current SSID associated with the network + * + * return: ssid string + */ char* SSID(); /* - * Return the current BSSID associated with the network. - * It is the MAC address of the Access Point - * - * return: pointer to uint8_t array with length WL_MAC_ADDR_LENGTH - */ + * Return the current BSSID associated with the network. + * It is the MAC address of the Access Point + * + * return: pointer to uint8_t array with length WL_MAC_ADDR_LENGTH + */ uint8_t* BSSID(uint8_t* bssid); /* - * Return the current RSSI /Received Signal Strength in dBm) - * associated with the network - * - * return: signed value - */ + * Return the current RSSI /Received Signal Strength in dBm) + * associated with the network + * + * return: signed value + */ int32_t RSSI(); /* - * Return the Encryption Type associated with the network - * - * return: one value of wl_enc_type enum - */ + * Return the Encryption Type associated with the network + * + * return: one value of wl_enc_type enum + */ uint8_t encryptionType(); /* - * Start scan WiFi networks available - * - * return: Number of discovered networks - */ + * Start scan WiFi networks available + * + * return: Number of discovered networks + */ int8_t scanNetworks(); /* - * Return the SSID discovered during the network scan. - * - * param networkItem: specify from which network item want to get the information - * - * return: ssid string of the specified item on the networks scanned list - */ + * Return the SSID discovered during the network scan. + * + * param networkItem: specify from which network item want to get the information + * + * return: ssid string of the specified item on the networks scanned list + */ char* SSID(uint8_t networkItem); /* - * Return the encryption type of the networks discovered during the scanNetworks - * - * param networkItem: specify from which network item want to get the information - * - * return: encryption type (enum wl_enc_type) of the specified item on the networks scanned list - */ + * Return the encryption type of the networks discovered during the scanNetworks + * + * param networkItem: specify from which network item want to get the information + * + * return: encryption type (enum wl_enc_type) of the specified item on the networks scanned list + */ uint8_t encryptionType(uint8_t networkItem); uint8_t* BSSID(uint8_t networkItem, uint8_t* bssid); uint8_t channel(uint8_t networkItem); /* - * Return the RSSI of the networks discovered during the scanNetworks - * - * param networkItem: specify from which network item want to get the information - * - * return: signed value of RSSI of the specified item on the networks scanned list - */ + * Return the RSSI of the networks discovered during the scanNetworks + * + * param networkItem: specify from which network item want to get the information + * + * return: signed value of RSSI of the specified item on the networks scanned list + */ int32_t RSSI(uint8_t networkItem); /* - * Return Connection status. - * - * return: one of the value defined in wl_status_t - */ + * Return Connection status. + * + * return: one of the value defined in wl_status_t + */ uint8_t status(); unsigned long getTime(); diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp index ddd3a3ce4..d34ad83b0 100644 --- a/libraries/Wire/Wire.cpp +++ b/libraries/Wire/Wire.cpp @@ -122,14 +122,22 @@ size_t arduino::MbedI2C::write(const uint8_t* data, int len) { } int arduino::MbedI2C::read() { + int rv = -1; + core_util_critical_section_enter(); + if (rxBuffer.available()) { - return rxBuffer.read_char(); + + rv = rxBuffer.read_char(); } - return -1; + core_util_critical_section_exit(); + return rv; } int arduino::MbedI2C::available() { - return rxBuffer.available(); + core_util_critical_section_enter(); + int rv = rxBuffer.available(); + core_util_critical_section_exit(); + return rv; } int arduino::MbedI2C::peek() { @@ -151,13 +159,16 @@ void arduino::MbedI2C::receiveThd() { onRequestCb(); } if (usedTxBuffer != 0) { + core_util_critical_section_enter(); slave->write((const char *) txBuffer, usedTxBuffer); + core_util_critical_section_exit(); usedTxBuffer = 0; } //slave->stop(); break; case mbed::I2CSlave::WriteGeneral: case mbed::I2CSlave::WriteAddressed: + core_util_critical_section_enter(); rxBuffer.clear(); char buf[240]; c = slave->read(buf, sizeof(buf)); @@ -171,6 +182,7 @@ void arduino::MbedI2C::receiveThd() { if (rxBuffer.available() > 0 && onReceiveCb != NULL) { onReceiveCb(rxBuffer.available()); } + core_util_critical_section_exit(); //slave->stop(); break; case mbed::I2CSlave::NoData: diff --git a/package_full.sh b/package_full.sh index 4e74bf34e..cb57b1a98 100755 --- a/package_full.sh +++ b/package_full.sh @@ -1,5 +1,5 @@ #Get version from git(hub) tag -export VERSION="4.2.1" +export VERSION="4.2.2" FLAVOURS=`ls *.variables` diff --git a/patches/0245-WHD-fix-WhdSTAInterface-add-return-value-to-set_time.patch b/patches/0245-WHD-fix-WhdSTAInterface-add-return-value-to-set_time.patch new file mode 100644 index 000000000..b96a94888 --- /dev/null +++ b/patches/0245-WHD-fix-WhdSTAInterface-add-return-value-to-set_time.patch @@ -0,0 +1,24 @@ +From 310f0dd40c5b070ea2077c8a580f777a5cf17951 Mon Sep 17 00:00:00 2001 +From: pennam +Date: Tue, 7 Jan 2025 09:47:09 +0100 +Subject: [PATCH] WHD: fix WhdSTAInterface, add return value to set_timeout + +--- + .../drivers/emac/COMPONENT_WHD/interface/WhdSTAInterface.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/connectivity/drivers/emac/COMPONENT_WHD/interface/WhdSTAInterface.h b/connectivity/drivers/emac/COMPONENT_WHD/interface/WhdSTAInterface.h +index bfe933bac7..8d8f540759 100644 +--- a/connectivity/drivers/emac/COMPONENT_WHD/interface/WhdSTAInterface.h ++++ b/connectivity/drivers/emac/COMPONENT_WHD/interface/WhdSTAInterface.h +@@ -122,6 +122,7 @@ public: + nsapi_error_t set_timeout(uint32_t timeout) + { + _timeout = timeout; ++ return NSAPI_ERROR_OK; + } + + /** Set blocking status of interface. +-- +2.45.2 + diff --git a/patches/0246-WHD-remove-v-from-WHD_VERSION-define.patch b/patches/0246-WHD-remove-v-from-WHD_VERSION-define.patch new file mode 100644 index 000000000..8d0289263 --- /dev/null +++ b/patches/0246-WHD-remove-v-from-WHD_VERSION-define.patch @@ -0,0 +1,25 @@ +From fa1e9697ca3b74489bd2eb08ab9ab1ffeee2a298 Mon Sep 17 00:00:00 2001 +From: pennam +Date: Fri, 31 Jan 2025 16:34:05 +0100 +Subject: [PATCH 246/247] WHD: remove v from WHD_VERSION define + +--- + .../wifi/COMPONENT_WHD/wifi-host-driver/inc/whd_version.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/connectivity/drivers/wifi/COMPONENT_WHD/wifi-host-driver/inc/whd_version.h b/connectivity/drivers/wifi/COMPONENT_WHD/wifi-host-driver/inc/whd_version.h +index 1caef23b67..5f69d8c3e0 100755 +--- a/connectivity/drivers/wifi/COMPONENT_WHD/wifi-host-driver/inc/whd_version.h ++++ b/connectivity/drivers/wifi/COMPONENT_WHD/wifi-host-driver/inc/whd_version.h +@@ -15,6 +15,7 @@ + * limitations under the License. + */ + +-#define WHD_VERSION "v1.94.0" ++/* This define is used by arduino::WiFiClass::firmwareVersion() do not prepend v */ ++#define WHD_VERSION "1.94.0" + #define WHD_BRANCH "v1.94.0" + #define WHD_DATE "2021-04-27 16:54:34 +0800" +-- +2.47.2 + diff --git a/patches/0247-ICMPSocket-add-ping.patch b/patches/0247-ICMPSocket-add-ping.patch new file mode 100644 index 000000000..2019bcb0c --- /dev/null +++ b/patches/0247-ICMPSocket-add-ping.patch @@ -0,0 +1,106 @@ +From 933694e0f35451d21eed77a93fa346570de20878 Mon Sep 17 00:00:00 2001 +From: pennam +Date: Tue, 4 Feb 2025 14:31:59 +0100 +Subject: [PATCH] ICMPSocket: add ping + +--- + .../netsocket/include/netsocket/ICMPSocket.h | 4 ++ + connectivity/netsocket/source/ICMPSocket.cpp | 61 +++++++++++++++++++ + 2 files changed, 65 insertions(+) + +diff --git a/connectivity/netsocket/include/netsocket/ICMPSocket.h b/connectivity/netsocket/include/netsocket/ICMPSocket.h +index 1837bc8e09..5e1ee8fb03 100644 +--- a/connectivity/netsocket/include/netsocket/ICMPSocket.h ++++ b/connectivity/netsocket/include/netsocket/ICMPSocket.h +@@ -37,6 +37,10 @@ public: + */ + ICMPSocket(); + ++#if MBED_CONF_LWIP_RAW_SOCKET_ENABLED ++ int ping(SocketAddress &socketAddress, uint32_t timeout); ++#endif ++ + #if !defined(DOXYGEN_ONLY) + + protected: +diff --git a/connectivity/netsocket/source/ICMPSocket.cpp b/connectivity/netsocket/source/ICMPSocket.cpp +index f6c9b98de1..d8ea954835 100644 +--- a/connectivity/netsocket/source/ICMPSocket.cpp ++++ b/connectivity/netsocket/source/ICMPSocket.cpp +@@ -16,12 +16,73 @@ + */ + + #include "ICMPSocket.h" ++#if MBED_CONF_LWIP_RAW_SOCKET_ENABLED ++#include "drivers/Timer.h" ++#include "lwip/prot/icmp.h" ++#include "lwip/inet_chksum.h" ++#include "lwip/prot/ip4.h" ++#endif + + ICMPSocket::ICMPSocket() + { + _socket_stats.stats_update_proto(this, NSAPI_ICMP); + } + ++#if MBED_CONF_LWIP_RAW_SOCKET_ENABLED ++int ICMPSocket::ping(SocketAddress &socketAddress, uint32_t timeout) ++{ ++ struct __attribute__((__packed__)) { ++ struct icmp_echo_hdr header; ++ uint8_t data[32]; ++ } request; ++ ++ ICMPH_TYPE_SET(&request.header, ICMP_ECHO); ++ ICMPH_CODE_SET(&request.header, 0); ++ request.header.chksum = 0; ++ request.header.id = 0xAFAF; ++ request.header.seqno = random(); ++ ++ for (size_t i = 0; i < sizeof(request.data); i++) { ++ request.data[i] = i; ++ } ++ ++ request.header.chksum = inet_chksum(&request, sizeof(request)); ++ ++ int res = sendto(socketAddress, &request, sizeof(request)); ++ if (res <= 0){ ++ return -1; ++ } ++ ++ mbed::Timer timer; ++ timer.start(); ++ int elapsed = -1; ++ do { ++ struct __attribute__((__packed__)) { ++ struct ip_hdr ipHeader; ++ struct icmp_echo_hdr header; ++ } response; ++ ++ int rxSize = recvfrom(&socketAddress, &response, sizeof(response)); ++ if (rxSize < 0) { ++ // time out ++ break; ++ } ++ ++ if (rxSize < sizeof(response)) { ++ // too short ++ continue; ++ } ++ ++ if ((response.header.id == request.header.id) && (response.header.seqno == request.header.seqno)) { ++ elapsed = std::chrono::duration_cast(timer.elapsed_time()).count(); ++ timer.stop(); ++ } ++ } while (elapsed == -1 && std::chrono::duration_cast(timer.elapsed_time()).count() < timeout); ++ ++ return elapsed; ++} ++#endif ++ + nsapi_protocol_t ICMPSocket::get_proto() + { + return NSAPI_ICMP; +-- +2.47.2 + diff --git a/variants/ARDUINO_NANO33BLE/defines.txt b/variants/ARDUINO_NANO33BLE/defines.txt index 0158ebf63..8bf9cde35 100644 --- a/variants/ARDUINO_NANO33BLE/defines.txt +++ b/variants/ARDUINO_NANO33BLE/defines.txt @@ -34,7 +34,7 @@ -DFEATURE_STORAGE=1 -D__FPU_PRESENT=1 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730202709.4767566 +-DMBED_BUILD_TIMESTAMP=1738678457.278008 -D__MBED_CMSIS_RTOS_CM -DMBED_MPU_CUSTOM -DMBED_TICKLESS diff --git a/variants/ARDUINO_NANO33BLE/libs/libmbed.a b/variants/ARDUINO_NANO33BLE/libs/libmbed.a index 9cf04c0cd..729832d39 100644 Binary files a/variants/ARDUINO_NANO33BLE/libs/libmbed.a and b/variants/ARDUINO_NANO33BLE/libs/libmbed.a differ diff --git a/variants/EDGE_CONTROL/conf/mbed_app.json b/variants/EDGE_CONTROL/conf/mbed_app.json index 572df7428..93d202c0d 100644 --- a/variants/EDGE_CONTROL/conf/mbed_app.json +++ b/variants/EDGE_CONTROL/conf/mbed_app.json @@ -19,7 +19,8 @@ "cellular.offload-dns-queries": true, "cellular.at-handler-buffer-size": 1024, "mbed-trace.enable": true, - "target.mbed_app_start": "0x10000" + "target.mbed_app_start": "0x10000", + "lwip.raw-socket-enabled": true }, "EDGE_CONTROL": { "sd.SPI_MOSI": "P0_20", diff --git a/variants/EDGE_CONTROL/defines.txt b/variants/EDGE_CONTROL/defines.txt index 9b1e41ac1..4fd396229 100644 --- a/variants/EDGE_CONTROL/defines.txt +++ b/variants/EDGE_CONTROL/defines.txt @@ -38,7 +38,7 @@ -DFEATURE_STORAGE=1 -D__FPU_PRESENT=1 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730202880.502858 +-DMBED_BUILD_TIMESTAMP=1738678638.4581091 -D__MBED_CMSIS_RTOS_CM -DMBED_MPU_CUSTOM -DMBED_TICKLESS diff --git a/variants/EDGE_CONTROL/libs/libmbed.a b/variants/EDGE_CONTROL/libs/libmbed.a index 99db5183e..d42e1137e 100644 Binary files a/variants/EDGE_CONTROL/libs/libmbed.a and b/variants/EDGE_CONTROL/libs/libmbed.a differ diff --git a/variants/EDGE_CONTROL/mbed_config.h b/variants/EDGE_CONTROL/mbed_config.h index c61166166..31fa1228d 100644 --- a/variants/EDGE_CONTROL/mbed_config.h +++ b/variants/EDGE_CONTROL/mbed_config.h @@ -239,7 +239,7 @@ #define MBED_CONF_LWIP_PPP_IPV6_ENABLED 0 // set by library:lwip #define MBED_CONF_LWIP_PPP_THREAD_STACKSIZE 768 // set by library:lwip #define MBED_CONF_LWIP_PRESENT 1 // set by library:lwip -#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 0 // set by library:lwip +#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 1 // set by application[*] #define MBED_CONF_LWIP_SOCKET_MAX 4 // set by library:lwip #define MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY osPriorityNormal // set by library:lwip #define MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE 1200 // set by library:lwip diff --git a/variants/GENERIC_STM32H747_M4/defines.txt b/variants/GENERIC_STM32H747_M4/defines.txt index c410536fe..b44c062da 100644 --- a/variants/GENERIC_STM32H747_M4/defines.txt +++ b/variants/GENERIC_STM32H747_M4/defines.txt @@ -42,7 +42,7 @@ -DFEATURE_BLE=1 -D__FPU_PRESENT=1 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730202826.649384 +-DMBED_BUILD_TIMESTAMP=1738678579.8515525 -D__MBED_CMSIS_RTOS_CM -DMBED_MPU_CUSTOM -DMBED_TICKLESS diff --git a/variants/GENERIC_STM32H747_M4/libs/libmbed.a b/variants/GENERIC_STM32H747_M4/libs/libmbed.a index 31e9c33bf..72951f8a2 100644 Binary files a/variants/GENERIC_STM32H747_M4/libs/libmbed.a and b/variants/GENERIC_STM32H747_M4/libs/libmbed.a differ diff --git a/variants/GIGA/conf/mbed_app.json b/variants/GIGA/conf/mbed_app.json index 0fb7e9221..361a0ab94 100644 --- a/variants/GIGA/conf/mbed_app.json +++ b/variants/GIGA/conf/mbed_app.json @@ -11,6 +11,9 @@ "rtos.main-thread-stack-size": 32768, "cordio.max-connections": 5, "target.mbed_app_start": "0x8040000", + "nsapi.dns-response-wait-time": 5000, + "nsapi.dns-total-attempts": 3, + "lwip.raw-socket-enabled": true, "target.macros_add": [ "METAL_INTERNAL", "VIRTIO_DRIVER_ONLY", diff --git a/variants/GIGA/defines.txt b/variants/GIGA/defines.txt index 500b94883..20ad512ab 100644 --- a/variants/GIGA/defines.txt +++ b/variants/GIGA/defines.txt @@ -44,7 +44,7 @@ -DFEATURE_BLE=1 -D__FPU_PRESENT=1 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730203074.8719478 +-DMBED_BUILD_TIMESTAMP=1738678847.5982425 -D__MBED_CMSIS_RTOS_CM -DMBED_TICKLESS -DMBEDTLS_FS_IO diff --git a/variants/GIGA/libs/libmbed.a b/variants/GIGA/libs/libmbed.a index 47d47295d..589bc11d9 100644 Binary files a/variants/GIGA/libs/libmbed.a and b/variants/GIGA/libs/libmbed.a differ diff --git a/variants/GIGA/mbed_config.h b/variants/GIGA/mbed_config.h index 460ac941c..3133aa110 100644 --- a/variants/GIGA/mbed_config.h +++ b/variants/GIGA/mbed_config.h @@ -226,7 +226,7 @@ #define MBED_CONF_LWIP_PPP_IPV6_ENABLED 0 // set by library:lwip #define MBED_CONF_LWIP_PPP_THREAD_STACKSIZE 768 // set by library:lwip #define MBED_CONF_LWIP_PRESENT 1 // set by library:lwip -#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 0 // set by library:lwip +#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 1 // set by application[*] #define MBED_CONF_LWIP_SOCKET_MAX 4 // set by library:lwip #define MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY osPriorityNormal // set by library:lwip #define MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE 1200 // set by library:lwip @@ -250,9 +250,9 @@ #define MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY NONE // set by library:nsapi #define MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT 10 // set by library:nsapi #define MBED_CONF_NSAPI_DNS_CACHE_SIZE 3 // set by library:nsapi -#define MBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME 10000 // set by library:nsapi +#define MBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME 5000 // set by application[*] #define MBED_CONF_NSAPI_DNS_RETRIES 1 // set by library:nsapi -#define MBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS 10 // set by library:nsapi +#define MBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS 3 // set by application[*] #define MBED_CONF_NSAPI_PRESENT 1 // set by library:nsapi #define MBED_CONF_NSAPI_SOCKET_STATS_ENABLED 0 // set by library:nsapi #define MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT 10 // set by library:nsapi diff --git a/variants/NANO_RP2040_CONNECT/defines.txt b/variants/NANO_RP2040_CONNECT/defines.txt index 6e93a6953..e4f955eb0 100644 --- a/variants/NANO_RP2040_CONNECT/defines.txt +++ b/variants/NANO_RP2040_CONNECT/defines.txt @@ -21,7 +21,7 @@ -DDEVICE_USTICKER=1 -DDEVICE_WATCHDOG=1 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730202686.158914 +-DMBED_BUILD_TIMESTAMP=1738678431.5907538 -D__MBED_CMSIS_RTOS_CM -DMBED_MPU_CUSTOM -DMBEDTLS_ENTROPY_NV_SEED diff --git a/variants/NANO_RP2040_CONNECT/libs/libmbed.a b/variants/NANO_RP2040_CONNECT/libs/libmbed.a index 0cc8325ea..475e6e096 100644 Binary files a/variants/NANO_RP2040_CONNECT/libs/libmbed.a and b/variants/NANO_RP2040_CONNECT/libs/libmbed.a differ diff --git a/variants/NICLA/defines.txt b/variants/NICLA/defines.txt index afd185e64..2c2321141 100644 --- a/variants/NICLA/defines.txt +++ b/variants/NICLA/defines.txt @@ -33,7 +33,7 @@ -DFEATURE_BLE=1 -D__FPU_PRESENT=1 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730202924.3808827 +-DMBED_BUILD_TIMESTAMP=1738678686.654947 -D__MBED_CMSIS_RTOS_CM -DMBED_MPU_CUSTOM -DMBED_TICKLESS diff --git a/variants/NICLA/libs/libmbed.a b/variants/NICLA/libs/libmbed.a index 410c385af..3cd144aff 100644 Binary files a/variants/NICLA/libs/libmbed.a and b/variants/NICLA/libs/libmbed.a differ diff --git a/variants/NICLA_VISION/conf/mbed_app.json b/variants/NICLA_VISION/conf/mbed_app.json index 6d743d296..f3227a71f 100644 --- a/variants/NICLA_VISION/conf/mbed_app.json +++ b/variants/NICLA_VISION/conf/mbed_app.json @@ -12,6 +12,9 @@ "rtos.main-thread-stack-size": 32768, "cordio.max-connections": 5, "target.mbed_app_start": "0x8040000", + "nsapi.dns-response-wait-time": 5000, + "nsapi.dns-total-attempts": 3, + "lwip.raw-socket-enabled": true, "target.macros_add": [ "METAL_INTERNAL", "VIRTIO_DRIVER_ONLY", diff --git a/variants/NICLA_VISION/defines.txt b/variants/NICLA_VISION/defines.txt index e763ec718..6e2d9a947 100644 --- a/variants/NICLA_VISION/defines.txt +++ b/variants/NICLA_VISION/defines.txt @@ -45,7 +45,7 @@ -DFLOW_SILENT -D__FPU_PRESENT=1 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730202959.8104806 +-DMBED_BUILD_TIMESTAMP=1738678724.8386328 -D__MBED_CMSIS_RTOS_CM -DMBED_TICKLESS -DMBEDTLS_FS_IO diff --git a/variants/NICLA_VISION/libs/libmbed.a b/variants/NICLA_VISION/libs/libmbed.a index a9cd38f54..c6991a257 100644 Binary files a/variants/NICLA_VISION/libs/libmbed.a and b/variants/NICLA_VISION/libs/libmbed.a differ diff --git a/variants/NICLA_VISION/mbed_config.h b/variants/NICLA_VISION/mbed_config.h index ed8376f00..d4ec859a3 100644 --- a/variants/NICLA_VISION/mbed_config.h +++ b/variants/NICLA_VISION/mbed_config.h @@ -226,7 +226,7 @@ #define MBED_CONF_LWIP_PPP_IPV6_ENABLED 0 // set by library:lwip #define MBED_CONF_LWIP_PPP_THREAD_STACKSIZE 768 // set by library:lwip #define MBED_CONF_LWIP_PRESENT 1 // set by library:lwip -#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 0 // set by library:lwip +#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 1 // set by application[*] #define MBED_CONF_LWIP_SOCKET_MAX 4 // set by library:lwip #define MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY osPriorityNormal // set by library:lwip #define MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE 1200 // set by library:lwip @@ -250,9 +250,9 @@ #define MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY NONE // set by library:nsapi #define MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT 10 // set by library:nsapi #define MBED_CONF_NSAPI_DNS_CACHE_SIZE 3 // set by library:nsapi -#define MBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME 10000 // set by library:nsapi +#define MBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME 5000 // set by application[*] #define MBED_CONF_NSAPI_DNS_RETRIES 1 // set by library:nsapi -#define MBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS 10 // set by library:nsapi +#define MBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS 3 // set by application[*] #define MBED_CONF_NSAPI_PRESENT 1 // set by library:nsapi #define MBED_CONF_NSAPI_SOCKET_STATS_ENABLED 0 // set by library:nsapi #define MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT 10 // set by library:nsapi diff --git a/variants/OPTA/conf/mbed_app.json b/variants/OPTA/conf/mbed_app.json index 0fb7e9221..361a0ab94 100644 --- a/variants/OPTA/conf/mbed_app.json +++ b/variants/OPTA/conf/mbed_app.json @@ -11,6 +11,9 @@ "rtos.main-thread-stack-size": 32768, "cordio.max-connections": 5, "target.mbed_app_start": "0x8040000", + "nsapi.dns-response-wait-time": 5000, + "nsapi.dns-total-attempts": 3, + "lwip.raw-socket-enabled": true, "target.macros_add": [ "METAL_INTERNAL", "VIRTIO_DRIVER_ONLY", diff --git a/variants/OPTA/defines.txt b/variants/OPTA/defines.txt index 9701064b3..76b04861f 100644 --- a/variants/OPTA/defines.txt +++ b/variants/OPTA/defines.txt @@ -44,7 +44,7 @@ -DFEATURE_BLE=1 -D__FPU_PRESENT=1 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730203018.6299732 +-DMBED_BUILD_TIMESTAMP=1738678787.2016976 -D__MBED_CMSIS_RTOS_CM -DMBED_TICKLESS -DMBEDTLS_FS_IO diff --git a/variants/OPTA/libs/libmbed.a b/variants/OPTA/libs/libmbed.a index 13b2ad904..0dd368bf8 100644 Binary files a/variants/OPTA/libs/libmbed.a and b/variants/OPTA/libs/libmbed.a differ diff --git a/variants/OPTA/mbed_config.h b/variants/OPTA/mbed_config.h index c0485cbf8..4b6d57eaa 100644 --- a/variants/OPTA/mbed_config.h +++ b/variants/OPTA/mbed_config.h @@ -226,7 +226,7 @@ #define MBED_CONF_LWIP_PPP_IPV6_ENABLED 0 // set by library:lwip #define MBED_CONF_LWIP_PPP_THREAD_STACKSIZE 768 // set by library:lwip #define MBED_CONF_LWIP_PRESENT 1 // set by library:lwip -#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 0 // set by library:lwip +#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 1 // set by application[*] #define MBED_CONF_LWIP_SOCKET_MAX 4 // set by library:lwip #define MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY osPriorityNormal // set by library:lwip #define MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE 1200 // set by library:lwip @@ -250,9 +250,9 @@ #define MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY NONE // set by library:nsapi #define MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT 10 // set by library:nsapi #define MBED_CONF_NSAPI_DNS_CACHE_SIZE 3 // set by library:nsapi -#define MBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME 10000 // set by library:nsapi +#define MBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME 5000 // set by application[*] #define MBED_CONF_NSAPI_DNS_RETRIES 1 // set by library:nsapi -#define MBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS 10 // set by library:nsapi +#define MBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS 3 // set by application[*] #define MBED_CONF_NSAPI_PRESENT 1 // set by library:nsapi #define MBED_CONF_NSAPI_SOCKET_STATS_ENABLED 0 // set by library:nsapi #define MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT 10 // set by library:nsapi diff --git a/variants/PORTENTA_H7_M7/conf/mbed_app.json b/variants/PORTENTA_H7_M7/conf/mbed_app.json index 2ab0fddc5..fbf702dd2 100644 --- a/variants/PORTENTA_H7_M7/conf/mbed_app.json +++ b/variants/PORTENTA_H7_M7/conf/mbed_app.json @@ -15,6 +15,9 @@ "cellular.at-handler-buffer-size": 512, "mbed-trace.enable": true, "target.mbed_app_start": "0x8040000", + "nsapi.dns-response-wait-time": 5000, + "nsapi.dns-total-attempts": 3, + "lwip.raw-socket-enabled": true, "target.macros_add": [ "BT_UART_NO_3M_SUPPORT", "USB_DYNAMIC_CONFIGURATION", diff --git a/variants/PORTENTA_H7_M7/defines.txt b/variants/PORTENTA_H7_M7/defines.txt index 7f3f52d69..24f4526bd 100644 --- a/variants/PORTENTA_H7_M7/defines.txt +++ b/variants/PORTENTA_H7_M7/defines.txt @@ -46,7 +46,7 @@ -D__FPU_PRESENT=1 -DLSE_STARTUP_TIMEOUT=200 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730202770.5918262 +-DMBED_BUILD_TIMESTAMP=1738678521.1974137 -D__MBED_CMSIS_RTOS_CM -DMBED_TICKLESS -DMBEDTLS_FS_IO diff --git a/variants/PORTENTA_H7_M7/libs/libmbed.a b/variants/PORTENTA_H7_M7/libs/libmbed.a index 0b0f82eb9..286f51da4 100644 Binary files a/variants/PORTENTA_H7_M7/libs/libmbed.a and b/variants/PORTENTA_H7_M7/libs/libmbed.a differ diff --git a/variants/PORTENTA_H7_M7/mbed_config.h b/variants/PORTENTA_H7_M7/mbed_config.h index a6f5ffd53..0bdce3566 100644 --- a/variants/PORTENTA_H7_M7/mbed_config.h +++ b/variants/PORTENTA_H7_M7/mbed_config.h @@ -227,7 +227,7 @@ #define MBED_CONF_LWIP_PPP_IPV6_ENABLED 0 // set by library:lwip #define MBED_CONF_LWIP_PPP_THREAD_STACKSIZE 768 // set by library:lwip #define MBED_CONF_LWIP_PRESENT 1 // set by library:lwip -#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 0 // set by library:lwip +#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 1 // set by application[*] #define MBED_CONF_LWIP_SOCKET_MAX 4 // set by library:lwip #define MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY osPriorityNormal // set by library:lwip #define MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE 1200 // set by library:lwip @@ -252,9 +252,9 @@ #define MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY NONE // set by library:nsapi #define MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT 10 // set by library:nsapi #define MBED_CONF_NSAPI_DNS_CACHE_SIZE 3 // set by library:nsapi -#define MBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME 10000 // set by library:nsapi +#define MBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME 5000 // set by application[*] #define MBED_CONF_NSAPI_DNS_RETRIES 1 // set by library:nsapi -#define MBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS 10 // set by library:nsapi +#define MBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS 3 // set by application[*] #define MBED_CONF_NSAPI_PRESENT 1 // set by library:nsapi #define MBED_CONF_NSAPI_SOCKET_STATS_ENABLED 0 // set by library:nsapi #define MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT 10 // set by library:nsapi diff --git a/variants/PORTENTA_X8/defines.txt b/variants/PORTENTA_X8/defines.txt index 4f22911f8..84f8e1a24 100644 --- a/variants/PORTENTA_X8/defines.txt +++ b/variants/PORTENTA_X8/defines.txt @@ -34,7 +34,7 @@ -DEXTRA_IDLE_STACK_REQUIRED -D__FPU_PRESENT=1 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730203130.6854968 +-DMBED_BUILD_TIMESTAMP=1738678907.604638 -D__MBED_CMSIS_RTOS_CM -DMBED_MPU_CUSTOM -DMBED_TICKLESS diff --git a/variants/PORTENTA_X8/libs/libmbed.a b/variants/PORTENTA_X8/libs/libmbed.a index b1614fc6e..f97d15a42 100644 Binary files a/variants/PORTENTA_X8/libs/libmbed.a and b/variants/PORTENTA_X8/libs/libmbed.a differ diff --git a/variants/RASPBERRY_PI_PICO/defines.txt b/variants/RASPBERRY_PI_PICO/defines.txt index 9992f6dfd..145819bb8 100644 --- a/variants/RASPBERRY_PI_PICO/defines.txt +++ b/variants/RASPBERRY_PI_PICO/defines.txt @@ -21,7 +21,7 @@ -DDEVICE_USTICKER=1 -DDEVICE_WATCHDOG=1 -D__MBED__=1 --DMBED_BUILD_TIMESTAMP=1730202745.2787673 +-DMBED_BUILD_TIMESTAMP=1738678494.5493546 -D__MBED_CMSIS_RTOS_CM -DMBED_MPU_CUSTOM -DMBEDTLS_ENTROPY_NV_SEED diff --git a/variants/RASPBERRY_PI_PICO/libs/libmbed.a b/variants/RASPBERRY_PI_PICO/libs/libmbed.a index 77892601e..1075eec8e 100644 Binary files a/variants/RASPBERRY_PI_PICO/libs/libmbed.a and b/variants/RASPBERRY_PI_PICO/libs/libmbed.a differ