Skip to content

Conversation

@ianic
Copy link

@ianic ianic commented Dec 24, 2025

Here is one more pico wifi implementation ;)...

I started from the initial cyw43 bus implementation and added wifi initialization mostly based on the work from this series of articles and this repo.

Then I copied lwip from Ashet-OS and glue lwip and cyw43.

cyw43 uses lwip provided packet buffers. Lwip is configured to prepare buffers with enough headroom space for cyw43 bus header and command on both send and receive. So both send/receive are zero copy. Packet fragmentation works ok, lwip responds to ping messages with packet size longer than mtu (1500 bytes) and can send fragmented udp packets.

So far I was just testing udp and ping

cyw43.zig rpi example demonstrates:

  • wifi join
  • dhcp ip config
  • udp send
  • ping responding

Example depends on secrets.zig which is not in the repo and should have content like:

pub const ssid = "...";
pub const pwd = "...";

Receiver ip is currently hard coded so it needs to be updated in the code.

To receive udp packets on the host:

nc -u -l  -p 9999

Besides lwip and foundationlibc includes there are also few configuration files:

  • modules/lwip/include/lwipopts.h - defines lwip features, pbuf size and number of pbufs
  • modules/lwip/include/arch/cc.h - export functions
  • examples/raspberrypi/rp2xxx/srs/lwip_exports.zig - definition of exported functions

ianic added 30 commits December 23, 2025 22:37
Use existing cyw43 driver to blink led on the rpi pico 2w.
Remove write function which requires adding command to the read buffer.
More Zig like, less C like interface.
Use namespaces, avoid repeating cyw43 name in each struct, variable...
Off by 1 after previous refactor.
Make it more Zig like.
use packet struct for bit size fields
no need for that huge struct
There we have all information.
Switch to vectored write, from write to writev
@mattnite
Copy link
Contributor

Hey @ianic I merged the other wifi PR, and it seems like there are some conflicts in your branch. Once you fix them I'll take a look

@ianic
Copy link
Author

ianic commented Dec 24, 2025

Hi @mattnite, can you please help me with a thing. I'm stuck with rebasing on #775. After that if the rpi example has exported function build fails.

If I add something like:

export fn sys_now() u32 {
    return 0;
}

in any example (can be blinky.zig) it fails with:

 /home/ianic/.cache/zig/p/N-V-__8AAN5NhBR0oTsvnwjPdeNiiDLtEsfXRHd1fv-R3TOv/zig build-exe -ODebug --dep app -Mroot=/home/ianic/Code/microzig/core/src/generate_root.zig -target thumb-freestanding-eabihf -mcpu cortex_m33+dsp+fp_armv8d16sp --dep microzig -Mapp=/home/ianic/Code/microzig/examples/raspberrypi/rp2xxx/src/blinky.zig --dep config --dep drivers --dep cpu --dep chip --dep hal --dep board --dep app -Mmicrozig=/home/ianic/Code/microzig/core/src/microzig.zig -Mconfig=.zig-cache/c/56f37e7b179445b95e470635223dfd8c/options.zig -ODebug -Mdrivers=/home/ianic/Code/microzig/drivers/framework.zig --dep rtt --dep microzig -Mcpu=/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig --dep microzig -Mchip=.zig-cache/o/81ad655c2785d48a0a87bfcaf2200ef1/chips/RP2350.zig --dep bounded-array --dep microzig -Mhal=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal.zig --dep microzig -Mboard=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/boards/raspberry_pi_pico2.zig -ODebug -Mrtt=/home/ianic/Code/microzig/modules/rtt/src/rtt.zig -ODebug -Mbounded-array=/home/ianic/Code/microzig/modules/bounded-array/src/bounded_array.zig --cache-dir .zig-cache --global-cache-dir /home/ianic/.cache/zig --name generate_root --zig-lib-dir /home/ianic/.cache/zig/p/N-V-__8AAN5NhBR0oTsvnwjPdeNiiDLtEsfXRHd1fv-R3TOv/lib/
zsh: segmentation fault (core dumped)  /home/ianic/.cache/zig/p/N-V-__8AAN5NhBR0oTsvnwjPdeNiiDLtEsfXRHd1fv-R3TOv/zig

@mattnite
Copy link
Contributor

@ianic I'm about to head to bed, but what operating system are you on? And in the mean time try clearing your cache. Ttyl

@ianic
Copy link
Author

ianic commented Dec 24, 2025

Thanks,
Arch Linux 6.16.8-arch3-1
Clearing local and global cache didn't help.

@mattnite
Copy link
Contributor

@ianic I have an idea, it might be the self-hosted backend hitting a bug and segfaulting. To get around this, go to the root build.zig, look for this chunk of code, and add the indicated line:

            const generate_root_exe = mb.builder.addExecutable(.{
                .name = "generate_root",
                .use_llvm = true, // <---- Add this please
                .root_module = mb.builder.createModule(.{
                    .root_source_file = mb.core_dep.path("src/generate_root.zig"),
                    .target = mb.builder.graph.host,
                    .optimize = .Debug,

                    .imports = &.{
                        .{ .name = "app", .module = app_mod },
                    },
                }),
            });

@ianic
Copy link
Author

ianic commented Dec 24, 2025

What I find strange is that building generate_root is using target thumb-freestanding-eabihf, this is failing command:

/home/ianic/.build/zig/zig-x86_64-linux-0.15.1/zig build-exe \
    -ODebug \
    --dep app \
    -Mroot=/home/ianic/Code/microzig/core/src/generate_root.zig \
    -target thumb-freestanding-eabihf \
    -mcpu cortex_m33+dsp+fp_armv8d16sp \
    --dep microzig \
    -Mapp=/home/ianic/Code/microzig/examples/raspberrypi/rp2xxx/src/cyw43.zig \
    --dep config \
    --dep drivers \
    --dep cpu \
    --dep chip \
    --dep hal \
    --dep board \
    --dep app \
    -Mmicrozig=/home/ianic/Code/microzig/core/src/microzig.zig \
    -Mconfig=.zig-cache/c/56f37e7b179445b95e470635223dfd8c/options.zig \
    -Mdrivers=/home/ianic/Code/microzig/drivers/framework.zig \
    --dep rtt \
    --dep microzig \
    -Mcpu=/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig \
    --dep microzig \
    -Mchip=.zig-cache/o/c287a30c377e2df95f52a611c231e087/chips/RP2350.zig \
    --dep bounded-array \
    --dep microzig \
    -Mhal=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal.zig \
    --dep microzig \
    -Mboard=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/boards/raspberry_pi_pico2.zig \
    -Mrtt=/home/ianic/Code/microzig/modules/rtt/src/rtt.zig \
    -Mbounded-array=/home/ianic/Code/microzig/modules/bounded-array/src/bounded_array.zig \
    --cache-dir .zig-cache \
    --global-cache-dir /home/ianic/.cache/zig \
    --name generate_root \
    --zig-lib-dir /home/ianic/.build/zig/zig-x86_64-linux-0.15.1/lib/

I expected that should be built for the host.
Removing .target = zig_resolved_target, at the line 556 seems to fix this.

Building with .use_llvm = true still fails.

Edit:
removing that line is not the fix trying to build app for host target fails when we reach file which has arm assembly, risc callconv or something target specific.

@mattnite
Copy link
Contributor

Great find, I think we were running into some issues for when we were mixing modules and targets, your change makes it more sane by making it so only the root module has a target set.

@ianic
Copy link
Author

ianic commented Dec 24, 2025

But now build fails because app can't be build for the host target.
For example when I add exported function to the blinky.zig example:

export fn sys_now() u32 {
    const ts = time.get_time_since_boot();
    return @truncate(ts.to_us() / 1000);
}

it fails with wrong callconv for the target

zig build -Dexample=blink
install
└─ install generated to pico2_riscv_blinky.elf
   └─ compile exe pico2_riscv_blinky Debug riscv32-freestanding-eabi
      └─ run exe generate_root (main.zig)
         └─ compile exe generate_root Debug native 1 errors
/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig:37:34: error: calling convention 'riscv32_interrupt' only available on architectures 'riscv32'
    riscv: *const fn () callconv(riscv_calling_convention) void,
                                 ^~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    InterruptHandler: /home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig:35:37
    InterruptOptions: /home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig:43:58
    20 reference(s) hidden; use '-freference-trace=22' to see all references
error: the following command failed with 1 compilation errors:
/home/ianic/.cache/zig/p/N-V-__8AAN5NhBR0oTsvnwjPdeNiiDLtEsfXRHd1fv-R3TOv/zig build-exe -ODebug --dep app -Mroot=/home/ianic/Code/microzig/core/src/generate_root.zig --dep microzig -Mapp=/home/ianic/Code/microzig/examples/raspberrypi/rp2xxx/src/blinky.zig --dep config --dep drivers --dep cpu --dep chip --dep hal --dep board --dep app -Mmicrozig=/home/ianic/Code/microzig/core/src/microzig.zig -Mconfig=.zig-cache/c/6b0844f2b1a728ab54a26f03ed960fcc/options.zig -ODebug -Mdrivers=/home/ianic/Code/microzig/drivers/framework.zig --dep riscv32-common --dep microzig -Mcpu=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig --dep microzig -Mchip=.zig-cache/o/195ff184b0c1a0e189b705b8b871db74/chips/RP2350.zig --dep bounded-array --dep microzig -Mhal=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal.zig --dep microzig -Mboard=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/boards/raspberry_pi_pico2.zig -Mriscv32-common=/home/ianic/Code/microzig/modules/riscv32-common/src/riscv32_common.zig -ODebug -Mbounded-array=/home/ianic/Code/microzig/modules/bounded-array/src/bounded_array.zig --cache-dir .zig-cache --global-cache-dir /home/ianic/.cache/zig --name generate_root --zig-lib-dir /home/ianic/.cache/zig/p/N-V-__8AAN5NhBR0oTsvnwjPdeNiiDLtEsfXRHd1fv-R3TOv/lib/ --listen=-
install
└─ install generated to pico2_riscv_flashless_blinky.uf2
   └─ run exe elf2uf2 (output.uf2)
      └─ compile exe pico2_riscv_flashless_blinky Debug riscv32-freestanding-eabi
         └─ run exe generate_root (main.zig)
            └─ compile exe generate_root Debug native 1 errors
/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig:37:34: error: calling convention 'riscv32_interrupt' only available on architectures 'riscv32'
    riscv: *const fn () callconv(riscv_calling_convention) void,
                                 ^~~~~~~~~~~~~~~~~~~~~~~~

If I understand correctly: it builds generate_root for the host target, generate_root depends on app, app can't be built for the host target.

@mattnite
Copy link
Contributor

What version of zig are you using? I didn't see any issues building rpi examples

@ianic
Copy link
Author

ianic commented Dec 25, 2025

zig 0.15.1

I'm also successfully compiling examples. But when I add exported function to the example then compile fails.

This blinky.zig fails to compile:

const std = @import("std");
const microzig = @import("microzig");
const rp2xxx = microzig.hal;
const time = rp2xxx.time;

const pin_config: rp2xxx.pins.GlobalConfiguration = .{
    .GPIO25 = .{
        .name = "led",
        .direction = .out,
    },
};

const pins = pin_config.pins();

pub fn main() !void {
    pin_config.apply();

    while (true) {
        pins.led.toggle();
        time.sleep_ms(250);
    }
}

export fn sys_now() u32 {
    const ts = time.get_time_since_boot();
    return @truncate(ts.to_us() / 1000);
}
microzig/examples/raspberrypi/rp2xxx ❯ zig build -Dexample=blink

install
└─ install generated to pico_flashless_blinky.uf2
   └─ run exe elf2uf2 (output.uf2)
      └─ compile exe pico_flashless_blinky Debug thumb-freestanding-eabi
         └─ run exe generate_root (main.zig)
            └─ compile exe generate_root Debug native 3 errors
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:152:9: error: invalid mnemonic: 'cpsid'
    pub fn disable_interrupts() void {
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:148:9: error: invalid mnemonic: 'cpsie'
    pub fn enable_interrupts() void {
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:140:9: error: invalid mnemonic: 'mrs'
    pub fn globally_enabled() bool {
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
error: the following command failed with 3 compilation errors:
/home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/zig build-exe -ODebug --dep app -Mroot=/home/ianic/Code/microzig/core/src/generate_root.zig --dep microzig -Mapp=/home/ianic/Code/microzig/examples/raspberrypi/rp2xxx/src/blinky.zig --dep config --dep drivers --dep cpu --dep chip --dep hal --dep board --dep app -Mmicrozig=/home/ianic/Code/microzig/core/src/microzig.zig -Mconfig=.zig-cache/c/e6c4197b08344097803d0d459f90e66c/options.zig -ODebug -Mdrivers=/home/ianic/Code/microzig/drivers/framework.zig --dep rtt --dep microzig -Mcpu=/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig --dep microzig -Mchip=.zig-cache/o/9d343f38ac137f9316feded030f55e84/chips/RP2040.zig --dep bounded-array --dep microzig -Mhal=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal.zig --dep bootloader --dep microzig -Mboard=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/boards/raspberry_pi_pico.zig -ODebug -Mrtt=/home/ianic/Code/microzig/modules/rtt/src/rtt.zig -ODebug -Mbounded-array=/home/ianic/Code/microzig/modules/bounded-array/src/bounded_array.zig -Mbootloader=.zig-cache/o/2720d8753bdaffa20c5d29c898980c03/w25q080.bin --cache-dir .zig-cache --global-cache-dir /home/ianic/.cache/zig --name generate_root --zig-lib-dir /home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/lib/ --listen=-
install
└─ install generated to pico_blinky.uf2
   └─ run exe elf2uf2 (output.uf2)
      └─ compile exe pico_blinky Debug thumb-freestanding-eabi
         └─ run exe generate_root (main.zig)
            └─ compile exe generate_root Debug native 3 errors
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:152:9: error: invalid mnemonic: 'cpsid'
    pub fn disable_interrupts() void {
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:148:9: error: invalid mnemonic: 'cpsie'
    pub fn enable_interrupts() void {
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:140:9: error: invalid mnemonic: 'mrs'
    pub fn globally_enabled() bool {
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
error: the following command failed with 3 compilation errors:
/home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/zig build-exe -ODebug --dep app -Mroot=/home/ianic/Code/microzig/core/src/generate_root.zig --dep microzig -Mapp=/home/ianic/Code/microzig/examples/raspberrypi/rp2xxx/src/blinky.zig --dep config --dep drivers --dep cpu --dep chip --dep hal --dep board --dep app -Mmicrozig=/home/ianic/Code/microzig/core/src/microzig.zig -Mconfig=.zig-cache/c/7575016d361e32c39b5caa904d36b9db/options.zig -ODebug -Mdrivers=/home/ianic/Code/microzig/drivers/framework.zig --dep rtt --dep microzig -Mcpu=/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig --dep microzig -Mchip=.zig-cache/o/9d343f38ac137f9316feded030f55e84/chips/RP2040.zig --dep bounded-array --dep microzig -Mhal=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal.zig --dep bootloader --dep microzig -Mboard=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/boards/raspberry_pi_pico.zig -ODebug -Mrtt=/home/ianic/Code/microzig/modules/rtt/src/rtt.zig -ODebug -Mbounded-array=/home/ianic/Code/microzig/modules/bounded-array/src/bounded_array.zig -Mbootloader=.zig-cache/o/2720d8753bdaffa20c5d29c898980c03/w25q080.bin --cache-dir .zig-cache --global-cache-dir /home/ianic/.cache/zig --name generate_root --zig-lib-dir /home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/lib/ --listen=-
install
└─ install generated to pico2_riscv_flashless_blinky.elf
   └─ compile exe pico2_riscv_flashless_blinky Debug riscv32-freestanding-eabi
      └─ run exe generate_root (main.zig)
         └─ compile exe generate_root Debug native 1 errors
/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig:37:34: error: calling convention 'riscv32_interrupt' only available on architectures 'riscv32'
    riscv: *const fn () callconv(riscv_calling_convention) void,
                                 ^~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    InterruptHandler: /home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig:35:37
    InterruptOptions: /home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig:43:58
    20 reference(s) hidden; use '-freference-trace=22' to see all references
error: the following command failed with 1 compilation errors:
/home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/zig build-exe -ODebug --dep app -Mroot=/home/ianic/Code/microzig/core/src/generate_root.zig --dep microzig -Mapp=/home/ianic/Code/microzig/examples/raspberrypi/rp2xxx/src/blinky.zig --dep config --dep drivers --dep cpu --dep chip --dep hal --dep board --dep app -Mmicrozig=/home/ianic/Code/microzig/core/src/microzig.zig -Mconfig=.zig-cache/c/3700faaf9bc3214304f637ce193f1f5e/options.zig -ODebug -Mdrivers=/home/ianic/Code/microzig/drivers/framework.zig --dep riscv32-common --dep microzig -Mcpu=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig --dep microzig -Mchip=.zig-cache/o/618fbfeaf3ad74ac5b6216a4202052cb/chips/RP2350.zig --dep bounded-array --dep microzig -Mhal=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal.zig --dep microzig -Mboard=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/boards/raspberry_pi_pico2.zig -Mriscv32-common=/home/ianic/Code/microzig/modules/riscv32-common/src/riscv32_common.zig -ODebug -Mbounded-array=/home/ianic/Code/microzig/modules/bounded-array/src/bounded_array.zig --cache-dir .zig-cache --global-cache-dir /home/ianic/.cache/zig --name generate_root --zig-lib-dir /home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/lib/ --listen=-
install
└─ install generated to pico2_riscv_blinky.elf
   └─ compile exe pico2_riscv_blinky Debug riscv32-freestanding-eabi
      └─ run exe generate_root (main.zig)
         └─ compile exe generate_root Debug native 1 errors
/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig:37:34: error: calling convention 'riscv32_interrupt' only available on architectures 'riscv32'
    riscv: *const fn () callconv(riscv_calling_convention) void,
                                 ^~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    InterruptHandler: /home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig:35:37
    InterruptOptions: /home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig:43:58
    20 reference(s) hidden; use '-freference-trace=22' to see all references
error: the following command failed with 1 compilation errors:
/home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/zig build-exe -ODebug --dep app -Mroot=/home/ianic/Code/microzig/core/src/generate_root.zig --dep microzig -Mapp=/home/ianic/Code/microzig/examples/raspberrypi/rp2xxx/src/blinky.zig --dep config --dep drivers --dep cpu --dep chip --dep hal --dep board --dep app -Mmicrozig=/home/ianic/Code/microzig/core/src/microzig.zig -Mconfig=.zig-cache/c/feca2abefd707535129c150aec15a09b/options.zig -ODebug -Mdrivers=/home/ianic/Code/microzig/drivers/framework.zig --dep riscv32-common --dep microzig -Mcpu=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/cpus/hazard3.zig --dep microzig -Mchip=.zig-cache/o/618fbfeaf3ad74ac5b6216a4202052cb/chips/RP2350.zig --dep bounded-array --dep microzig -Mhal=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal.zig --dep microzig -Mboard=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/boards/raspberry_pi_pico2.zig -Mriscv32-common=/home/ianic/Code/microzig/modules/riscv32-common/src/riscv32_common.zig -ODebug -Mbounded-array=/home/ianic/Code/microzig/modules/bounded-array/src/bounded_array.zig --cache-dir .zig-cache --global-cache-dir /home/ianic/.cache/zig --name generate_root --zig-lib-dir /home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/lib/ --listen=-
install
└─ install generated to pico2_arm_blinky.elf
   └─ compile exe pico2_arm_blinky Debug thumb-freestanding-eabihf
      └─ run exe generate_root (main.zig)
         └─ compile exe generate_root Debug native 1 errors
/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal/bootmeta.zig:46:5: error: Unimplemented: ExportOptions.section
    @export(&image_def_block, .{
    ^~~~~~~
error: the following command failed with 1 compilation errors:
/home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/zig build-exe -ODebug --dep app -Mroot=/home/ianic/Code/microzig/core/src/generate_root.zig --dep microzig -Mapp=/home/ianic/Code/microzig/examples/raspberrypi/rp2xxx/src/blinky.zig --dep config --dep drivers --dep cpu --dep chip --dep hal --dep board --dep app -Mmicrozig=/home/ianic/Code/microzig/core/src/microzig.zig -Mconfig=.zig-cache/c/bf79d601f9027bfca29cb33e0f2bc88f/options.zig -ODebug -Mdrivers=/home/ianic/Code/microzig/drivers/framework.zig --dep rtt --dep microzig -Mcpu=/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig --dep microzig -Mchip=.zig-cache/o/47f8ee93655841f876fe0ac0555ed732/chips/RP2350.zig --dep bounded-array --dep microzig -Mhal=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal.zig --dep microzig -Mboard=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/boards/raspberry_pi_pico2.zig -ODebug -Mrtt=/home/ianic/Code/microzig/modules/rtt/src/rtt.zig -ODebug -Mbounded-array=/home/ianic/Code/microzig/modules/bounded-array/src/bounded_array.zig --cache-dir .zig-cache --global-cache-dir /home/ianic/.cache/zig --name generate_root --zig-lib-dir /home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/lib/ --listen=-
install
└─ install generated to pico2_arm_flashless_blinky.elf
   └─ compile exe pico2_arm_flashless_blinky Debug thumb-freestanding-eabihf
      └─ run exe generate_root (main.zig)
         └─ compile exe generate_root Debug native 4 errors
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:715:40: error: expected type 'u32', found 'usize'
              [start_fn] "r" (@as(u32, @intFromPtr(&_start))),
                                       ^~~~~~~~~~~~~~~~~~~~
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:715:40: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values
referenced by:
    image_def_block: /home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal/bootmeta.zig:23:49
    comptime: /home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal/bootmeta.zig:46:14
    14 reference(s) hidden; use '-freference-trace=16' to see all references
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:737:39: error: no field named 'r0' in struct 'builtin.assembly.Clobbers__struct_4021'
                : .{ .memory = true, .r0 = true, .r1 = true });
                                      ^~
/home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/lib/std/builtin/assembly.zig:2:29: note: struct declared here
    .x86, .x86_64 => packed struct {
                     ~~~~~~~^~~~~~
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:909:13: error: invalid constraint: 's'
            fn invoke() callconv(.c) void {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig:909:13: error: invalid constraint: 's'
            fn invoke() callconv(.c) void {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the following command failed with 4 compilation errors:
/home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/zig build-exe -ODebug --dep app -Mroot=/home/ianic/Code/microzig/core/src/generate_root.zig --dep microzig -Mapp=/home/ianic/Code/microzig/examples/raspberrypi/rp2xxx/src/blinky.zig --dep config --dep drivers --dep cpu --dep chip --dep hal --dep board --dep app -Mmicrozig=/home/ianic/Code/microzig/core/src/microzig.zig -Mconfig=.zig-cache/c/bfaaf5d82b48db647017e2f748112c65/options.zig -ODebug -Mdrivers=/home/ianic/Code/microzig/drivers/framework.zig --dep rtt --dep microzig -Mcpu=/home/ianic/Code/microzig/core/src/cpus/cortex_m.zig --dep microzig -Mchip=.zig-cache/o/47f8ee93655841f876fe0ac0555ed732/chips/RP2350.zig --dep bounded-array --dep microzig -Mhal=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/hal.zig --dep microzig -Mboard=/home/ianic/Code/microzig/port/raspberrypi/rp2xxx/src/boards/raspberry_pi_pico2.zig -ODebug -Mrtt=/home/ianic/Code/microzig/modules/rtt/src/rtt.zig -ODebug -Mbounded-array=/home/ianic/Code/microzig/modules/bounded-array/src/bounded_array.zig --cache-dir .zig-cache --global-cache-dir /home/ianic/.cache/zig --name generate_root --zig-lib-dir /home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/lib/ --listen=-

Build Summary: 63/100 steps succeeded; 6 failed
install transitive failure
├─ install generated to pico_flashless_blinky.uf2 transitive failure
│  └─ run exe elf2uf2 (output.uf2) transitive failure
│     └─ compile exe pico_flashless_blinky Debug thumb-freestanding-eabi transitive failure
│        └─ run exe generate_root (main.zig) transitive failure
│           └─ compile exe generate_root Debug native 3 errors
├─ install generated to pico_flashless_blinky.elf transitive failure
│  └─ compile exe pico_flashless_blinky Debug thumb-freestanding-eabi (+5 more reused dependencies)
├─ install generated to pico2_arm_flashless_blinky.uf2 transitive failure
│  └─ run exe elf2uf2 (output.uf2) transitive failure
│     └─ compile exe pico2_arm_flashless_blinky Debug thumb-freestanding-eabihf transitive failure
│        └─ run exe generate_root (main.zig) transitive failure
│           └─ compile exe generate_root Debug native 4 errors
├─ install generated to pico2_arm_flashless_blinky.elf transitive failure
│  └─ compile exe pico2_arm_flashless_blinky Debug thumb-freestanding-eabihf (+4 more reused dependencies)
├─ install generated to pico2_riscv_flashless_blinky.uf2 transitive failure
│  └─ run exe elf2uf2 (output.uf2) transitive failure
│     └─ compile exe pico2_riscv_flashless_blinky Debug riscv32-freestanding-eabi transitive failure
│        └─ run exe generate_root (main.zig) transitive failure
│           └─ compile exe generate_root Debug native 1 errors
├─ install generated to pico2_riscv_flashless_blinky.elf transitive failure
│  └─ compile exe pico2_riscv_flashless_blinky Debug riscv32-freestanding-eabi (+4 more reused dependencies)
├─ install generated to pico_blinky.uf2 transitive failure
│  └─ run exe elf2uf2 (output.uf2) transitive failure
│     └─ compile exe pico_blinky Debug thumb-freestanding-eabi transitive failure
│        └─ run exe generate_root (main.zig) transitive failure
│           └─ compile exe generate_root Debug native 3 errors
├─ install generated to pico_blinky.elf transitive failure
│  └─ compile exe pico_blinky Debug thumb-freestanding-eabi (+5 more reused dependencies)
├─ install generated to pico2_arm_blinky.uf2 transitive failure
│  └─ run exe elf2uf2 (output.uf2) transitive failure
│     └─ compile exe pico2_arm_blinky Debug thumb-freestanding-eabihf transitive failure
│        └─ run exe generate_root (main.zig) transitive failure
│           └─ compile exe generate_root Debug native 1 errors
├─ install generated to pico2_arm_blinky.elf transitive failure
│  └─ compile exe pico2_arm_blinky Debug thumb-freestanding-eabihf (+4 more reused dependencies)
├─ install generated to pico2_riscv_blinky.uf2 transitive failure
│  └─ run exe elf2uf2 (output.uf2) transitive failure
│     └─ compile exe pico2_riscv_blinky Debug riscv32-freestanding-eabi transitive failure
│        └─ run exe generate_root (main.zig) transitive failure
│           └─ compile exe generate_root Debug native 1 errors
└─ install generated to pico2_riscv_blinky.elf transitive failure
   └─ compile exe pico2_riscv_blinky Debug riscv32-freestanding-eabi (+4 more reused dependencies)

error: the following build command failed with exit code 1:
.zig-cache/o/b69b767ec331fe48e217bbd8fc16364d/build /home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/zig /home/ianic/.cache/zig/p/N-V-__8AANeVhBSiRwesZrZKZ1hTkJd-goYzJWpN6kwXi-FJ/lib /home/ianic/Code/microzig/examples/raspberrypi/rp2xxx .zig-cache /home/ianic/.cache/zig --seed 0xd503e931 -Z5c6c2599fddcfeb1 -Dexample=blink

Is it working for you with those exported function also?
Sorry for bothering you so much if that is only my local problem.

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

Successfully merging this pull request may close these issues.

2 participants