Skip to content

port to ESP-IDF 6.0 and open62541 v1.5.4 - #13

Open
diplfranzhoepfinger wants to merge 1 commit into
Pro:masterfrom
diplfranzhoepfinger:IDF6_min
Open

port to ESP-IDF 6.0 and open62541 v1.5.4#13
diplfranzhoepfinger wants to merge 1 commit into
Pro:masterfrom
diplfranzhoepfinger:IDF6_min

Conversation

@diplfranzhoepfinger

Copy link
Copy Markdown

feat: port to ESP-IDF 6.0 and open62541 v1.5.4, minimal NS0 build

  • Update open62541 build to freertos-lwip architecture (renamed from
    freertosLWIP), providing FreeRTOS stub and no_install.cmake to satisfy
    CMake configure without a host FreeRTOS source tree
  • Switch BUILD_COMMAND to open62541-amalgamation target
  • Add patch_config.cmake to disable UA_HAS_GETIFADDR in generated
    config.h (not available on FreeRTOS/ESP32)
  • Add compat_includes/ wrappers for FreeRTOS.h and task.h (IDF 5+
    requires freertos/ prefix)
  • Suppress all warnings on generated open62541.c (third-party file)
  • Add gethostname() shim to custom_getaddrinfo.c
  • Switch UA_NAMESPACE_ZERO from FULL + hand-maintained nodes_blacklist.txt
    to REDUCED: open62541's own curated minimal NS0 (Opc.Ua.NodeSet2.Reduced.xml
    plus per-feature Minimal.xml nodesets), gated by UA_ENABLE_ flags. The
    blacklist approach kept breaking whenever a blacklisted node was still
    transitively referenced (DataType, HasTypeDefinition, reference type
    lookups) by an active node. nodes_blacklist.txt is now unused and removed.
  • Disable UA_ENABLE_DIAGNOSTICS, UA_ENABLE_HISTORIZING, UA_ENABLE_PUBSUB,
    UA_ENABLE_DA, UA_ENABLE_SUBSCRIPTIONS_EVENTS, UA_ENABLE_JSON_ENCODING,
    UA_ENABLE_XML_ENCODING and UA_ENABLE_STATUSCODE_DESCRIPTIONS to shrink
    the build; keep UA_ENABLE_DISCOVERY/_MULTICAST=MDNSD (used by main.c's
    mDNS setup) and leave UA_ENABLE_TYPEDESCRIPTION / UA_ENABLE_DATATYPES_ALL
    at their defaults (ON) since open62541 v1.5.4's security/GDS code and
    structure-description parsing reference types that don't compile with
    either one turned off
  • Migrate main.c APIs for IDF 5+/6:
    • UA_String_deleteMembers/UA_LocalizedText_deleteMembers → _clear
    • tcpip_adapter → esp_netif
    • spi_flash_init/get_chip_size → esp_flash_get_size
    • sntp_* → esp_sntp_*
    • esp_task_wdt_init → esp_task_wdt_config_t struct
    • UA_ServerConfig.customHostname → serverUrls
    • UA_ARCHITECTURE_FREERTOSLWIP guard moved after open62541.h include
  • Add CONFIG_ETHERNET_HELPER_CUSTOM_HOSTNAME to sdkconfig.defaults
  • Add spi_flash to main component REQUIRES
  • Binary size drops from ~2.9 MB (98% of the 3 MB factory partition) to
    ~1.1 MB (63% free); factory partition size left at 3 MB for headroom

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

feat: port to ESP-IDF 6.0 and open62541 v1.5.4, minimal NS0 build

- Update open62541 build to freertos-lwip architecture (renamed from
  freertosLWIP), providing FreeRTOS stub and no_install.cmake to satisfy
  CMake configure without a host FreeRTOS source tree
- Switch BUILD_COMMAND to open62541-amalgamation target
- Add patch_config.cmake to disable UA_HAS_GETIFADDR in generated
  config.h (not available on FreeRTOS/ESP32)
- Add compat_includes/ wrappers for FreeRTOS.h and task.h (IDF 5+
  requires freertos/ prefix)
- Suppress all warnings on generated open62541.c (third-party file)
- Add gethostname() shim to custom_getaddrinfo.c
- Switch UA_NAMESPACE_ZERO from FULL + hand-maintained nodes_blacklist.txt
  to REDUCED: open62541's own curated minimal NS0 (Opc.Ua.NodeSet2.Reduced.xml
  plus per-feature *Minimal.xml nodesets), gated by UA_ENABLE_* flags. The
  blacklist approach kept breaking whenever a blacklisted node was still
  transitively referenced (DataType, HasTypeDefinition, reference type
  lookups) by an active node. nodes_blacklist.txt is now unused and removed.
- Disable UA_ENABLE_DIAGNOSTICS, UA_ENABLE_HISTORIZING, UA_ENABLE_PUBSUB,
  UA_ENABLE_DA, UA_ENABLE_SUBSCRIPTIONS_EVENTS, UA_ENABLE_JSON_ENCODING,
  UA_ENABLE_XML_ENCODING and UA_ENABLE_STATUSCODE_DESCRIPTIONS to shrink
  the build; keep UA_ENABLE_DISCOVERY/_MULTICAST=MDNSD (used by main.c's
  mDNS setup) and leave UA_ENABLE_TYPEDESCRIPTION / UA_ENABLE_DATATYPES_ALL
  at their defaults (ON) since open62541 v1.5.4's security/GDS code and
  structure-description parsing reference types that don't compile with
  either one turned off
- Migrate main.c APIs for IDF 5+/6:
  - UA_String_deleteMembers/UA_LocalizedText_deleteMembers → _clear
  - tcpip_adapter → esp_netif
  - spi_flash_init/get_chip_size → esp_flash_get_size
  - sntp_* → esp_sntp_*
  - esp_task_wdt_init → esp_task_wdt_config_t struct
  - UA_ServerConfig.customHostname → serverUrls
  - UA_ARCHITECTURE_FREERTOSLWIP guard moved after open62541.h include
- Add CONFIG_ETHERNET_HELPER_CUSTOM_HOSTNAME to sdkconfig.defaults
- Add spi_flash to main component REQUIRES
- Binary size drops from ~2.9 MB (98% of the 3 MB factory partition) to
  ~1.1 MB (63% free); factory partition size left at 3 MB for headroom

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@diplfranzhoepfinger diplfranzhoepfinger changed the title Updated submodule components/open62541/repo port to ESP-IDF 6.0 and open62541 v1.5.4 Aug 2, 2026
@diplfranzhoepfinger

Copy link
Copy Markdown
Author

Switch UA_NAMESPACE_ZERO from FULL + hand-maintained nodes_blacklist.txt
to REDUCED: --> this is the Main change here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant