-
Notifications
You must be signed in to change notification settings - Fork 160
pi pico 2w cyw43 wifi and lwip integration #780
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
base: main
Are you sure you want to change the base?
Conversation
Use existing cyw43 driver to blink led on the rpi pico 2w.
Extremly dirty proof of concept. Will be cleaned up, just to store something working. References: https://download.kamami.pl/p1180672-Infineon-CYW43439.pdf https://iosoft.blog/2022/12/06/picowi_part3/ https://github.com/embassy-rs/embassy/blob/main/cyw43-pio/src/lib.rs#L253
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.
Just appears on the network Reference: https://github.com/jbentham/picowi/blob/bb33b1e7a15a685f06dda6764b79e429ce9b325e/lib/picowi_join.c#L46
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
No need to pbuf_free after passing it to the netif.input, pbuf ownership is transferred. But needed in other cases like udp_sendto.
Switch to zero copy in cyw43 driver
into separate file, keep lwip.zig chip independednt
removes led_pin variable from cyw43 chip
Replaced by lwip now
|
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 |
|
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: in any example (can be blinky.zig) it fails with: |
|
@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 |
|
Thanks, |
|
@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 },
},
}),
});
|
|
What I find strange is that building generate_root is using I expected that should be built for the host. Building with Edit: |
|
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. |
|
But now build fails because app can't be build for the host target. it fails with wrong callconv for the target 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. |
|
What version of zig are you using? I didn't see any issues building rpi examples |
|
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=blinkIs it working for you with those exported function also? |
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:
Example depends on secrets.zig which is not in the repo and should have content like:
Receiver ip is currently hard coded so it needs to be updated in the code.
To receive udp packets on the host:
Besides lwip and foundationlibc includes there are also few configuration files: