Yeah, a firmware update might solve this one. Make sure you have a fully charged battery and an SD card that works normally in your camera. Format the SD card (note this deleted all info on it, so back up your photos). Then follow this guide:
Pentax Firmware Update Guide - Tutorial Videos | PentaxForums.com
You can find links to the firmware data on a link in the previous guide, or here:
Latest K-5 Firmware Update : Software Downloads | RICOH IMAGING
The latest update includes all previous stuff so only get the latest one.
Note! There are cameras X-5, K-5, K-5II, K-5IIs. They have different firmware updates! So make sure you get the one for your camera. The camera's model name is written on the camera.
Here are more instructions and discusion:
https://www.pentaxforums.com/forums/115-pentax-k-5/215866-k-5-firmware-update-instructions.html Originally posted by kmurphy220 Dunno. How do I check?
Probably just hold the Menu button while turning the camera on? I don't have a K-5, so feel free to google a bit more or check the Manual. I think you can find a pdf version of the manual online, if you want. You can then just put it on your smartphone and always have it with you. Its easy to search.
Originally posted by kmurphy220 Or is the card bad?
Hopefully the card is okay. Make sure it doesn't have any "lock" button engaged. You can check how well it works by trying it in another device, like with your computer. But start with the firmware update. After the firmware update, try formatting the new SD card in-camera, as that formats it in the way that is best for the camera