I'm working on project that needs some web functionality. Using STM32F429 + PHY LAN8720 with FreeRTOS and LwIP 1.4.1 raw API. I'm running webserver from SDCard, which is showing numbers generate by microcontroller firmware, and Modbus communication protocol over TCP. As far as I'm testing only one of these functionality, everything works fine - problems starts when I'm trying to run both at once. To be precise:
pwmfreq.open("GET", "/pwmfreqget?id=1", true);
and in firmware in fs.c file function fs_open is including
if (strncmp(name, "/pwmfreqget?id=1", 16) == 0)
static char pcBuf;
sprintf(pcBuf, "%f", variable.value);
file->data = "">
file->len = strlen(pcBuf);
file->index = file->len;
file->pextension = NULL;
- Modbus TCP is just a simple packet service. In receive callback payload is parsed for modbus frame length, id, function etc. and in return is sending random value (the same value is used in website). I'm requesting for 20 registers information (= 40 bytes) from four different sources every 10 seconds.
As I said before, everything works fine until I run both function at once. Then modbus starts losing connection every few (random) seconds, and website overwrite values with much bigger interval than one second. Everything is very unstable.
My question is - is there possibility to increase LwIP performance, and if is, what I should trying to modify to get better results. I'm using also external SRAM memory, but I'm entirely sure how I should apply it to cooperate with LwIP.