HS101 Bluetooth – Debugging

I hope you did not have to read this content. It means something went wrong. Be armed with patience and good luck! :)

Deep Insight the Bluetooth Modules

Major issue of this project is in the HC-05 or HC-06 module sourcing. The market is full of different PCB versions with different firmware versions, working with different commands and with different specifications.

Wrong Bluetooth Modules

Following are the modules that are not good for this project since max speed is limited to 115200. You may know that are wrong modules because they use a small chip compared to the fast ones (see pictures below).

HC-06 Bluetooth Modules

Are those usually with 4 pins and no button. They may install the firmware with HC-06 protocol and the firmware with HC-05 protocol. In the second case you have a very fast module (it can send data up to 20-25fps in HScope).

HS101 Bluetooth Firmware in the STM32 allow the setup procedure to work with both HC-06 and HC-05 protocols.

HC-05 Bluetooth Module

Since Firmware v.10.1 you can configure the HC-05 module with the Wire Setup procedure but before powering on the STM32 and HC-05 you must keep pressed the button on the HC-05 (this will allow the module to enter in AT mode).

You can see the result on the Debug serial port (pin PB10 of STM32, baud rate: 115200).

If the automatic configuration doesn’t work here is the manual procedure.

  • Enter AT mode by pressing the button on HC-05 and then power the module
  • Connect an USB-TTL cable to it to communicate, set the serial terminal to 38400 baud
  • Send these AT commands (these are firmware depending, consider as reference):
  • AT+NAME=HS-10X_ABCD (ABCD can be arbitrary)
  • AT+PSWD=”0000″
  • AT+UART=1382400,0,0
  • Connect the HC05 to the STM32

Possible issues

It has been reported that some module cannot communicate at 1.3Mbaud. Some modules won’t allow configuration of serial port to 1382400 baud, other modules just stop to communicate after they get this configuration.

Test 1 – Does the Bluetooth module works?

You have configured the Bluetooth Module to work at 1.3Mbaud. Now shortcut RXD and TXD of the HC-06 Module and with this app (Serial Bluetooth Terminal) check if the commands you send echoes back.

However you still don’t know if the serial port is communicating at 1.3Mbaud or less (when you configured the serial speed it is possible that the AT command reply OK but actually the module did not apply the requested speed)

Test 2 – Does it communicate with STM32?

Connect the Bluetooth Module to the STM32, then use the app Serial Bluetooth Terminal to talk directly to the Bluetooth Module. Following are the configurations for this app.

  • Select the Bluetooth module
  • Settings -> Terminal: set to HEX
  • Settings -> Send: set to HEX

Sent the following HEX string to the Bluetooth Module: 07 00 00 00 00 00 FF FF. If the Bluetooth Module can communicate with the STM at 1.3Mbaud then you should receive a reply:

Phones with issue

Has been reported that with some phone Hscope cannot see the Bluetooth module. Here the list of phones with issues:

  • Xiaomi Mi9SE (Android 10)
  • Huawei Mate 10 PRO (Android 10)