Why is my iPhone 5 acting weird?

I have an iPhone 5 model A1428 and it will not turn on. also when i plug it into the charger it shows that is dead than shows the apple logo as if it is turning on than the screen immediatley goes black and it starts the cycle again
Re: why is my iphone acting wierd

Have you tried restoring it via a Mac or PC?
Re: why is my iphone acting wierd

Try the following:

1. Turn the phone off while plugged in to the wall socket and let it charge for about 2 hours and then turn the phone on.

OR

2. Connect the iPhone to your computer, initiate the computer's iTunes app, and then when iTunes detects it, select to restore it, if applicable.

OR

3. Make a Genius Bar appointment with the nearest Apple Store and have them diagnose the problem for you.
Re: why is my iphone acting wierd

yes i have tried restoring it but i get error code 21

Original thread: https://forums.imore.com/threads/why-is-my-iphone-5-acting-weird.314853/