From ca17420a81df7bec9382459970652e7dc79cfe26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20=22xq=22=20Quei=C3=9Fner?= Date: Thu, 21 Sep 2023 12:16:03 +0200 Subject: [PATCH] Adds more architectures --- build.zig | 15 +++++++++++---- build.zig.zon | 12 ++++++------ shell.nix | 1 + 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/build.zig b/build.zig index 3aeb293..4064772 100644 --- a/build.zig +++ b/build.zig @@ -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"); @@ -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 }, @@ -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| { @@ -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 }); } } diff --git a/build.zig.zon b/build.zig.zon index 1180edb..7166259 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -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", @@ -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", }, }, } diff --git a/shell.nix b/shell.nix index 3c88ea0..b1724c4 100644 --- a/shell.nix +++ b/shell.nix @@ -3,6 +3,7 @@ pkgs.mkShell { nativeBuildInputs = [ pkgs.zig_0_11_0 pkgs.picotool + pkgs.llvmPackages_16.bintools ]; buildInputs = []; }