Tagged: direct memory access

Tutorial: Control WS2812B leds with STM32 0

Tutorial: Control WS2812B leds with STM32

In this tutorial I will explain how to drive WS2812B with STM32 using TIM PWM and DMA peripherals in the most efficient way by using minimum amount of RAM, required to process all leds. There is a good explanation, already available on the web. If you have no experience with WS2812B leds, I strongly recommend you to read the blog post. It is very well written, but it has one major issue. It uses 24 words of RAM for each LED,...

STM32 tutorial: Efficiently receive UART data using DMA 23

STM32 tutorial: Efficiently receive UART data using DMA

Latest updates and examples are available at my official Github repository. STM32 + UART + DMA RX + unknown length This repository may give you information about how to read data on UART by using DMA when number of bytes to receive is not known in advance. In STM32 microcontroller family, U(S)ART reception can work in different modes: Polling mode (no DMA, no IRQ): Application must poll for status bits to check if new character has been received and read...

HAL Library 33- DMA extension for SPI on STM32Fxxx 21

HAL Library 33- DMA extension for SPI on STM32Fxxx

SPI DMA library allows you to send and receive data via SPI in non-blocking mode. It can be use for TX only, RX only or both (transmissing mode). This library is extension for my SPI library. It requires SPI library as basic to make this to work. Library Read more about HAL libraries Features SPI extension for non-blocking TX, RX or both modes Supports all SPI peripherals on STM32F4 and STM32F7 device Supports interrupt processing Allows you to start DMA transmissing and wait till done This is...

HAL Library 31- DMA for STM32Fxxx devices 1

HAL Library 31- DMA for STM32Fxxx devices

It’s been a while since last published library. From that time, I got some requests about making DMA library for HAL and later using this library with USART, SPI, ADC and more libraries. So I’ve made a first step in DMA libraries list. Basic “root” library for DMA process has been created for managing things with DMA streams for STM32F4 and STM32F7 devices. What else it supports, you should check below. Library Read more about HAL libraries Features Root library...

Library 63- DMA for STM32F4xx 12

Library 63- DMA for STM32F4xx

Having each stream on separate bits for checking flags has really annoying for me! I had to made a library for DMA which will handle all that stuff any maybe a little more for me because it is really stressfull, when I have to change DMA stream. Then you have to change interrupt handler function name, all flag bit locations and so on. Too much work for easily fail and bug is here! To enable/disable interrupts, get/clear flags, you have to...

Library 56- Extend SPI with DMA for STM32F4xx 18

Library 56- Extend SPI with DMA for STM32F4xx

As said in one post before, here is SPI DMA library for STM32F4 devices. Instead of onl TX functionality (as in USART DMA library) SPI DMA extension library enables DMA for TX and RX modes at the same time, to receive and transmit data over DMA. Library supports up to 6 SPIs (max number in STM32F4 devices). It can work in 3 main modes: Send data to slave device, receive data from slave device Send data to slave device, don’t...