STM32F3 CAN Hardware not Entering Init Mode
This code is wrong:

while(~(MY_CAN_PORT-&gt;MSR &amp; CAN_MSR_INAK));


~ is not the logical NOT operator, but the bitwise complement operator!

So this does not mean "while init ack is not set", but it means "while 1". When INAK (binary mask 0x00000001) is set you get 0xFFFFFFFE and when it is not set, you get 0xFFFFFFFF. Both evaluate to true/1.

Surely your debugger should hang up here?

Fix it by using logical comparisons instead:

while((MY_CAN_PORT-&gt;MSR &amp; CAN_MSR_INAK)==0)
  ;


Note that the placement of the semi colon on a line of its own is good practice, so that the reader can tell that this is intentionally an empty loop and you didn't just dump the semicolon at the end of the line by habit/accident.