Difference between revisions of "STM32F4 Discovery"
(added pin bank pic's) |
|||
Line 126: | Line 126: | ||
====solder jumper==== | ====solder jumper==== | ||
* SB17 bypass for JP1 | * SB17 bypass for JP1 | ||
close this, if JP1 gets loose due vibrations, the MCU will not be supplied with power and your plane WILL crash ! | |||
==Firmware Flashing== | ==Firmware Flashing== |
Revision as of 13:37, 14 October 2013
CAUTION! This page is for the STM32F4 Discovery board with STM32F407VGT6, a familiar board is available with STM32F401VCT6 but this is NOT exactly the same! Do not use the other board with files build for this one!
Overview
- STMicroelectronics STM32F4VGT6 Cortex M4 MCU, up to 168Mhz with floating point unit (FPU), 192 KB RAM, 1024KB Flash
- on-board stlinkv2 with SWD header (capable of programming itself or an external MCU)
- ob-board power regulator for the MCU (3V or 5V Input)
- 1 x user push button
- 4(5) x LED (orange, green, blue, red, green)
- 6 x UART (UART1, UART2, UART3, UART4, UART5, UART6)
- 3 x SPI (SPI1, SPI2, SPI3)
- 2(3) x I2C (I2C1, I2C2, (I2C3))
- 1 x PPM input
- 4 x ADC input, which one is used for bat voltage
- 97 x 66 mm PCB
- 4 x status LED (USB OTG, stlink red, stlink green, USB power)
- LIS302DL MEMS 3 axis accelerometer (currently not supported)
Pinout
The Discovery has a male 100 pin (2x25pin on both sides) pinout.
LED
LED_3 PD13 orange, above LIS302DL
LED_4 PD12 green, left of LIS302DL
LED_5 PD14 red, right of LIS302DL
LED_6 PD15 blue, below LIS302DL
LED_9 PA9, same as USB power (VBUS), needs to be enabled in stm32f4_discovery.h
UART
- UART1
- TX PB6
- RX PB7
- UART2
- TX PD5
- RX PD6
- UART3
- TX PD8
- RX PD9
- UART4
- TX PC10
- RX PC11
Can not be used if SPI3 is active !
- UART5
- TX PC12
- RX PD2
Can not be used if SPI3 is active !
- UART6
- TX PC6
- RX PC7
SPI
- SPI1
- SCK PB3
- MISO PB4
- MOSI PB5
- SPI2
- SCK PB13
- MISO PB14
- MOSI PB15
Can not be used if PWM10 & PWM11 are active !
- SPI3
- SCK PC10
- MISO PC11
- MOSI PC12
Can not be used if UART4 & UART5 are active !
- SPI select Slave 0 PE2
- SPI select Slave 1 PE7
I2C
- I2C1
- SCL PB8
- SDA PB9
- I2C2
- SCL PB10
- SDA PB11
- I2C3
- SCL PA8
- SDA PC9
I2C3 needs to be enabled in stm32f4_discovery.h
ADC
- ADC_1 PB1
- ADC_2 PC1
- ADC_3 PC4
- ADC_4 PA4 (used for BAT Voltge with voltage divider)
PWM
- PWM0 PE9
- PWM1 PE11
- PWM2 PE13
- PWM3 PE14
- PWM4 PE5
- PWM5 PE6
- PWM6 PA3
- PWM7 PA2
- PWM8 PA1
- PWM9 PA0
- PWM10 PB14 (can not be ised if SPI2 is active !)
- PWM11 PB15 (can not be ised if SPI2 is active !)
PPM Input
PA8
Spektrum
bind pin PA8
input UART2 PA10
Jumper
pin jumper
- JP1 current consumption of the MCU can be measured here
- CN3 set: stlinkv2 is connected to onboard MCU, unset: stlinkv2 is connected to SWD header to program external MCU
solder jumper
- SB17 bypass for JP1
close this, if JP1 gets loose due vibrations, the MCU will not be supplied with power and your plane WILL crash !
Firmware Flashing
FLASH_MODE=DFU is set as default
stm32f4-discovery can be programmed in two different ways:
- with the MCU native (embedded in rom) DFU USB bootloader over the micro usb ab connector
- required hardware: usb to micro and usb to mini usb cable
- required software: dfu_util tool (present
- put MCU in DFU mode: connect mini and usb to pc, connect pin BOOT0 with 3V, press reset button(LED LD7 should light up now), disconnect BOOT0 to 3V
- with onboard stlinkv2 over SWD
- required hardware: usb to mini usb cable
- required software: st_flash and st_util
- more information: STLink page