STM32F4 Discovery

From PaparazziUAV
Revision as of 12:21, 28 October 2013 by NeoFromMatrix (talk | contribs) (formatting)
Jump to navigation Jump to search

This page is for the STM32F4 Discovery board with STM32F407VGT6, STM32F4 Disco is a familiar board with STM32F401VCT6, do not use this Files for the Disco board !

Stm32f4-discovery.jpg


Overview

  • STMicroelectronics STM32F4VGT6 Cortex M4 MCU, up to 168Mhz with floating point unit (FPU), 192 KB RAM, 1024 KB 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, red, blue, 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 red, USB green, power, USB OTG green, USB OTG red)
  • LIS302DL MEMS 3 axis accelerometer on SPI1 (support under development)

Pinout

left pin bank in relation to paparazzi
right pin bank in relation to paparazzi

The Discovery has a male 100 pin (2x25pin on both sides) pinout.

LED

3 PD13 orange, above LIS302DL

4 PD12 green, left of LIS302DL

5 PD14 red, right of LIS302DL

6 PD15 blue, below LIS302DL

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

  1. PWM0 PE9
  2. PWM1 PE11
  3. PWM2 PE13
  4. PWM3 PE14
  5. PWM4 PE5
  6. PWM5 PE6
  7. PWM6 PA3
  8. PWM7 PA2
  9. PWM8 PA1
  10. PWM9 PA0
  11. PWM10 PB14 (can not be ised if SPI2 is active !)
  12. 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 the UAV WILL crash !

Firmware Flashing

FLASH_MODE=DFU is set as default

STM32F4 Discovery can mainly be programmed in two different ways:

DFU

  • 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
  • push MCU in DFU mode: connect mini and micro USB to PC, connect pin BOOT0 with 3V, press reset button(LED LD7 should light up now), disconnect BOOT0 to 3V (if this does not work, also connect BOOT1 (PB2) with GND)
  • more information: DFU page

SWD

  • with onboard STLinkV2 over SWD
  • required hardware: usb to mini USB cable
  • required software: st_flash and st_util from Texane
  • more information: STLink page