NFC Cockpit VCOM compile fails for PN7642 on MacOS

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

NFC Cockpit VCOM compile fails for PN7642 on MacOS

651 Views
ingenutec
Contributor III

My goal is to build the VCOM project to load into my PN7642 dev board and then add some custom secondary firmware.

I have downloaded the latest NFC Cockpit v8.0 and the associated VCOM project library - v5.6.0

I'm running MCUXpresso v11.9.0 on Mac OS 13.6.6

I opened the VCOM project is a clean workspace

When I click build, it appears it's trying to pull in pieces of the PN7642 SDK using python.  However, this fails on the Mac.

python "./../../../../../scripts/Extract.py" -c "./../../../../../scripts/cfg/Config_PN7642.ini" -ad ./../../../../ -bs ; cp -r "/Volumes/Ingenutec/client-projects/nfc_cockpit_74/NxpNfcCockpit_VCOM_LibNncFW/NNC_LibNncFW/NNC_Nfcrdlib_HCE_T4T/project/mcux/PN7642/../../../../Utility/PN7642/Script" "/Volumes/Ingenutec/client-projects/nfc_cockpit_74/nfc_cockpit_workspace/.mcuxpressoide_packages_support/PN7642_support"

/bin/sh: python: command not found

Still working on getting past the location issue, but once I do, I recall in a previous version, the script that was used had paths that were not correctly handled for Mac.   (looked like linux and Windows were).  Is there an update that fixes the scripting for Mac too?

0 Kudos
Reply
3 Replies

619 Views
ingenutec
Contributor III

Making progress...

First fix - search path for python

Must add the path to python to your MCUXpresso environment variable:

- Project Properties -> C++ Build -> Environment -> PATH

Select PATH in the "Environment variables to set", Edit and add the path to your Python to the end of the existing path.

Second fix - userprofile / home directory

The cfg/Config_PN7642.ini (and PN7462AU.ini) have the sdk_src defined as %userprofile%...

On MacOS, (and possibly linux), this gets converted to "USERPROFILE" and then os.environ() is called with that parameter.  And "USERPROFILE" does not exist on MacOS as an environment variable.

Solution: edit the ini file(s) and change %userprofile% to %home%

NOTE: you might be tempted to change %userprofile% to HOME, $HOME or even /Users/<your-home-dir> but don't the python script recognizes the need for the environment substitution and performs the substitution for you.  It does NOT interpret HOME or $HOME and if you use the explicit full path, it will remove the leading slash resulting in a failure to find the desired path.

Third fix - source SDK name

The cfg/Config_PN7642.ini (and PN7462AU.ini) have the sdk_name defined as board_PNEV7642FAMA*

Change this to the actual SDK name: example: PN7642_MCUXpresso_SDK_02-12-05_PUB.zip

Fourth fix - path separator

The cfg/Config_PN7642.ini (and PN7462AU.ini) specify Win path separator "\"

The extract script does SOME conversion from "\" to "/" but also misses some.  Specifically, sdk_dst is missed and if you build with the setting as ..\..\PN7642_SDK, you'll end up with a hidden folder named ..\..\PN7642_SDK in the wrong location.  (hidden because it starts with a '.', wrong location because the two levels of indirection are not processed)

Fifth fix - [SDK_CONTENTS] - file subsection

NOTE: NOT the plural 'files' subsection.  Go to the bottom and there is a section labeled file.  Change the path separator from Win ('\') to Mac ('/')

I have no idea why the Extract.py script doesn't handle all of the path separators, but if you don't make this change you'll end up with a folder named "components\CLIF"

Close the project and reopen the project (so the include paths are picked up and processed)

You should now be able to successfully build.

605 Views
danielchen
NXP TechSupport
NXP TechSupport

Thanks for your sharing.

0 Kudos
Reply

639 Views
ingenutec
Contributor III

Yep - got python added correctly to the path and now I have this:

It seems the GetPath substitution is failing

 

 

Traceback (most recent call last):
  File "./../../../../../scripts/Extract.py", line 305, in <module>
    main ()
  File "./../../../../../scripts/Extract.py", line 263, in main
    Instantiate ( SDK_Src, SDK_File, SDK_Dst, CfgFile, FileList, FilePattern, SpecificFile, BeSilent, AddAdr )
  File "./../../../../../scripts/Extract.py", line 192, in Instantiate
    Extract_Obj = NfcCockpit_ExtractSDK ( SDK_Src, SDK_File, SDK_Dst, CfgFile, not BeSilent, AddAdr )
  File "./../../../../../scripts/Extract.py", line 61, in __init__
    self.SDK_Src_Dir = self.GetPath  ( SDK_Path, "\%\w+\%" )
  File "./../../../../../scripts/Extract.py", line 101, in GetPath
    SDK_Path = os.path.join ( SDK_Path, os.environ[Path.replace ( "%", "" ).upper ()] )
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py", line 40, in __getitem__
    raise KeyError(key)
KeyError: 'USERPROFILE'

 

0 Kudos
Reply