2025-01-31 04:45 AM
Hi!
I use STM32CubeIde + FreeRTOS + LWIP and quite often, especially for debugging, I change features through CubeMX. It causes reloading of several files that I would like to patch before build. Examples are LWIP->tcpip.c or LWIP->cc.h.
I face an issue, that once they are reloaded, I need to apply changes manually. I looked into file templates, but it seems even worse idea to manipulate that. I know I could add my patched templates to the project, but it's some kind of CubeIDE feature I guess and could make it work properly. I'd like to just create a patch file and add "git apply" command to pre-build steps. However, it seems that reloading file from the Repository by CubeMX causes patch to be not relevant to the file since I get error that patch "does not apply". I used "git diff" for patch creation.
Any idea how to patch Repository files before building my application and maintain CubeMX "rebuild" functionality?
Solved! Go to Solution.
2025-01-31 05:56 AM
You could run a post-build step that patches them. Pre-build doesn't seem useful.
If you want to use git to patch, look into why "git apply" is failing. Probably the --reject flag would give the desired result.
2025-01-31 05:56 AM
You could run a post-build step that patches them. Pre-build doesn't seem useful.
If you want to use git to patch, look into why "git apply" is failing. Probably the --reject flag would give the desired result.
2025-01-31 06:47 AM
Thanks, this is actually what I wanted. Putting a shell script into main folder and running after code generation patches files I needed.