About the C-code generate from Simulink transplant to the project of CodeWarrior

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

About the C-code generate from Simulink transplant to the project of CodeWarrior

1,009 Views
edenli
Contributor V

Hi Guys,

   Now,i wanna to transplant the C-code generate from simulink to the Codewarrior project,but i come across some error.

Now,let me discribe my operation :

Firstly:

I opened the Model named tests564xl.mdl using simulink,and generate the C- code;

not:the file of tests564xl.mdl in the attactment.

secondly:

i built an empty project using CW;

Thirdly:

I copy the files in the folder named tests564xl_rappid_rtw to src;

shown as below:

187230_187230.pngpastedImage_3.png

and,there are some Errors,shown as below:

187231_187231.pngpastedImage_4.png

As the picture shown:

(1)How to comprehend the first warnning 'Projects can support only command file'?

(2)I cann't find the .o file,Why popup the error?

 

Not: My transplanting project named Test_GPIO.zip in the attachment.

 

Help me!

Original Attachment has been moved to: tests564xl_rappid_rtw.zip

Original Attachment has been moved to: tests564xl.mdl.zip

Original Attachment has been moved to: Test_GPIO.zip

6 Replies

716 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi edenli‌,

Your approach is correct but you need to pay attention to few details.

(1)How to comprehend the first warning 'Projects can support only one linker command file'?

Answer 1: That is because you have added 2 linker files into your project: one from the empty project creation and one from the Matlab generated code. You need to keep only one file.

Capture.PNG

Ideally would be to keep the one from Model Based design since that was used to generated and build the code.

(2)I can't find the .o file,Why popup the error?

Answer 2: No, the error says something different. It says that the "file_xxx.o" contains a symbol "YYY" and the LINKER does not know where to place it.

The *.o extension files are the outputs of the compilation stage - machine code but with unresolved address for the symbols.

The LINKER takes all these *.o file that are the outcome of *.c files and tries to resolve all the symbols based on the linker command file that basically tells the LINKER in which memory section to place your function/variable/code/data etc (aka symbols)

You need to fix the #1 problem first and choose the correct linker command file for compilation.

Hope this helps!

Daniel

PS: one of these days i'm going to create a video about how to create a CW project from files generated by Model Based Design - since i see is a hot topic.

716 Views
edenli
Contributor V

Hi Dainel,

Thank you for your reply,i still has some error ,since it is so-'create a video about how to create a CW project from files generated by Model Based Design',i wanna know when did release the video?

0 Kudos

716 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi edenli‌,

Next week, i'm going to be present to a Matlab Conference - hence by bandwidth is limited. I'll try to make it available by end of next week - eventually i can start with a written tutorial first.

Best regards,
Daniel

0 Kudos

715 Views
edenli
Contributor V

Hi Daniel,

When did the video about the how to create a CW project from files generated by Model Based Design will release?

I will continue to focus on your post.

0 Kudos

715 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi edenli‌,

It's on my plate. As soon as i finish it i will post it. For the moment i'm still gathering ideas about what to showcase in such video. You gave me some :-)

Best regards,
Daniel

0 Kudos

715 Views
edenli
Contributor V

OK

0 Kudos