BluePill crashes but keeps output pins in their last state

Post here all questions related to LibMaple core if you can't find a relevant section!
Post Reply
Lucas Cartaman
Posts: 3
Joined: Mon Oct 30, 2023 1:32 am
Location: Paraguay

BluePill crashes but keeps output pins in their last state

Post by Lucas Cartaman »

I am using a Blue Pill STM32103FC8T6 for flight control of a drone and an MPU6050 as an IMU connected to the I2C2 port (PB10-SCL and PB11-SDA).

With this code everything works normally:

Code: Select all

#include <SoftWire.h>
SoftWire HWire(PB10, PB11, I2C_FAST_MODE);
With this code the Blue Pill crashes after about 15 seconds:

Code: Select all

#include <Wire.h>
TwoWire HWire (2, I2C_FAST_MODE); 
Effects of the crash:
  • LED PC13 flashes.
  • Any type of communication is lost (both UART and I2C).
  • The control outputs of the ESCs are not turned off but maintain their last state.
  • The only way to reverse the crash is to press the reset button.
This scares me, because if the crash happens while I'm flying the drone I will lose control and I won't be able to press the reset button on the BluePill, but the motors won't stop and the drone will continue flying without me being able to stop it.

Is there any way to make sure that if the BluePill crashes, it turns off all its outputs instead of keeping them active? Any firmware modification?

PS: I don't know if it helps but I am using Arduino IDE 1.8.3 with the following configurations. I upload the code using an FTDI but I also have a ST-Link V2
Attachments
ArduinoConfig.jpg
ArduinoConfig.jpg (23.91 KiB) Viewed 4836 times
User avatar
fpiSTM
Posts: 1776
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 92
Location: Le Mans
Contact:

Re: BluePill crashes but keeps output pins in their last state

Post by fpiSTM »

watchdog ? When it expires you can do some stuff.
Post Reply

Return to “General discussion”