problems establishing tcp connection with stm32h753 #3106
-
Hello! I'm fairly new to embedded development. I'm trying to turn my stm into an echoserver, but I'm having problems with it. I followed the tutorial and the provided github tcp example. In main.c "USER CODE BEGIN/END 0" Section, I have everything from the tcp example before the main function. Additionally I've defined All attempts to ping the board are succesful but when I try to connect (using hercules SETUP utility as client) then I get a "tcp connection error 10061". Doing a debug run, the first loop through the server event handler goes into the if branch with MG_EV_OPEN event and the loops after that don'. But it never goes into the if branch with MG_EV_READ. Any idea of what the problem could be, and how to fix it? PS: here's the (relevant part of) my main.c:
PPS: I've done everything with STM32CubeIDE |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Please do not post screen captures, post text logs. Said that, to the best of my guessing, you have copied a piece of code that is intended to work on an operating system where both client and server run on the same host and use the loopback interface provided by the OS. You pasted that code into an embedded system with no OS, where there is no loopback interface. From the back of my mind, I would change 'localhost' for '0.0.0.0', which means "listen in all interfaces", and is shown and explained in most of our embedded tutorials. Then you can expect to get a CONNECT event first, then when your connecting client sends any data, you will see a DATA event Please see our documentation, and follow the guidelines in our tutorials. |
Beta Was this translation helpful? Give feedback.
Please do not post screen captures, post text logs.
Please do not post your whole program, we don't check user code for errors, if you have a problem, ask specific questions and post those sections where you are in doubt.
Please don't throw pieces of code here and there and then ask us why it doesn't work. It is impossible to understand why what you want to do is not working if you don't say what you want to do.
Said that, to the best of my guessing, you have copied a piece of code that is intended to work on an operating system where both client and server run on the same host and use the loopback interface provided by the OS. You pasted that code into an embedded system with no OS, wher…