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

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Jump to solution
472 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
321 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
8 Replies
321 Views
b23204
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
321 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
321 Views
b23204
NXP Employee
NXP Employee

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

Regards,
Marek
0 Kudos
321 Views
mitterha
Senior Contributor I

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

0 Kudos
322 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
91 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
72 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

0 Kudos
321 Views
mitterha
Senior Contributor I

Hello,

thank you for your answer and your suggestion!

Kind regards,

Stefan

0 Kudos