I want to test the TCP/IP echo server demo available in FreeRTOS-Plus library on my STM32H745I-DISCO. So as a first step, I ran the demo as described in STM32H7_Dual_Core_AMP_RTOS_demo.html
Next I converted that to a LED blinky demo using LED1 and LED2 to blink. Worked so far fine.
Now I want to convert this to a TCP Echo server project. So I followed the steps described in TCP_Networking_Tutorial_Adding_Source_Files.html
I have also added the NetworkInterface.c and eth.c driver from the demo directory. I have also updated the include paths to see the new include files. However NetworkInterface.c throws following compilation error:-
ETH_RX_BUF_SIZE, ETH_TX_BUF_SIZE not defined and protype for ETH_IRQHandler couldn’t be found
Could someone help me understand why the NetworkInterface.c can’t see the above defines and prototype? I have tried to solve first two by adding the defines in STM*hal_conf.h, however can’t figure out why ETH_IRQHandler is not seen. Also seeing several build warnings.
Welcome to the FreeRTOS Forum!
The config flags
ETH_TX_BUF_SIZE are not provided by default for STM32Hxx as they should be configured in the application layer to fit the application needs [FreeRTOS-Plus-TCP Configuration]. You could refer to the STM32Hxx readme and STM32Fxx readme for more details.
ETH_IRQHandler is not seen
If you are using STM32CubeIDE for code generation there can be a chance that you might have
ETH_IRQHandler defined (auto generated) in
stm32*_it.c as well, you might have to check if those definitions are conflicting each other (maybe disable the auto generated version and use the one in the
NetworkInterface.c). If that’s not the case then I don’t see any reason for having a prototype as its an ISR registered among the external interrupt section of your startup file. Also, please check if
ETH_IRQHandler is called explicitly somewhere in your project (ideally it shouldn’t be).
I have also added the NetworkInterface.c and eth.c driver from the demo directory.
Can you share which demo directory is that
Thank you for the quick response!
ETH_TX_BUF_SIZE, I will define them in application layer as per your suggestion.
For ‘ETH_IRQHandler is not seen’, I am using IAR IDE, not STM32CubeIDE as the demo for STM32H745I-DISCO is using the IAR project. And the driver files are copied from following path in the FreeRTOS zip file that is same as the STM32Hxx readme file you have referenced in your reply. The files are added to the IAR project as per port guide, TCP_Networking_Tutorial_Adding_Source_Files.html at the FreeRTOS web page. Fyi, as per forum guideline, I am not allowed to use link in this response as I am a new user.
ETH_IRQHandler should be visible if your
NetworkInterface.c is getting compiled, can you make sure if that’s happening (I hope you are using this NetworkInterface.c which has the
ETH_IRQHandler defined in line 739)
Can you post the error log that you are getting on the IAR here?