2024-04-26 06:06 AM
Hello,
I have a problem with my microcontroller (stm32f407VGT). The microcontroller runs correctly in our application for 30 minutes or 5 minutes (times are always different until the error occurs). Then suddenly the peripherals no longer work, e.g. no CAN messages are sent or received, all I2C and SPI buses do not read in correctly, GPIO outputs no longer switch HIGH (e.g.: LED turns on briefly for 300ms and then goes off, even though the LED should stay on for 1 second.
I have already debugged and the microcontroller continues to run normally. There is no hard fault, otherwise the system timer also continues to run normally. I suspect it's not an EMC problem, since the problem doesn't occur periodically in our application.
Does anyone have a suggestion on how I can fix the problem so that the microcontroller runs reliably.
2024-04-26 06:18 AM
Hi,
not clear...when debug is connected, no problem , never ?
+
Temperature of chip ...then ?
+
Did you check with DSO the VDD 3,3V , clock, etc. stable - when it stops working ?
2024-04-26 06:50 AM
Check the stability of your power supply. Sudden drops or fluctuations in voltage could cause the microcontroller to behave erratically or peripherals to malfunction. If you have made a custom board with the stm32f407VGT, you must check if your PCB has any fault. You can test with a multimeter or a PCB tester: https://www.pcbway.com/project/shareproject/Miniature_PCB_Tester_c2b226d2.html
2024-05-14 04:55 AM
Hi,
thanks for your tips. I checked the power supply and the voltage is stable. The clock also runs correctly and the temperature of the chip is fine.
I checked the peripherals again (I2C, SPI and GPIO) and they still worked.
I have determined that the CAN bus is the problem. After a random time, CAN messages are no longer sent, but messages are still received. Sometimes it happens after 10 minutes or only after an hour. The strange thing is that the microcontroller continues to run normally. No hard fault or other error occurs.
Is it possible that the mailbox is full?
Does anyone have a suggestion how I can solve the problem.
2024-05-14 05:01 AM
The Status Registers on the CAN peripheral are available for review, check them. Output telemetry and diagnostic output to a serial port so the debugger doesn't need to be connected but you can observe system state and behaviour.
2024-05-14 05:08 AM
I have also noticed that the data to be sent is not written to the register (CAN_TDL0R and CAN_TDH0R).
2024-05-14 05:15 AM
@PHolz.1 wrote:I have also noticed that the data to be sent is not written to the register (CAN_TDL0R and CAN_TDH0R).
how do you observe that?
As @Tesla DeLorean said, provide diagnostics to give you insight into what's going on; what changes when the problem occurs; etc ...
2024-05-14 05:51 AM
I looked at the registers in debug mode.
2024-05-14 06:08 AM
Remember that a debugger access is just like any other access to those registers.
Would those registers be expected to read-back what was previously written?