NUCLEO-WB55RG - Mbed OS Example programs are not working at all

Hey guys,

I really don’t know what I’m doing wrong. Tried to get any of the Mbed OS BLE Examples for the NUCLEO-WB55RG Board up and running but failed hard!

My System:

  • Manjaro Linux (Kernel: 5.14.21-2-MANJARO)
  • Nucleo-WB55RG

What I tried:

Online Compiler

  • Compile any of the examples via Online Compiler and Drag and Drop it to the board
    → No BLE Device shows up in LightBlue App?! I have no idea what the Board is doing actually…

Mbed Studio

  1. Cannot import example via “Import Programm”, this error shows up: “Failed to create program mbed-os-example-mbed5-blinky”
  2. Tried importing via Online Compiler: Export (Zip Archiv), Import in Mbed Studio, set Mbed OS path, but the Target option is showing “Loading” all the time, even if I “Fixed All Problems”.

Clion

  1. Next Try in Clion: Export from Compiler → CMake-Gcc-ARM → Import to Clion → Error: “fatal error: mbed_config.h: No such file or directory” while loading CMake Project.
  2. Tried to fix some stuff in CMakeLists.txt next error while building: “error: ‘events’ does not name a type”
  3. Again fixed some stuff in the CMakeLists.txt, which at least made me build the project.
  4. Upload to the board? Somehow I managed to flash it to the board via OpenOCD but nothing happens.
  5. Debug? Does not work: “MCU Communication Failure”

Mbed Cli 1

  • Tried to flash the Board but the used python side packages throw a shitload of errors again, because deprecated stuff ist used. I have python 3.10.5 installed.

Mbed CLI 2

  • Again some error: “KeyError: ‘supported_c_libs’”

I don’t get it, but nothing really seams to work! Is there any stable way to test the BLE functionality of the Nucleo-WB55RG Board by installing existing examples, which results in the ability to connect to the board via LightBlue or something similar?

Thanks a lot guys!!

Hi Benjamin,
I use the same board, Nucleo-WB55RG, with the BLE example applications and it works perfectly. My environment is Mbed CLI 1, GCC_ARM. I will also suggest to setup your python environment with a venv. That is what I use. And I compile like so:

  1. Make sure you read/follow the instructions for importing the BLE examples at GitHub - ARMmbed/mbed-os-example-ble: BLE demos using mbed OS and mbed cli

  2. As I am presuming Mbed CLI 1, here is a gist of what you might have to do:

    Source your python environment

    source py37-venv/bin/activate

    git clone GitHub - ARMmbed/mbed-os-example-ble: BLE demos using mbed OS and mbed cli

    cd mbed-os-example-ble

    Let’s use BLE Advertising as an example:

    cd BLE_Advertising

    Ensure to pull in tools and all other dependencies:

    mbed deploy

    Here I would create an mbed_app.json file having the configurations

    particular to our board and in case you might want to enable BLE

    traces in the future. Technically this step is not necessary as per my

    understanding the BLE firmware is already built-in for our board.

    Here are some relevant links on this:

    NUCLEO-WB55RG | Mbed

    mbed-os/README.md at master · ARMmbed/mbed-os · GitHub

    The file’s contents should be:

    {
    “target_overrides”: {
    “*”: {
    “platform.stdio-baud-rate”: 9600,
    “platform.stdio-convert-newlines”: true,
    “mbed-trace.enable”: false,
    “mbed-trace.max-level”: “TRACE_LEVEL_DEBUG”,
    “cordio.trace-hci-packets”: false,
    “cordio.trace-cordio-wsf-traces”: false,
    “ble.trace-human-readable-enums”: false
    }
    }
    }

  3. Compile with:

    mbed compile -m nucleo_wb55rg -t GCC_ARM

  4. When compilation completes, flashing the board is as straightforward
    as copying the binary and dropping it on the enumerated USB drive for the
    Nucleo-WB55RG.

Enjoy
Nuertey

Thank you so much for your help!

I fixed the python issues and compiling on my machine is no problem now.
I followed the exact example on git but still when I drag the “BLE_Advertising.bin” File to the board nothing happens. I don’t get it?!
No Messages on Serial Plotter nor any life sign via Light Blue…

Is it normal, that the USB drive disappears for a second and when it reappears the .bin is gone?

My Boards Firmware:
FUS Version v1.2.0
STACK Version v1.14.1.1

Is it my Board (probably) or my binary which is the problem? Any further ideas?

Thanks!!

Great that you can compile now.

Yes, the sequence that you observed implies the board was successfully flashed and then it reboot to run the BLE application. You will no longer see a .bin there. The act of copy and pasting the .bin simply emulates flashing to the board. So that step is good too.

I believe that BLE application does not actually output anything to the serial so that method will not tell you much. In fact in my copy of the code, I had to add a printf at the beginning in order to confirm that the application is indeed running. See below for that code so you can use it.

Now the next step is to use the BLE app on your phone to scan for the advertisements being broadcast by the board’s radio. You should see a Bluetooth device called “BATTERY”. That is your application, and that confirms that that example is indeed sending out advertisements correctly. Also check for the battery charging level… it should change.

The BLE scanner on your phone to use is nRF Connect for Mobile. Install it from the App Store. That will show you the battery level received in the advertisements for the BATTERY Bluetooth device. A good learning test is to change the code, source/main.cpp line 23 and set it to “NUCLEO-WB55RG”, save, rebuild, reflash, and see if the scanner on your phone discovers that device.

Regards
Nuertey

printf("\r\n\r\n\"../mbed-os-example-ble/BLE_Advertising\" Application - Beginning... \r\n\r\n");

#ifdef MBED_MAJOR_VERSION
printf(“Mbed OS version: %d.%d.%d\n\n”, MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION);
#endif
printf(“Built: %s, %s\n\n”, DATE, TIME);

1 Like

Thx man, you are really helpful!

Added the Debug printf code and in earlier attempts downgraded STLink Firmware to V2J39M27. Now we talking, finally becoming some errors :partying_face::

"../mbed-os-example-ble/BLE_Advertising" Application - Beginning... 



++ MbedOS Error Info ++
Error Status: 0x80FF0100 Code: 256 Module: 255
Error Message: Fatal Run-time error
Location: 0x8015FBD
Error Value: 0x0
Current Thread: main Id: 0x20002474 Entry: 0x80021B1 StackSize: 0x1000 StackMem: 0x20001450 SP: 0x2000229C 
For more info, visit: https://mbed.com/s/error?error=0x80FF0100&tgt=NUCLEO_WB55RG
-- MbedOS Error Info --
ERROR booting WB controler

No idea whats wrong now :see_no_evil: but I will at least try some other example…

EDIT: The GattServer_Char_write example throws the exact same error :cry:

Try my version of the BLE_Advertising repo here GitHub - nuertey/Nuertey-BLE_Advertising

That version, which, if I recall correctly, I certainly modified somewhat and rearranged slightly, worked for me. So since we have the same target MCU, it should work for you as well.

git clone https://github.com/nuertey/Nuertey-BLE_Advertising
cd Nuertey-BLE_Advertising
mbed deploy
rebuild, reflash, retest as before...

Let me know if it works for you.
Nuertey

Also Benjamin, what is your compiler? And its version? There is one thing we may still have to change to ensure that you do not see that Runtime crash.

Nuertey

Really I don’t get it, this is your project:

"../mbed-os-example-ble/BLE_Advertising" Application - Beginning... 

Mbed OS version: 6.16.0

Built: Aug 12 2022, 19:36:43



++ MbedOS Error Info ++
Error Status: 0x80FF0100 Code: 256 Module: 255
Error Message: Fatal Run-time error
Location: 0x8015FB1
Error Value: 0x0
Current Thread: main Id: 0x20002474 Entry: 0x80021B1 StackSize: 0x1000 StackMem: 0x20001450 SP: 0x2000229C 
For more info, visit: https://mbed.com/s/error?error=0x80FF0100&tgt=NUCLEO_WB55RG
-- MbedOS Error Info --
ERROR booting WB controler

How do you compile it?

Yeah, forget to add it ^^
I have these GNU ARM Tools installed:
https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin

which links to:

Think that’s what my system uses… But still if I use the online compiler, same error.
By now I suspect my Board. But still I can flash the blinky example :smiley:
Maybe the BLE Stack Version?

Okay, so you have a GCC_ARM compiler, Good.And then you are using the Mbed CLI 1, correct? to compile like so?:

mbed compile -m nucleo_wb55rg -t GCC_ARM

Now instead of that, compile like so:

mbed compile -m nucleo_wb55rg -t GCC_ARM --profile my_profile.json

And then retest and let me know what you see.

1 Like

Puuh I’m pissed man. Downgraded the fucking BLE Stack Version to v1.13.0 and now everything seems to work like a charm.

Solution: Downgrade to BLE Stack Version v1.13.0

Thank you @Nuertey_Odzeyem very much for your help!! :pray:
Btw. the --profile my_profile.json flag threw a fat error again :smiley:

Till now this mbed os is the worst dev experience I ever encountered :melting_face:

You are welcome.

1 Like

And what is the error? Copy and paste it here. It is probably complaining about the C++20 switch due to your GCC version. If that is it, you can simply change that line to C++17

[mbed] Working path "/home/benjo/Downloads/mbed-os-example-ble/Nuertey-BLE_Advertising" (library)
[mbed] Program path "/home/benjo/Downloads/mbed-os-example-ble/Nuertey-BLE_Advertising"
[Warning] @,: Compiler version mismatch: Have 11.2.1; expected version >= 9.0.0 and < 10.0.0
Building project Nuertey-BLE_Advertising (NUCLEO_WB55RG, GCC_ARM)
Scan: Nuertey-BLE_Advertising
Using ROM region application in this build.
  Region application: size 0xca000, offset 0x8000000
Compile [ 13.0%]: BLE.cpp
[Error] GattCharacteristic.h@1919,9: expected unqualified-id before 'const'
[Error] GattCharacteristic.h@1918,35: expected ')' before 'const'
[Error] GattCharacteristic.h@1962,9: expected unqualified-id before 'const'
[Error] GattCharacteristic.h@1961,36: expected ')' before 'const'
[Error] GattCharacteristic.h@2004,9: expected unqualified-id before 'const'
[Error] GattCharacteristic.h@2003,36: expected ')' before 'const'
[Error] GattCharacteristic.h@2047,9: expected unqualified-id before 'const'
[Error] GattCharacteristic.h@2046,55: expected ')' before 'const'
[Error] GattCharacteristic.h@2091,9: expected unqualified-id before 'const'
[Error] GattCharacteristic.h@2090,54: expected ')' before 'const'
[Error] GattCharacteristic.h@2136,9: expected unqualified-id before 'const'
[Error] GattCharacteristic.h@2135,55: expected ')' before 'const'
[ERROR] In file included from ./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattService.h:23,
                 from ./mbed-os/connectivity/FEATURE_BLE/include/ble/GattServer.h:28,
                 from ./mbed-os/connectivity/FEATURE_BLE/include/ble/BLE.h:28,
                 from ./mbed-os/connectivity/FEATURE_BLE/source/BLEInstanceBase.h:26,
                 from ./mbed-os/connectivity/FEATURE_BLE/source/BLE.cpp:21:
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:1919:9: error: expected unqualified-id before 'const'
 1919 |         const UUID &uuid,
      |         ^~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:1918:35: error: expected ')' before 'const'
 1918 |     ReadOnlyGattCharacteristic<T>(
      |                                  ~^
      |                                   )
 1919 |         const UUID &uuid,
      |         ~~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:1962:9: error: expected unqualified-id before 'const'
 1962 |         const UUID &uuid,
      |         ^~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:1961:36: error: expected ')' before 'const'
 1961 |     WriteOnlyGattCharacteristic<T>(
      |                                   ~^
      |                                    )
 1962 |         const UUID &uuid,
      |         ~~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:2004:9: error: expected unqualified-id before 'const'
 2004 |         const UUID &uuid,
      |         ^~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:2003:36: error: expected ')' before 'const'
 2003 |     ReadWriteGattCharacteristic<T>(
      |                                   ~^
      |                                    )
 2004 |         const UUID &uuid,
      |         ~~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:2047:9: error: expected unqualified-id before 'const'
 2047 |         const UUID &uuid,
      |         ^~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:2046:55: error: expected ')' before 'const'
 2046 |     WriteOnlyArrayGattCharacteristic<T, NUM_ELEMENTS>(
      |                                                      ~^
      |                                                       )
 2047 |         const UUID &uuid,
      |         ~~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:2091:9: error: expected unqualified-id before 'const'
 2091 |         const UUID    &uuid,
      |         ^~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:2090:54: error: expected ')' before 'const'
 2090 |     ReadOnlyArrayGattCharacteristic<T, NUM_ELEMENTS>(
      |                                                     ~^
      |                                                      )
 2091 |         const UUID    &uuid,
      |         ~~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:2136:9: error: expected unqualified-id before 'const'
 2136 |         const UUID    &uuid,
      |         ^~~~~
./mbed-os/connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h:2135:55: error: expected ')' before 'const'
 2135 |     ReadWriteArrayGattCharacteristic<T, NUM_ELEMENTS>(
      |                                                      ~^
      |                                                       )
 2136 |         const UUID    &uuid,
      |         ~~~~~

[mbed] ERROR: "/sbin/python3" returned error.
       Code: 1
       Path: "/home/benjo/Downloads/mbed-os-example-ble/Nuertey-BLE_Advertising"
       Command: "/sbin/python3 -u /home/benjo/Downloads/mbed-os-example-ble/Nuertey-BLE_Advertising/mbed-os/tools/make.py -t GCC_ARM -m nucleo_wb55rg --profile my_profile.json --source . --
build ./BUILD/NUCLEO_WB55RG/GCC_ARM-MY_PROFILE"
       Tip: You could retry the last command with "-v" flag for verbose output
---

Quite ugly but there is one: “Compiler version mismatch: Have 11.2.1; expected version >= 9.0.0 and < 10.0.0”?!

You can ignore the compiler version mismatch one; that is just a warning.

I just pushed up a new version of my_profile.json in my repo to fix your compile error. Pull it down and see if it compiles now. I think “git pull” should update that for you.

1 Like

I am having a problem compiling the ble example, but i am using MBED cli 2 with mbed-tools. Is there a known issue with FEATURE BLE on a NUCLEO_WB55RG with the CLI 2? I get the same dreaded error:
++ MbedOS Error Info ++
Error Status: 0x80FF0100 Code: 256 Module: 255
Error Message: Fatal Run-time error
Location: 0x800BF85
Error Value: 0x0
Current Thread: main Id: 0x200012A0 Entry: 0x8002F51 StackSize: 0x1000 StackMem: 0x200012E8 SP: 0x20001FAC
For more info, visit: mbedos-error
– MbedOS Error Info –
ERROR booting WB controler

using MBED 6.16 and GCC_ARM latest

Just tested against example_mbed-os-example-ble/BLE_GattServer_CharacteristicUpdates and Nuertey-BLE_Advertising and get the same error on both

++ MbedOS Error Info ++
Error Status: 0x80FF0100 Code: 256 Module: 255
Error Message: Fatal Run-time error
Location: 0x800BE29
Error Value: 0x0
Current Thread: main Id: 0x20001170 Entry: 0x8002DBD StackSize: 0x1000 StackMem: 0x200011B8 SP: 0x20001E04
For more info, visit: mbedos-error
– MbedOS Error Info –
ERROR booting WB controler

mbed-os latest 6.16
mbed-os-ble-utils latest
copro bin stm32wb5x_BLE_Stack_full_fw.bin v1.14.1

Finally got it working using the 1.13.1 bluetooth firmware.