Skip to main content
Associate III
May 12, 2026
Question

MX_MCE2_Init crashes when no context is selected

  • May 12, 2026
  • 1 reply
  • 110 views

When enabling MCE2 for the STM32N6 with the following settings:

Tuomas95_0-1778596206478.png

the generated MX_MCE2_Init crashes here:

Tuomas95_1-1778596233031.png

 ContextAESConfig.KeySize and ContextAESConfig.Cipher_Mode are not initialized to any value. After adding:

  ContextAESConfig.KeySize = MCE_AES_256;
  ContextAESConfig.Cipher_Mode = MCE_CONTEXT_BLOCK_CIPHER;

the function crashes to:

Tuomas95_2-1778596387605.png

HAL_MCE_EnableAESContext cannot be called with MCE_NO_CONTEXT.

 

 

1 reply

Ghofrane GSOURI
Technical Moderator
May 13, 2026

Hello @Tuomas95 

It would be useful if you could provide your IOC.

THX

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.