ARMmbed / mbed-os-example-ble

BLE demos using mbed OS and mbed cli
Apache License 2.0
134 stars 117 forks source link

How to change component to "BlueNRG_2" from "BlueNRG_MS" #394

Open aaron-yang-dev opened 1 year ago

aaron-yang-dev commented 1 year ago

Problem

I have two boards, one is NUCLEO-L446RE, the other is NUCLEO-BNRG2A1. I want to modify the app_main.json in the BLE_Advertising example and change "BlueNRG_MS" to "BlueNRG_2". But I got an error.

Cannot specify link libraries target "mbed-ble-bluenrg2" which is not built by this project.

mbed cli V2 version is 7.59.0

arm-none-eabi-gcc version is 10.3.1 20210824

mbed-os branch is master

How is this defect reproduced ?

  1. Replace "BlueNRG_MS" to "BlueNRG_2" in line17
  2. Add cmd in shell as below:
    mbed-tools configure -m NUCLEO_F401RE -t GCC_ARM
    mbed-tools compile -m NUCLEO_F401RE  -t GCC_ARM

Log

Configuring project and generating build system...
CMake Error at mbed-os/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_BlueNRG_2/CMakeLists.txt:4 (target_sources):
  Cannot specify sources for target "mbed-ble-bluenrg2" which is not built by
  this project.

CMake Error at mbed-os/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_BlueNRG_2/CMakeLists.txt:9 (target_link_libraries):
  Cannot specify link libraries for target "mbed-ble-bluenrg2" which is not
  built by this project.

-- Configuring incomplete, errors occurred!
See also "/mbed/mbed-os-example-ble/BLE_Advertising/cmake_build/NUCLEO_F401RE/debug/GCC_ARM/CMakeFiles/CMakeOutput.log".
See also "/mbed/mbed-os-example-ble/BLE_Advertising/cmake_build/NUCLEO_F401RE/debug/GCC_ARM/CMakeFiles/CMakeError.log".
ERROR: CMake invocation failed!