The 5d code is actually an Sd code and it means suds have been detected in the washer.
This can indicate to much soap or the wrong kind of soap was used in the washer. Be sure HE detergent is being used.
If can also indicate the drain pump is restricted or the drain hose is kinked.
First run a rinse cycle without adding any soap and let the washer run through the cycle and confirm there is no suds in the water and that the drain pump is working okay.
The first image below shows how to access and clean out the drain pump.
The problem can also be caused by suds confusing the pressure switch. For this you remove the top of the washer, see the 2nd image below, to access the pressure switch and with the drum empty of water remove the clear plastic hose from the switch and blow through it towards the tub. You should be able to blow easily and may even hear some bubbles from the sump. If the hose has a kink in it it can cause the Sd error.
I hope this information helps you resolve this problem but if additional help is needed then submit another question with any more details for further assistance.