Using Ethernet in interrupt mode with Cube generated code on STM32H7 (LwIP + HAL + baremetal)
I have a project which is using the STM32H723 to communicate with host PC over ethernet (UDP/IP). Currently I am working with a nucleo development board. I followed the tutorials on the forum and example repos on github to get things working.
I have very strict timing requirements and I am not using an RTOS. I have been benchmarking different parts of my code and have noticed that on occasion the UDP server that I have running takes much longer to send out a response (handful of ms instead of a fraction of a ms). I narrowed down the blocking code to the `HAL_ETH_Transmit();` call from `low_level_output` in the etherntif.c file generated by Cube.
Reading through the HAL documentation I found that there exists a `HAL_ETH_Transmit_IT()` function which should send out packets without blocking. I enabled the ethernet interrupt in Cube code generation tool and then had to edit both the `low_level_output` and `ethernet_link_check_state` functions in ethernetif.c to use the interrupt variety of HAL_ETH and I had to register the `HAL_ETH_TxCpltCallback` to call `HAL_ETH_ReleaseTxPacket` to get things to work.
My question is as follows: Is there a reason that the generated Cube code does not use the HAL ethernet functions in interrupt mode? Am I missing something with what I have done or is this modification the "right" way to do it? Are there settings in Cube that I could have used to generate the correct code from the get go?
