2025-05-07 12:36 AM
Hi all,
I'm working on a BLE project on STM32WB5MMGHx module on each side (client and server).
For the server side, I use CubeMX to generate almost all the code (pairing configuration, GATT service and characteristics, etc.). I managed to "bypass" some CubeMX generated using the USER CODE comment areas to do what I wanted.
For the client part (more complex), I can only get a Custom P2P Client (this not what I want). Looks like I can't disable the Custom P2P Client (combobox disabled).
So here is the questions :
- How am I supposed to use CubeMX to create the BLE client with some custom code without bypassing 90% of CubeMX generated code (if possible...) ?
- Should I create all the projet manually and integrate some CubeMX generated code (in another folder) by hand ?
Thx
Solved! Go to Solution.
2025-05-07 1:31 AM - edited 2025-05-11 11:37 PM
Thank you @STTwo-32 the wiki page is pretty interesting, so long story short => do not use CubeMX unless you want a basic P2P client.
2025-05-07 1:15 AM
Hello @GuilhemG
If you want to create a client code based on the STM32CubeMX, the Custom P2P Client is enabled by default and the code generated is the one based on this config. I don't know what you want to do but you may refer to the STM32WB55_BLE_HeartRate_Client together with this WIKI page. The example is based on the BLE_P2PClient application from STM32CubeWB V1.21.0. It configures a BLE Client for the BLE_HeartRate project from STM32CubeWB. You can try to use the same method for your implementation.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-05-07 1:31 AM - edited 2025-05-11 11:37 PM
Thank you @STTwo-32 the wiki page is pretty interesting, so long story short => do not use CubeMX unless you want a basic P2P client.
2025-05-07 1:38 AM
It would be nice to be able to tell CubeMX not to generate an application and just generate the skeleton of a project with the WPAN stack. This way we could benefit from CubeMX while working on a custom application.
We must finally do everything without CubeMX once we use an example so if we want to enable a module a posteriori (AES, RNG or whatever) it is impossible, we have to generate the code in another folder and retrieve the files by hand.
2025-05-07 1:52 AM - edited 2025-05-07 9:10 AM
@GuilhemG wrote:
It would be nice to be able to tell CubeMX not to generate an application and just generate the skeleton of a project with the WPAN stack. This way we could benefit from CubeMX while working on a custom application.
I've escalated this request internally to the dev teams to review the possibility to add it (under internal ticket number 209290) (no engagement on that).
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-05-07 8:00 AM - edited 2025-05-07 8:09 AM
Hello @GuilhemG
No exactly but the STM32CubeMX will always generate the Custom P2P Client as client mode. This is very helpful for client configuration for startup. For the Peripherals (AES, RNG,...), you can enable and configure them on the generated .ioc file. After that, you can configure and implemented it.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.