Skip to main content
Visitor
August 25, 2026
Question

STM32F407 CAN1: INAK not set in Keil µVision Simulator

  • August 25, 2026
  • 0 replies
  • 3 views

STM32F407 CAN1: INAK not set in Keil µVision Simulator

I am implementing a bare-metal, polling-only CAN1 driver on an STM32F407VG in Keil µVision Simulator.

During CAN initialization:

CAN1->MCR.INRQ = 1;

while (CAN1->MSR.INAK == 0)
{
/* timeout */
}

MCR.INRQ successfully becomes 1, but MSR.INAK never changes from 0, so the program remains stuck in the loop.

I have verified:

  • STM32F407VG is selected and Use Simulator is enabled.

  • CAN1 clock is enabled (RCC->APB1ENR bit 25 = 1).

  • CAN1 register writes work; for example, MCR.INRQ and BTR fields update correctly.

  • Manually setting INRQ=1 in the CAN1 peripheral window also does not cause INAK to become 1.

  • Similarly, setting MCR.SLEEP=1 does not cause MSR.SLAK to become 1.

  • TSR.TME0/TME1/TME2 also remain 0.

Is the CAN1 peripheral state-machine behavior (INRQ → INAK, SLEEP → SLAK, mailbox status, etc.) actually supported for the STM32F407VG in the Keil µVision simulator? Or is there a specific configuration required for these hardware-generated status bits to update?

Thanks.