Difference between nominal spread and credit spread

I’m confused on the difference between nominal spread and credit spread. I though they are both calculated as YTM risky bond - YTM risk free bond. Can someone plz explain the difference? Much appreciated!

Anyone ?