Skip to main content
EGonc.1
Associate II
February 23, 2021
Question

After reset I see that both PRIMASK and FAULTMASK registers have the value of 0. In my understanding (I could be wrong...) this means that the interrupts are enabled. Is this normal? I would expect the interrupts to be disabled after reset... thanks

  • February 23, 2021
  • 4 replies
  • 2043 views

..

This topic has been closed for replies.

4 replies

Uwe Bonnes
Chief
February 23, 2021

It is good habit to write a short title and the real description in the text.

Are you sure you evaluated both masks really before any initialization was done?

EGonc.1
EGonc.1Author
Associate II
February 23, 2021

I just put a breakpoint at:

Reset_Handler:  

 ldr  sp, =_estack   /* set stack pointer */

and at this point using the Eclipse registers window I can see that both PRIMASK and FAULTMASK are 0.

Uwe Bonnes
Chief
February 23, 2021
Pavel A.
Super User
February 23, 2021

Yes, by contrast with some other architectures in Cortex-M the 'global' core interrupts are enabled after reset.

Most of interrupt sources are vendor-specific and controlled via NVIC. In the NVIC all vectors are disabled after reset.

So just be careful not to get a fault (exception) and you can safely set up your interrupts after reset.

Call __disable_irq() and __enable_irq() around configuration of NVIC and peripherals, if this comforts you.

-- pa