I have had recent problems with my M8 and some sd cards. I mistakenly erased some files on my mac from the sd card. When inserting it into the M8, I got an error message that the card was locked and could not take any shots nor format the card. I found a suggestion on one of the forums to format the card on my mac and add a couple of folders with random names on it. When i inserted the card into the M8 I now had a message that the card was full but was able to format it in camera and use it. I also had this happen with a brand new lexar pro card. It seems this fixes the sd lockup problem.
Hope this helps some of you with a similar sd lockup problem.