Why cant I get two mex files to save their generated content in two places.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Why cant I get two mex files to save their generated content in two places.

4,087件の閲覧回数
anthonygarza
Contributor I

I do not get it, I have tried over and over again to get this to work but as usual it just falls.....SHORT

 

I have two .mex files I want one to create files in one directory and the other to change files in another. I have edited the xml files fifty times and the tool just comes in and stomps on it every time. No matter what I do. I have one excluded from the build and it still just always puts them in the first directory. 

 

I just do not get the limitation

 

Projects have multiple configurations why wouldnt the tool support this????????

0 件の賞賛
返信
7 返答(返信)

2,263件の閲覧回数
VassiliN
Contributor III

@Petr_H, it's been a while since this topic was created.  I just checked with the MCUXpresso IDE v11.10.0 [Build 3148] [2024-07-03] that ConfigTools > Configuration Preferences > Output path overrides still do not work (as stated in the topic). Is there any specific plan to fix it at some point? 

0 件の賞賛
返信

2,211件の閲覧回数
Petr_H
NXP Employee
NXP Employee

Hi,

I'm sorry, but unfortunately it showed up that there is needed more complex change to fix this issue, so it has been delayed and the limitation still persists. However we still plan to fix it. Current plan is approximately end of Q1 of the 2025.

Could you please add more details on your build process that you are using and how you actually plan to build and use one project for multiple boards? Are you using multiple build configurations? Are you changing them manually? Config tools do not handle settings related to actual build configurations. We typically expect having and building a separate project for each board as it can have even different processor or use different SDK.

Regards

Petr Hradsky

 

 

0 件の賞賛
返信

2,150件の閲覧回数
VassiliN
Contributor III

Petr, 

we use MCUXpresso/Config Tools for the  i.MXRT1170-EVKB and proprietary board based on the same MCU set. 

currently we have the same project for two different boards, just one project configuration includes additional /board_our_board source folder and excludes /board folder, while the other configuration do the opposite. Obviously we generated and copied /board_our_board  from /board at some moment using after Config Tools, then reverted /board back to reflect the first board hw. 

 

We also use different debug probes on different boards, but this does not really affect the source code, just an option in each configuration.

 

I am still considering to create two separate projects, one for each board, but it would require some additional work to share our common source code, which is pretty much all of our code except couple of conditional definitions used in one or the other configuration. 

 

I would appreciate any advice how to effectively maintain the same source code  for two different but similar HW boards.  

0 件の賞賛
返信

4,040件の閲覧回数
anthonygarza
Contributor I

Using MCU Expresso

How exactly do I get the different mex files to output their board files to different directories? 

0 件の賞賛
返信

4,021件の閲覧回数
Petr_H
NXP Employee
NXP Employee

Hi,

it's little bit complex so I try to describe individual issues one by one.

Multiple configurations for one project

Unfortunately, in MCUXpresso IDE, there is a limitation, it's not expected to have multiple .mex files in the root of the project. However, its possible to workaround it. You can create/copy the second .mex file into the project root.

Then, anytime you would like to modify pins/clocks/peripherals of some configuration, you have to open the configuration you would like to modify using double-click it on the .mex file in the project view. 

Petr_H_0-1676630857752.png

The downside is that the config tools do not indicate, which of the .mex you are editing at the moment. There is just IDE project shown in the toolbar. That's why you should always double-click the .mex file to get to Config Tools perspective to ensure the right project is edited.

Generating code to different folders

Second limitation is the sage of 'Update code' command which is currently limited to use the default 'board' project in project.

There an option specific for each .mex file where you can override the default code generation folder by custom path (ConfigTools > Configuration Preferemces > Output path overrides). However, I have learned that there is reported a bug in this feature and these rules are currently not applied when there is  toolchain project detected (e.g. MCUXpresso IDE). After it's fixed, there will be possible to generate files to different folder from each .mex file.

The workaround for now is to use the Export command, where you can specify the target folder. The shortcut icon for the export is available in the Code preview window of each config tool:

Petr_H_1-1676631440977.png

Solution with MCUXpresso Config tools standalone 

Alternative solution for the above limitation can be to using the MCUXPresso Config tools standalone application (https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-c...).

If you are using the standalone config tools, you can move the .mex files into different folders and just open .mex file and edit them. 

The 'Update code' command will produce output to the sub-folders of the folders where you saved the .mex file, but it can be overriden via the rules in Configuration preferences mentioned above.

Downside of this solution is that it will not handle dependency checks of the SDK components in your toolchain project this way so you have to ensure you have right files (drivers, middleware) in your project.

 

We are sorry for the inconvenience, we are preparing improvements to simplify these more complex use-cases. 

best regards

Petr Hradsky

Config Tools Team

 

0 件の賞賛
返信

3,282件の閲覧回数
alonbl
Contributor III

Hello @Petr_H,

Thank you for the good explanation, was there a progress since this post?

I would like to have a project that supports multiple boards, and conditionally call the correct files that were generated out of the mex files. I could see that I can modify the mex so that it will generate files with different names, but I would like to have a common part, for example the USB settings of the two configuration is the same.

I thought of doing codegen per mex at order {common, board1, board2}, but this approach does not seems to be viable.

In your opinion what is the preferred method of supporting multiple board configurations in a single project?

Thanks,

0 件の賞賛
返信

4,066件の閲覧回数
Petr_H
NXP Employee
NXP Employee

Hi, 

Please add more details on your use-case. Are you using MCUXPresso IDE or stand-alone version of config tools? Do I understand it correctly that you need two .mex files generate the output to different folders? I don't know what are you editing, but this should be possible with using the "Output path overrides" in Configuration preferences.

Best regards

Petr Hradsky

Config Tools Team

0 件の賞賛
返信