Hi Marius,
One problem when I use mbd_mpc574x_user_copy_required_files,That is to generate an error when generating the code:

I declared a function called copy1 directly below the SWT init function:

To pass compilation, I added coder.extrinsic('fullfile');But another error occurred:

So again I use the coder.extrinsic function:

Finally no error occurred,But there is no "swt_driver.c" I copied in the folder where the code is generated.
I think it may be due to the existence of the coder.extrinsic function in the process of generating the code, and the copy1 function is not run, the help document of MATLAB may explain this problem:

Actually, I may have misunderstood what you mean, you may mean to make me write a script that copies files by referring to script mbd_mpc574x_user_copy_required_files. Because the script that copies the files doesn't have to generate code, and I did:

In order to automatically run this script, I use it as a callback function:

According to the CallbackTracing function of Simulink, can see that the copy function does run:

But there is still no copied source file in the code generated file:

I think maybe the copy function needs to be executed after the generated code is done, but I don't know how to automate it
If I run it manually, copy the source file to the folder where the code is generated, and then import it into S32DS through the XML file, the copied source file cannot actually be imported into the project, so I have to run it manually and copy the source file to Under the directory of the S32DS project.
But I wonder if there is a way to make the script run automatically?
Best Regards
Zhang