What is the process for Exporting a .mex project file and Importing it into a new project?

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

What is the process for Exporting a .mex project file and Importing it into a new project?

Jump to solution
1,703 Views
myke_predko
Senior Contributor III

Hiya,

I would like to take a previously created .mex file and import it into a new project so that it can be updated in the new project.  

I can see questions about the process, but I can't find any description of the process.  When I right click on the .mex file and select "Export..." I have a number of options (especially when I look at the "pins tool" but there is also "Peripheral Tools" and "Processor Data") but none will export the .mex file.  

Now, there is an option under the project for Importing a .mex file - is it as simple as importing a .mex file from another project?  Will this version be copied in so that any changes made to it won't affect the source project's .mex file?

I'm somewhat nervous about experimenting with this because when I select a number of the options, I get a message saying that "DCDx tool does not support selected processor".  The selected processor is the MK20DN512VLL10 which seems odd but I guess if it isn't used for a TWR or FRDM board it doesn't have the same level of support.  

Thanx,

myke

Tags (1)
0 Kudos
1 Solution
1,567 Views
liborukropec
NXP Employee
NXP Employee

Hello Myke,

exporting for Pins, Clocks, Peripherals means exporting *generated sources*, typically 2 sources, but for Peripherals it could be much more, this has sense.

For exporting MEX file the export wizard does not make sense here, as it is simple file, which you can simply copy/drag and drop somewhere else.

Regarding importing MEX, there are more things to mention:

  1. import can be done from any part, the target processor is not changed, only the tool settings is imported (if particular tool is supported)
  2. because import can be done from other part, it might result into errors that has to be fixed manually; obviously there might be different pins/clocks signals, some peripherals may be different or missing completely.
  3. you may select which tools you want to import and which not
  4. tools which are not supported in target part, they cannot be imported as it does not have sense.

Now when import can be done, the settings depends on the tool

  • Pins/Clocks/Peripherals tools store settings in functional groups
    • during import it can be selected whether particular conflicting Functional Group will be overwritten (old settings lost) or renamed (new Functional Group will be created with non-conflicting name)
  • DCDx/TEE tools have one global settings
    • you can just select whether import the settings or not. When imported, original settings is overwritten.

It is recommended to create a backup of the original (target) MEX file before import is done.

Regards,

Libor

View solution in original post

5 Replies
1,568 Views
liborukropec
NXP Employee
NXP Employee

Hello Myke,

exporting for Pins, Clocks, Peripherals means exporting *generated sources*, typically 2 sources, but for Peripherals it could be much more, this has sense.

For exporting MEX file the export wizard does not make sense here, as it is simple file, which you can simply copy/drag and drop somewhere else.

Regarding importing MEX, there are more things to mention:

  1. import can be done from any part, the target processor is not changed, only the tool settings is imported (if particular tool is supported)
  2. because import can be done from other part, it might result into errors that has to be fixed manually; obviously there might be different pins/clocks signals, some peripherals may be different or missing completely.
  3. you may select which tools you want to import and which not
  4. tools which are not supported in target part, they cannot be imported as it does not have sense.

Now when import can be done, the settings depends on the tool

  • Pins/Clocks/Peripherals tools store settings in functional groups
    • during import it can be selected whether particular conflicting Functional Group will be overwritten (old settings lost) or renamed (new Functional Group will be created with non-conflicting name)
  • DCDx/TEE tools have one global settings
    • you can just select whether import the settings or not. When imported, original settings is overwritten.

It is recommended to create a backup of the original (target) MEX file before import is done.

Regards,

Libor

1,566 Views
myke_predko
Senior Contributor III

I just tried dragging and dropping the .mex file from a previous project into a new one.  

It worked without any issues BUT you should make sure that you rename the .mex file that was dragged into the project as it will be confusing when you're trying to edit them and the previous project is still available.  

myke

0 Kudos
1,566 Views
liborukropec
NXP Employee
NXP Employee

Hello Myke,

this is true for case all settings should be imported/restored and the board/processor is the same.

In case only one tool or selected Functional Groups should be imported, then the only way is the Import wizard.

1,566 Views
myke_predko
Senior Contributor III

Understood.  But, in this case, the board/processor is the same and I'm adding functionality which is why I want to import the .mex file and then rename (so it matches the project name) it so that it isn't confused with previous project's .mex file.  

Cheers!

0 Kudos
1,567 Views
myke_predko
Senior Contributor III

Hi Libor,

Thank you for the explanation.  

I don't think I'll fall into any of the traps you are mentioning as I am porting an application from MQX to FreeRTOS and I'm building it up a task at a time.  This means that each new project is building on the previous and I'm adding capabilities, not changing them.  

As I have 100 pins, having to specify new ones each project is tedious and error prone (now that I'm above 50 specified) so if I can copy in a previous .mex file then I'm just adding to the configuration, not changing or using another part.  

Again, thank you.

myke

0 Kudos