I'm facing an ethernet project design based on STM32F207 MCU. The firmware runs a server (TCP or UDP servers) that is constantly asked by 1 to 10 clients. Request and answer payload are less than 20 bytes. Before the custom PCB was produced the server was developed and tested on its corresponding nucleo board. But tests were based on 1 remote host connection as a client to the nucleo server by a local network.
After this moment, a PCB prototype production was done so we could test and validate this PCB design. The PCB was exactly working as Nucleo did. From here, firmware development and debugging continued within the custom hardware.
When we tried to add more clients -in a nonstop way test- the application works correctly during some hours before getting a "hardfault". The great part of times, it was the stop working event. We were unable to trace this hardfault, or surelly we don't know how to trace it.
I would like to ask for a thinking that is incoming to my head and I have not found any data about this:
Talking with someone, this person says to me that putting a server with multiclient connections in a microcontroller is a very big challenge, due they are not processors neither uProcessors (powerful and higher performance devices compared to cortex-m3 like stm32f2). CPU could be "collapsed" by this kind of applications.
Hearing this, I tried to look for people who deals with "servers on microcontroller with multi-clients connections" or give its suggestions about this. But I have no success. I have seen that there is no examples, a lot of developers asking for help at the same point with not solved situations, no evidence of a working demo, etc.. Even I opened a ticket with ST stuff (I'm waiting for their answer).
I'm looking for some ethernet embedded expert that gives me answers about this question. Someone who tells me from its experience if he did a server with multi connection with success in a microcontroller like this. It will be appreciate if someone brings me related documentation/webpages about that implementing this kind of applications on microcontroller could easily hang its CPU or not.
I need some evidence that multiclient in a stm32f207 asking for requests to the server could be supported.
Are someone with experience on this here?
Edit
As it seems to be concerning and it could useful for readers in order to talk about this situation, I decided to add here the particular requirements of this server application what I'm talking about.
We made the simpler server application from echo server demo given by ST: client requests with a byte and server answering 16 bytes. Then we add read or write 16 digital input or digital output (using HAL write/read functions) depending on command byte received into every client request.
We were having same issue with TCP server and UDP server, using freeRTOS plus netif, using HAL layer, and we have been using LwIP stack as suggested by ST, now we are not using FreeRTOS due we are not very experienced on this and we were unable to deal with advanced level FreeRTOS handling. So we tried to change to a non RTOS strategy and we are working with RAW API.
Server Application details:
- We would connect from 1 to 10 clients.
- Every client would be sending requests to the server 100per/sec (but it could be slower if this ratio is too much for this server).
- Client only stops requests once it is disconnected from the server.
- Every client request has less than 20 bytes of data payload,
- When server receives a request the MCUreads/writes some GPIOs, then; server musts answer immediately to the client request with the result into a 16bytes data payload.
- Now we are trying this with TCP and UDP server. The same result.
- I defined pool options for statical buffers.
- Server is configured with RxMode = polling mode.
- Client is made with python running on remote host with Windows and clients are executed from windows cmd.
I'm working on understanding and calculating the correct and optimal lwipopts.h options. I'm also working on HAL_Ethernet defines for MAC frames handling.
I'm sure optimal configuration could improve some resource issues. But not sure if it will solve our hard fault problem.