1 Therefore this test can determine if damage to the pudendal nerve is the cause of ED. 2  Nocturnal penile tumescence-Men normally have erections when asleep at night, if not, this may be indicative of a problem with nerve function, hormones or blood supply to the penis.