Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jrmoulton/cross-comp
Cross compilation template project for building for embedded targets
https://github.com/jrmoulton/cross-comp
Last synced: about 2 months ago
JSON representation
Cross compilation template project for building for embedded targets
- Host: GitHub
- URL: https://github.com/jrmoulton/cross-comp
- Owner: jrmoulton
- Created: 2024-02-20T20:52:22.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-10-16T15:36:39.000Z (3 months ago)
- Last Synced: 2024-10-18T13:22:10.734Z (3 months ago)
- Language: C
- Size: 3.22 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Installation
- clone the repository
- run `git submodule update --init --recursive`
- install zig
- macOS
- `brew install zig`
- Windows
- https://ziglang.org/learn/getting-started/- install probe-rs using the below instructions
- macOS
- `curl --proto '=https' --tlsv1.2 -LsSf https://github.com/probe-rs/probe-rs/releases/download/v0.22.0/probe-rs-installer.sh | sh`
- Windows
- `irm https://github.com/probe-rs/probe-rs/releases/download/v0.22.0/probe-rs-installer.ps1 | iex`# Build the project
First add the names of the executables (all .c files with a `main` function) to the `executables`
list in `build.zig`.run `zig build {name of executable without .c}`
Example: `zig build lab1`
# Build and flash the project
run `zig build flash-{name of executable without .c}`
Example: `zig build flash-lab1`
then press the reset button on the device
# Usage
Make sure to add your FreeRTOSConfig.h file to the `include` folder. (freertos is currently
disabled)The build.zig file defines where includes go (.h files) and where the source files (.c files) go. By
default source files go in the `src` folder and header files go in the `include` folder.Zig also has a `-Doptimize=ReleaseFast` flag to enable optimizations. This significantly reduces the
binary size which makes flashing significantly faster.`zig build lab1 -Doptimize=ReleaseFast`
`zig build flash-lab1 -Doptimize=ReleaseFast`