AnsweredAssumed Answered

MCToolbox can't find my hand written code. Does it support S-Function?

Question asked by Meimei Ouyang on Apr 4, 2017
Latest reply on Apr 7, 2017 by Meimei Ouyang

Hi,

 

I am working on a Simulink model with normal Simulink blocks and C code (S-Function Builder) combined together. The S-Function Builder itself is super simple (output = input * 2) for testing. It generated a "testMult.c" and "testMult_wrapper.c" automatically. I tested the S-Function with Simulink scope and it is working as expected.

 

However, when I build the model to generate the ".mot" file to download to the hardware, I always get the following error:

...

Building file sine_wave_library.o...
Building file siu_init.o...
Building file sys_init.o...
Building file sysclk_init.o...

Building file testMult_wrapper.o...

### CW for MPC55xx and MPC56xx 2.10/PowerPC_EABI_Tools/Command_Line_Tools/mwcceppc Usage Error:
# Specified file 'testMult_wrapper.c' not found
Errors caused tool to abort.
gmake: *** [testMult_wrapper.o] Error 1
### Creating HTML report file PWM_test_codegen_rpt.html
### Build procedure for model: 'PWM_test' aborted due to an error.

Looks like the compiler can't find the "testMult_wrapper.c". Not sure if it found the "testMult.c" or not. Those two C files are in the same folder where the Simulink model is.

 

I tried to remove the S-Function Builder and then the ".mot" file can be generated successfully.

 

Does anyone experience this error before? Thanks!

 

EDIT:

Also tried with Legacy Code Tool, still has a similar error.

Building assembly file crt0.o...
Building assembly file sw_handlers.o...
Building assembly file excep_handler.o...
Building file untitled3.o...
Building file CTU_564xL_library.o...
Building file FlexPWM_564xL_library.o...
Building file adc0_EOC_isr.o...
Building file adc0_config.o...
Building file adc_564xl_library.o...
Building file adc_init.o...
Building file adc_trigger_init.o...
Building file doubleValue.o...
### CW for MPC55xx and MPC56xx 2.10/PowerPC_EABI_Tools/Command_Line_Tools/mwcceppc Usage Error:
# Specified file 'doubleValue.c' not found
Errors caused tool to abort.
gmake: *** [doubleValue.o] Error 1
### Creating HTML report file untitled3_codegen_rpt.html
### Build procedure for model: 'untitled3' aborted due to an error.

Where doubleValue.c is my code.

Outcomes