working zig on tiva tm4c
This commit is contained in:
1
tiva/.gitignore
vendored
1
tiva/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
.zig-cache/
|
||||
zig-out/
|
||||
|
||||
@@ -17,11 +17,22 @@ pub fn build(b: *std.Build) void {
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
const cmsis_path = "/home/priec/programs/CMSIS";
|
||||
|
||||
// Generic CMSIS Core (for core_cm4.h)
|
||||
tiva_module.addIncludePath(.{ .cwd_relative = cmsis_path ++ "/CMSIS/Include" });
|
||||
// TM4C Device Specific (for TM4C123GH6PM.h)
|
||||
tiva_module.addIncludePath(.{ .cwd_relative = cmsis_path ++ "/Device/TI/TM4C/Include" });
|
||||
|
||||
const elf = b.addExecutable(.{
|
||||
.name = "tiva-app",
|
||||
.root_module = tiva_module,
|
||||
});
|
||||
|
||||
elf.root_module.strip = true;
|
||||
elf.root_module.omit_frame_pointer = true;
|
||||
elf.root_module.unwind_tables = .none;
|
||||
|
||||
// Disable red zone for bare metal
|
||||
elf.root_module.red_zone = false;
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
const cmsis = @cImport({
|
||||
@cInclude("TM4C123GH6PM.h");
|
||||
});
|
||||
|
||||
pub fn main() noreturn {
|
||||
while (true) {}
|
||||
}
|
||||
|
||||
pub fn panic(_: []const u8, _: ?*@import("std").builtin.StackTrace, _: ?usize) noreturn {
|
||||
while (true) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user