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
Solved! Go to Solution.
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:
Now when import can be done, the settings depends on the tool
It is recommended to create a backup of the original (target) MEX file before import is done.
Regards,
Libor
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:
Now when import can be done, the settings depends on the tool
It is recommended to create a backup of the original (target) MEX file before import is done.
Regards,
Libor
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
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.
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!
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