0

for example, I use HAL_TIM_OC_Start_IT(&htim3, TIM_CHANNEL_1) to start Outcomparison Interrupt Mode. considering HAL_TIM_OC_DelayElapsedCallback().Will it process parallelly with commands in the main() or first process interrupt then resume to process in the main()?

JAMES
  • 5
  • 2
  • It's not cleear what you mean by "parallely". You are talking about a processor with only one core and no OS, so only one thread is executing at once and there is no scheduling. An interrupt is handled until it exits (or until a more prioritary exception occurs). – Guillaume Petitjean Aug 10 '22 at 07:12

1 Answers1

0

The main context will stop, either between two instructions or occasionally part-way through a multi-part instruction (such as LDM "load-multiple").

The interrupt will run to completion and then the main context will resume.

For more details read section B1.5 of the ARMv7M architecture reference manual: https://developer.arm.com/documentation/ddi0403/latest (or the equivalent section of the ARMv6M ARM if you are using a Cortex-M0).

Tom V
  • 4,827
  • 2
  • 5
  • 22
  • "the interrupt will run to completion" unless there is a more prioritary exception. Also the main context will not resume if another exception is pending at the end of the first exception handler – Guillaume Petitjean Aug 11 '22 at 06:50
  • Yes, one could also add "unless the power is removed" or "unless the reset signal is asserted", or "unless a bomb destroys the microcontroller core" but these are all just common sense that follow on from what is stated. – Tom V Aug 11 '22 at 08:24