Hello there, i had the same problem with my phone ,most of the HTC smartphones have the exact problem of charging and the red light blinking . I took my 820 to the htc service center and they told me that the charging port was damaged and this is a common problem in many devices they gave me a bill of 3000 INR for replacing the port as well as the battery with one month warranty. but if you are low on budget and don't want to spend that much you can get both of them replaced at a local shop for 1500 INR. Battery costs around 700-800 while the port costs around 500-600.Your phone will no longer have any charging issues . believe me its no software problem .