Assuming you haven't fixed this yet, here are some hints for a suggested course of action next time it occurs. I'm operating on the theory that it isn't the battery (they don't generally go flat 10 mins after a good start & engine running):
- see whether it is starting system related or whole electrical system related by turning on headlights. If they don't come on, it's telling you it's a general power source problem eg: very bad battery connection (remember there are 3 main places for bad battery connections - both battery terminals and the other end of the earth strap where it connects to the body/chassis.
- If the lights come on, but dimly - it's confirming that there is a high resistance connection as per above, not so bad as to kill the lights but enough to strangle the high power needs of the starter system. You can confirm this by putting the blower fan on max (this is quite power hungry) and note the lights dim further.
- If all seems well with lights, you are probably looking at a fault with the starter or its solenoid (high power relay located in the starter body casing. See if you can hear the solenoid 'clicking' when you try to turn the engine over to start it (you will need someone's help here) - an absence of 'click' means a duff solenoid or faulty wiring to it. If you get a click but no turn, it's either the starter motor or the wiring to that.
- don't know anything about this 'code' business on the dash - it might be something to do with failing to pick up the transponder in the key fob (if there is such a thing on your car)and the immobiliser doing its job - which would fit your symptoms. However it also might tend to imply that it thinks the battery has been disconnected, which takes us back to a bad battery connection. Unless the connection is obviously loose, you can't tell just by looking - we are talking about corrosion between the terminal on the cable & the battery posts. You need to take them off and clean them. Remember that if you do this you will need to re-enter anything that has a 'code' like the radio.
- hope some of this helps. Might be worth investigating how the immobiliser on your car works to see if this 'code' message is a clue or just a symptom.
all things must pass.