You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
biom4st3r fcb68ad0e2
Updated to zig 0.13.0 (#198)
* Updated to latest zig

* feat(flake): update zig to 0.13.0 and add zls

This also disable diffs for flake.lock to not
not polute the git diff output too much

* feat(build): Update dependencies to support 0.13.0

* feat(build): disable broken examples

* feat(ci): Update zig to 0.13.0

* feat(rp2040): Update pio tokenizer tests to 0.13.0

* feat(build): Fix uses of deprecated std.zig.CrossTarget

* feat(rezg): Fix uses of deprecated std.mem.{tokenize,slice}

* feat(rp2040): Fix uses of depreacted std.rand

* feat(readme): Update zig version

---------

Co-authored-by: Maciej 'vesim' Kuliński <vesim809@pm.me>
2 months ago
..
deps update zig build api and family enum 7 months ago
src updates for zig 0.12.0 5 months ago
.gitignore parsing elf and saving uf2 files 7 months ago
.gitmodules parsing elf and saving uf2 files 7 months ago
LICENSE updates for zig 0.12.0 5 months ago
README.md fix build pkg (#14) 7 months ago
build.zig Updated to zig 0.13.0 (#198) 2 months ago
build.zig.zon updates for zig 0.12.0 5 months ago

README.md

uf2

USB Flashing Format (UF2) for your build.zig

This package is for assembling uf2 files from ELF binaries. This format is used for flashing a microcontroller over a mass storage interface, such as the Pi Pico.

See https://github.com/microsoft/uf2#file-containers for how we're going to embed file source into the format.

For use in a build.zig:

const uf2 = @import("uf2");

pub fn build(b: *Build) void {
    // ...
    const uf2_dep = b.dependency("uf2", .{});

    const uf2_file = uf2.from_elf(uf2_dep, exe, .{ .family_id = .RP2040 });
    _ = b.addInstallFile(uf2_file, "bin/test.uf2");
}

Manually Executing elf2uf2

pub fn build(b: *Build) void {
    // ...

    const uf2_dep = b.dependency("uf2", .{});

    const elf2uf2_run = b.addRunArtifact(uf2_dep.artifact("elf2uf2"));

    // family id
    elf2uf2_run.addArgs(&.{"--family-id", "RP2040"});

    // elf file
    elf2uf2_run.addArg("--elf-path");
    elf2uf2_run.addArtifactArg(exe);

    // output file
    const uf2_file = elf2uf2_run.addPrefixedOutputFileArg("--output-path", "test.uf2");
    _ = b.addInstallFile(uf2_file, "bin/test.uf2");
}