There is a GREAT SF short stoty on this topic
Astronaut crashes on far side of an isolated moon, away from the (unmanned) rescue shelter and has to walk back to base because his suit radio is dead. Suit is damaged, but is also a sentient AI. The suit and man work together to get home, both slowly failing. Eventually, they arrive, but turns out the man died some time back. The suit was hallucinating that he had survived and was still talking, so gets put into AI psych ward to recover!
I forget who wrote it, but it's a great vignette.
