Question about s function builder

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Question about s function builder

Jump to solution
1,287 Views
260068845
Contributor III

Hello, engineers
I am currently learning the toolbox of MPC5744P. I have encountered some problems when using s function builder. My idea is to use s function to call the module after s function builder build, but I am not very familiar with the following problems during compilation. Understand, is it wrong with me? The forum mentioned using the model call s function builder build, but I have not succeeded. Attachment is my project file, I hope to get answers, thank you! !

模型照片.PNGerror.PNG

1 Solution
1,093 Views
mariuslucianand
NXP Employee
NXP Employee

Hello 260068845@qq.com‌,

Your problem cause is that the file test_builder_wrapper.c is not found in the Test_v1_mbd_rtw folder, so it is not compiled and when it tries to create the elf file, it finds no reference to the custom functions inserted. 

In order to solve this, the easiest way is to go to the {Matlab Addons}\MPC\Toolboxes\NXP_MBDToolbox_MPC57xx\code\mbdtbx_mpc574x\mbdtbx_mpc574x\mscripts\utils, rename the mbd_mpc574x_user_copy_required_files.m to mbd_mpc_user_copy_required_files.m and inside the function add the following line of code.

 mbd_mpc_copy(fullfile('{absolute file location}', 'test_builder_wrapper.c'), fullfile(dest_dir, 'test_builder_wrapper.c'), 'f');

This will copy the test_builder_wrapper.c any time you will generate the code and add the file in the makefile too. 

Best Regards, 

Marius

View solution in original post

0 Kudos
2 Replies
1,094 Views
mariuslucianand
NXP Employee
NXP Employee

Hello 260068845@qq.com‌,

Your problem cause is that the file test_builder_wrapper.c is not found in the Test_v1_mbd_rtw folder, so it is not compiled and when it tries to create the elf file, it finds no reference to the custom functions inserted. 

In order to solve this, the easiest way is to go to the {Matlab Addons}\MPC\Toolboxes\NXP_MBDToolbox_MPC57xx\code\mbdtbx_mpc574x\mbdtbx_mpc574x\mscripts\utils, rename the mbd_mpc574x_user_copy_required_files.m to mbd_mpc_user_copy_required_files.m and inside the function add the following line of code.

 mbd_mpc_copy(fullfile('{absolute file location}', 'test_builder_wrapper.c'), fullfile(dest_dir, 'test_builder_wrapper.c'), 'f');

This will copy the test_builder_wrapper.c any time you will generate the code and add the file in the makefile too. 

Best Regards, 

Marius

0 Kudos
1,094 Views
260068845
Contributor III

That's right ! My problem have sloved,thank you.