cancel
Showing results for 
Search instead for 
Did you mean: 

Add custom file to project

DLy.1
Associate

Hi,

Please help me, how to add a custom file into my project. When regenerate source by CubeMX it will delete my source

Thanks,

2 REPLIES 2
BVauc.1
Associate II

I recomend that you separate as much as possible the auto-generated files and your own files. Inside auto generated files, just add functions calls to jump to you own libraries you created in a separate forder.

Khouloud ZEMMELI
ST Employee

​Hello @DLy.1​ , it's recommended to add the custom file after the code generation, you can also rename the  existing "fsdata.c" file wth "fsdata_custom.c".

Some info :

- HTTPD_USE_CUSTOM_FSDATA enabled requires once code has been generated to have in your project folder within Middlewares\Third_Party\LwIP\src\apps\httpd folder "fsdata_custom.c" instead of "fsdata.c".

- Adding "fsdata_custom.c" can be done by renaming existing "fsdata.c" file in "fsdata_custom.c".

- If "fsdata.c" has not been copied in your project, it can be taken from the Firmware Repository (Menu Help > Updater Settings...) Software Package folder within Middlewares\Third_Party\LwIP\src\apps\httpd folder.

- Depending on project settings and IDE used, "fsdata_custom.c" or "fsdata.c" can be removed after each code generation. Please take care of this!

Best Regards,

Khouloud