Hello there,
I think i have a solution to your problem and the answer is ( just follow what i say)
1) Download Androxyde XPERIA Flashtool from .
2) Then install it on your PC , later install Fastboot and Flashtool Drivers (the .exe file will be there in c:\flashtool\flashtool drivers,u need not download separately) , as u are using Sony Xperia M , Check Flashtool drivers , Fastboot Drivers and Drivers for Xperia P,S when prompted.
3) Download the .FTF file of your Phone. Google it u"ll find it in no time
4)Then open Flashtool and Connect your Phone in Flashmode Mode ( by holding Volume Down button ,check for ur phone )
5) Search for the .FTFfile u"ve downloaded , Do check Wipe cache and data checkboxes and then click Flash, plz wait for the Flashtool to detect and prepare your files for Flashing
That's it , Now your Phone will work like never before
Plz tell me if it worked or not coz it worked for me and i am sure it will work for u too. i use Sony Xperia M Dual C2004
Hit thanks if it helped