Is it possible to create multiple MCUXpresso Config Tool configurations for one IAR EWARM project?

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

Is it possible to create multiple MCUXpresso Config Tool configurations for one IAR EWARM project?

Jump to solution
4,791 Views
mitterha
Senior Contributor I

Hello,

we have one IAR EWARM project with multiple configurations. Each configuration could be a different product, therefore it is necessary to create different pin_mux/clock/.. settings for each EWARM configuration. Is this somehow possible with MCUXpresso Config Tools v7?

If I create two .mex files at the same folder level as the EWARM project file it will create pin_mux, clock_mux in the board subfolder. My first idea was to create this file/folder structure:

<project workspace>
|-- config1.mex
|-- config2.mex
|-- ewarmproject.eww
|--/board
   |--/config1
   |  |-- pin_mux.c
   |  |-- pin_mux.h
   |  |-- clocks.c
   |  |-- clocks.h
   |
   |--/config2
      |-- pin_mux.c
      |-- pin_mux.h
      |-- clocks.c
      |-- clocks.h

In the MEX files there are the following entries for every MCUXpresso Tool

<generated_project_files>
            <file path="board/Config1/pin_mux.c" update_enabled="true"/>
            <file path="board/Config1/pin_mux.h" update_enabled="true"/>
</generated_project_files>

For config1.mex these entries would include the path board/Config1 and for the config2.mex it would be board/Config2. After changing the <generated_project_files> paths for all tools and saving the file, I opened the MEX file with MCUXpresso Tool and changed one pin setting. After saving and generating the source code I realized that MCUXpresso Tools still used the pin_mux.c file of Config2 despite changing the generated_project_files path to Config1. The other tools used the Config1 path. In addition to this MCUXpresso Tools changed the <generated_project_files> paths back to Config2. It looks like the tool is not using the paths written in the MEX file.

Do you have any idea how we could implement multiple clock/pin/peripherals/dcd settings for one EWARM project? We would like to put the MEX files in the same directory as the EWARM project file so MCUXpresso can read the project settings and give hints for missing drivers.

Kind regards,

Stefan

Labels (1)
0 Kudos
1 Solution
4,640 Views
Petr_H
NXP Employee
NXP Employee

Hi,

Unfortunately, this is a limitation of the current version of the config tools. I'm not aware of any workaround as the .mex file needs to be along with the project file and it can work with only one pin_mux.c output file. The only solution that I see is to split the application into several separate IAR projects in separate folders linking the shared source files and have the .mex files separately in each of those projects. 

We will try to improve this in next versions of the MCUXPresso config tools.

best regards

Petr Hradsky

MCUXPresso config tools team

View solution in original post

0 Kudos
10 Replies
4,640 Views
marek-trmac
NXP Employee
NXP Employee

Hi Stefan,

in Pins Tool, you can create several configurations called "Functional Groups", see main menu - Edit - Functional Group Properties.

All the configurations are generated into pin_mux.c, but each of them is in separate function. Normally these configurations are used to switch pin configuration in run-time, however some functions will not be used in your application, they should be removed by the linker.

Functional Groups are supported in Clocks Tool and Peripherals Tool too.

Regards

Marek

Regards,
Marek
0 Kudos
4,640 Views
mitterha
Senior Contributor I

Hi Marek,

thank you for your suggestion. Your suggestion works well for projects which use the same processor. In our case we also have to change the processor within one EWARM project and I think for different processors you have to use different MEX files, right?

Kind regards,

Stefan

0 Kudos
4,641 Views
marek-trmac
NXP Employee
NXP Employee

Yes, you are right. This would work only for one processor.

Regards,
Marek
0 Kudos
4,641 Views
mitterha
Senior Contributor I

Do you have an idea for a workaround with multiple processors in one EWARM project?

0 Kudos
4,641 Views
Petr_H
NXP Employee
NXP Employee

Hi,

Unfortunately, this is a limitation of the current version of the config tools. I'm not aware of any workaround as the .mex file needs to be along with the project file and it can work with only one pin_mux.c output file. The only solution that I see is to split the application into several separate IAR projects in separate folders linking the shared source files and have the .mex files separately in each of those projects. 

We will try to improve this in next versions of the MCUXPresso config tools.

best regards

Petr Hradsky

MCUXPresso config tools team

0 Kudos
4,411 Views
bhenry
Contributor I

Hi,

Did this ever happen?  I can't see anywhere that it's possible to create multiple board configurations for the same design.   You know, like board rev A, B, C, etc.  This seems to be a pretty practical and basic user requirement.  Every board we build goes through several different revisions and often pin functions move, are removed or deleted.  

I am using MCUXpresso and am surprised to see that simple board revs aren't supported in the config tool.  I have an old LPCOpen project that I wanted to port to the new SDK/MEX file paradigm, but the new paradigm doesn't support even simple revision changes so I'm stuck. 

I have #define board versions in my LPCOpen project so I can build my code for any board version simply by changing a #define and recompiling.  Sadly, the new system doesn't support that, so I have to stay in old LPCOpen land... 

Also, not only do I use the #define tag for changing pin definitions, but it also brackets different pieces of code that talk to different hardware on the board. 

I'm surprised that with all the work you guys have done that you haven't managed to get the tools to even equal the lowly #define.

Thanks,

Blake

0 Kudos
4,392 Views
Petr_H
NXP Employee
NXP Employee

Hi, 

Is your goal using same software source code for different versions of hardware?

There are the following possibilities of achieving that:

1. Create separate IDE project for each version of the hardware. You application files can be linked into both IDE projects from share location. Configuration .mex will be kept separately.
Example of the folder structure:

 

  • Repo_folder
    • Source   (shared files, link this folder into the Board_A and Board_B projects)
    • Platforms
      • Board_A (IDE project root folder for board A)
        • board_a_project.mex
        • other specific folders and files
      • Board_B (IDE project root folder for board A)
        • board_b_project.mex
        • other specific folders and file

2. Keep one project but create separate function groups in the Config tools for each version of the board. You need to do this in each tool separately (Pins, Clocks, Peripherals) and name each function according to the version of the board.   

 

#if defined(VERSION_A)

BOARD_InitPins_A();
BOARD_BootClockRun_A();
BOARD_InitPeripherals_A();

#elif defined(VERSION_B)

BOARD_InitPins_B();
BOARD_BootClockRun_B();
BOARD_InitPeripherals_B();

#endif​

 

best regards

Petr Hradsky

3,006 Views
nickdolling
Contributor IV

Hi @Petr_H ,

I came here looking for a way to do this.

I have a family of products where the core of the design is common, in some cases running on common hardware but in others with variations or different peripheral circuits.

I want to use the same source files so that changes only have to be made in one place, and I'm trying to avoid having multiple IDE projects to avoid differences creeping in.

I had thought I might be able to have multiple .mex files in the same directory as the single IAR project, and manually edit the path for pin_mux.c etc to point to different versions of the generated files in different subfolders but the tool ignores the changes I make and goes back to the default path.

I've also tried the suggestion of using different function groups. I have one function group for the pins that are configured the same way for all products, then additional function groups for the different products with the correct one selected in the code by a build option and an #ifdef. This sort of works but falls down because changing the label field for a pin in one function group changes it in all the others, so you can't have meaningful labels where you need the same pin configured differently in different function groups.

If your original offer to improve this in a future version stands, then either of the following would help me achieve the desired outcome

1) allow the path for the generated code to be specified, so that the project can allow different versions of pin_mux.c etc for different build configurations. I can then have different .mex files generating different versions of pin_mux.c in different directories in the source for the different products

2) allow different labels for the same pins in the different functional groups

Thanks,

Nick

0 Kudos
2,636 Views
Petr_H
NXP Employee
NXP Employee

Hi @nickdolling ,

Regarding the issue 1 - changing output path - in the latest recently released version of Config Tools (V12) it's possible to override the path of the the generated files, so it should be possible to use the solution with the multiple .mex files.

To modify the path in the particular mex file, use the Edit -> Configuration Preferences command and there is Output path overrides section:

Petr_H_0-1662390350856.png

There you can Edit the set of rules that override the paths.

You can add for example a rule as the following one, that overrides the folder 'board/' in the paths to some relative path "../my_board_folder/" (you can tweak it as you need):

Petr_H_1-1662390684235.png

Now all the files that normally go to board folder will go to the one you specify. If you'd like you can create different individual rules for individual files like pin_mux.c etc.

Just please note that having multiple .mex in one folder would now work properly only in standalone version of the Config Tools. It  would not work in MCUXpresso IDE, where is expected to have one .mex file in the root of the project.

Regarding point 2 - having multiple labels - it's possible to have multiple labels in the labels field separated by for example '/' character and also multiple identifiers and when you route the pins in the individual functinal group, you can select which labels you'd like to use.

If you'd like to have additional information like (for example additional custom labels or features of pins) stored directly in the tool, there may be useful other new feature from Config Tools V12. You can create a completely customized user signals table, using the new External Signals View. 

You can open it using View > External User signals. There you can add list of signals on your board, specify their connection to the processor and add columns with your information on the signals/pins.  

Petr_H_2-1662391627817.png

Once the connection is specified, the tooltips show the information and state of the pisn and pins are highlighted in Package and Pins view. This table can also be imported and exported using .csv format (editable for example in MS Excel). 

best regards

Petr Hradsky

Config Tools Team

0 Kudos
4,641 Views
mitterha
Senior Contributor I

Hello,

thank you for your answer and your suggestion!

Kind regards,

Stefan

0 Kudos