ERROR COMPILE of export project for MBDT KVx

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

ERROR COMPILE of export project for MBDT KVx

Jump to solution
6,695 Views
CauTran
Contributor I

Hello everyone,  I want to build the code which was generated from MBDT Kvx in Matlab. I followed the instruction to configure MBDT.  But, in MCUXpresso IDE, I have a problem. which show that: 

make (e=2): The system cannot find the file specified.

make: [makefile:62: clean] Error 2 (ignored).

Can you help me? 

Thank you.

 

Labels (1)
0 Kudos
1 Solution
6,558 Views
nxa11767
NXP Employee
NXP Employee

Hi @CauTran ,

The project you attached helped to identify the issue. Somehow in .cproject the sdkVersion turned out to be set to: 

nxa11767_0-1635966558975.png

That really confused the IDE, actually the space between the 2 versions made the IDE to throw that error.

I'm puzzled how that version got there - I wasn't able to reproduce it on my side. Did you changed the SDK path of the model? That's the only reason I'm thinking is causing that version to be put in .cproject (In Model Parameters Settings).

nxa11767_1-1635966733746.png

As a fix - open the .cproject from the <model_name>Config project as a text file and search for <sdkVersion>1.0.0 2.8.0</sdkVersion> and replace it with: <sdkVersion>2.8.0</sdkVersion>

then in MCU IDE, just right click on the project and do a refresh.

Best regards,

Alexandra

View solution in original post

0 Kudos
14 Replies
6,678 Views
nxa11767
NXP Employee
NXP Employee

Hi @CauTran ,

 

Make sure that when you import the project into MCU IDE you do not check the Copy project into workspace. This option will break the paths created in Simulink.

This is the flow I use in MCU IDE. I go to File-> Import -> Existing projects into workspace, Select Config project and make sure the Copy project into workspace is unchecked.

nxa11767_0-1635795792614.png

 

Best regards,

Alexandra

0 Kudos
6,666 Views
CauTran
Contributor I

Dear @nxa11767 ,

I already followed your instruction, but I met a problem. Can you tell how to fix this problem?

 

0 Kudos
6,656 Views
nxa11767
NXP Employee
NXP Employee

Hi @CauTran ,

 

What version of MCU IDE do you use? I tried on a fresh installation of MCU V11.4.1 and a fresh installation of the KVx toolbox and I was able to import the KV5x project with success.

I recommend to recreate the <model_name>Config project - to do that go to the location of the mdl and delete the <model_name>Config project and also the _rtw project and do again a build of the model. Use again the export option for Hardware Settings in Simulink and export the project. Then import it again in MCU IDE. Make sure that you have the SDK for KV5 installed in MCU IDE:

nxa11767_0-1635837996538.png

If you import an SDK project in MCU IDE, you can build it with success? 

If you still see the errors with the project from Simulink please send me the .cproject and .project files (located in the <model_name>Config folder).

Best regards,

Alexandra

0 Kudos
6,639 Views
CauTran
Contributor I

Dear @nxa11767 , 

Sometimes, I already built an imported project successfully. Actually, I have to update the .mex file to build.

I have a question.  "How to link the .mex file with the Simulink file?". I don't how to start with this question. I just modified the demo file and develop them to create an mbd project. 

 

0 Kudos
6,623 Views
nxa11767
NXP Employee
NXP Employee

Hi @CauTran ,

About this question:  "How to link the .mex file with the Simulink file?" - The .mex file is linked to the simulink model by its name. The .mex file naming convention is <model_name>Config.mex (similar for the project created with the SDK files that are needed to build the final application from Simulink). In order to modify the parameters of a block (or configure extra pins, change clock settings), just open a block from the model and press the Configure button:

nxa11767_0-1635924551545.png

This will open the <model_name>Config.mex file using MCUX Configuration Tool (this tool is incorporated into the toolbox). After this you can modify the .mex content - after you did the desired modification just save the file (ctrl+S) - there is no need to use the Update Code option from MCUX Configuration Tool. Going back to Simulink, just press the Update button found inside the block. This will tell the toolbox that the mex file was changed and to consider the changes in the code generation and build process.

When you press the Build and Deploy button in your model:

nxa11767_1-1635924888956.png

Besides generating code for the blocks you have in the model, the toolbox will also generate the C and header files for your <model_name>Config.mex file. These files will be located in <model_name>Config folder, in board subfolder: peripherals.c, peripherals.h, pin_mux.c, pin_mux.h, clock_config.c, clock_config.h) - that's why you don't need to Update Code from Configuration Tool. At Build&Deploy&Start step the <model_name>.axf file of the Simulink model is created and it tries to downloaded on the board based on the settings your model has in Hardware Implementation -> Target hardware resources -> Download. 

You did the right approach by starting from an existing example and start adding there blocks. Initializing the new peripherals that you want to add is done using MCUX Configuration Tool by doing the steps I mentioned above. If you change the name of the model, you need to change also the name of the mex file to match the pattern <model_name>Config.mex.

 

Usually you'll import the <model_name>Config project into MCU IDE after the Build and Deploy step from Simulink. When you do the export from Simulink, the toolbox will create the links between the <model_name>Config folder and the <model_name>ert_rtw folder so that when you import the <model_name>Config project into MCU IDE you can see also the generated code. If you export the project and choose as location Simulink model Folder that ensure that any changes done in MCU IDE in the source files and also in the .mex file will be seen also in the Simulink and vice versa.

You said that you build with success an imported project after: 'Actually, I have to update the .mex file to build.' - from Simulink you are just generating code? Even so, the toolbox will generated the C files for the .mex file if you saved the .mex file after you did the changes.

I hope this answers some of your questions.

Best regards,

Alexandra

 

0 Kudos
6,615 Views
CauTran
Contributor I

Dear @nxa11767 , 

What version do you use for MCUXpresso IDE, MCUXpresso, MBDT?

thank you

0 Kudos
6,606 Views
nxa11767
NXP Employee
NXP Employee

I have MCUXpresso IDE v11.4.1: (latest available on the NXP site).

nxa11767_0-1635930642789.png

I have the NXP KVx 1.0.0 toolbox (this is the only release so far). and I use the configuration tool that comes with the toolbox:

nxa11767_1-1635930799085.png

This is the version that is used by the toolbox when the C files for the .mex file are being generated. And also this is the version that is opened when the user is pressing the Configure button from the NXP block. You can see the tools that the toolbox is using in Model Configuration Parameters:

nxa11767_2-1635931001756.png

The SDK path is used to create the content of the <modelName>Config folder - all the driver files, startup, additional component files are taken from the SDK package.

 

Best regards,

Alexandra

0 Kudos
6,602 Views
CauTran
Contributor I

How about MCUXpresso ?

I see a error in IDE " illegalargumentexception invalid version 1.0.0 2.8.0" when I build project.

@nxa11767 

0 Kudos
6,580 Views
nxa11767
NXP Employee
NXP Employee

Hi @CauTran ,

 

I'm using MCUXpresso IDE v11.4.1; Did you try to import, build and run an SDK example? You need to go and download the SDK from NXP MCUXpresso SDK: https://mcuxpresso.nxp.com/en/select look for below processor: 

nxa11767_0-1635950374335.png

Let me know if you need help on installing the SDK in mcuxpresso IDE.

And does the IDE give more details on the error you get:  " illegalargumentexception invalid version 1.0.0 2.8.0" ? In your IDE workspace is a hidden folder, .metadata - inside it is a file .log - please send it to me - it should detail the IDE errors you got.

BR,

Alexandra

0 Kudos
6,572 Views
CauTran
Contributor I

I send you the log and project which I build in MCU IDE, but it still fails. 

What version for MCUXpresso Configuration Tool?

THank you for your help.

0 Kudos
6,559 Views
nxa11767
NXP Employee
NXP Employee

Hi @CauTran ,

The project you attached helped to identify the issue. Somehow in .cproject the sdkVersion turned out to be set to: 

nxa11767_0-1635966558975.png

That really confused the IDE, actually the space between the 2 versions made the IDE to throw that error.

I'm puzzled how that version got there - I wasn't able to reproduce it on my side. Did you changed the SDK path of the model? That's the only reason I'm thinking is causing that version to be put in .cproject (In Model Parameters Settings).

nxa11767_1-1635966733746.png

As a fix - open the .cproject from the <model_name>Config project as a text file and search for <sdkVersion>1.0.0 2.8.0</sdkVersion> and replace it with: <sdkVersion>2.8.0</sdkVersion>

then in MCU IDE, just right click on the project and do a refresh.

Best regards,

Alexandra

0 Kudos
6,550 Views
CauTran
Contributor I

I think the solution for this issue is good. But, it is temporary for this issue. 

Can you tell me how to fix automatic this problem?

0 Kudos
6,479 Views
nxa11767
NXP Employee
NXP Employee

Hi @CauTran ,

I need more information from your side to understand how that string got there - I was not able to reproduce it on my side.

Did you change the SDK path of the model? That's the only reason I'm thinking is causing that version to be put in .cproject: In Model Parameters Settings -> Hardware Board -> Target Hardware Resources:

nxa11767_0-1636463217040.png

Also, do you see the same error (the same string is written in the .cproject file) when you run other examples from the toolbox? 

Best regards,

Alexandra

.

0 Kudos
6,468 Views
CauTran
Contributor I

Hi @nxa11767 ,

I did not change anything ever the path of sdk folder.

I met this issue in two my different computer. 

Thank you.

0 Kudos