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

Cross-compile PC-ble-driver for arm7-32bit architecture on x86-64bit linux host

Hi All,

 

       We have tested the DFU(nrf52840) from a central to the target device over the BLE. In which a central device attached to the PC(x86-64bit Linux) via a Serial USB. We run this test using nrfuti on linux machine and it's work. Now we want to create the same environment for the gateway which is based on arm7-32bit architecture. We successfully installed the nrfutil on arm32 arch, but we stuck when run the DFU command because pc-ble-driver shard object not created for x86_32.

" raise RuntimeError("Could not load shared library {} : '{}'.".format(shlib_path, error))
RuntimeError: Could not load shared library /usr/lib/python3.5/site-packages/pc_ble_driver_py/lib/linux/x86_32/libpc_ble_driver_shared_sd_api_v3.so : '/usr/lib/python3.5/site-packages/pc_ble_driver_py/lib/linux/x86_32/libpc_ble_driver_shared_sd_api_v3.so: cannot open shared object file: No such file or directory'. "

    We tried to follow the steps given at https://github.com/NordicSemiconductor/pc-ble-driver#Compiling-pc-ble-driver-from-source, but facing an error when we run a command

$ vcpkg install asio catch2 spdlog
Error: Invalid vcpkg root directory /home/kashif/Downloads/pc-ble-driver-master/build/home/kashif/vcpkg: No such file or directory

Questions:

  1. Does the steps mentioned in above link, will help to cross-compile the pc-ble-driver for arm-32bit arch.
  2. if no, then can you please share what steps need to be followed for cross-compilation.

Thank You,

K.Khan

Parents
  • Hi, you can try to compile asio, catch2 and spdlog from source instead of using the vcpkg package manager.

    I wrote a guide in this Devzone post: https://devzone.nordicsemi.com/f/nordic-q-a/47329/connection-3b-armv8-and-nrf-52840-dongle/188449#188449

    Unfortunately the guide is a bit old now and things have changed, so I'm not sure if it work right out of the box, but at least you get the idea of how you can compile the necessary libraries from source.

  • Hi,

        I have compiled the necessary libraries from source as mentioned in your post and build using cmake command, But it's compiled for the native 64-bit compiler. I want to compile it for arm32 bit . Could you please tell me where and what changes need to be done for cross-compilation. I have attached the build debugs, Please have a look.

    Fullscreen
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

      

    Thank You!

    K.Khan

  • Hi, I think it is easiest to build the libraries and compile everything on the ARM core. Then you don't need to cross-compile. Can you try that first? Thanks

Reply Children
  • Hi All,

        we are trying to cross-compile the pc-ble-driver for the arm-32bit architecture. But unable to achieve the target yet. Made some changes in cmake configurations of required libraries like spdl, but getting errors as mentioned below. Can anyone, please let me know how can we complete the cross-compilation?

    Thank You!

    K.Khan

    Fullscreen
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi All,

        We have cross-compiled the PC-ble-driver and it's dependencies for the Arm-32 architect. We copied the shared object files like "libpc_ble_driver_shared_sd_api_v3.so" to the target arm device in the corresponding x86_32 directory and then run the dfu command. But it's  showing an error as mentioned below:

    Fullscreen
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Can anyone please, let me know if I am missing something and, What's this error indicates ?

    Thank You!

    K.Khan

  • Hi,

    We have successfully build the libraries and compile everything on RPI-2(ARM-32 bit core).  We have installed the following :

    python3.8

    nrfutil version- 6.1.0

    pc-ble-driver-py version - 0.15.0

    pc-ble-driver - 4.1.2

      After all, We connected a NRF52840 custom board with RPI ( flashed with a connectivity firmware 'connectivity_4.1.2_usb_for_s132_5.1.0.hex' only) . We are able to run 'nrfutil dfu' command over RPI and successfully updated the firmware to another NRF52840(flashed with bootloader and softdevice) over ble. 

    Sometimes we are getting below mentioned error during dfu:

    " File "/usr/local/lib/python3.8/site-packages/pc_ble_driver_py-0.15.0-py3.8-linux-armv7l.egg/pc_ble_driver_py/ble_driver.py", line 103, in wrapper

        raise NordicSemiException(
    pc_ble_driver_py.exceptions.NordicSemiException: Failed to ble_gattc_write. Error code: NRF_ERROR_SD_RPC_NO_RESPONSE
    Can anyone please let us know, Why are we getting this error?
    What action can be taken to resolve this?

    Thank You!

    K.Khan

  • Hi,

    "Hi, can you try to turn off the MSD like described here:"

    I tried to turn off the MSD, I run the command on JLinkExe:

    > MSDDisable

    it shows "Probe configured successfully". But still getting the same error during dfu.

    Is there any other way to resolve the issue?

    Thank You,

    K.Khan