Hello everyone,
I'm using an STM32F103C8 (Blue Pill) board with stm32duino via Arduino IDE. My goal is to program the board wirelessly using an HC-05 Bluetooth module.
First, I selected "Serial" as the upload method (instead of stm32duino) and set the BOOT0 pin to HIGH. To confirm everything was working, I initially tested it with a basic Blink sketch using a USB-TTL converter, and it worked successfully.
Next, I made the connections between my HC-05 module and the STM32 board:
STM32 HC-05
5V VCC
GND GND
PA10 TXD
PA9 RXD
I don't believe there's a problem with my connections, as these are the same connections I used for the USB-TTL converter, and they worked fine.
After making the connections, I paired my HC-05 module with my computer by entering the password. My computer assigned two COM ports: COM6 and COM7. To determine which one to use, I connected the TXD and RXD pins of my HC-05 module together (loopback test). After testing the ports through the Arduino IDE, I found that only on COM7 did my typed input echo back.
Based on this, I selected COM7 as the port in the Arduino IDE. When I tried to upload the code, I received the following error:
`Failed to init device.
stm32flash 0.4
http://stm32flash.googlecode.com/
Using Parser : Raw BINARY
Interface serial_w32: 115200 8E1`
According to the error message, the HC-05 module's baud rate should be 115200, but mine was initially 9600. I adjusted it to 115200 baud via AT commands (AT+UART=115200,0,0
). I also selected 115200 in Device Manager for the COM port. However, when I tried to upload again, I still got the same error.
I then researched the meaning of the 8E1
code, which indicates 8 data bits, Even Parity, and 1 stop bit. When I queried my HC-05 via AT commands (AT+UART?
), I found it was set to No Parity. I corrected this setting both in Device Manager and on the HC-05 itself (AT+UART=115200,0,2
to set Even Parity). The only change after this was the position of the "Failed to init device." error, which now appeared after the link.
How can I fix this? Any help would be greatly appreciated, as this is a bit urgent for me.
Thank you in advance for your time and assistance!