Access of register STM32 CAN communication

It is the common way to check flags or more precisliy – if bit is set in some register. In this particular example:

INAK: Initialization acknowledge This bit is set by hardware and
indicates to the software that the CAN hardware is now in
initialization mode.

So you are basically wait in the infinite loop until CAN enter initialization mode.

BTW. I think you have way to much structures in your CAN configuration. If you use CMSIS macros package, it should look like this:

while((CAN->MSR & CAN_MSR_INAK) == 0);

Browse More Popular Posts

Leave a Comment