Skip to content

[QUESTION] TCP transport cannot compile on Zephyr (missing netdb.h, pthread, and unsupported threading) #473

@rongteng-lee

Description

@rongteng-lee

Hi, I’m trying to build eRPC on Zephyr RTOS and encountered several compilation errors when enabling the TCP transport (erpc_tcp_transport.cpp). It seems that the TCP transport and pthread threading implementation are not compatible with Zephyr.

Environment

  • Zephyr version: (4.0.0)
  • eRPC version: master (1.13.0)
  • Toolchain: Zephyr SDK / GCC ARM
  • Platform: Raspberry Pi Pico (rp2040)

Issue Description

When building eRPC inside a Zephyr application, the following errors occur:

  1. netdb.h not found

fatal error: netdb.h: No such file or directory #include <netdb.h>

Zephyr does not provide netdb.h (POSIX network database), so this header cannot be included.

  1. pthread-based implementation is pulled into the build

error: 'pthread_key_t erpc::Thread::s_threadObjectKey' is not a static data member

and

error: no matching function for call to 'k_thread::k_thread(int)'

Zephyr does not support pthreads, and the k_thread structure does not behave like a C++ class, so this code cannot compile.

Questions

  1. Is TCP transport officially supported on Zephyr?

  2. If not, is there any plan (or recommended approach) to port TCPTransport to the Zephyr networking stack (zephyr/net/socket.h)?

Thank you!

Steps you didn't forgot to do

  • I checked if there is no related issue opened/closed.
  • I checked that there doesn't exist opened/closed PR which is solving this issue.
  • I looked in documentation if there is related information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions