Hello dear,
Erection of penis is caused due to increased blood flow in the arteries of penis on account of any stimulation.
The reasons for difficulty in maintaining erection can be many such as
Hypertension,
Diabetes mellitus,
Atherosclerosis of the arteries, Neurological problems, Chronic illness, Prolonged intake of drugs, Stress, Smoking, Alcohol, etc.
And as you have already mentioned in your post about the history of Diabetes &
Hyperlipidemia, they can act as risk factors.
The presence of erection in early morning rules out any psychological cause.
But, to rule out any organic cause for your symptom, you need to undergo certain investigations like:
1. Doppler to determine any problem with blood flow.
2. Intra cavernosal injection test
Though medications like
Sildenafil citrate preparations are available, they should be taken under guidance of a Physician to avoid unwanted side effects.
Wishing you a Good Health.
Please let me know if I need to clarify further.
Thanks & take care.