Skip to main content
ludovic-micou2
Associate II
January 4, 2016
Question

crash of stm32

  • January 4, 2016
  • 4 replies
  • 1486 views
Posted on January 04, 2016 at 11:20

I use a STM32f103VB in a system who charge and discharge a battery. The microcontroler stops working in a random way. I can have the system which works during several days before having a crash of the microcontroler as I can have this crash after a few hours. I dont have a condition that it crash. I use 2 I2C bus, 1 I2C in master for communicate with a gauge and a component and the second I2C in slave for communicate with the output.

    This topic has been closed for replies.

    4 replies

    waclawek.jan
    Super User
    January 4, 2016
    Posted on January 04, 2016 at 12:09

    Most of the time the inexplicable crashes point to software error of various kind, stack overflow is one of the common mechanisms.

    Try increasing the crash occurence e.g. by increasing workload, communication flow, input toggle using external pulse generators, deliberately introducing errors in I2C communication by grounding manually SDA/SCK or shorting them together, etc.

    JW

     
    Tesla DeLorean
    Guru
    January 4, 2016
    Posted on January 04, 2016 at 20:35

    In order to debug this kind of thing, where you don't or can't have a debugger attached, is to provide enough telemetry and diagnostic output via a serial port, and log it. You also want to have a proper Hard Fault Handler, that can output the internal registers and faulting instructions. It could perhaps be expanded to dump the stack, or memory around the fault, etc. Consider also adding routines to measure the stack depth, and alert when limits are exceeded.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    re.wolff9
    Senior
    January 5, 2016
    Posted on January 05, 2016 at 12:36

    Besides ''software error'', the other possiblity is ''hardware error''. For example it might be possible that your powersupply dips below the minimum every now and then. I had a bug in  a design that caused the powersupply to dip from 3.3V down VERY low. It surprised me how long the CPU would continue to run on ''too low'' a supply.... 

    Too few decoupling capacitors can result in ''hard to debug'' occasional crashes. 

    pkumar1883
    Associate III
    January 11, 2016
    Posted on January 11, 2016 at 07:14

    hi ludovic.micou,

    Could you find out the solution of problem? if yes then please share what you did, so that can be useful and beneficial for others too.