出自flip the world

ST, STM32F4 Discovery:修訂間差異

Tommy​(留言 | 貢獻)
Consistency: fix external-link syntax, heading case and wikilink form
Tommy​(留言 | 貢獻)
Remove links to pages that were never written
 
(未顯示同一使用者於中間所作的 3次修訂)
第1行: 第1行:
The '''STM32F4 Discovery''' is an ST Cortex-M4 board. These notes cover the GNU/ARM toolchain, building and flashing with ST-Link, and debugging with GDB.
[[File:IMAG4572 BURST001.jpg|thumb|200px|Dot matrix + servo + touch sensor]]
[[File:IMAG4572 BURST001.jpg|thumb|200px|Dot matrix + servo + touch sensor]]
== Download the GNU/ARM toolchain ==
== Download the GNU/ARM toolchain ==
第6行: 第8行:
* sudo apt-get install autoconf pkg-config libusb-1.0 git
* sudo apt-get install autoconf pkg-config libusb-1.0 git
* git clone https://github.com/texane/stlink.git
* git clone https://github.com/texane/stlink.git
<pre>
<syntaxhighlight lang="bash">
cd ~/stlink
cd ~/stlink
./autogen.sh
./autogen.sh
./configure
./configure
make
make
</pre>
</syntaxhighlight>
== Download STM32 Libraries and Blinky Example ==
== Download STM32 Libraries and Blinky Example ==
* git clone https://github.com/rowol/stm32_discovery_arm_gcc
* git clone https://github.com/rowol/stm32_discovery_arm_gcc
第60行: 第62行:
</pre>
</pre>


== [[Application - MPR121, capacitive touch sensor controller]] ==
== Related projects ==
== [[Application - MAX7219, Serially Interfaced, 8-Digit LED Display Drivers (interact with MPR121)]] ==
* [[Application - MPR121, capacitive touch sensor controller]]
== [[Application - MAX7219, Serially Interfaced, 8-Digit LED Display Drivers (scrolling text)]] ==
* [[Application - MAX7219, Serially Interfaced, 8-Digit LED Display Drivers (interact with MPR121)]]
== [[application - CS43L22, built-in DAC(audio playback)]] ==
* [[Application - MAX7219, Serially Interfaced, 8-Digit LED Display Drivers (scrolling text)]]
== [[Application - MG90S, Metal Gear Servo]] ==
* [[Application - MG90S, Metal Gear Servo]]
== [[Application - Joystick]] ==
* [[Application - Joystick]]
== [[Application - nRF52, (BLE - UART - STM32F4)]] ==
* [[Application - nRF52, (BLE - UART - STM32F4)]]
== [[Application - MeArm, mini robotic arm]] ==
* [[Application - MeArm, mini robotic arm]]


== Reference ==
== Reference ==

2026年8月23日 (日) 18:18的最新修訂

The STM32F4 Discovery is an ST Cortex-M4 board. These notes cover the GNU/ARM toolchain, building and flashing with ST-Link, and debugging with GDB.

Dot matrix + servo + touch sensor

Download the GNU/ARM toolchain

  • tar -xvjf gcc-arm-none-eabi-4_8-2014q2-20131204-linux.tar.bz2
  • export PATH=$PATH:~/gcc-arm-none-eabi-4_8-2014q2/bin

Download and Build STLINK

cd ~/stlink
./autogen.sh
./configure
make

Download STM32 Libraries and Blinky Example

Compile Your Source Code

  • Edit Makefile
    • STLINK=/home/rowol/stlink #Example, change to your location
    • STM_COMMON=/home/rowol/stm32_discovery_arm_gcc/STM32F4-DISCOVERY_FW_V1.1.0
    • make it

Program ARM's Flash and Run Code

  • make burn

or

  • st-flash write STM32F4-Discovery.bin 0x08000000

Using external ST-Link

  • Remove CN3 jumper
ST-Link     STM32F4
VCC            3V
SWIO           PA13
SWCLK          PA14
VDD            VDD ( depends on product, could range from 1.8v - 5v )
GND            GND

GDB

In the directory with your source code, I've also add a .gdbinit file which contains:

define reload
kill
monitor jtag_reset
load
end

target extended localhost:4242
load

This will execute whenever you start GDB in the source directory

To start up:

~/stlink/st-util                 #Start GDB server
arm-none-eabi-gdb main.elf       #In a second terminal window, start GDB

continue                         #Starts code running, or use other GDB commands to 
                                 # set breakpoints, etc first...

Related projects

Reference