Skip to content

Stream Buffers

Jorge Pérez edited this page Nov 11, 2024 · 11 revisions

Firstly, what is an interrupt

Checkout Computerphile video as an intro.

Key-points

  • Interruptions are raised from hardware. So sometimes you'll see them listed as a peripheral
  • Stop main code execution
  • Are kinda like functions, but don't have arguments, nor return value
  • Lower values mean highest priority (0 is the MOST important)
  • The interrupt values for some peripherals are usually predefined by the manufacturer. Check the interrupt table, and the vector table.
  • Each *_IRQHandler instance in startup_stm32f767xx.s is used to map the function name to an address in the interrupt vector table. On ARM Cortex-M0+, -M3, -M4, and -M7 devices, this vector table can be relocated by an offset at runtime. See Further reading for some links to more information on these concepts.
  • Most (but not all) peripherals on STM32 hardware will automatically clear interrupt flags when certain registers are read. It is important to ensure the interrupt is no longer pending—otherwise, the interrupt will fire continuously and you will always be executing the associated ISR!
  • All ISRs share the same system stack; each task has a dedicated stack

Table of concepts

Acrronym Meaning What it does
NVIC Nested Vector Interrupt Controller The special hardware that manages interrupts. Decides what the processor should do when triggered.
ISR Interrupt Service Routine The function called when the intrrupt triggers
IRQ
Handler
- Vector table List that defines pointers to every possible ISR. These are specified in the .s file in your project.

What are they

Are bridnges to pass trams of data from an iterruption to a task FreeRTOS Steam Buffers

Check the Drivers and ISR file in the Hands on RTOS with microcontrollers

How to set up a peripheral

  1. Configure the pins using AFIO (Alternate Function GPIO)
  2. Enable the peripheral Clock (RCC. Reset and Clock Control registers).
  1. __UART4_CLK_ENABLE()
  1. Configure the interrupts in the nested vector interrupt controller (NVIC)
  2. Configure the DMA.
  3. Configure the peripheral with the necessary settings, baud rate, parity, flow control, and so on.

Samples

UART DMA

Clone this wiki locally