This doesn't solve your current problem, but the second to last section of this tutorial explains how to get your device ID by SWD:
I've been meaning to figure out and write up a guide for programming firmware by SWD. I'm not sure I'll get to that soon enough for your purposes, however.