diff --git a/tiva/.gitignore b/tiva/.gitignore index 1dfcbd2..3389c86 100644 --- a/tiva/.gitignore +++ b/tiva/.gitignore @@ -1 +1,2 @@ .zig-cache/ +zig-out/ diff --git a/tiva/build.zig b/tiva/build.zig index 1cb8377..bfd58bc 100644 --- a/tiva/build.zig +++ b/tiva/build.zig @@ -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; diff --git a/tiva/src/main.zig b/tiva/src/main.zig index e69de29..9a05383 100644 --- a/tiva/src/main.zig +++ b/tiva/src/main.zig @@ -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) {} +}