Download STM32 M4 clicker User Manual

Transcript
A compact starter kit with your favorite
microcontroller and a socket for click™ add-on
boards. New ideas are just a click away.
TO OUR VALUED CUSTOMERS
I want to express my thanks to you for being interested in our products and for having
confidence in MikroElektronika.
The primary aim of our company is to design and produce high quality electronic products
and to constantly improve the performance thereof in order to better suit your needs.
Nebojsa Matic
General Manager
The PIC® and Windows® logos and product names are trademarks of Microchip Technology® and Microsoft® in the U.S.A. and other countries.
Page 2
Table of contents
1. What is STM32 M4 clicker?
4
step 4 – Uploading .HEX file
12
2. Power supply
6
step 5 – Finish upload
13
3. STM32F415RG microcontroller
8
Programming with mikroProg™ programmer
14
8
mikroProg Suite for ARM software
15
9
Programming with ST-LINK V2 programmer
16
Key microcontroller features
4. Programming the microcontroller
™
®
Programming with mikroBootloader
10
5. Buttons and LEDs
18
step 1 – Connecting STM32 M4 clicker 10
6. RTC battery
20
step 2 – Browsing for .HEX file 11
™
7. click boards are plug and play!
22
step 3 – Selecting .HEX file 11
8. Dimensions
24
Page 3
1. What is STM32 M4 clicker?
01 64-pin STM32F415RG MCU
02 Connection pads
03 16 MHz crystal oscillator
01
02 03
04
05
04 mikroBUS™ socket
12
05 RESET button
06 USB Mini-B connector
07 3.3V Voltage regulator
13
08 JTAG Programmer connector
09 32.768 KHz crystal oscillator
12
10 RTC battery pads
11 Power indication LED
06
07
08
9 10
Figure 1-1: STM32 M4 clicker
11
12 Additional buttons
13 Additional LEDs
STM32 M4 clicker is an amazingly compact starter development kit which brings the innovative mikroBUS™ socket to your favorite
microcontroller. It features STM32F415RG, a 32-bit ARM® Cortex®-M4 microcontroller, two indication LEDs, two general purpose buttons, a
reset button, a USB Mini-B connector and a single mikroBUS™ socket. A JTAG connector and pads for interfacing with external electronics are
provided as well. The mikroBUS™ connector consists of two 1x8 female headers with SPI, I2C, UART, RST, PWM, Analog and Interrupt lines as
well as 3.3V, 5V and GND power lines. STM32 M4 clicker board can be powered over a USB cable.
Page 4
3.3V VOLTAGE REGULATOR
T1
VCC-3.3
R1
4K7
C13
VCC-3.3
J1A
C1
22pF
C14
C16
100nF 100nF 100nF 100nF 100nF
2.2uF
1
2
3
4
5
6
#RST
7
PC0/T1
8
9
PC1/T2
10
11
CN3
12
13
PA0/AN
14
PA1/LED1 15
PA2/LED2 16
C3
22pF
C4
22pF
X1
16MHz
C6
22pF
VCC-3.3
R6
10K
T3
#RST
1K
VCC-3.3
VCC-5V
PWM
INT
RX
TX
SCL
SDA
5V
GND
TDO
PC1/T2
C2
2.2uF
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
VDD
VCAP2
PA13
PA12
PA11
PA10
PA9
PA8
PC9
PC8
PC7
PC6
PB15
PB14
PB13
PB12
STM32F415RG
PA4
PA5
PA6
PA7
C8
100nF
R4
100K
VBAT
PC13
PC14
PC15
PH0
PH1
NRST
PC0
PC1
PC2
PC3
VSSA
VDDA
PA0
PA1
PA2
TMS-SWD
USB-D_P
USB-D_N
USB-ID
USB-DET
PB0/PWM
PB1/INT
PC11/RX
PC10/TX
PB10/SCL
PB11/SDA
R11
220
FP1
FERRITE
CN1
1
2
3
4
5
C5
100nF
VBUS
DD+
ID
GND
USB
MINIB
R9
PA2/LED2
4K7
R8
PA1/LED1
4K7
LD1
VCC-3.3
PA4
PA5
PA6
PA7
PB9
PB8
PB7
PB6
C7
2.2uF
VCC-3.3
1
3
5
7
9
CN2
2
4
6
8
10
JTAG
Page 5
USB-DET
USB-D_N
USB-D_P
USB-ID
LD2
PB15/MOSI
PB14/MISO
PB13/SCK
PB12/CS
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
RST
R7
VCC-5V
U1
PB10/SCL
PB11/SDA
X2
32.768KHz
AN
RST
CS
SCK
MISO
MOSI
3.3V
GND
C15
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
VCC-3.3
PA0/AN
PB5/RST
PB12/CS
PB13/SCK
PB14/MISO
PB15/MOSI
C11
PC11/RX
PC10/TX
TDI
TCK-SWC
R5
39K
AP7331-ADJ
PB0/PWM
PB1/INT
2.2uF
C12
4
EN ADJ
PC0/T1
GND
3
PWR
R3
287K
PB7
PB6
PB5/RST
2
C10
5
IN OUT
PB9
PB8
R10
470
10uF
U2
1
VDD
VSS
PB9
PB8
BOOT0
PB7
PB6
PB5
PB4
PB3
PD2
PC12
PC11
PC10
PA15
PA14
VCC-5V
VCC-3.3
C9
PA3
VSS
VDD
PA4
PA5
PA6
PA7
PC4
PC5
PB0
PB1
PB2
PB10
PB11
VCAP1
VDD
VCC-3.3
T2
VCC-3.3
R2
4K7
TMS-SWD
TCK-SWC
TDO
TDI
#RST
1
2
3
4
5
6
7
8
9
10
HD2
Figure 1-2:
STM32 M4 clicker
schematic
2. Power supply
Figure 2-1:
Connecting USB power supply
through CN1 connector
When the board is powered up the power indication LED will be automatically turned on. The USB connection can provide up to
500mA of current which is more than enough for the operation of all on-board and additional modules.
Page 6
3.3V VOLTAGE REGULATOR
C13
VCC-3.3
VCC-3.3
VCC-5V
R10
470
3
2.2uF
PWR
1
2
C12
1
2
3
4
5
6
7
8
9
10
HD2
VCC-5V
VCC-3.3
10uF
U2
IN OUT
GND
EN ADJ
FP1
FERRITE
5
4
AP7331-ADJ
R3
287K
R5
39K
Figure 2-2: Power supply schematic
Page 7
C5
100nF
CN1
1
2
3
4
5
VBUS
DD+
ID
GND
USB
MINIB
3. STM32F415RG microcontroller
JTAG & SW
FLASH 1MB
GPIOs 51
SRAM 192
KB
DMA 2
DMA 1
SRAM 4KB
AHB BUS GPIO PORT
(A,B,C,D,H)
Key microcontroller features
- 1024KB of Flash memory
3 x TIMER 16
-bit
2 x USART
- 192KB SRAM
1 x SPI
- 64 pin LQFP
- 3x 16 ch, 12-bit ADC
- USB 2.0, UART, RTC, SPI, I2C, etc.
temperature
sensor
3 x ADC
Page 8
z
APB2 84MH
- 32-bit ARM® Cortex®-M4 architecture
2 x TIM/PW
M 16-bit
Cortex™-M
4
STM32F415
RG
POWER / RE
SET
WWDG
2 x TIMER 16
-bit
2 x DAC
USB OTG FS
USB OTG HS
ARM
SDIO/MMC
- Up to 168 MHz operation
RNG
MATRIX
APB1 42MH
z
The STM32 M4 clicker development tool comes with the
STM32F415RG microcontroller. This 32-bit high performance
microcontroller is rich with on-chip peripherals and features
1024KB of Flash and 192KB of SRAM. It has integrated full speed
USB 2.0. support.
IWDG
RTC
2 x TIMER 32
-bit
5 x TIMER 16
-bit
2 x USART
2 x UART
2 x SPI
3 x I2C
2 x CAN
4. Programming the microcontroller
Figure 4-1:
STM32F415RG
microcontroller
The microcontroller can be programmed in two ways:
01 Using USB HID mikroBootloader,
02 Using external mikroProg™ for STM32 programmer.
Page 9
Programming with mikroBootloader
You can program the microcontroller with a
bootloader which is preprogrammed by default.
To transfer .hex file from a PC to MCU you need
bootloader software (mikroBootloader USB HID)
which can be downloaded from:
step 1 – Connecting STM32 M4 clicker
www.mikroe.com/downloads/get/2144/
mikrobootloader_usb_hid_STM32F415RG.zip
01
After the mikroBootloader software is downloaded,
unzip it to desired location and start it.
Figure 4-2: USB HID mikroBootloader window
01 To start, connect the USB cable, or if already connected press
the Reset button on your STM32 M4 clicker. Click the Connect
button within 5s to enter the bootloader mode, otherwise
existing microcontroller program will execute.
Page 10
step 2 – Browsing for .HEX file
step 3 – Selecting .HEX file
01
01
02
Figure 4-3: Browse for HEX
Figure 4-4: Selecting HEX
01 Click the Browse for HEX button and from a
pop-up window (Figure 3.4) choose the .HEX file
which will be uploaded to MCU memory.
01 Select .HEX file using open dialog window.
02 Click the Open button.
Page 11
step 4 – Uploading .HEX file
01
01
Figure 4-5: Begin uploading
Figure 4-6: Progress bar
01 To start .HEX file bootloading click the
Begin uploading button.
01 Progress bar enables you to monitor .HEX file uploading.
Page 12
step 5 – Finish upload
01
Figure 4-7: Restarting MCU
Figure 4-8: mikroBootloader ready for next job
01 Click OK button after the uploading process is finished.
02 Press Reset button on STM32 M4 clicker board and wait
for 5 seconds. Your program will run automatically.
Page 13
Programming with mikroProg™ programmer
Figure 4-9: mikroProg™ connector
The microcontroller can be programmed with external mikroProg™ for STM32 programmer and mikroProg Suite™ for ARM® software.
The external programmer is connected to the development system via 2x5 JTAG connector soldered on the CN2 connector pads,
Figure 4-9. mikroProg™ is a fast USB 2.0 programmer with hardware debugger support. It supports STM32 M3 and M4 devices from
STMicroelectronics. Outstanding performance, easy operation and elegant design are its key features.
Page 14
mikroProg Suite™ for ARM® software
On-board mikroProg™ programmer requires special programming software called mikroProg Suite™
for ARM®. This software is used for programming of all supported microcontroller families with
ARM® Cortex™-M3 and Cortex™-M4 cores. The software has an intuitive interface and SingleClick™
programming technology. To begin, first locate the installation archive on the link bellow:
http://www.mikroe.com/downloads/get/1809/mikroprog_suite_for_arm.zip
After downloading, extract the package and double click the executable setup file, to start installation.
Quick guide
01
Click the Detect MCU button in order to recognize the device ID.
02
Click the Read button to read the entire microcontroller memory.
You can click the Save button to save it to the target HEX file.
03
If you want to write the HEX file into the microcontroller, first
make sure to load the target HEX file using the Load button.
Then click the Write button to begin programming.
04
Click the Erase button to clear the microcontroller memory.
Page 15
Figure 4-10:
mikroProg Suite™
for ARM® window
Programming with ST-LINK V2 programmer
In order to adjust the ST-LINK™ V2 programmer
to be connected to the development system, it
is necessary to provide the appropriate adapter
such as the mikroProg to ST-LINK V2 adapter.
2x5 male headers should be first soldered on
the CN2 connector pads. Then you should plug
the adapter into the ST-LINK V2 programmer
(2x10 header), and plug an IDC10 flat cable in
headers, Figure 4-12.
The microcontroller can also
be programmed with the
ST-LINK V2 programmer
and mikroProg Suite™ for
ARM® software, Figure 5-1.
This programmer connects
with mikromedia board via
mikroProg to ST-LINK V2
adapter (Figure 4-11).
Figure 4-12:
Connecting ST-LINK™
V2 programmer
Figure 4-11:
mikroProg™ to
ST-LINK™ V2 adaper
Page 16
C14
C16
2.2uF
VCC-3.3
J1A
C1
22pF
X2
32.768KHz
X1
16MHz
C3
22pF
C4
22pF
#RST
C6
22pF
CN3
NOTE Before attaching
VCC-3.3
1
3
5
7
9
CN2
U1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2 TMS-SWD
4 TCK-SWC
6
TDO
8
TDI
10
#RST
VBAT
PC13
PC14
PC15
PH0
PH1
NRST
PC0
PC1
PC2
PC3
VSSA
VDDA
PA0
PA1
PA2
STM32F415RG
VDD
VCAP2
PA13
PA12
PA11
PA10
PA9
PA8
PC9
PC8
PC7
PC6
PB15
PB14
PB13
PB12
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
the programming
connector, you
have to solder the
provided 2x5 male
header to the JTAG
(CN2) pads.
TDI
TCK-SWC
C11
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
C10
VDD
VSS
PB9
PB8
BOOT0
PB7
PB6
PB5
PB4
PB3
PD2
PC12
PC11
PC10
PA15
PA14
C9
PA3
VSS
VDD
PA4
PA5
PA6
PA7
PC4
PC5
PB0
PB1
PB2
PB10
PB11
VCAP1
VDD
C15
100nF 100nF 100nF 100nF 100nF
TDO
VCC-3.3
C7
2.2uF
JTAG
Figure 4-13: mikroProg™ connection schematic
Page 17
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
C2
2.2uF
TMS-SWD
5. Buttons and LEDs
01
02
03
Figure 5-1: Two buttons, two LEDs and a reset button
The board also contains a 01 reset button and a pair of 02 buttons and 03 LEDs. Each of these additional peripherals are located
in the bottom area of the board. Reset button is used to manually reset the microcontroller. Pressing the reset button will generate
a low voltage level on microcontroller’s reset pin. LEDs can be used for visual indication of the logic state on two pins (RA0 and RA1).
An active LED indicates that a logic high (1) is present on the pin. Pressing any of these buttons can change the logic state of the
microcontroller pins (RD2 and RD3) from logic high (1) to logic low (0).
Page 18
VCC-3.3
C9
J1A
C6
22pF
VCC-3.3
R6
10K
T3
RST
R7
1K
C8
100nF
#RST
C14
VBAT
PC13
PC14
PC15
PH0
PH1
NRST
PC0
PC1
PC2
PC3
VSSA
VDDA
PA0
PA1
PA2
VDD
VSS
PB9
PB8
BOOT0
PB7
PB6
PB5
PB4
PB3
PD2
PC12
PC11
PC10
PA15
PA14
1
2
3
4
5
6
#RST
7
PC0/T1
8
9
PC1/T2
10
11
CN3
12
13
PA0/AN
14
PA1/LED1 15
PA2/LED2 16
STM32F415RG
VDD
VCAP2
PA13
PA12
PA11
PA10
PA9
PA8
PC9
PC8
PC7
PC6
PB15
PB14
PB13
PB12
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
C2
2.2uF
LD2
R9
PA2/LED2
4K7
R8
PA1/LED1
4K7
LD1
T1
VCC-3.3
R1
4K7
T2
VCC-3.3
R2
4K7
C7
2.2uF
Figure 5-2: Other modules connection schematic
Page 19
PC1/T2
C4
22pF
X1
16MHz
C16
2.2uF
PC0/T1
C3
22pF
C11
PA3
VSS
VDD
PA4
PA5
PA6
PA7
PC4
PC5
PB0
PB1
PB2
PB10
PB11
VCAP1
VDD
X2
32.768KHz
C10
U1
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
C1
22pF
C15
100nF 100nF 100nF 100nF 100nF
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
VCC-3.3
6. RTC battery
STM32 M4 clicker features RTC battery pads for
powering microntroller’s internal RTC module. Battery
is used as an alternative source of power, so the
RTC module can keep track of time while primary
source of power is OFF or unavailable. In order to
use this option it is necessary to connect (solder)
external battery (type CR2032; voltage range from
1.65 to 3.6 V) and unsolder jumper J1, Figure 6-1.
Make sure that orientation of the battery is correct
(plus on VBAT and minus on GND pad), otherwise it
won’t work properly.
Figure 6-1:
battery pads
and jumper J1
Page 20
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
VCC-3.3
J1
X1
16MHz
C3
22pF
C4
22pF
C6
22pF
VCC-3.3
C15
C16
100nF 100nF 100nF 100nF 100nF
C9
C10
C11
C14
2.2uF
VBAT
PC13
PC14
PC15
PH0
PH1
NRST
PC0
PC1
PC2
PC3
VSSA
VDDA
PA0
PA1
PA2
VDD
VSS
PB9
PB8
BOOT0
PB7
PB6
PB5
PB4
PB3
PD2
PC12
PC11
PC10
PA15
PA14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
STM32F415RG
VDD
VCAP2
PA13
PA12
PA11
PA10
PA9
PA8
PC9
PC8
PC7
PC6
PB15
PB14
PB13
PB12
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
CN3
U1
PA3
VSS
VDD
PA4
PA5
PA6
PA7
PC4
PC5
PB0
PB1
PB2
PB10
PB11
VCAP1
VDD
X2
32.768KHz
C1
22pF
C7
2.2uF
Figure 6-2: RTC battery schematic
Page 21
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
C2
2.2uF
7. click boards are plug and play!
Up to now, MikroElektronika has released more than
90 mikroBUS™ compatible click™ Boards. On the
average, one click board is released per week. It is
our intention to provide you with as many add-on
boards as possible, so you will be able to expand your
development board with additional functionality.
Each board comes with a set of working example
code. Please visit the click™ boards webpage for the
complete list of currently available boards:
www.mikroe.com/click
Figure 7-1:
STM32 M4 clicker driving
a GSM click board
Page 22
RFid click™
Relay click™
8x8 click™
BarGraph click™
7seg click™
THERMO click™
FM click™
Gyro click™
Page 23
Bluetooth2 click™
Thunder click™
USB SPI click™
EEPROM click™
LightHz click™
Pressure click™
8. Dimensions
75.6
2979
71.6
2819
8 1.6
315 63
2.54
100
Legend
mm
mils
Mounting hole size
Ø2
Ø 79
17.2
679
25.4
1000
Page 24
4
159
DISCLAIMER
All the products owned by MikroElektronika are protected by copyright law and international copyright treaty. Therefore, this manual is to be treated as any
other copyright material. No part of this manual, including product and software described herein, may be reproduced, stored in a retrieval system, translated
or transmitted in any form or by any means, without the prior written permission of MikroElektronika. The manual PDF edition can be printed for private or
local use, but not for distribution. Any modification of this manual is prohibited.
MikroElektronika provides this manual ‘as is’ without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties
or conditions of merchantability or fitness for a particular purpose.
MikroElektronika shall assume no responsibility or liability for any errors, omissions and inaccuracies that may appear in this manual. In no event shall
MikroElektronika, its directors, officers, employees or distributors be liable for any indirect, specific, incidental or consequential damages (including damages
for loss of business profits and business information, business interruption or any other pecuniary loss) arising out of the use of this manual or product,
even if MikroElektronika has been advised of the possibility of such damages. MikroElektronika reserves the right to change information contained in this
manual at any time without prior notice, if necessary.
HIGH RISK ACTIVITIES
The products of MikroElektronika are not fault – tolerant nor designed, manufactured or intended for use or resale as on – line control equipment
in hazardous environments requiring fail – safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication
systems, air traffic control, direct life support machines or weapons systems in which the failure of Software could lead directly to death, personal
injury or severe physical or environmental damage (‘High Risk Activities’). MikroElektronika and its suppliers specifically disclaim any expressed or
implied warranty of fitness for High Risk Activities.
TRADEMARKS
The MikroElektronika name and logo, mikroC™, mikroBasic™, mikroPascal™, Visual TFT™, Visual GLCD™, mikroProg™, Ready™, MINI™, mikroBUS™, EasyPIC™, EasyAVR™,
Easy8051™, click™ boards and mikromedia™ are trademarks of MikroElektronika. All other trademarks mentioned herein are property of their respective companies.
All other product and corporate names appearing in this manual may or may not be registered trademarks or copyrights of their respective companies, and
are only used for identification or explanation and to the owners’ benefit, with no intent to infringe.
Copyright © 2014 MikroElektronika. All Rights Reserved.
Page 25
If you want to learn more about our products, please visit our web site at www.mikroe.com
If you are experiencing some problems with any of our products or just need additional
information, please place your ticket at www.mikroe.com/support
If you have any questions, comments or business proposals,
do not hesitate to contact us at [email protected]
STM32 M4 clicker manual
ver. 1.00
0 100000 027011