How can I use S32 DS to compile the C code generated from Simulink model?

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

How can I use S32 DS to compile the C code generated from Simulink model?

2,053 Views
1506840872
Contributor II

Hello, I bought a Devkit-MPC5744 recently, and downloaded the Model-based Design Toolbox for MPC5744P from the NXP website.

pastedImage_1.png

And then I open the example model file from the Model-based Design Toolbox. The model is "uart_model_pnt".

pastedImage_6.png

 After that I configure the parameter and build the model, and then the Simulink generate the C code.

pastedImage_5.png

pastedImage_7.png

After that I created a new project in S32 design studio and replace the source file and header file with the C code generated from Simulink.

But when I import the C code into the S32 Design Studio, and build the project, it always failed.

The building operation always abort ,and a red cross occured.

pastedImage_8.png my project in S32 ds

The everyone process before the building seems OK. But I cannot build the code generated from the simulink.

Could anyone please help me?

Labels (1)
0 Kudos
8 Replies

1,607 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

can you please share output from build console? 

Jiri

0 Kudos

1,607 Views
1506840872
Contributor II

Thank you for your reply. The console is as fellow:

pastedImage_1.png

It says cannot open the *.s file, but in fact the Simulink generated the *.s file and I put them into the "src" folder.

pastedImage_2.png

So how can I solve the problem? thank you

0 Kudos

1,607 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

for some reason is S32DS using files from temporary folder. It is possible share your project? 

Jiri 

0 Kudos

1,607 Views
1506840872
Contributor II

No problem. The project and the code generated from the Simulink are as fellow.

And I tried after your last reply.

I tried to delete the *.s file in the "src" folder, it is not ok.

pastedImage_1.png

And then I put the *.s file which contains the 'e200zx_interrupt_setup' function, into the "include" folder, it is ok to read. But then new problem occur.

pastedImage_2.png

So I put the all *.s files into the "include" folder. But the problem is still here, and new problem occurs:

pastedImage_3.png

Could you please show me how to compile the code generated from the Simulink?

Thank you so much.

Best wishes.

0 Kudos

1,607 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

thanks for sharing your project. So - there was couple issues - you need to use linker script file from Simulink project. Second one - Simulink project already contains startup code. I excluded from build default startup.S. Also some assembly code are used for include (in include), some others are dedicated to build (in src) 

Fixed project is in attachment. 

Jiri 

0 Kudos

1,607 Views
1506840872
Contributor II

Thank you, Jiri. I do appreciate your help.

The fixed project has been successful to compile, but with a warning.

pastedImage_1.png

And the problem is that the program doesn't run.

When I click "resume" button and start the program, it will stop somewhere in configure_flash.s file

pastedImage_3.png

pastedImage_4.png

And when I reclick the "resume" button, the program seems running, but actually not running. 

I am sure the program are not running because I add some sentences to turn on the LED. However, it doesn't work.

pastedImage_8.png

 The console text is in attachment.

I do appreciate if you could help.

0 Kudos

1,607 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

this question is more related to Model-based design toolbox than S32DS and I'm not familiar with this stuff. Better idea is place your question to this community - https://community.nxp.com/community/mbdt/diy 

Jiri 

0 Kudos

1,607 Views
1506840872
Contributor II

Thank you soooooooooooo much, Jiri.

I will place the question in the community which you mentioned.

0 Kudos