Skip to main content
Randy Nelson
Associate III
November 29, 2017
Solved

Am looking for beginner documentation on interrupts on STM32F3 series

  • November 29, 2017
  • 8 replies
  • 1806 views
Posted on November 29, 2017 at 13:57

With the community's help I have code that runs and demonstrates interrupts and interrupt handling. I need more information to understand how the STM32F3 series parts process event changes (interrupts) such as the SysTick and GPIOs and setting their priorities. All the docs I can easily find indicates the internal hardware but does not explain how to put the hardware (registers) together.  Yes I have STD code examples (thanks to the community) but no foundation to understand what the settings are doing.

Can someone point to some documentation or suggest a way to get this experience/knowledge.

Thanks...

Randy

    This topic has been closed for replies.
    Best answer by Randy Nelson
    Posted on November 30, 2017 at 15:00

    JW, Clive

    Both great ideas. Used Clive's idea of having the free running clock and JW's idea of resetting the 'count' at the start. Simple idea and clean code. 

    Thanks to both!

    Randy

    8 replies

    Randy Nelson
    Associate III
    November 29, 2017
    Posted on November 29, 2017 at 14:29

    More info. I'm trying to understand why my SysTick handler is not being called while in the handler for a GPIO pin changing. I'm wondering if this is a priority issue.

    Randy

    Tesla DeLorean
    Guru
    November 29, 2017
    Posted on November 29, 2017 at 15:05

    More likely NVIC preemption level, ie can I interrupt an interrupt vs queue to be serviced next.

    Joseph Yiu's Essential Cortex-Mx books would be good for this, ARM also has Technical Reference Manuals for their cores, which include the NVIC

    ST has programming manuals, this for the M3 showed up in a quick search, there should be an M4 one also

    http://www.st.com/content/ccc/resource/technical/document/programming_manual/5b/ca/8d/83/56/7f/40/08/CD00228163.pdf/files/CD00228163.pdf/jcr:content/translations/en.CD00228163.pdf

     

    The SPL is documented in several ways

    There is the library source, the examples, and a Windows Help file in the root directory

    \STM32F30x_DSP_StdPeriph_Lib_V1.2.3\stm32f30x_dsp_stdperiph_lib_um.chm

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Randy Nelson
    Associate III
    November 29, 2017
    Posted on November 29, 2017 at 17:06

    Clive,

    Can you explain your '

    interrupt vs queue to be serviced next' comment more?

    Randy

    Tesla DeLorean
    Guru
    November 29, 2017
    Posted on November 29, 2017 at 17:41

    When you exit one IRQHandler (bx lr) it triggers the NVIC to either exit interrupt state or start the next highest priority interrupt pending (Tail Chaining). In the model a low number has highest priority, and where not called out (differentiated) the interrupt number.

    The NVIC has programmable grouping, an allocation of priority vs preemption.

    The SysTick is a System Handler rather than an Interrupt, so some settings live in the SCB rather than the NVIC

    To 'interrupt an interrupt' you need something to have a high preemption level, otherwise the new interrupt will pend in the NVIC and get serviced in order as the current one exits.

    One should generally avoid using software counters for time outs, ie use a 32-bit TIM rather than a variable you increment in an interrupt.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..