Likely, since your uart code points to WiFi chip, I would replace it and see if it makes any difference
Problem solved.
I replaced the Wi-Fi IC, and it’s working perfectly again.
Apparently, the Wi-Fi IC can fail without showing any short circuit or other obvious signs of failure.
Thank you very much for your valuable support!
@jkyoho @Calvin