Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tralamazza/embedded_zig
minimal Zig embedded ARM example (STM32F103 blue pill)
https://github.com/tralamazza/embedded_zig
arm stm32f103 zig
Last synced: 2 months ago
JSON representation
minimal Zig embedded ARM example (STM32F103 blue pill)
- Host: GitHub
- URL: https://github.com/tralamazza/embedded_zig
- Owner: tralamazza
- Created: 2019-06-18T23:15:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-29T07:50:57.000Z (about 4 years ago)
- Last Synced: 2024-08-03T23:20:55.996Z (6 months ago)
- Topics: arm, stm32f103, zig
- Language: Zig
- Homepage:
- Size: 12.7 KB
- Stars: 72
- Watchers: 5
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-zig - tralamazza/embedded_zig
- awesome-zig - embedded_zig🗒️minimal Zig embedded ARM example (STM32F103 blue pill)
README
# embedded_zig
A "minimal" ARM cortex-M firmware in Zig running on a STM32F103. It blinks.
## building
Get [GNU Arm Embedded Toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm) and [Zig](https://ziglang.org/) in `PATH` and type:
make
## running on a [bluepill](http://wiki.stm32duino.com/index.php?title=Blue_Pill)
Run OpenOCD on a terminal:
openocd -f /usr/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg
Open your favorite GDB:
arm-none-eabi-gdb firmware.elf -ex 'target extended-remote :3333'
load
rBonus: you can type `make` inside gdb and `load` it again.
## issues
If you have any linking issues uncomment the line below (in the `Makefile`) to use GNU ld:
# zig build-exe ${BUILD_FLAGS} $(OBJS:%=--object %) --name [email protected] --linker-script ${LINKER_SCRIPT}
arm-none-eabi-ld ${OBJS} -o [email protected] -T ${LINKER_SCRIPT} -Map [email protected] --gc-sections## raq (rarely asked questions)
a) Shouldn't the Makefile...
A: lalalala
b) How do I flash this?
A: see [running on a bluepill](#running-on-a-bluepill)
c) Why didn't you use `@cImport()`?
A: yes