|A Bit URGENT|Help with STM32F103C8 (Blue Pill) Wireless Programming via HC-05 - "Failed to init device" Error

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!

Hello

Hey

@stm32curcious it is rude to bump your post at this frequency. We would generally consider it reasonable to make a one-time bump if a few days pass without any response, but anything more than that is being disrespectful to our community.

While you wait for one of the forum's volunteer helpers to respond, I recommend you spend the time working on solving the problem on your own. Even if you don't find a solution, this will allow you to come back to post an update with a detailed description of the new things you have tried, and the results. This way your bump can add something of value instead of consisting solely of a lazy and worthless "hey".

1 Like

Hello.I understand that you said hello. However, the reason I did the first one is that my account was blocked for 1 day due to a correct suggestion. You are an admin, I think you can see it. I have always solved my problem myself until now, but this did not happen. I am constantly trying to do this. Please, my account was blocked. I think you can understand. If I remember correctly, French is created on this platform with hundreds of internal posts for the sole purpose of talking, chatting and having fun. And as you can guess, it is always at the top. I apologize; are the ones I mentioned rude and without warning?

Is it because of the message I wrote in this completely empty chat for just one more? Okay. It will not happen again.

Your account was silenced for one hour due to a false positive from the forum's automated spam detection system. That did not affect the visibility of this topic in any way.

No. Although it is unfortunate that your account was unfairly silenced, that is not a justification for rude behavior.

No, because they are people engaging in discussions.

That is a different situation from someone adding reply on their topic solely for the purpose of bumping your topic back to the top of the list.

Thanks!