GR has given some good advice. I’m curious, tho - what did you mean by ‘I can’t flex it’? Are you talking about when performing a ‘Kegal’ your penis doesn’t move? Normally if you tighten these muscles - the same ones you’d use to stop urination - the penis should ‘twitch’ slightly, and this effect is much more noticeable with an erection.
Anyway, take GR’s advice & see a Dr., then get back to us about what was found & how you’re doing...
If this is ongoing, I'd talk to your doctor. You can experience ED if you’re vitamin D deficient, diabetic, severely stressed, not having frequent sex, or smoking too much. So, any of these things could be involved and some lifestyle tweaks can help fix it. You don't mention your age. You don't have blood pressure issues do you? Partially erect can involve that if you are older.