0
\$\begingroup\$

I wrote a code on stm32f103c8 to communicate with the HC-05 Bluetooth module. So far I have no problem and I receive and send any data correctly, but once I disconnect from the module via mobile phone and reconnect, I can not receive any data unless I once reset the micro to get data again. when I disconnect from the module, what does it do with the micro that gets stuck and needs to be reset? I set the UART connection with interrupt.

\$\endgroup\$
  • \$\begingroup\$ I dont have much experience at stm32 but, clearing error flags or resetting uart can be solution. \$\endgroup\$ – CCA Aug 1 at 9:03
  • 1
    \$\begingroup\$ This is unanswerable from the information provided, you need to figure out what is happening on the serial lines and determine the state of your program. Is it sitting in an exception handler? Is it operating normally but never seeing any more data? \$\endgroup\$ – Chris Stratton Aug 1 at 9:30
0
\$\begingroup\$

I found the problem, it might work for you too. When the device (mobile phone) is disconnected from the hc05 Bluetooth module , HC05 sends a string as + DISK:SUCCESS to the micro and because it was an unknown string my program gets stuck.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.