Driving a PMSM (sometimes called BLDC)

Since you don't know why the thing doesn't work, you can't truly be sure it's not the code, can you? If you want the help of the real gurus (not me) you have to meet at least halfway.

Check this out: