CW10.0; Win-XP; CF-V2 - How can I set MQX_PATH to the value of an environment variable?

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

CW10.0; Win-XP; CF-V2 - How can I set MQX_PATH to the value of an environment variable?

Jump to solution
1,775 Views
dhlocker
Contributor III

We have a small team of developers with MQX-3.6.2 installed in various locations.  I need to set CW's MQX_PATH variable to a value from each user's environment to avoid thrashing the .project file.

 

Searches (in TFM, WEB, and fora) have been fruitless.  Suggestions?

 

TIA,

Donald.

Labels (1)
0 Kudos
1 Solution
1,409 Views
CrasyCat
Specialist III

Hello

 

Can you pkease try to define a path variabel using notation   ${ENV-MQX_PATH}

instead of ${ENV(MQX_PATH)} as you indicated in your post.

 

I tried it on my side on MCU V10.1 and it works fine.

 

I am not sure this is documented anywhere.

 

CrasyCat

View solution in original post

0 Kudos
14 Replies
1,409 Views
CrasyCat
Specialist III

Hello

 

I did not quite understand what you are trying to achieve here.

 

I assume you want to be able to use path relative to environment variable MQX_PATH in your project to retrieve the MQX include files.

 

Am I correct?

 

If that is what you are looking for, define MQX_PATH in the Environment variables inside of the System Control panel .

You should be able to refer to that environment variable using notation "${MQX_PATH}/<something>" in the User Path list box..

 

CrasyCat

0 Kudos
1,409 Views
dhlocker
Contributor III

Thank you, CC.

 

I know of at least two places where MQX_PATH is used - .project and .cproject

 

.project seems to define and de-reference a bare MQX_PATH (and other bare words) in setting relative paths.  It also uses ${PROJECT_LOC} as a component of MQX_PATH in such forms as:

    <variableList>
        <variable>
            <name>MQX_PATH</name>
            <value>${PROJECT_LOC}/../../../..</value>
        </variable>
    </variableList>

 

PROJECT_LOC is not an environment variable in my "OS" (giving Windows XP the benefit of that doubt :smileyhappy: so I presume it is defined for CodeWarrior.  Can I use an OS-level environment variable (MQX_PATH or MACHINE_SPECIFIC_MQX_PATH) instead of PROJECT_LOC as the referent in the MQX_PATH definition above?  I would very much like to keep the variables used to just MQX_PATH and PROJECT_LOC

 

.cproject seems to use ${MQX_PATH} after defining it:

<macros>
<stringMacro name="MQX_PATH" type="VALUE_PATH_DIR" value="${ProjDirPath}\..\..\..\.."/>
</macros>

 

Where are these variables, settings and configurations documented?  I'd love to be RTFMing instead asking the forum.

 

How can I determine which are inherited from the OS environment and which are set in the Code Warrior environment?  TFM states "When looking for an environment variable, all programs first search the system environment, then the default.env file, and finally the global environment file defined by ENVIRONMENT. If no definition is found, a default value is assumed."  Is "system environment" the DOS environment variable strings?  (The phrase "system environment" is not defined in the docs I read; only referenced.)  Is "project.ini" or "default.env" the file to define environment variables in if the DOS environment variables are deprecated?  Where can ENVIRONMENT be defined?

 

Thanks again,

Donald.

0 Kudos
1,409 Views
CrasyCat
Specialist III

OK

 

These ones are defined in Linked Resources panel.

 

  - Start CodeWarrior

  - Open your project

  - Click right on the project name in the CodeWarrior Projects window and select Edit Linked Resource Locations

  - MQX_PATH should be visible in the Path variables tab.

 

You should be able to change its value from there.

 

Additional tip:

After importing a project created on another host PC, it is a good practice to check this Linked Resources panel.

If you go to Linked Resources tab, you should be able to see all files which are associated with an Invalid (or broken) location.

 

Just ignore the .elf file (The executable file) as this one will be created after a successful build only.

 

I hope this helps.

 

CrasyCat

0 Kudos
1,409 Views
dhlocker
Contributor III

Thank you again, CC.

 

I understand setting MQX_PATH; what I don't understand is who uses it and how to reliably set it for all projects in a workspace such that all developers can reliable share the project.

 

I will try setting an environment variable LOCAL_MQX_PATH on each developer's computer and use ${LOCAL_MQX_PATH} as the value for MQX_PATH.  We have about 11 different subprojects in each workspace and I think it is far too much to ask of each developer to click Properties->Linked Resources for each of these every time they pull fixes from the repository!  Even I forget to check everything when I pull fixes for our BSP development.  It is just one more manual step that introduces instability in the process.

 

Regards,

Donald.

0 Kudos
1,409 Views
dhlocker
Contributor III

I have experimentally determined that Project->Properties->C/C++ Build->Build Variables->Show System Variables shows the MQX_LOCAL_PATH value from the Windows->My Computer->Properties->Advanced->Environment Variables, so this appears to be an Eclipse thing.  A value for MQX_LOCAL_PATH is not visible anywhere else within the Code Warrior unless I define it with Project->Edit Linked Resources Locations... or Project->Properties->Linked Resources (the same dialogue window.)

 

Does no one else share projects?  Is everyone else working alone?

 

Donald.

0 Kudos
1,409 Views
dhlocker
Contributor III

It doesn't appear possible to have an OS environment variable resolved within CW10 as a linked resource pointer.  If anyone knows otherwise, I'll be interested to know how it is done.

 

For the nonce, have decided to place MQX in a fixed location on each machine.  Actually, we'll probably allow MQX to be installed anywhere, but require an NTFS reparse point pointed to that at a fixed location so that MQX always appears at that location.

 

Regards,

Donald.

0 Kudos
1,409 Views
CrasyCat
Specialist III

Hello

 

Can you try defining a Path Variable using following notation:

 

    ${ENV-MQX_PATH}

Where MQX+PATH is the name of your environment variable.

 

I know this is working in CodeWarrior eclipse for StarCore. Hopefully it will work as well for CodeWarrior MCU.

 

 

CrasyCat

 

 

0 Kudos
1,409 Views
dhlocker
Contributor III

That would be great!  (I tried ${ENV(MQX_PATH)} but that didn't work.

 

Can you point me to documentation for the ENV variable as used in the Linked Resources window?  A search for ENV in help returned a small boatload of hits, the first 40 or so which were irrelevant.  I gave up then.  A search for "Linked Resources" gave fewer hits but nothing relevant; "Linked Resources" AND ENV gave "nothing found".

 

Regards,

Donald.

0 Kudos
1,410 Views
CrasyCat
Specialist III

Hello

 

Can you pkease try to define a path variabel using notation   ${ENV-MQX_PATH}

instead of ${ENV(MQX_PATH)} as you indicated in your post.

 

I tried it on my side on MCU V10.1 and it works fine.

 

I am not sure this is documented anywhere.

 

CrasyCat

0 Kudos
1,409 Views
dhlocker
Contributor III

Thank you, CC.  I did try it.  It did work.  And answers my original question.

 

I don't believe it is documented anywhere either.  I spend several days off-and-on (probably about 6 hours altogether) searching and reading.  This is just not Freescale-level documentation.

 

Donald.

 

Summary - to access an OS environment variable, define a Linked Resource Location using the syntax:

  ${ENV-OS_VAR_NAME}

 

Resolved Value should then display (after closing and re-opening the "Edit Linked Resources ..." dialog) the value of the OS environment variable

 

Example:

Name: MQX_PATH

Value: ${ENV-LOCAL_MQX_PATH}

Resolved Value: "C:\Users\Public\Lib\MQX"

0 Kudos
1,409 Views
J2MEJediMaster
Specialist I

According to our MQX support forum located here, you are supposed to use only MQX v3.7 with CW v10.x. To be fair, MQX v3.7 was released just a few days ago (March 31, 2011). You might want to search the boards in the MQX forum to see if someone has already solved your other problems.

 

---Tom

 

0 Kudos
1,409 Views
dhlocker
Contributor III

Where can I find MQX-3.7???  I followed links Products->Software and Tools->All Software and Tools landing at <http://www.freescale.com/webapp/sps/site/homepage.jsp?code=DEVELOPER_HOME>

 

Clicked on Freescale MQX Software Solutions (OS) on that page, landing on <http://www.freescale.com/webapp/sps/site/homepage.jsp?code=MQX_HOME&tid=SWnT> where I clicked on the  Download the latest MQX releases now (landing <http://www.freescale.com/webapp/sps/site/overview.jsp?code=MQXSWDW&tid=m32MQX>)

 

Sure looks like 3.6.2 to me.  One other note, from that download page, I fetched the MQXIOUG.pdf - it is rev 6 from 2010 Aug; I have Rev 7 (of 2010 Nov) on my computer - is the download page out of date!?  ouch!?

 

TIA,

Donald.

0 Kudos
1,409 Views
J2MEJediMaster
Specialist I

Your vision is good. It is version 3.6.2. I just checked with the MQX manager and currently the target date for the version 3.7 release is the middle of this month.

 

---Tom

 

 

0 Kudos
1,409 Views
dhlocker
Contributor III

I've been using CW10 since Feb 2010 (beta) with MQX 3.5.1 (IIRC) and trying mightily to use it for our larger projects.  If it's only qualified for MQX-3.7, I need to get a time machine.  :smileyhappy:

 

Donald.

0 Kudos