Can somebody say what im doing wrong
I have project in STM32Cube with lwip and freertos
Im trying to add new thread(as new task) with exist principles and cant do it
And at build I have got the following make errors:
main.o: in function ‘main’
undefined reference to ‘mstartTcpCon’
As I created project by cube I dont think that problem with project structure
yet another question to that
The target of mstartTcpCon is to connect to the sever(PC) within TCPIP
In that function I use netconn API within FreeRTOS and I create connection(socket), connect to server and send data
But in proctice I have en Error after netconn_connect
Please help
Here the source code of that function:
You should add the necessary details (which error(code) ?) if you want some help.
Also it’s very helpful to know what you’re trying to achieve.
(I wonder that you first connect to a server as client and afterwards changing the role being the server.)
Please note that is a lwIP issue which is not part of FreeRTOS. FreeRTOS comes with it’s own (optional) TCP stack.
Did you try one of the probably provided STcube lwIP demos/examples first to get in touch with it ?
Hint: Please enclose code blocks in 3 tildas (~~~) or 3 backticks (```) and try to align/format the code for better readability
Sorry, the previous en error was cause of absence of server
Now connection established but when I send data I cant see it in Wireshark
and in debug mode I have Err_Ok after data transmission. At PC side server in listen
What is slave here ? The client resp. your application ?
Where is the send call with the data you want to transfer to the (server) peer?
There is no TCP transfer (start) in the Wireshark logs.
You should check the return and/or error codes of the networking API calls.
They usually give some well documented information on failure. See the lwIP docs for the details.
At the PC(server) side I see the connetion, receiving, but the data is mpty string and size of data decreased in 2 bytes, - I send 8 bytes and receive 6.
Why I cant see it in wireshark maybe cause of W10?
Also I cant see any ARP
So finally you have your application somehow working, netconn_write returns OK and you receive only 6 bytes instead of 8 and the data is wrong, right ?
Did you check the received bytes ? Are they partially wrong or completely junk ?
I wonder why the connection establishment IS traced by Wireshark and the data transfer is not. That’s strange and shouldn’t happen. Is there some wrong/unwanted filtering configured in Wireshark ? Without Wireshark you’ll probably have a hard time investigating networking issues. It’s an inevitable tool.
Is your ethernet driver known to work ?
Did you verify your setup / board with a lwIP demo/example application known to work ?
If the software is provided by ST as is you should ask them for support.
I don’t think the issue is related to FreeRTOS and also I’m not familiar with lwIP and can’t help with it.
Good luck !
Finally Ive got working TCP, but while integration it in exist project I have some problem
Project based on queues and then I create new queue I stopped on xQueueReceive
And when I trying to paste new code into existing queue I also have problem
Here the existing queue:
In addition the critical section covers by far too much code. You really should try to understand what you’re glueing together. Otherwise it’s a road to nowhere…