Hi, I am using STM32WB55 custom board,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-10 10:40 PM
I have to configure it as a Client. Can please someone help me with the starting guide for the client configuration like how to establish connection with server and how to write attribute to server, everywhere I found only starting guide for server only.
Thank You,
Arief
Solved! Go to Solution.
- Labels:
-
BLE
-
STM32CubeIDE
-
STM32CubeMX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-11 2:14 AM
Hello @Community member​
First let me thank you for posting.
To configure the STM32WB55 as a BLE client using the CubeMX software, you'll need to perform the following steps:
- First, you'll need to use the CubeMX tool to configure the necessary peripherals and generate the initial project for your STM32WB55 board. Make sure to enable the BLE module and configure it as a client.
- Next, you'll need to use the generated code to establish a connection with the server. You can do this by using the provided BLE stack to scan for available BLE devices and connect to the desired server device.
- Once connected, you can use the provided stack to write attributes to the server. Each attribute is represented by a unique handle, and you can use the stack's API to write the value of the attribute to the server.
- The stack will also provide a way to check the status of the connection and the current state of the device(client)
- In the end of your application use disconnect API provided by stack to disconnect the connection.
The process for establishing a connection with a BLE server using a BLE wireless stack will depend on the specific stack you are using, but in general, you will need to perform the following steps:
- Initialize the stack by calling the appropriate initialization function. This will typically include configuring the underlying transport (UART, SPI, etc.) and initializing any internal data structures.
- Start the stack by calling the appropriate start function. This will typically include starting any underlying protocols (such as the link layer or host controller interface) and setting the device in discovery mode.
- Start scanning for nearby devices. This can typically be done by calling a function such as StartScan() and specifying the type of scan (passive or active) and the duration of the scan.
- Once the scan is complete, you can retrieve the list of discovered devices by calling a function such as GetDiscoveredDevices(). You can then iterate through the list and connect to the desired server device.
- To connect to a specific server device, you can call a function such as Connect() and pass in the address of the server device. The stack should handle the connection process, including initiating the connection request, sending connection parameters, and authenticating the connection.
- You should also check for the events or callbacks from stack indicating the status of the connection and take appropriate actions.
- Once connected, you can then proceed to write attributes to the server.
Thx
Ghofrane
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-11 2:14 AM
Hello @Community member​
First let me thank you for posting.
To configure the STM32WB55 as a BLE client using the CubeMX software, you'll need to perform the following steps:
- First, you'll need to use the CubeMX tool to configure the necessary peripherals and generate the initial project for your STM32WB55 board. Make sure to enable the BLE module and configure it as a client.
- Next, you'll need to use the generated code to establish a connection with the server. You can do this by using the provided BLE stack to scan for available BLE devices and connect to the desired server device.
- Once connected, you can use the provided stack to write attributes to the server. Each attribute is represented by a unique handle, and you can use the stack's API to write the value of the attribute to the server.
- The stack will also provide a way to check the status of the connection and the current state of the device(client)
- In the end of your application use disconnect API provided by stack to disconnect the connection.
The process for establishing a connection with a BLE server using a BLE wireless stack will depend on the specific stack you are using, but in general, you will need to perform the following steps:
- Initialize the stack by calling the appropriate initialization function. This will typically include configuring the underlying transport (UART, SPI, etc.) and initializing any internal data structures.
- Start the stack by calling the appropriate start function. This will typically include starting any underlying protocols (such as the link layer or host controller interface) and setting the device in discovery mode.
- Start scanning for nearby devices. This can typically be done by calling a function such as StartScan() and specifying the type of scan (passive or active) and the duration of the scan.
- Once the scan is complete, you can retrieve the list of discovered devices by calling a function such as GetDiscoveredDevices(). You can then iterate through the list and connect to the desired server device.
- To connect to a specific server device, you can call a function such as Connect() and pass in the address of the server device. The stack should handle the connection process, including initiating the connection request, sending connection parameters, and authenticating the connection.
- You should also check for the events or callbacks from stack indicating the status of the connection and take appropriate actions.
- Once connected, you can then proceed to write attributes to the server.
Thx
Ghofrane
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-16 1:35 AM
Hi Ghofrane,
Thank you for making me understand the flow.
I have joined the server, once the join is successful after a few sec it enters into HardFault_Handler. I am trying to find out the reason but I didn't get it.
Can you please help me solve this?
Thank you,
Arief
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-16 2:27 AM
Hello @Community member​
Actually it is difficult to determine the specific cause of the HardFault_Handler issue without more information about your code but try to review your code to ensure that there are no memory leaks or buffer overflows that could cause a HardFault.
Make sure that the communication between the STM32WB55 and the server device is working properly by checking the connection parameters and debugging the communication process.
Thx
Ghofrane
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-01-16 5:02 AM
I have just modified the filtering advertised device data and
BleApplicationContext.DeviceServerFound = 0x01;
No other modifications.
