Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESP32-C3] How do I correctly setup the blink example on my own repository #285

Open
JanBeelte opened this issue Nov 11, 2024 · 1 comment

Comments

@JanBeelte
Copy link

Hello together,

I am pretty new to the zig build system and struggeling to setup ESP32-C3 support on my own repository using microzig as a dependency. Currently I have the following in my build.zig.zon file:

.{
    .name = "firmware/blink",
    .version = "0.0.0",
    .dependencies = .{
        .@"microzig/build" = .{  
            .url = "git+https://github.com/ZigEmbeddedGroup/microzig.git#d6a97c9476c3377877946873cad040f769e42698",
            .hash = "12204ade9b0ef08b6787667a99396aa1e89e8a6dca1e25b62b9490e3ab8394a0383c" },
        .@"microzig/port/espressif/esp" = .{ 
            .url = "git+https://github.com/ZigEmbeddedGroup/microzig.git#d6a97c9476c3377877946873cad040f769e42698",
            .hash = "12204ade9b0ef08b6787667a99396aa1e89e8a6dca1e25b62b9490e3ab8394a0383c" },
    },

    .paths = .{
        "LICENSE",
        "README.md",
        "build.zig",
        "build.zig.zon",
        "src",
    },
}

This can obviously not work as I am using the same url for both dependencies. How do I do this correctly?
Also I am a bit confused by the error message from zig build:

❯ zig build
/Users/jan/projects/open-sensor-platform/firmware/blink/build.zig:10:30: error: root struct of file 'build' has no member named 'init'
    const microzig = MicroZig.init(b, .{});
                     ~~~~~~~~^~~~~
/Users/jan/.cache/zig/p/12204ade9b0ef08b6787667a99396aa1e89e8a6dca1e25b62b9490e3ab8394a0383c/build.zig:1:1: note: struct declared here
const std = @import("std");
^~~~~
referenced by:
    runBuild__anon_8411: /opt/homebrew/Cellar/zig/0.13.0/lib/zig/std/Build.zig:2116:27
    main: /opt/homebrew/Cellar/zig/0.13.0/lib/zig/compiler/build_runner.zig:301:29
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

Is this error even linked or completely unrelated?
Feel free to also checkout our repository for the full setup:
https://github.com/opendata-nuernberg/open-sensor-platform/tree/main/firmware/blink

Thanks for your help!

Best,

Jan

@Kytezign
Copy link

I'm new to this zig & this community but I was able to get the RP Pico to blinky in a separate repo.
Not sure it's helpful to you or others but I'll share it here just in case.

https://github.com/Kytezign/zig_pico_blinky_example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants