STM32 Journal - Digikey
STM32 Journal - Digikey
STM32 Journal - Digikey
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>STM32</strong> <strong>Journal</strong><br />
next sample time. In fact, the<br />
bus matrix combined with a<br />
5-channel DMA enables the<br />
<strong>STM32</strong> F0 to support execution<br />
of code from Flash in parallel<br />
with other memory-memory,<br />
peripheral-memory, or memoryperipheral<br />
DMA transfers.<br />
There are many tools to<br />
assist developers in taking<br />
advantage of the <strong>STM32</strong> F0’s<br />
DMA capabilities without<br />
requiring them to become<br />
DMA experts. The ARM DSP<br />
Cortex Microcontroller Software<br />
Interface Standard (CMSIS)<br />
library, for example, provides<br />
signal processing functionality<br />
that has been optimized for<br />
the <strong>STM32</strong> F0 and takes full<br />
advantage of the DMA.<br />
An intelligent compiler can<br />
also help developers exploit<br />
DMA technology to its fullest<br />
advantage. IAR Embedded<br />
Workbench, for example, offers<br />
a feature that will automatically<br />
rearrange program data to<br />
maximize the use of the DMA.<br />
This enables developers to<br />
achieve high efficiency without<br />
having to put much forethought<br />
into how to layout the data<br />
space. The compiler achieves<br />
this by analyzing how data<br />
is used by the application.<br />
Consider a program that<br />
copies two different data<br />
structures using DMA. Each<br />
copy operation requires a<br />
separate DMA operation.<br />
However, after the compiler<br />
collocates the data structures<br />
in memory, they can be copied<br />
with a single DMA transfer.<br />
Note that each MCU may use<br />
the DMA in a slightly different<br />
manner. Keil’s MDK-ARM,<br />
for example, abstracts how<br />
the DMA is used from the<br />
application through an API<br />
that prevents code from being<br />
tied to a particular processor.<br />
This enables developers to<br />
migrate applications to other<br />
<strong>STM32</strong> devices and know that<br />
code utilizing the DMA will still<br />
perform optimally.<br />
Writing 32-bit Code<br />
Moving from 8-bit to 32-bit<br />
assembly is not trivial, given<br />
the vastly different instructions<br />
32-bit architectures offer; i.e.,<br />
single-instruction, multiple data<br />
(SIMD) instructions work on<br />
multiple data to vastly accelerate<br />
processing. Even moving<br />
between 16-bit architectures<br />
is challenging given that the<br />
peripherals can differ and impact<br />
how application code is written.<br />
5