STM32F429 Seminar
STM32F429 Seminar
•Hands-On
• Ensure you picked-up
• USB Cable
Presentation
Time
• Ready to begin?
Step #1 - File Installation 6
• For this workshop, we will be using the full version of the IAR
Embedded Workbench for ARM. The license you are about to install
will be valid for 5 days.
• Please ask any of the proctors for assistance if you have an issue.
Step #3 - EWARM Installation 8
Single-click on
Install IAR Embedded
Workbench® to begin
the installation.
Step #4 - EWARM Installation 9
Single-click on
NO to skip installing
the dongle drivers on
your system.
Step #4 - EWARM Installation 10
Installation is complete.
‘Uncheck’ both switches.
select ‘Finish’, and wait
to proceed to the next
step (Total time ~ 25 min).
Overview of the STM32 portfolio
Today - STM32 portfolio overview 12
Core/features
High-performance MCUs
398 CoreMark
120 MHz/150 DMIPS
Mainstream MCUs
177 CoreMark
72 MHz/61 DMIPS
Entry-level MCUs
106 CoreMark Cortex-M0
48 MHz/38 DMIPS
Frequency/performance
5 reasons to chose an STM32 13
ART Accelerator™,
Chrom-ART USB-OTG High speed,
< 1 µA RTC in VBAT
Accelerator™, CCM- Ethernet, CAN, ARM + ST ecosystem
mode, ultra-low Reset circuitry, voltage
SRAM, LCD-TFT controller, (eval boards,
dynamic power regulator, internal RC
Multi-AHB bus matrix, crypto/hash processor, discovery kits,
consumption oscillator, PLL,
Excellent real-time
140 µA/MHz PGA, 16-bit ∑∆ ADC software libraries,
up to 180 MHz/ WLCSP packages
1.65 to 3.6 V VDD, and 12-bit ADC RTOS)
225 DMIPS (up to 5 MSPS),
0.45 µA Stop mode
Zero-wait state external memory
and 0.3 µA Standy
execution performance interface, CEC
mode
from Flash
NEW
binary compatible
Floating Point Unit (FPU)
Source: ARM
A large community of partners 18
Hardware Development Tools 19
• Promotion Kits
• Discovery Kits
• Evaluation Boards
• Application Bricks
• Audio
• Industrial
• Motor Control
Software Development Tools 21
• Configuration Tools
• MicroXplorer
• Monitoring Tools
• STMStudio
NEW STM32F429
High-performance Cortex™-M4 MCU
STM32 F4 23
MCU DSP
Ease of use of C Harvard architecture
programming Single-cycle MAC
Interrupt handling Cortex-M4 Barrel shifter
Ultra-low power
STM32F429 Highlights 25
Peripherals Performance
USB FS / HS 12 Mbit/s / 480 Mbit/s
USART Up to 11.25 Mbit/s
SPI Up to 45 Mbit/s
I²C 1Mbit/s
GPIO toggling Up to 90 MHz
3-phase MC timer 180 MHz PWM timer clock input
SDIO Up to 48 MHz
I²S and SAI From 8 kHz to 192 kHz sampling frequencies
Camera interface Up to 54 Mbyte/s at 54 MHz (8- to 14-bit parallel)
Crypto/hash processor AES-256 up to 149.33 Mbyte/s
Up to 90 MHz (8-/16-/32-bit data bus, supports SRAM, PSRAM, NAND and
FMC
NOR Flash, SDRAM, parallel graphic LCD)
12-bit ADC / 12-bit DAC 0.41 μs (2.4 MSPS, 7.2 MSPS in Interleaved mode) / 1 MSPS dual DAC
CAN 2.0B Up to 2 independent CAN
Ethernet 10/100 Mbit/s MAC with hardware IEEE 1588
LCD TFT controller Display size : QVGA, QWVGA, VGA, SVGA with 2-layer blending and dithering
STM32F4 30
power efficiency
Typ current
Vdd Range
Measurements conditions:
VDD = 3.3V
260µA/MHz Room temperature
@ 180MHz
= 46.8mA
@180MHz
280µA
Wake up time:110μs
238µA/MHz 310µA
@ 168MHz Wake up time:17μs
2.2µA
= 40mA 100µA
Wake up time: 104μs
3.1µA
@168MHz Wake up time:318μs
290µA 2.2µA
Wake up time: 17μs <1µA
3.1µA
137µA/MHz 11µA Wake up time:375μs
@ 84MHz Wake up time:118μs <1µA
2.2µA
= 11.5mA 3.1µA
50µA
@84MHz Wake up time:19μs Wake up time:314μs <1µA
Legend:
* Run mode Conditions: Coremark executed from Flash, peripherals OFF
STM32F427/437 and STM32F429/439 STM32F405/415 and STM32F407/417 STM32F401
High integration 32
WLSCP66 F205
1 M/128 K (<3.7x4mm)
WLSCP90 F405
1 M/192 K (<4x4.3 mm)
WLSCP143 F429
2 M/256 K (<4.5x5.6mm)
STM32F4 multiple applications 33
Consumer Medical
• PC peripherals, gaming • High-end glucose meters
• Digital cameras, GPS • Power meters
platforms • Battery-operated applications
• Home audio
• Wi-Fi , Bluetooth modules
• Smartphone accessories
Note:
1/ 1.7 V min on specific packages
2/ Hardware crypto/hash on F415/417
and F437/439 only STM32 F4 product lines 34
STM32F429/439
STM32F405/415
168 MHz
Hardware
512-KB to
Crypto 2x
1-MB
/hash² 12-bit
• Up to 3x 12-bit ADC Flash
DAC
192-KB
(0.41 μs) SRAM
RNG
STM32F401
84 MHz
• Low voltage 1.71 to 3.6 V 128-KB to • Power efficient:
256-KB • Run mode down to 140 µA/MHz
Flash • Stop mode down to 11 µA typ
64-KB • Small form factor: down to 3 x 3 mm
SRAM
STM32 F4 portfolio 35
STM32F427/437/429/439 36
• Packages
• WLSCP143 (<4.5x5.6mm)
• LQFP100
• LQFP144
• LQFP176
• BGA176
• LQFP208
• BGA216
• Operating voltage
• 1.7 to 3.6V
• Temperature range
• -40C to 85 °C
• -40C to 105 °C
STM32F429 as HMI* controller 37
STM32F4x9 using
Chrom-ART Accelerator
Chrom-ART TFT
offers twice more Cortex-M4 Accelerator Controller
performance for
• Up to VGA/SVGA
Dedicated TFT interface
• 16-/32-bit external memory with fully programmable
interface Bus Matrix panel timings
• Recommended packages:
LQFP144,LQFP176/BGA176
or LQFP208/BGA216
Dedicated interface
(up to 32-bit/90 MHz)
with Flash, SRAM and
*HMI : Human Machine Interface SDRAM support
STM32F4 specific Hardware 38
• Evaluation boards:
• Large offering of evaluation boards:
• STM3240G-EVAL
• STM3241G-EVAL
• STM32429I-EVAL
• STM32439I-EVAL
• Discovery kits:
• STM32F4DISCOVERY
• 32F401CDISCOVERY
• 32F429IDISCOVERY
www.st.com/stm32f4-discovery
STM32F4 optimal software 39
• Beyond C Language !
• Objectives
• SDRAM interface
STM32F4x9 Block Diagram 44
• 256KB SRAM
• LCD-TFT Controller
Chrom-ART
TFT
Cortex-M4 Accelerator
controller
(DMA2D)
Bus Matrix
External
Internal Internal
Memory
Flash SRAM
Controller
External memory
Layer1
64x32b Blending
LCD_CLK
LCD Panel
LCD_HSYNC
Layer2
LCD_VSYNC
FIFO PFC
Dithering LCD_DE
64x32b
LCD_R[7:0]
APB2 Interface
Configuration and
LCD_G[7:0]
status registers
Synchronous
LCD_B[7:0]
Timings
Generation
LTDC Timings 49
Active
Heigh
1 Frame
VSYNC Vertical Back LCD Lines Vertical Front
Porch (VBP) Porch (VFP)
1 Line
HSYNC Horizontal LCD Columns Horizontal
(VBP) (HFP)
1 2 3 4 5 x x x x x 480
LCD_CLK
LCD RGBs
LCD Data
Enable
Vertical/Horizontal transactions 51
• Vertical transaction
Start of Frame
• Horizontal transaction
bpp
Panel Resolution Total Pixel Required memory (KB)
( Bit per pixel)
76.8K 16bpp 153.6
320x240 (QVGA)
8bpp 76.8
480x272 (WQVGA) 130.5K 16bpp 216.1
640x480 (VGA) 307.2K 16bpp 614.4
800x600 (SVGA) 480K 16bpp 960
LTDC Clocks and reset 54
• LTDC Reset
• It is reset by setting the LTDCRST bit in the RCC_APB2RSTR register
LCD-TFT Signals 55
• The LCD-TFT I/O pins not used by the application can be used for
other purposes.
Aliased Anti-aliased
• 0xFF = opaque
Layer Programmable Parameters:
59
Window
• Window position and size
• The first and last visible Pixel are configured in the LTDC_LxWHPCR register.
• The first and last visible line are configured in the LTDC_LxWVPCR
START_POS_X END_X_POS
START_POS_Y
END_POS_Y
Layer Programmable Parameters:
60
Color Frame Buffer
• The frame buffer size, line length and the number of lines settings must
be correctly configured :
• If it is set to fewer bytes than required by the layer, a FIFO under run error will be set.
• If it is set to more bytes than actually required by the layer, the useless data read is
discarded. The useless data is not displayed.
Pitch
Number of Lines
.
.
Layer Programmable Parameters:
61
Color Frame Buffer - effects
• Simply changing the start of the layer frame buffer you can scroll the
picture over the layer
• The picture stored in the memory must be bigger than actual layer size
.
.
.
.
Chrom-ART Accelerator™
STM32F4 Graphic Accelerator (DMA2D)
63
14:21
Temperature
21°C
Humidity
62% -5 °C
ARMED
Frame buffer construction 65
14:21
Temperature
21°C
Humidity
62% -5 °C
ARMED
Frame buffer generation needs 66
Bitmaps
Overview 69
Width
Height
Blending 70
Blended
Not Blended
Back to our « cool » interface 71
Background
14:21
Almost Uniform
L8 mode
Temperature
Button 21°C
Round shape
Gradient Humidity
ARGB8888 mode 62% -5 °C
Icon
Complex shape
ARMED
Many colors
ARGB8888 mode
Fonts
PFC
Chrom-ART Accelerator
(DMA2D)
Overview 75
• To offload the CPU of raw data copy, the Chrom-ART is able to copy
a part of a graphic into another part of a graphic, or simply fill a part of
a graphic with a specified color.
Chrom-ART TFT
Cortex-M4 Accelerator Controller
Bus Matrix
External
Internal Internal
Memory
Flash SRAM Controller
• Dedicated memory for color lookup table (CLUT) independent from LTDC
• Optional image format conversion from direct or indirect color mode to direct
color mode
Foreground
FG FIFO FG PFC
Output Output
Blender
PFC FIFO
BG FIFO BG PFC
Background
Bitmap parameter 79
Address Width
Original_Address
14:21
Temperature
21°C
Height
Original_Height Humidity
62% -5 °C
ARMED
Original_Width
Application Application
• Interfaces with parallel LCD modules: Intel 8080 and Motorola 6800
4096 Rows
or 32-bit (Cw)
Memory latency computation 89
Up to 512MB
Independent chip select SDRAM Bank2
Independent configuration
Easy to use 256MB (4x16MBx32-bit)
0xDFFF FFFF
SDRAM main features (2/4) 92
-
SDRAM main features (4/4) 94
• FMC_CLK up to 90MHz
• Basic 2D library
• PC SW Tools
• Window manager
• Configuration
• Basic 2D library
• PC SW Tools
• Window manager
• Configuration
GUI_SetColor(GUI_RED);
GUI_SetDrawMode(GUI_DRAWMODE_NORMAL);
GUI_FillCircle(120, 120, 80);
GUI_SetDrawMode(GUI_DRAWMODE_XOR);
GUI_FillCircle(140, 140, 80);
Basic 2D library - examples 103
GUI_SetBkColor(GUI_YELLOW);
GUI_Clear();
GUI_SetColor(GUI_BLUE);
GUI_SetPenSize(4);
GUI_DrawLine(30, 30, 60, 190);
GUI_DrawLine(30, 190, 60, 30);
{
const GUI_POINT aPoints[8] = {
{ 230, 30},{ 240, 100},
{ 310, 110}, { 240, 120},
{ 230, 190}, { 220, 120},
{ 150, 110}, { 220, 100},
};
GUI_FillPolygon(&aPoints, 8, 0, 0);
}
Basic 2D library - examples 104
• STemWin enables you to add text of any font into your GUI
GUI_SetFont(&GUI_Font8x16);
GUI_DispString("Hello from origin");
GUI_DispStringAt("Hello here, I'm at:
20,30", 20,30);
{
GUI_RECT pRect = {100, 60, 300, 220};
GUI_DrawRect(100, 60, 300, 220);
GUI_DispStringInRectWrap("Hello from
rectangle, my name is STM32F4 and I love
C programming", &pRect, GUI_TA_VCENTER |
GUI_TA_HCENTER, GUI_WRAPMODE_WORD);
}
Example PLAYER application 107
GUI_FillPolygon(pPoint, 3, x, y);
}
• You can see the application in the Discovery kit. Pushing the user
button you can navigate to next steps of this example application.
No anti-alias Anti-alias
• Supported formats
• Internal bitmap format
• BMP
• JPEG
• PNG
• GIF
Project
• GUI_PID_StoreState()
• If a PID event occurs (pressed, released or changing the position) it should be
passed to this routine.
• GUI_TOUCH_StoreState()
• In case of human touch on touchscreen, this function should be called
The WM then automatically polls the keyboard and the PID buffer.
Keyboard input will be passed to the currently focused window and PID
input to the respective window
Window Manager 116
• Basic capabilities:
• Automatic clipping
• Automatic use of multiple buffers
• Automatic use of memory devices
• Automatic use of display driver cache
• Motion support
WM – callback mechanism 117
• Start with single button for prompt the user to select song
#include "BUTTON.h" Always include the widget
static BUTTON_Handle hButton; header
GUI_Exec();
• STemWin is high level GUI package, but it needs a low level driver to
access MCU resources
Step 1: GUI_Clear()
Step 2: GUI_DrawPolygon()
Step 3: GUI_DispString()
Step 4:
GUI_MEMDEV_CopyToLCD()
• Multiple buffering
Other STemWin features 128
• With multiple buffers enabled there is a front buffer which is used by the display
controller to generate the picture on the screen and one or more back buffers
which are used for the drawing operations.
• Virtual screens
• Display area greater than the physical size of the display. It requires
additional video memory and allows instantaneous switching between
different screens.
LCD_YSIZE
Virtual page 1
Virtual page 2
Other STemWin features 130
• Open the License Manager from the information Center main window by
selecting:
• Help/License Manager.
Step #6 - EWARM Installation 133
1. License/Offline
activation.
• 2. Use an activation
response file from IAR
systems.
Single-click on
No (you can
install this later
if you wish).
To Extend the License Online after the 136
Seminar
• Open the License
Manager from the
information Center
main window by
selecting: Help/License
Manager.
• License/Get Evaluation
license from the license
manager.
3. Select
“Update Driver Software”
Step #2 ST-Link Driver Trouble Shooting, 141
(continued)
4. Select “Browse my computer for
driver software”
6. Click “Next”
Step #3 ST-Link Driver Trouble Shooting, 142
(continued)
The “STMicroelectronics ST-Link
dongle” should be listed
7. Click “Next”
Step #4 ST-Link Driver Trouble Shooting, 143
(continued)
A warning message may appear
• Click on “Power”, then hold down the Shift key, and click on
“Restart” to restart the PC
3) After driver installation go into Windows Device Manager and you may
see the device “STM32 STLink” noted with or without a “!” indicating a
problem. For both cases, right click the STM32 STLink and choose
“Update Driver” and navigate to USB devices. You will find the ST-Link
dongle in the list. Select this item and choose “ok”
• Firmware
• Specific Hands on Examples for today’s workshop
• Additional Project Examples specific to the F429 Discovery board
• STM32F4xx Standard Peripheral Library, CMSIS and USB Host/Device/OTG Libraries
• Documentation
• Board Schematic
• Microcontroller, Gyro, LCD, SDRAM Datasheets
• Application Notes for STemWIN, FPU, Upgrading board firmware via USB
• Reference Manual
• Programming Manual
• Errata
• Additional Tools
• Graphics related, MicroXplorer, IAR EWARM v6.60.2
Process check 152
• LD1 and LD2 (at top edge of board) should be ON and solid
RED (indicating board power available and ST-Link is
functional)
• Alternatively, you can open this workspace from within IAR EWARM
• File > Open > Workspace
Compile 155
Disassembly Window
Files Window
Build Window
Run 157
• Mission Accomplished
• Modify the delay value from 50 to 1000 and place in the Delay(xxx)
statement (this is in milliseconds)
• Compile, Debug, and Run
• Validate! Did it work?
• Stop debug and exit the debugger
Firmware Project Overview
Project Files 160
• User files
• main.c (program entry point)
• system_stm32f4xx.c (initial system configuration)
• stm32f4xx_it.c (ISR’s)
• stm32f429i_discovery.c
• Board specific functions
• STM32F4xx_StdPeriph_Driver
• Contains peripheral library functions
• startup_stm32f429_439xx.s
• System initialization, vector table, reset and branch to main()
startup_stm32f429_439xx.s 161
• Main Characteristics
• Initializes stack pointer
• SystemInit()
• This function is called at startup just after reset and before branch to main
program. This call is made inside the "startup_stm32f429_439xx.s" file.
• Sets up the system clock (System clock source, PLL Multiplier and Divider factors,
AHB/APBx prescalers and Flash settings)
SystemInit()
Call SetSysClock()
• Example main()
• Standard C main() function entry
• Start of application program
stm32f4xx_it.c 164
• The Interrupt Handlers for the used peripheral(s) (PPP) can be added
• For the available peripheral interrupt handler names please refer to the startup file:
startup_stm32f429_439xx.s
• Functions are added as follows (this overrides the weak definitions from the startup
file): void PPP_IRQHandler(void) {};
stm32f429i_discovery.c 165
29/10/2013
General guidelines 169
• You will need to update the example number in “main.c” for each
exercise
// !! TO BE MODIFIED !!
#define EXAMPLE 1
• If you are unsure of where the code needs to be updated, you can
search for “// !! TO BE MODIFIED !!”
• The folder where all the example pictures are located is:
“…\Firmware\Projects\Demonstration\Media\”
• The folder where all the source file we will create should be saved to
is:
“…\Firmware\Projects\Demonstration\Core\User_HandsOn\”
LTDC
1 Example Layer Scroll (1) 171
• Objective
• Learn how to work with the LTDC Layer parameters
• Learn how to convert a picture to C source code
• Tasks
• Use the Scrolling layer example and change the picture to be scrolled
• You can use a picture located in the example directory
• Or, you can select your own picture larger than 320 x 240 (to see the scrolling
effect) and raw size < 1MB (to fit into the internal flash memory)
171
1 Example Layer Scroll (2) 172
• Open any picture you want to use (larger than 240x320 pixels, smaller than
1MB in raw size)
• Available example: c:\stm32seminar\Firmware\Projects\Demonstration\Media\kristynka.jpg
173
2 Example Alpha Blending (1) 174
• Objective
• Learn how to work with alpha channels and layer blending
• Tasks
• Take the Two Layers example and change the scrolling picture
• You can select your own picture which already includes the alpha layer. The
size of the picture should be smaller than 240 x 320 to see its movement
• You can also use a picture located in the example directory
174
2 Example Alpha Blending (2) 175
• Open any picture with an alpha channel you want to use (size smaller
than 240x320 pixels)
• Available example: c:\stm32seminar\Firmware\Projects\Demonstration\Media\stm32f4.png
• Objective
• Learn how to use the Chrome ART (DMA2D)
• Tasks
• Take the GUI Content Creation example and add more icons
177
3 Example GUI Creation (2) 178
178
STemWin
Hands-On session
4 Example PLAYER application 180
• You will see how easy it is to change the looks of the GUI in STemWin
• There is a missing element which will be added at each step of the example PLAYER
application
18
0
4 Add STOP button 181
182
6 Create your own font 183
183
6 Create your own font 184
• You can create your own bmp using the “BmpCvt” SW:
“C:\stm32seminar\Tools\BmpCvt.exe”
185
7 Insert bitmap as background
• “File→Save as” the bitmap file as a .c file in RGB565 format with
186
Project
186
8 Skinning of widgets 187
187
static int DrawSkinST_BUTTON(const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo) {
#define RAD 5
char acBuffer[20]; Skinning of
GUI_RECT Rect; 188
switch (pDrawItemInfo->Cmd) {
case WIDGET_ITEM_DRAW_TEXT:
BUTTON_GetText(pDrawItemInfo->hWin, acBuffer, sizeof(acBuffer));
widgets
GUI_SetColor(STPINK);
Rect.x0 = pDrawItemInfo->x0; // Default position of text
Rect.y0 = pDrawItemInfo->y0;
Rect.x1 = pDrawItemInfo->x1;
Rect.y1 = pDrawItemInfo->y1;
GUI_SetTextMode(GUI_TM_TRANS);
GUI_DispStringInRect(acBuffer, &Rect, GUI_TA_VCENTER | GUI_TA_HCENTER); Enter text string
break;
case WIDGET_ITEM_DRAW_BACKGROUND:
GUI_SetPenSize(3);
// draw background
Rect.x0 = pDrawItemInfo->x0;
Rect.y0 = pDrawItemInfo->y0;
Background depends
Rect.x1 = pDrawItemInfo->x1; on pressed state
Rect.y1 = pDrawItemInfo->y1;
if (pDrawItemInfo->ItemIndex == BUTTON_SKINFLEX_PI_PRESSED)
GUI_SetColor(GUI_GRAY);
else
GUI_SetColor(GUI_WHITE);
GUI_FillRoundedRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1, RAD);
// draw outline
GUI_SetColor(STPINK); Round corners
GUI_DrawArc(Rect.x0 + RAD, Rect.y0 + RAD, RAD, RAD, 90, 180);
GUI_DrawArc(Rect.x1 - RAD, Rect.y0 + RAD, RAD, RAD, 0, 90);
GUI_DrawArc(Rect.x1 - RAD, Rect.y1 - RAD, RAD, RAD, 270, 359);
GUI_DrawArc(Rect.x0 + RAD, Rect.y1 - RAD, RAD, RAD, 180, 270);
GUI_DrawLine(Rect.x0 + RAD, Rect.y0, Rect.x1 - RAD, Rect.y0);
GUI_DrawLine(Rect.x1, Rect.y0 + RAD, Rect.x1, Rect.y1 - RAD);
GUI_DrawLine(Rect.x0 + RAD, Rect.y1, Rect.x1 - RAD, Rect.y1);
GUI_DrawLine(Rect.x0, Rect.y0 + RAD, Rect.x0, Rect.y1 - RAD);
break;
Default:
return BUTTON_DrawSkinFlex(pDrawItemInfo); Frame
}
} 188
www.st.com/stm32f4
STM32F429 Smart Digital
Peripherals
STM32 F4 2MB 191
New feature
Cryptographic processor
Definitions 193
• Encryption is the process used to convert plaintext into a form that is not
readable without knowledge of the rules and key to decrypt.
• A key is the value string used for both encryption and decryption.
Encryption/ Decryption Modes 194
• Counter(CTR) modes.
• GCM: AES Galois/Counter Mode allows encryption and
• CCM: Combined cypher Machine authentication
1977 (standardized
First published 1998 1998 (ANS X9.52)
on January 1979)
CRYP Block Diagram 196
DMA request
DMA request AES
for incoming ECB CBC CTR for outgoing
data transfer
data transfer
GCM CCM
Key: 128-, 192- and 256-bit
TDES
Data swapping
Data swapping
ECB CBC
Output FIFO
Input FIFO
DES
ECB CBC
Key: 64-bit
CRYPTO Processor
Interruption Routine
DMA request
HASH
Message
Input FIFO
16 x 32-bit
Digest
H0..H7
HMAC
8x32bit
HASH Processor
Interruption routine
message
concat HASH
pad
Concat
key 0x5C
NEW
• The μ-Law and A-Law formats encode data into 8-bit code elements
with MSB alignment. Companded data is always 8 bits wide
STM32F4xx
WS_A
Master configuration
FIFO
Clock generator for
Clock1 SCK_A
SysCK
BLOC A SD_A
8x32b
MCLK_A
CKin
PLL WS_B
Clock2 FIFO SCK_B
BLOC B SD_B
8x32b MCLK_B
Audio Clock configuration 207
NODIV MCLK_x
MCKDIV[3:0] 0 FRL[7:0]
1
NODIV NODIV
Master Clock
0 Bit Clock
divider divider 0
0 SCK_x
SAI_CK_x
1 1
Audio Slot configuration(1/2) 208
Slot size = data size Slot size < data size Slot size < data size
Audio of frame
Half of frame
FS
SCK
STM32F429I-Discovery_FW_V1.0.0\Projects\Peripheral_Examples\FPU_Example\EWARM\FPU.EWW
Step #2a FPU code size
215
BenchMark
• Generate a MAP output file.
• Project Options Linker List ‘Generate Linker map file.
• The FPU Project is setup in a while(1) which will loop for ever. Each
time through, the execution will hit the BREAK point set on Line 72
and STOP so the results can be viewed.
Step #3c FPU performance
219
Bench Mark, Simulator
• Run the Program.
• Debug GO or F5.
• The execution will stop at the BREAK point. Clear the Simulator
Trace Window contents.
• The Simulator Trace window will show the END cycle count.
• Record the end cycle count value.
• Browse to the start of the Simulator Trace window data and look for the instruction,
Data0 = 1.0. Record the cycle count value.
• Subtract the two cycle count values to get the FPU execution cycle count.
• The code did not change, the BREAK point is still at Line 72.
Step #3e FPU performance
221
Bench Mark, Simulator
• Run the Program.
• Debug GO or F5.
• The execution will stop at the BREAK point. Clear the Simulator
Trace Window contents.
• The Simulator Trace window will show the END cycle count.
• Record the end cycle count value.
• Browse to the start of the Simulator Trace window data and look for the instruction,
Data0 = 1.0. Record the cycle count value.
• Subtract the two cycle count values to get the FPU execution cycle count.
• The FPU Project is setup in a while(1) which will loop for ever. Each
time through, the execution will hit the BREAK point set on Line 111
and STOP so the results can be viewed.
Step #4d FPU performance
225
Bench Mark, SysTick
• Execute one loop of the FPU Project.
• Debug GO or F5.
• The execution will stop at the BREAK point, line 111.
• The code did not change, the Debug opens main_step4.c at line 67,
and the BREAK point is still at Line 111.
Step #4f FPU performance
227
Bench Mark, SysTick
• Execute one loop of the FPU Project.
• Debug GO or F5.
• The execution will stop at the BREAK point, line 111.
• Using the previous sequence of steps (3 thru 3d), measure the toggle
rate of LED4 for the FPU Enabled and the FPU Disabled (emulation).
FPU Bench Marking Summary 229
FPU
IAR Simulator SysTick
Performance I/O Toggle
Counts Counts
Results
1570 @180Mhz
FPU Enabled 1578 8.4 usec
8.7 usec
2502 @180Mhz
FPU Disabled 2539 14.2 usec
13.9 usec
FPU
38% 37% 40%
Improvement
Thank you 230
www.st.com/stm32f429idiscovery
STM32F429-Discovery
Gyro Hands On
STM32F429 Discovery Kit Gyro 232
• Open-Hardware Initiatives
• Arduino-compatible, for example Leaflabs Maple, Olimexino-STM32, SecretLabs
Netduino
• Gadgeteer-compatible, for example Mountaineer, GHI Fez-Cerberus,
Embedded Software (Firmware) (1/3) 242
• Full STM32 coverage in standard C language, from low level drivers to Firmware stacks and
Application bricks
• Low level:
• Free ST Boards Support Packages (BSP)
• Free ST Peripheral Libraries (Drivers) and Free ST DSP Library
• Firmware Stacks:
• RTOS
• Open source for example FreeRTOS
• Commercial solutions, for example Micrium or ExpressLogic
• Cryptographic
• Free ST “STM32 Cryptographic Library”
• USB
• Free ST USB Libraries
• Commercial solutions for example HCC, Micrium or ExpressLogic
• TCP/IP
• Open source for example uIP or LwIP
• Commercial solutions for example Interniche or Quadros
• File Systems
• Open source for example FatFS
• Commercial solutions for example HCC or SEGGER
• BlueTooth
• Commercial solutions for example Alpwise or Searan
• Graphics
• Free ST “STemWin” graphical library
• Commercial solutions for example SEGGER or ExpressLogic
• Touch sensing
• Free ST STMTouch Library
Embedded Software (Firmware) (2/3) 243
• Many open source solutions exist, while Commercial solutions all have some free
options, either time-limited or code size-limited
• Commercial solutions:
• IAR EWARM
• Keil MDK
• Atollic TrueStudio
• Rowley CrossWorks
• Raisonance Ride
• Altium Tasking
• Emprog Thunderbench
• …
EvoPrimer STM32-ComStick
Motor control kit Range of STM32 W evaluation kit
5 Discovery kits
evaluation boards STM32W-SK
• MicroXplorer 3.2 is an
intuitive graphical tool for
the STM32 MCU families
• From the USB Image that you copied to your PC, find the following
folder and launch the MicroXplorer installer
• C:\STM32Seminar\Utilities\MicroXplorer\InstallShieldMicroXplorer-
V3.2.exe
• Note: This software needs Java Runtime v6.7 or higher. If you have
an older Java version, use one of the two Java installers at this path:
• C:\STM32Seminar\Utilities\Java\
ST MicroXplorer v3.2 253
• Sub-Family: STM32F429
Pin assignment: Peripherals needed for our application (STM32F4 Discovery Kit):
- FSMC SDRAM
- 1-I2C
- LTDC
- 1-SPI
- 1-UART
- USB OTG_FS
ST MicroXplorer v3.2 256
• Pin assignment: Peripherals needed for our application with their full
configuration (STM32F429 Discovery Kit):
• FSMC_SDRAM: 12 bit address, 16 bit data, check 2 bit bank address, check ChipSelect2
• I2C3: I2C
• LTDC: RGB666
• SPI5: Full Duplex Master with NSS
• SYS: Debug = Serial Wire, OSC = HSE External Oscillator, OSC32 = LSE External Oscillator
• USART1: Asynchronous
ST MicroXplorer v3.2 257
ST MicroXplorer v3.2 258
• CONFIGURATION Tab
• GPIO Modes
• Input
• Output
• Alternate Function
• Analog input
• Pull up/down/none
• Output type
• Push-Pull
• Open Drain
• src
• mx_gpio.c
• mx_main.c
• inc
• mx_gpio.h