Skip to content

Repository files navigation

cyw43439

Heapless driver for the Wifi+bluetooth integrated circuit on the pico.

Note for Automate Your Home Using Go book readers below!

Examples

To run the blinky example:

tinygo flash -target=pico -stack-size=8kb -scheduler=tasks -monitor  ./examples/blinky
To run Wifi examples you must first set your wifi credentials:
  1. Clone this repository

  2. Create ssid.text and password.text files in the examples/common directory. Write your SSID into ssid.text and WiFi password into password.text. Do not add final newlines to the files. If the password is empty then an open network is assumed.

  3. Run any of the examples in the examples directory

    Example of how to run the DHCP example:

    tinygo flash -target=pico -stack-size=8kb -scheduler=tasks -monitor  ./examples/dhcp

Developing/Debugging

Stringer install

stringer used for enum string representation generation. Automated via running go generate in repo root:

go install golang.org/x/tools/cmd/stringer@latest

Build Tags

Build tag Source Effect
debugheaplog lneto Enables verbose logging of networking stack with [ALLOC] tagged log lines on heap allocation detection.
noslog lneto Omits log/slog package calls within networking library. Useful to cut down on binary size and omit json and fmt package inclusion in resulting binary.
xnetdebug lneto Enables packet capture logging on all packets received and sent.
cy43nopio cyw43439 For setting user defined PIO. Useful for non RP2 targets or if not using TinyGo. See bus.go cmdBus.

Example:

tinygo flash -target=pico -stack-size=8kb -scheduler=tasks -monitor -tags=debugheaplog,xnetdebug  ./examples/dhcp

Go and TinyGo Ethernet/IP/TCP stack comparisons

stack comparison

Contributions

PRs welcome! Please read most recent developments on this issue before contributing.

Book notes

For Automate Your Home Using Go readers: Welcome! You will find the book examples still work but do note that you will be running a deprecated networking library called seqs. The new examples use lneto and have noticeably diverged from seqs style. The historical reasons for the drift is explained in a FOSDEM talk on youtube.

If you wish to return to the world of seqs and follow the examples in the book verbatim feel free to simply check out the commit right before lneto support was merged:

git checkout 0a1d121ea3

About

Baremetal, heapless driver for the Wifi+bluetooth integrated circuit on the pico.

Resources

Stars

223 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages