
Explore the DMA and multi AHB bus architecture of the ARM Cortex M, understand the MCU block diagram, and follow a practical from-scratch path to DMA applications.
Explore master–slave communication in ARM Cortex microcontrollers and how a DMA controller offloads data transfer from peripherals to memory, reducing processor load and power consumption.
Explore the Arm cortex-m4 block diagram, identifying seven masters and seven slaves on AHB and APB buses, and how DMA and USB OTG HS connect via the bus matrix.
Explore how the multi AHB bus matrix governs master–slave communication, detailing how I-bus, D-bus, and system bus routes, and how DMA paths bypass or use the matrix for efficient transfers.
Explore concurrent transfer on Arm Cortex-M by coordinating the processor and DMA to move ADC and UART data on APB2 bus, using DMA FIFO and arbitration to SRAM1 or SRAM2.
Demonstrates concurrent data transfer using ARM and DMA by streaming UART data to SRAM2 while the ARM transfers to SRAM1, comparing UART interrupts with DMA-based transfer.
Demonstrates concurrent data transfer using DMA for UART to memory, reducing CPU interrupts as DMA runs in the background and ARM stays off, with parallel paths to SRAM1 and SRAM2.
Choose a beginner-friendly STM32 board like the Nucleo-F446RE for affordable learning, and ensure it has on-board debugger, robust documentation, and adequate RAM, flash, and peripherals support.
Compare stm32f407vg discovery and nucleo boards, covering older and newer discovery variants, st-link v2 vs v2-a, clock options, and virtual com port availability.
Install ST-LINK drivers for Windows (32/64 bit) from ST's site, use Ubuntu commands for Linux, and communicate with the board via UART over the ST-LINK in-circuit debugger.
Download the ST-LINK firmware upgrade tool for Windows, Mac, and Ubuntu to upgrade ST-LINK, ST-LINK/V2, and ST-LINK/V2-1 (V2-A); connect the board, refresh devices, and perform the upgrade.
Install Keil MDK 5 on Windows to create an ARM microcontroller development environment with the IDE, debugger, and native compiler, and use MDK Lite with a 32 kilobytes limit.
Install Keil MDK5 and complete the setup. Locate the Kiel-V5 folder in C drive and launch the MDK5 IDE to develop, compile, and download code to hardware.
Install keil pack installer to add device firmware packages and board support. Explore devices and boards to install STM32F4 DFP and BSP and enable ARM cortex-m development.
Locate installed software packs by navigating to the Keil pack folder under the C drive, then explore the F4xx_DFP drivers to access the HAL layer, source, include, and CMSIS headers.
Create a Keil microvision project for the stm32f4 discovery board, add startup files and CMSIS Core, then implement main.c and build to verify compilation.
Toggle the on-board leds using board support package APIs, locate leds via the schematic, initialize and control them, then compile, flash, and observe continuous toggling with a software delay.
Practice led toggling on the Nucleo F446RE by configuring board support packages, writing main.c, and using Keil with ST-LINK, pa5 led 0, and a delay to blink the led.
Add button support to the Nucleo project using BSP APIs; press the user button to toggle the LED, and release to stop. The setup uses PC13 GPIO and Buttons_GetState.
Download the OpenSTM32 System Workbench installer from openstm32.org and sign up if prompted. Choose your platform (Windows, Mac, Linux) and architecture, then install Java JRE.
Install the OpenSTM32 System Workbench for STM32 microcontrollers, choosing your drive and creating a workspace. It then installs the ARM toolchain and ST-LINK drivers.
Install STM32CubeMX by downloading, extracting, and installing to the C drive, then launch it from STMicroelectronics and regularly check for updates including STM32F4xx firmware, FatFile system, and FreeRTOS V9.0.0.
Learn to create STM32CubeMX projects by selecting the ST vendor and nucleo board, configuring the stm32f4 MCU peripherals (USART2, PC13 EXTI), and generating Keil code.
Create a CubeMX project for Open STM32 system workbench, configure USRAT2 and GPIO, enable the EXTI IRQ handler, generate code, and build with CMSIS and HAL drivers.
Create a STM32Cube project, place your code between user code begin and end, extern the messages, and print via HAL UART transmit using the UART handle, then compile and run.
Connect a nucleo board, configure, compile, and download code with STM32CubeMX. Open a serial monitor at 115200 (try 9600), reset the board, press the user button, and see UART strings.
Follow generic dma steps to toggle an led using dma and transfer data between sram blocks, identifying the suitable controller, initializing the dma, and triggering with completion handling.
Learn CubeMX setup for stm32f446re, identify gpio port a pin 5 on ahb1, and toggle the led using dma2 writing from sram to the gpio output data register.
Configure CubeMX to use DMA2 for memory-to-memory transfers, with byte by byte transfer and auto address increment, and polling mode, generating HAL-driven code for an LED toggle project.
Initialize and trigger a DMA transfer from memory to memory in polling mode, using HAL_DMA_Start, then poll for full transfer to toggle the GPIOA output data register with led_data.
Flash the code and reset the board to demonstrate a 1-second LED blink via DMA in polling mode. Learn memory-to-AHB byte transfers, manual DMA trigger, and polling for transmission complete.
Toggle an LED using DMA interrupts by configuring DMA2 stream0 in the NVIC and handling transfer complete and half-transfer events via the HAL_DMA_IRQHandler, then start the transfer with IT.
Implement and register a dma callback for full transfer in interrupt mode to toggle the led on completion, and perform memory transfer from sram1 to sram2 in the exercise.
Learn how UART2 transfers bytes from the PC via a virtual com port to SRAM1 using DMA in interrupt mode, with DMA1 handling requests and auto-incremented addresses.
Configure USART2 on a Nucleo board as a virtual COM port and transfer data from USART2 to SRAM1 using DMA in interrupt mode, overriding the RX complete callback with HAL_UART_Receive_DMA.
Explore uart to sram data transfer using dma in interrupt mode, observing 100-byte blocks and rx complete callbacks, with data at 0x2000800; reproduce with polling as a comparison.
Explore the dma block diagram, its ahb master and slave ports, and how ARM configures the dma via the ahb slave interface for transfers between peripherals and memory.
Explore the eight unidirectional dma streams, enabling memory-to-peripheral, peripheral-to-memory, and memory-to-memory transfers, and learn why only one stream is active at a time via the ahb bus matrix.
Explore how DMA channels map requests to eight streams, controlled by CH bits in the DMA control register, with peripherals like SPI, UART, ADC, and timer driving transfers (STM32F446xx example).
Map the spi2 rx data transfer to memory by identifying the dma controller, stream 3, and channel 0 using the channel mapping table, illustrating a peripheral to memory path.
Explore memory to memory and memory to peripheral data transfers using DMA, selecting streams, channels, and controllers, and mapping UART2_TX to DMA1 channel 4 stream 6 via the reference manual.
Demystify DMA transfers by moving ADC data from the STM32 ADC data register to SRAM1 after a software-triggered conversion.
Demystify adc and dma configuration by setting up adc 1 to sample temperature sensor channel 16 times in continuous mode, wiring dma2 stream4 to sram memory, and enabling nvic/dma interrupts.
learn how to configure adc with dma, link the dma handle to the adc, and start a dma-driven conversion triggered by a button, capturing 16 samples in a 12-bit buffer.
Learn how to transfer adc data to SRAM via dma on a cortex-m microcontroller, then convert raw values to voltage and temperature using vsense, v25, and the adc reference.
Explore how the DMA arbiter prioritizes eight stream requests, allowing only one active at a time and selecting higher-priority streams, with software configurable levels and hardware default rules.
The course aims to demystify the Microcontroller DMA controller internals and its programming with various peripherals. Suitable for beginners to intermediate students in the field of Embedded Systems and programming. Please go through the description below to understand the course offering.
Key things you learn,
1) The Multi AHB bus matrix and ARM Cortex M Bus interfaces
2) MCU Master and Slave communication over bus matrix
3) DMA internals: channel mapping / streams/ fifo /Master ports / Arbiter/etc
4) DMA different transfer modes: M2P, P2M,M2M
5) DMA with peripherals like ADC, GPIO, UART_RX/TX and many other peripherals will be updated in this course.
6) DMA programming from scratch. Helps you to troubleshoot DMA issues on other microcontroller or processor platforms. You can speculate and debug problems more quickly when you learn the hard way.
7) And lots of other videos about circular mode/burst transfer /RTOS etc. will be added shortly.
Hardware used:
1) STM32F446RE Nucleo64 board
you can also use other STM32 boards such as the discovery board, evaluation board, or any other board.
Software used:
1) KEIL MDK V5 (free version, for windows)
2) Openstm32 system workbench ( windows/linux/mac) (free)
3) CubeMx software from ST (free)
The installation procedure is covered in the course
Description:
This course is all about understanding the Direct Memory Access Controller of the Micro-controller and how to use it in the embedded applications.
The course uses ARM Cortex M based STM32 Micro-controller for all theory discussion and code exercises. The course discusses generic details of the DMA which you can leverage to other Micro-controllers but you have made changes to the code in order to run on your target if it's not an ST's 32-bit Micro-controller.
The course will help you to raise your confidence in handling your MCU's DMA controller and connecting dots by going through the various levels of discussion.
I really tried to simplify the subject with clean/generic explanations and exercises.
We will discuss why DMA is required and how it benefits ARM to offload data transfer work with exercises.
We will learn different types of DMA transfers like M2M, P2M, and M2P (M: Memory P: Peripheral) and various DMA configurations. Please go through "What will I learn?" section above.
For the beginners/intermediate students, the course will indeed add huge advantage and helps to use DMA successfully in Embedded applications.
Learning order of FastBit Embedded Brain Academy Courses,
If you are a beginner in the field of embedded systems, then you can take our courses in the below-mentioned order.
This is just a recommendation from the instructor for beginners.
1) Microcontroller Embedded C Programming: absolute beginners(Embedded C)
2) Embedded Systems Programming on ARM Cortex-M3/M4 Processor(ARM Cortex M4 Processor specific)
3) Mastering Microcontroller with Embedded Driver Development(MCU1)
4) Mastering Microcontroller: TIMERS, PWM, CAN, RTC,LOW POWER(MCU2)
5) Mastering Microcontroller: STM32-LTDC, LCD-TFT, LVGL(MCU3)
6) Embedded System Design using UML State Machines(State machine)
7) Mastering RTOS: Hands-on FreeRTOS and STM32Fx with Debugging(RTOS)
8) ARM Cortex M Microcontroller DMA Programming Demystified(DMA)
9) STM32Fx Microcontroller Custom Bootloader Development(Bootloader)
10) Embedded Linux Step by Step using Beaglebone Black(Linux)
11) Linux device driver programming using Beaglebone Black(LDD1)
Other programming courses
1) Master The Rust Programming Language : Beginner To Advanced