Top Banner
STM32-M4 First Touch [email protected] 2012/06/26
16

Stm32 f4 first touch

May 11, 2015

Download

Technology

Benux Wei

This is a brief for STM32-F4 Discovery board for beginners.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Stm32 f4 first touch

STM32-M4 First [email protected]

2012/06/26

Page 2: Stm32 f4 first touch

STM32F407VGT6

● 32-bit ARM® Cortex™-M4-based STM32-F4

● 168MHz, upto 210 MIPS● 1MB Flash, 192KB RAM

USB for Input or ST-LINK

Page 3: Stm32 f4 first touch

STM32F407VGT6 I/O

USB 2.0 OTG

● ST-LINK● Need to be licensed

Page 4: Stm32 f4 first touch

Toolchain for ® Cortex™-M4-based

codesourcery arm ● https://sourcery.mentor.com/GNUToolchain/● arm-2012.03-56-arm-none-eabi-i686-pc-

linux-gnu.tar.bz2

Summon-arm-toolchain● https://github.com/MikeSmith/summon-arm-

toolchain● -mcpu=cortex-m4 -mthumb-interwork -

mfloat-abi=hard -mfpu=fpv4-sp-d16 -mlittle-endian

Page 5: Stm32 f4 first touch

Downloadsstm32● https://github.com/nabilt/STM32F4-Discovery-Firmware

st-link● git clone https://github.com/texane/stlink.git stlink

F4OS● git clone git://github.com/prattmic/F4OS.git

○ 6/26 version include UART with hello example

Page 6: Stm32 f4 first touch

compile stlink in ubuntu 11.04

sudo apt-get install autoconfsh autogen.sh./configure(ps: require libusb-1.0.0)make(note: please don't install, just use it by export PATH=~/stlink/:$PATH)

Page 7: Stm32 f4 first touch

Install udev rules for ST-LINK device

$ cd stlink$ sudo cp 49-stlink* /etc/udev/rules.d

Page 8: Stm32 f4 first touch

st-flashF4OS$ st-flash write ./os.bin 0x80000002012-06-11T08:56:21 INFO src/stlink-common.c: Loading device parameters....2012-06-11T08:56:21 INFO src/stlink-common.c: Device connected is: F4 device, id 0x200064112012-06-11T08:56:21 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes2012-06-11T08:56:21 INFO src/stlink-common.c: Attempting to write 18376 (0x47c8) bytes to stm32 address: 134217728 (0x8000000)EraseFlash - Sector:0x0 Size:0x4000Flash page at addr: 0x08000000 erasedEraseFlash - Sector:0x1 Size:0x4000Flash page at addr: 0x08004000 erased2012-06-11T08:56:22 INFO src/stlink-common.c: Finished erasing 2 pages of 16384 (0x4000) bytes2012-06-11T08:56:22 INFO src/stlink-common.c: Starting Flash write for F2/F42012-06-11T08:56:22 INFO src/stlink-common.c: Successfully loaded flash loader in sramsize: 183762012-06-11T08:56:22 INFO src/stlink-common.c: Starting verification of write complete2012-06-11T08:56:23 INFO src/stlink-common.c: Flash written and verified! jolly good!

Page 9: Stm32 f4 first touch

st-util wait gdbben@xubuntu:~/src/github/stlink$ ./st-util2012-06-10T22:56:32 INFO src/stlink-usb.c: -- exit_dfu_mode2012-06-10T22:56:32 INFO src/stlink-common.c: Loading device parameters....2012-06-10T22:56:32 INFO src/stlink-common.c: Device connected is: F4 device, id 0x200064112012-06-10T22:56:32 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytesChip ID is 00000413, Core ID is 2ba01477.KARL - should read back as 0x03, not 60 02 00 00init watchpointsListening at *:4242...

Page 10: Stm32 f4 first touch

gdb with st-util~/F4OS$ arm-none-eabi-gdbGNU gdb (Sourcery CodeBench Lite 2012.03-56) 7.2.50.20100908-cvsCopyright (C) 2010 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law. Type "show copying"and "show warranty" for details.This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-eabi".For bug reporting instructions, please see:<https://support.codesourcery.com/GNUToolchain/>.(gdb) target remote :4242Remote debugging using :42420x007f3ff4 in ?? ()

Page 11: Stm32 f4 first touch

Demo

STM32F407VGT6

Page 12: Stm32 f4 first touch

Backlogs

Page 13: Stm32 f4 first touch

Bus Blaster and OpenOCDhttp://www.nabiltewolde.com/?tag=STM32F4

Bus Blaster and OpenOCDWarning: OpenOCD does not fully support the CortexM4 yet and this method

may damage your hardware. I am not an expert OpenOCD user. Use at your own risk.

The Bus Blaster is an open hardware JTAG debugger made by Dangerous Prototypes, which you can get for about $35 atSeeedStudio. Any debugger compatible with Open On-Chip Debugger (OpenOCD) should work fine for these instructions.

Page 14: Stm32 f4 first touch

STM32F4 Adapter Board

SOURCE:Projects/stm32f4-adapter-board

Page 16: Stm32 f4 first touch

STM32F407VGT6

● microcontroller featuring 32-bit ARM Cortex-M4F core, 1 MB Flash, 192 KB RAM in an LQFP100 package

● On-board ST-LINK/V2 with selection mode switch to use the kit as a standalone ST- LINK/V2 (with SWD connector for programming and debugging)

● LIS302DL, ST MEMS motion sensor, 3-axis● digital output accelerometer● MP45DT02, ST MEMS audio sensor, omni- directional digital microphone● CS43L22, audio DAC with integrated class D speaker driver● Eight LEDs:● USB OTG FS with micro-AB connector● Extension header for all LQFP100 I/Os for quick connection to prototyping

board and easy probing

More - reference DM00037955.pdf