2021-12-02 09:24 PM
I've configured SWDCLK as UART_Tx in the initialization section. Everything runs fine but after running the system for a long time UART_Tx pin goes low all of a sudden and communication stops. The Tx pin remains low even if I reset the MCU. If I reprogram the MCU again everything runs fine. I have also noticed a few changes in the flash.
I am guessing that somehow the Tx pin is getting configured to its default status i.e., SWDClk when the error condition occurs and remains in SWDCLK mode until I reprogram the MCU.
What could be the possible reason? Any help will be highly appreciated.
2021-12-03 06:48 AM
FLASH doesn't typically spontaneously change, nor do register settings. Perhaps the chip is being reset, or held in reset. Perhaps the clock is configured incorrectly.
It would be more productive to address the problem objectively, determine where in your program the issue is occurring using GPIO pins or a debug UART stream, and go from there.