Zephyr RTOS: Getting bind error with respect to sockets #61506
-
Hi, i. Intel Agilex 7 FPGA board I am able to successfully create a socket but get the below error is generated during the binding process: ErrNo= -1, Error = Not owner Can anyone please tell me why the binding is throwing an error "Not owner"? Below are my socket configuration parameters in the pro.conf file: SocketsCONFIG_NET_SOCKETS=y Networking configuration parameters: Best Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Hi @sanjatpanigrahi! We appreciate you submitting your first issue for our open-source project. 🌟 Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙 |
Beta Was this translation helpful? Give feedback.
-
@sanjatpanigrahi I'm not sure if you're checking the error code correctly, Also, it'd be good to see some sample code on how are you actually using |
Beta Was this translation helpful? Give feedback.
-
@rlubos I do check the actual error returned from bind(). Below is the code snippet: #define | EPERM 1 int sockfd, connfd; if (sockfd == -1) // assign IP, PORT bind_status = bind(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)); Few more information: I am running my application program compiled with Zephyr RTOS below is my command: cmake -GNinja -DBOARD=intel_socfpga_agilex_socdk ../../samples/server I flash the Zephyr RTOS on an Agilex 7 Intel FPGA having an ARM Cortex A53 processor on which first the u-boot runs. Then using ARMDS IDE I flash the "zephyr.elf" which got generated with the above command. If instead of using Zephyr RTOS, I use Linux on the FPGA and run my program it works. This means, the FPGA board is not broke and the networking works. I am facing bind error only when I use the Zephyr RTOS to run my application. |
Beta Was this translation helpful? Give feedback.
-
Just as I wrote above, As for the board, I'm not familiar with that particular one, but looking at the documentation it seems that the board does not support networking in any form in Zephyr: |
Beta Was this translation helpful? Give feedback.
-
phooo... how did I miss it!!!! Does the below: does the above means that the Zephyr RTOS doesn't enables the networking stuffs? |
Beta Was this translation helpful? Give feedback.
-
Since you don't request any particular address to bind to (
During socket creation, it is not verified whether there are any network interfaces in the system (because at that point socket is not bound to any). But any operation that would require to bind it with particular interface (bind(), send() etc.) would fail. |
Beta Was this translation helpful? Give feedback.
Just as I wrote above,
bind_status
should not be interpreted wihtstrerror()
as it does not carry the error code. Socket functions in case of error will always return-1
, for the actual error code you should check theerrno
variable (sostrerror(errno))
etc.).As for the board, I'm not familiar with that particular one, but looking at the documentation it seems that the board does not support networking in any form in Zephyr:
https://docs.zephyrproject.org/latest/boards/arm64/intel_socfpga_agilex_socdk/doc/index.html#supported-features
So this is likely the culprit of the
bind()
failing - if there's …