Default [Q] HTC One m7 - System rebooting and can't update

Hi,
About two weeks ago, after running out of battery completely, my phone started rebooting once I charged it back. It boots without a problem, and I'm able to use for about 15 seconds, then it reboots. I'm able to boot into recovery and perform a factory reset, which apparently fixes the problem, but then I can't update to sense 6. Once the update fails, the rebooting problem returns. So I had basically given up updating. However, today, after turning off the phone to charge it, it started rebooting again after I turned it on.

I read a couple threads and imo the problem is a mix of these two:

http://forum.xda-developers.com/htc-...error-t2812666
http://forum.xda-developers.com/htc-...5/post54026176

My device has unlocked bootloader and is rooted.
Please help.

@alray I started a new thread, since the problems were a little different. If you can continue to help, it will be very much appreciated.