Skip to main content
Visitor II
August 25, 2026
Question

STM32F407 CAN1: INAK not set in Keil µVision Simulator

  • August 25, 2026
  • 1 reply
  • 27 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.

1 reply

mƎALLEm
ST Technical Moderator
August 31, 2026

Hello ​@Shashank_007 and welcome to the ST community,

That’s an expected behavior. You can’t test CAN or any other -communication- peripherals with Keil simulator. You should do that with a real hardware. The simulator doesn’t implement the peripherals behavior. For more details, please contact ARM over their forums: https://community.arm.com/forums

Hope I’ve answered your question.

 

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.