This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Troubles in compiling pc-ble-driver v4.1.2 for Python project with nRF52840 dongle

Hi,

As many of you, I'm tryng to compile pc-ble-driver (v4.1.2) found in https://github.com/NordicSemiconductor/pc-ble-driver/tree/v4.1.2, just to see how the code works and to re-use some parts in a Python project that I'm developing using the nRF52840 Dongle.

The Operative System is Windows 10 64-bit.

I've completed successfully the following steps Driver installationDriver validationInstalling toolsInstalling dependencies until facing troubles in Compiling pc-ble-driver on Windows:

- First problem encountered when Installing vcpkg dependencies: from the System Environment, I had to delete VCPKG_ROOT variable (previously set in the step 5 of Installing dependencies on Windows) and leave only the vcpkg correct link in path variable; after that I was able to install the vcpkg dependencies

mkdir build
cd build
vcpkg install asio
vcpkg install catch2
vcpkg install --head spdlog

- Second problem encountered at point "CMake Select the Visual Studio compiler to use according to this article: Build C/C++ code on the command line": (here I'm asking if someone can help me)

in this section, the System Environment variables CC and CXX were set  for MSVC compiler, and the cmake answer is as follow:

PS C:\Users\Fabio\Documents\nRF52840_Dongle\pc-ble-driver-4.1.2\build> cmake -G Ninja ..
-- NRF_BLE_DRIVER_VERSION not specified, setting it to 0.0.0
-- CONNECTIVITY_VERSION not specified, setting it to 0.0.0
-- The C compiler identification is MSVC 19.27.29112.0
-- The CXX compiler identification is MSVC 19.27.29112.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx86/x86/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx86/x86/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/Users/Fabio/Documents/nRF52840_Dongle/pc-ble-driver-4.1.2/build/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/ProgramData/chocolatey/bin/ninja.exe cmTC_23be1 && [1/2] Building C object CMakeFiles\cmTC_23be1.dir\testCCompiler.c.obj
    [2/2] Linking C executable cmTC_23be1.exe
    FAILED: cmTC_23be1.exe
    cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_23be1.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx86\x86\link.exe /nologo CMakeFiles\cmTC_23be1.dir\testCCompiler.c.obj  /out:cmTC_23be1.exe /implib:cmTC_23be1.lib /pdb:cmTC_23be1.pdb /version:0.0 /machine:X86  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D C:\Users\Fabio\Documents\nRF52840_Dongle\pc-ble-driver-4.1.2\build\CMakeFiles\CMakeTmp && powershell -noprofile -executionpolicy Bypass -file C:/src/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary C:/Users/Fabio/Documents/nRF52840_Dongle/pc-ble-driver-4.1.2/build/CMakeFiles/CMakeTmp/cmTC_23be1.exe -installedDir C:/src/vcpkg/installed/x86-windows/debug/bin -OutVariable out""
    RC Pass 1: command "rc /fo CMakeFiles\cmTC_23be1.dir/manifest.res CMakeFiles\cmTC_23be1.dir/manifest.rc" failed (exit code 0) with the following output:
    The system cannot find the file specified
    ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:25 (project)


-- Configuring incomplete, errors occurred!
See also "C:/Users/Fabio/Documents/nRF52840_Dongle/pc-ble-driver-4.1.2/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Fabio/Documents/nRF52840_Dongle/pc-ble-driver-4.1.2/build/CMakeFiles/CMakeError.log".
PS C:\Users\Fabio\Documents\nRF52840_Dongle\pc-ble-driver-4.1.2\build>

So, long story short, I'm blocked: Can any one please help me?

P.S. As a completion, but don't think is part of the problem, "gcc-arm-none-eabi-9-2020-q2-update-win32" was installed and 

 the `Mass Storage Device` was disable (using regedit ), as described in Driver installation

Thank you.

Fabio

  • Hello Karl,

    Thank you for your reply, don't worry if it took so long.

    Did you succeed in getting the pc-ble-driver-py to work as expected?

    No, I didn't yet... when have a free spot I will go for it... in the meanwhile I've imported the pc-ble-driver-py library on my scripts and started working on advertising on BLE, and found other troubles Sweat smile

    Could you run this command in a regular command prompt (not PowerShell):

    OK, here is the output:

    C:\WINDOWS\system32>"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -format Json
    [
      {
        "instanceId": "30540051",
        "installDate": "2017-12-08T21:04:45Z",
        "installationName": "VisualStudio/15.9.29+28307.1300",
        "installationPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community",
        "installationVersion": "15.9.28307.1300",
        "productId": "Microsoft.VisualStudio.Product.Community",
        "productPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\IDE\\devenv.exe",
        "state": 4294967295,
        "isComplete": true,
        "isLaunchable": true,
        "isPrerelease": false,
        "isRebootRequired": false,
        "displayName": "Visual Studio Community 2017",
        "description": "Free, fully-featured IDE for students, open-source and individual developers",
        "channelId": "VisualStudio.15.Release",
        "channelPath": "C:\\Users\\Fabio\\AppData\\Local\\Microsoft\\VisualStudio\\Packages\\_Channels\\4CB340F5\\catalog.json",
        "channelUri": "https://aka.ms/vs/15/release/channel",
        "enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
        "releaseNotes": "https://go.microsoft.com/fwlink/?LinkId=660692#15.9.29",
        "thirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=660708",
        "updateDate": "2020-11-12T05:37:03.7464676Z",
        "catalog": {
          "buildBranch": "d15.9",
          "buildVersion": "15.9.28307.1300",
          "id": "VisualStudio/15.9.29+28307.1300",
          "localBuild": "build-lab",
          "manifestName": "VisualStudio",
          "manifestType": "installer",
          "productDisplayVersion": "15.9.29",
          "productLine": "Dev15",
          "productLineVersion": "2017",
          "productMilestone": "RTW",
          "productMilestoneIsPreRelease": "False",
          "productName": "Visual Studio",
          "productPatchVersion": "29",
          "productPreReleaseMilestoneSuffix": "1.0",
          "productRelease": "RTW",
          "productSemanticVersion": "15.9.29+28307.1300",
          "requiredEngineVersion": "1.18.1063.29791"
        },
        "properties": {
          "campaignId": "711569342.1512751140",
          "canceled": "0",
          "channelManifestId": "VisualStudio.15.Release/15.9.29+28307.1300",
          "nickname": "",
          "setupEngineFilePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installershell.exe"
        }
      },
      {
        "instanceId": "ba2d467e",
        "installDate": "2019-12-17T19:22:43Z",
        "installationName": "VisualStudio/16.8.1+30711.63",
        "installationPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community",
        "installationVersion": "16.8.30711.63",
        "productId": "Microsoft.VisualStudio.Product.Community",
        "productPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\devenv.exe",
        "state": 4294967295,
        "isComplete": true,
        "isLaunchable": true,
        "isPrerelease": false,
        "isRebootRequired": false,
        "displayName": "Visual Studio Community 2019",
        "description": "Powerful IDE, free for students, open-source contributors, and individuals",
        "channelId": "VisualStudio.16.Release",
        "channelUri": "https://aka.ms/vs/16/release/channel",
        "enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
        "releaseNotes": "https://go.microsoft.com/fwlink/?LinkId=660893#16.8.1",
        "thirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=660909",
        "updateDate": "2020-11-14T03:31:53.1405875Z",
        "catalog": {
          "buildBranch": "d16.8",
          "buildVersion": "16.8.30711.63",
          "id": "VisualStudio/16.8.1+30711.63",
          "localBuild": "build-lab",
          "manifestName": "VisualStudio",
          "manifestType": "installer",
          "productDisplayVersion": "16.8.1",
          "productLine": "Dev16",
          "productLineVersion": "2019",
          "productMilestone": "RTW",
          "productMilestoneIsPreRelease": "False",
          "productName": "Visual Studio",
          "productPatchVersion": "1",
          "productPreReleaseMilestoneSuffix": "1.0",
          "productSemanticVersion": "16.8.1+30711.63",
          "requiredEngineVersion": "2.8.3267.30329"
        },
        "properties": {
          "campaignId": "1420090839.1575124163",
          "channelManifestId": "VisualStudio.16.Release/16.8.1+30711.63",
          "nickname": "",
          "setupEngineFilePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vs_installershell.exe"
        }
      }
    ]

    Thanx,

    Fabio

  • Fabio Ballanti said:
    Thank you for your reply, don't worry if it took so long.

    Thank you for your patience and understanding.

    Fabio Ballanti said:
    No, I didn't yet... when have a free spot I will go for it... in the meanwhile I've imported the pc-ble-driver-py library on my scripts and started working on advertising on BLE, and found other troubles

    I am sorry to hear that! But, at least the installation of the driver ( pip install pc-ble-driver-py ) was successful this time, correct? So we'll primarily have to resolve issues with using the driver directly. Please do not hesitate to open a separate ticket for any pc-ble-driver-py issues you might have ( such as the one we are discussing in the other ticket currently ).

    Fabio Ballanti said:
    OK, here is the output:

    Thank you. Everything looks as it should here. Could you run the vs_installer.exe file from \Microsoft Visual Studio\Installer, click modify, and make sure you have the "english" language pack installed? This might seem trivial and unrelated, but I have heard of instances in which this has proven to be a cause of errors.

    Best regards,
    Karl

Related