LwIP & CubeMX: Changing a static IP address during code initialization
I develop an app with ETH interface and static IP address based on the STM32F207 MCU. The IP address shall be derived from status of input pins, like DIP switch.
CubeMX allows to set the static IP address however does not accept user constants. This IP address is then set to LwIP internal variables in the lwip.c MX_LWIP_Init() routine. I would need to change the IP address in the routine before the LwIP stack gets initialized. I would expect some /* USER CODE BEGIN x */ section there, like in the ethernetif.c low_level_init() routine for easy changing the MAC address (section /* USER CODE BEGIN MACADDRESS */).
Any ideas how to do it without my code being overwritten each time CubeMX re-generates the code? Maybe I miss something. I tried a few hacks (like #undef the #define ip_init()) without success. Would be nice to be able to define own USER CODE section.
CubeMX version: 4.27.0