All Projects → ertuil → stm32_template

ertuil / stm32_template

Licence: other
这是一个stm32f103 和 stm32f407单片机在Unix、Linux等系统下使用的模版,可以使用make编译、下载、调试。

Programming Languages

c
50402 projects - #5 most used programming language
assembly
5116 projects
Makefile
30231 projects

Projects that are alternatives of or similar to stm32 template

Stm32l4xx Hal
A Hardware abstraction layer for the stm32l432xx series chips written in rust.
Stars: ✭ 65 (+35.42%)
Mutual labels:  arm, stm32
Xpcc
DEPRECATED, use our successor library https://modm.io instead
Stars: ✭ 177 (+268.75%)
Mutual labels:  arm, stm32
Stm32f0 arm
STM32 Cortex-M0 course
Stars: ✭ 72 (+50%)
Mutual labels:  arm, stm32
Avem
🚁 轻量级无人机飞控-[Drone]-[STM32]-[PID]-[BLDC]
Stars: ✭ 465 (+868.75%)
Mutual labels:  arm, stm32
arm-hard-fault-handler
What to do when Hard fault hits? Debugger and error reporter solution for ARM Cortex M3 and M4.
Stars: ✭ 32 (-33.33%)
Mutual labels:  arm, stm32
Stm32liquidcrystal
Liquid Crystal Library for STM32
Stars: ✭ 24 (-50%)
Mutual labels:  arm, stm32
Stm32 graphics display drivers
STM32 LCD drivers (currently: spi(dma), gpio, fsmc(dma), st7735, st7783, ili9325, ili9328, ili9341, ili9486, ili9488, hx8347g)
Stars: ✭ 151 (+214.58%)
Mutual labels:  arm, stm32
terminal
Terminal inside the microcontroller (cli for mcu)
Stars: ✭ 31 (-35.42%)
Mutual labels:  arm, stm32
Frosted
Frosted: Free POSIX OS for tiny embedded devices
Stars: ✭ 194 (+304.17%)
Mutual labels:  arm, stm32
Dirtyjtag
JTAG probe firmware for STM32F1
Stars: ✭ 183 (+281.25%)
Mutual labels:  arm, stm32
kconfig
Kconfig for ARM based MCUs
Stars: ✭ 15 (-68.75%)
Mutual labels:  arm, stm32
stm32f103xx
DEPRECATED
Stars: ✭ 31 (-35.42%)
Mutual labels:  arm, stm32
async-stm32f1xx
Abstractions for asynchronous programming on the STM32F1xx family of microcontrollers.
Stars: ✭ 24 (-50%)
Mutual labels:  arm, stm32
Tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
Stars: ✭ 9,068 (+18791.67%)
Mutual labels:  arm, stm32
toolchain68k
build a toolchain for cross developement. Supports motorola m68k-elf, avr and arm-none-eabi
Stars: ✭ 18 (-62.5%)
Mutual labels:  arm, stm32
Arm Cmake Toolchains
CMake toolchain configurations for ARM
Stars: ✭ 148 (+208.33%)
Mutual labels:  arm, stm32
STM32F10x Servo Library
Servo library with stm developed by the Liek Software Team. We are working on new versions.
Stars: ✭ 14 (-70.83%)
Mutual labels:  arm, stm32
CML
Fast, safe and easy to use Cortex-M HAL Library, written in C++ 17
Stars: ✭ 17 (-64.58%)
Mutual labels:  arm, stm32
Grbl Advanced
Grbl-Advanced is a no-compromise, high performance, low cost alternative for CNC milling. This version of Grbl runs on a STM32F411RE / STM32F446RE Nucleo Board. Now with backlash compensation, multi-axis and Tool Table support!
Stars: ✭ 182 (+279.17%)
Mutual labels:  arm, stm32
STM32Primer2 GNSS Tracker
GNSS Tracker For STM32 Primer2
Stars: ✭ 24 (-50%)
Mutual labels:  arm, stm32

STM32 GCC 编译模版

作者 ———— Ertuil

介绍

这里是我在Mac环境上使用 gcc-arm-none-eabi编译时候,使用的模版。其中包含了一个makefile,可以编译、烧写stm32程序。 有三个框架分别支持:stm32F103R8T6、stm32F407ZET6以及stm32F103R8T6带DSP库。 全部在Mac OS10.13 上测试通过,理论上linux也能使用。

目录介绍

基本与原子的目录相同:

  1. USER/ 用户文件(建议代码放在此处)、stm32fxxx_conf、stmfxxx_it、stmfxxx等
  2. BUILD/ 编译时产生文件
  3. CORE/ arm 内核文件
  4. FWLIB/ stm32 标准库文件
  5. SYSTEM/ 原子提供的一部分.c .h 文件
  6. HARDWARE/ 硬件相关的代码文件(建议硬件代码放在此处)
  7. makefile makefile文件,需要根据自己情况配置配置。

使用和Makefile文件配置

需要安装的软件等

  1. Unix、Linux上编译stm32文件,需要安装arm-none-eabi-gcc库。具体方法不再赘述。
  2. 我使用st-link-v2下载代码至单片机。需要安装st-link的命令行工具

Makefile文件配置

我这里使用的 Makefile 文件大体上是由 Stm32Cube自动生成的文件修改而成。常用的需要修改配置的的地方如下:

  1. TARGET: 输出文件名
  2. DEBUG: 时候开启debug
  3. OPT: 优化等级
  4. BUILD_DIR: 编译文件存放位置,默认build
  5. BINPATH: gcc-arm-none-eabi/bin的位置
  6. C_INCLUDES: C头文件位置

注意

  1. 对于不同型号的单片机,可能需要替换STM32F103R8Tx_FLASH.ld、startup_stm32f103xb.s两个.ld、.s文件为自己单片机对应型号的文件。 对应的makefile变量为:ASM_SOURCES和LDSCRIPT

  2. 如果引入库,则适量修改即可。

Make命令:

  1. make: 编译所有文件,生成.bin,.elf二进制文件
  2. make flash:使用st-flash命令把.bin 下载到单片机0x8000000处,(使用openocd等工具时需要自行修改命令)
  3. make clean:删除所有编译生成的文件。

关于调试:

使用 arm-none-eabi-gdb和 st-utils 配合使用可以很方便的进行调试。st-utils打开调试服务器,gdb连接服务器来调试。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].