2024-02-27 02:35 AM - last edited on 2024-02-27 07:29 AM by Peter BENSCH
Can anyone please direct me to documentation on how to interface to Bluetooth functionality on the STM32WB1MM module (or B-WB1M-WPAN1)?
My understanding is that I should be able to use the Bluetooth capability from either the on-board STM32WB15 of from an external MPU via TTL UART or SPI. The question is how?
I have found and read all manner of documentation about the STM32WB1MM and B-WB1M-WPAN1 devices but cannot find anything pertaining to Bluetooth. I have also looked through the example projects on GITHub but struggle to navigate the bewildering number of projects having rather cryptic names.
Is it just a question of connecting and using AT commands?
Thank you.
Solved! Go to Solution.
2024-04-12 06:08 AM
Hello @JBend.6
1- There is not BLE_AT_Client But you can create your own referring to the Client examples and the structure of the AT project (refer to the AT SERVER example for help).
2- A part is initiated by the .ioc generated file and others are directly configured by the user. refer to this WIKI for more details.
3- Refer to the last two answers.
4- You need to Flash the project as indicated on the ReadMe file of the examples of the B-WB1M-WPAN1.
PS: the problem on the BLE_HR_p2p_Sensor example is solved on the Last release of the STM32CubeWB (V1.19.0).
If you have any issue or problem, I suggest you close this post by selecting a "best answer". And create a new post for your problems.
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.
2024-02-27 11:59 PM
Hello @JBend.6
the B-WB1M-WPAN1 MCU is based on the STM32WB15CCY. You can use this module event directly using a code that run BLE commands directly from the MCU or through an UART terminal emulator using specific AT commands. For that I suggest you take a look at the existing BLE_AT_Server and use the AN5805. to migrate the project to your product.
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.
2024-02-28 12:02 AM
Hi JBend,
Were you able to try flashing your STM32WB1MM board with the project you mentioned?
Here is documentation that allows you to get started with the board and the application interfaces to play with BLE:
B-WB1M-WPAN1 Out of Box Demonstration
Joé
2024-03-01 04:56 AM
Thank Joe.
That document helped. I managed to run the Heart-Rate example. I have downloaded the STM32Cube_FW package and trying to find an example for the B-WB1M-WPAN1 which demonstrates how to interacting with the BLE. I copied, compiled and downloaded the "Projects\B-WB1M-WPAN1\Examples\BSP\BSP_Example". Nothing appears to happen and my phone is unable to find any BLE advertising.
My use case is to create a Bluetooth to serial bridge using the B-WB1M-WPAN1. From there I can take the project further.
Thanks again.
2024-03-01 05:30 AM
Thanks STTwo-32.
I have downloaded BLE_ATLServer. There is also something similar in the STM32Cube_FW_WB_V1.18.0 pack, although not for the B-WB1M-WPAN1. I have not found anything yet that explains what to do and why, just uncommented code.
The situation now is that I have explored, compiled and programmed a number of projects onto my B-WB1M-WPAN1. None of them produce any Bluetooth output that can be detected by my phone or laptop. Originally the B-WB1M-WPAN1 worked with the pre-installed demo software (heart-rate, temperature, giro, etc) and my Android phone using the ST BLE Sensor app. Has the Bluetooth been overwritten on the M0 core? I thought this was not possible.
I have a minimal test project that flashes the User LED as a heartbeat. This works so I assume that the B-WB1M-WPAN1 is functional and the toolchain is working.
Thanks.
2024-03-01 06:31 AM - edited 2024-03-01 06:33 AM
Hi,
@JBend.6 wrote:
I have downloaded the STM32Cube_FW package and trying to find an example for the B-WB1M-WPAN1 which demonstrates how to interacting with the BLE. I copied, compiled and downloaded the "Projects\B-WB1M-WPAN1\Examples\BSP\BSP_Example". Nothing appears to happen and my phone is unable to find any BLE advertising.
The BLE examples are located in the folder: \Applications\BLE.
By compiling the example: Projects\B-WB1M-WPAN1\Examples\BSP\BSP_Example, it is normal not to see any BLE advertising as it is an example that explains how to use the different drivers of external devices mounted (as explained in the README) and not a BLE example.
@JBend.6 wrote:
None of them produce any Bluetooth output that can be detected by my phone or laptop.
Under Applications\BLE you will find 2 samples dedicated for your B-WB1M-WPAN1:
Each of them contains a readme file that explains what the application is for and how to use it.
If you want to go further with your STM32WB, I recommend you to take a look at the following wiki page:
Note that you can draw inspiration from all the other STM32WB applications listed on this wiki page.
BR, Joé
2024-03-01 07:11 AM
Thank you.
Following your advice I am now using "Projects\B-WB1M-WPAN1\Applications\BLE\BLE_HR_p2p_Sensor". I had tried this project before, but now realise that I had accessed the project incorrectly. I should have used: File > Import,,, > Import STM32Cube Example and set the Board filter to "B-WB1M-WPAN1".
The problem I have now is that project build fails with exit code 2.
...BLE_HR_p2p_Sensor.elf section `._user_heap_stack' will not fit in region `RAM1'
...region `RAM1' overflowed by 40 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:74: BLE_HR_p2p_Sensor.elf] Error 1
Although I understand the meaning of the error I am out of my depth with how to fix it.
Thank you.
2024-03-01 09:57 AM
Hello @JBend.6
For the BLE_HR_p2p_Sensor example on the B-WB1M-WPAN1, we are aware of this problem and it has been reported in an internal ticket number 172512 (this is a ticket internal number and it can't be used by Customers). As a temporary workaround (until the resolution on the coming releases of the STM32CubeWB) you have to reduce the _Min_Heap_Size from 0x300 to 0x299 or the _Min_Stack_Size from 0x900 to 0x899. you can find those two variables on the line 41 of the STM32WB1MMCHX_FLASH.Id file of the project.
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.
2024-03-02 04:25 AM
Thanks STTwo-32.
BLE_AT_Server is more what I am looking for. It seems to be a lot of code for such a simple job and raises even more questions:
1 - Is there a BLE_AT_Client or does server relate to the use of the M0 core?
2 - app_entry.c and other related codes modules seem to have been initiated by machine and not user.
3 - How do we create such a project from scratch? There are many directories and files in the BLE_AT_Server project with no clues as to where they came from or why they are included.
4 - Do I need to flash the Wireless Coprocessor (M0 core) if using a target B-WB1M-WPAN1 (STM32WB1MMC module)?
Many thanks.
2024-04-12 06:08 AM
Hello @JBend.6
1- There is not BLE_AT_Client But you can create your own referring to the Client examples and the structure of the AT project (refer to the AT SERVER example for help).
2- A part is initiated by the .ioc generated file and others are directly configured by the user. refer to this WIKI for more details.
3- Refer to the last two answers.
4- You need to Flash the project as indicated on the ReadMe file of the examples of the B-WB1M-WPAN1.
PS: the problem on the BLE_HR_p2p_Sensor example is solved on the Last release of the STM32CubeWB (V1.19.0).
If you have any issue or problem, I suggest you close this post by selecting a "best answer". And create a new post for your problems.
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.