Possible factors include medications, illicit drugs, alcohol or nicotine. If a medication is causing the problem, your doctor may be able to prescribe an alternative. Conditions that restrict blood flow such as high blood pressure, hardening of the arteries or diabetes, can also be factors. Nerve damage from a spinal cord injury, stroke or kidney disease could be the culprit. If the problem is psychological, it may be from stress, depression, or anxiety over family, financial or job difficulties.
Medical care is important to determine the cause and find a treatment.
Your doctor will probably take a medical, sexual and psychological history. A physical examination is needed to check the blood vessels, nerves and tissue of the sexual organs. Sleep monitoring is another possible test. Most males have erections periodically throughout the night. If you are not having erections, the problem is probably physical.