Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Commit

Permalink
Adds more architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix "xq" Queißner committed Sep 21, 2023
1 parent 991d757 commit ca17420
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
15 changes: 11 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const stm32 = @import("stm32");
const lpc = @import("lpc");
const gd32 = @import("gd32");
const nrf5x = @import("nrf5x");
const esp = @import("esp");
const atmega = @import("atmega");

pub fn build(b: *std.Build) void {
const microzig = @import("microzig").init(b, "microzig");
Expand Down Expand Up @@ -33,7 +35,6 @@ pub fn build(b: *std.Build) void {
.{ .name = "stm32f429idiscovery", .target = stm32.boards.stm32f429idiscovery },

// NXP LPC
// TODO: Add checksum postprocessing
.{ .name = "lpc176x5x", .target = lpc.chips.lpc176x5x },
.{ .name = "mbed-lpc1768", .target = lpc.boards.mbed.lpc1768 },

Expand All @@ -47,12 +48,15 @@ pub fn build(b: *std.Build) void {
.{ .name = "nrf52840", .target = nrf5x.chips.nrf52840 },
.{ .name = "nrf52840-dongle", .target = nrf5x.boards.nordic.nRF52840_Dongle }, // TODO: Add support for DFU files!

// Espressif ESP
// .{ .name = "nrf52832", .target = nrf5x.chips.nrf52832 },
// TODO: Add support for Espressif Update Binaries
// RISC-V Espressif ESP
.{ .name = "esp32-c3", .target = esp.chips.esp32_c3 }, // TODO: Add support for Espressif Update Binaries

// Microchip ATmega
// TODO: Fix compiler bugs
// - https://github.com/ziglang/zig/issues/17219
// .{ .name = "atmega328p", .target = atmega.chips.atmega328p },
// .{ .name = "arduino-nano", .target = atmega.boards.arduino.nano },
// .{ .name = "arduino-uno-rev3", .target = atmega.boards.arduino.uno_rev3 },
};

for (available_targets) |dest| {
Expand All @@ -73,5 +77,8 @@ pub fn build(b: *std.Build) void {
//
// This will also install into `$prefix/firmware` instead of `$prefix/bin`.
microzig.installFirmware(b, firmware, .{});

// For debugging, we also always install the firmware as an ELF file
microzig.installFirmware(b, firmware, .{ .format = .elf });
}
}
12 changes: 6 additions & 6 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
.hash = "12208cab5f60ef97cac4165ad694f3ba0c7b28f279538c1539b74f7c152f34fe306d",
},
.lpc = .{
.url = "https://github.com/ZigEmbeddedGroup/nxp-lpc/archive/be4280a8b55690e8446fd4c3186dcd6673118cd3.tar.gz",
.hash = "1220891bc5fa43b30cd024a628f8915f54691e5664d2a34e6653bf92722b222b7c7e",
.url = "https://github.com/ZigEmbeddedGroup/nxp-lpc/archive/130a1316c0892415e7da958a5e9548ed87bba54d.tar.gz",
.hash = "1220165879f85a1d51656d35b3963a95f3585dc665fc7414f76aa6aad4e6635536cf",
},
.gd32 = .{
.url = "https://github.com/ZigEmbeddedGroup/gigadevice-gd32/archive/9324753cc3b8e7afe83fcda085bcfe76681a3be3.tar.gz",
Expand All @@ -27,12 +27,12 @@
.hash = "1220980da06f9634dcff06afefa7aa111bd030018fea49f79e86657dab69621e1d08",
},
.esp = .{
.url = "https://github.com/ZigEmbeddedGroup/espressif-esp/archive/f7e47d07996565036501f55ed781a5f6e786b2f7.tar.gz",
.hash = "12209b0365f56df4ce83b1300da86bef605bd299e94b87f373571351f71fa2ccd461",
.url = "https://github.com/ZigEmbeddedGroup/espressif-esp/archive/59b8ca028915c0d6224ec88dbf4db19afbb559c0.tar.gz",
.hash = "1220f6e5f22416fdc63442cd8869fcaa35f9abf30d878ea3d80073176677dc6f8a65",
},
.atmega = .{
.url = "https://github.com/ZigEmbeddedGroup/microchip-atmega/archive/46dfd08ad13e0a9a84351cfd595b1e6e341d4839.tar.gz",
.hash = "1220b2df269bf997b77bebcebea63a8e39aea354a7075cf99878423e304394bc28eb",
.url = "https://github.com/ZigEmbeddedGroup/microchip-atmega/archive/feefcb87a63c0aae31afb783d4e388e90c4d922f.tar.gz",
.hash = "1220048dc5d22729ee119a496f8b8ca3556838af1f3bd32ce6acd5f76480ec942965",
},
},
}
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pkgs.mkShell {
nativeBuildInputs = [
pkgs.zig_0_11_0
pkgs.picotool
pkgs.llvmPackages_16.bintools
];
buildInputs = [];
}

0 comments on commit ca17420

Please sign in to comment.