Showing results for 
Search instead for 
Did you mean: 

STM32WB P2P examle not working


Hi, i tried opening and debugging the STM32WB BLE-P2P example in my workspace but i dont get it to work. I tried a dozen ways to open and debug and even like in this video

but it doesn't work. One problem ist that the guy in the video seems to have different example files than these supplied by STM in github. And also code generation via new Project and then selecting existing examples in the IDE itself doesn't work.

Can you help me please


If i try it like in the video i get

14:43:17 **** Build of configuration Debug for project BLE_p2pServer ****

make -j12 all 

make: *** No rule to make target 'C:/Utilities/lpm/tiny_lpm/stm32_lpm.c', needed by 'Utilities/stm32_lpm.o'. Stop.

"make -j12 all" terminated with exit code 2. Build might be incomplete.

14:43:17 Build Failed. 1 errors, 0 warnings. (took 488ms)

Associate III


did you fix that in the meantime. I run into the same problem. The only way I could fix it was to open the projects in the repository that comes with the firmware installation (usually c:\user\yourname\STMCube\Repository\...). The program is loaded correctly into the STMCubeIDE by double-click on the .project file. However, the files are not copied into your local workspace. They still located in the above mentioned repository. So everything you change changed there. At the moment the only way I found is to copy a lot of files manually from the repository to my project.

Best Regards


I'm having the same problem. So much value of examples is lost if it's too hard to clone them as a starting point for our own code.

I have tried copying the project file from the repository into my workspace and then copying all the driver and middleware folders into my file structure 2 levels above my workspace and adjusting the compiler and linker paths to match. That didn't work.

I have tried deleting the .project file and re-generated it from the .ioc file with CubeMX, and that didn't work.

I have successfully generated a new project with CubeMX that has some basic functionality, but of course it's missing all of the user code from the example, so that's not so useful. I'm going to try that again but then replace all the .c and .h files with the ones from the repository example.

It would be so great if ST would build their examples (including _ota versions) consistent with .ioc files in the project directory and with everything needed to clone the example in the project directory, so that I can just copy the project directory folder into my own workspace, put it under configuration control, build it and run it. Then start making my own changes to the .ioc file and user source code. Or describe some specific additional steps to get to the same point, where example code that was copied from the repository file structure to another location, builds and runs.

Back to my latest attempt, here are my steps:

  1. Delete my previous attempts to clone the example from my workspace
  2. Start a new project in my workspace using CubeIDE, with the same name as the example (BLE_p2pServer). An .ioc file was generated, and the (basically empty) project compiles fine.
  3. Copy the .ioc file from the repository example into my new project directory and re-generate code. I can open it from the Cube IDE.
  4. Generate code and build. Failure. Several .h files are missing. I checked the project settings and the selection for copying necessary files into the project that I had made initially was changed to "add necessary files as a reference..." I changed it back and re-generated code.
  5. Weird, now my BLE_p2pServer project is missing from the IDE workspace. I go to re-import it, and wow, it's all gone. I'll see if I can duplicate this.
  1. Maybe a better idea. In CubeIDE, I select new project from an existing .ioc file, and choose a copy of the BLE_p2pServer.ioc that is in neither the repository nor my current workspace. So far so good, project is created with the example .ioc file, with lots of necessary features active. Does it compile? Yes it does!
  2. Now replace .c and .h files that have blank user code sections with the .c and .h files from the example. Replace files in core/Inc and Core/Src. Replace source files buried in STM32_WPAN/App. Does it compile? No! Missing stm32wbxx_nucleo.h
  3. Search for where stm32wbxx_nucleo.h is. It's buried back in repository/drivers/BSP. I'll copy those into .src and .inc and hope the compiler finds them. Does it compile now? Yes!
  4. Run the debugger in this new project on the nucleo. Does it function like the repository example? yes it does!

O.k., now I need to modify this new project for OTA, following the directions in the readme of the BLE_p2pServer_ota example.

I got the same error when trying ST Example.

make: *** No rule to make target 'C:/........

The problem happened when creating the example project by double clicking ".project" or ".cproject" file in FW library. Instead, there would be no problem if creating the project through MX process: New, STM32 Project, Example Select ....



I managed to solve it this way:

  1. Open the project .ioc file in STM32CUBEMX
  2. Go to file > Save Project As
  3. Choose a new location for the project (the selected folder will be the project name)
  4. Under Project Manager > Code Generator > STM32Cube MCU packages and embedded software packs, I selected 'copy only the necessary library files'
  5. Generate code

Step 4 I did mainly because the YouTube tutorial from ST told me to. I don't know if it helped avoid our problem.


EDIT: the code that you expect would be preserved, was in fact not copied to the new project location.

Associate III

When cloning or downloading the STM32Cube_FW_WB_V1.19.0 the examples comes with relative include paths (../)
Opening the Compiler Include Paths looks like this: 

When copying a example project the resources should therefore be included as well. This is done in the .ioc file by enabling 'Copy only the necessary library files'. 


Afterward the relative include paths should be changed to match the current include paths of the project. 
Go to Properties > C/C++ Build > MCU GCC Compiler > Include paths. Update these acording to your project setup. The default setup that matches the folder structure of STM32Cube_FW_WB_V1.19.0 is shown on the first screenshot.