Just in case anyone is interested, I have a working IP stack, which I call "zeptoIP" as it runs on zeptoforth, implemented in Forth for the Raspberry Pi Pico W. It makes use of the CYW43439 WiFi chip on the board. Aside from a the CYW43439 firmware anda tiny bit of code written in assembly (namely byte order-switching operations) it is written entirely in Forth (even if it uses an OO layer which, despite being written in Forth itself, may not be all too Forthy, and even though it severely abuses local
Note that for legal reasons (i.e. non-free code) it is up to the user to upload the firmware, which is distributed separately from zeptoforth, for the CYW43439 to their Pico W and then load the CYW43439 driver (note that it is not derivative of DamienGeorge's non-free CYW43439 driver) and zeptoIP on top of it.
In case you are wondering, it does not follow the typical BSD socket model from an API standpoint. Rather one receives pending "endpoints", for lack of a better term (I do not call them "connections" because they also include listening for UDP packets),with state or data changes, processes it (whether immediately or by storing the data into buffers for later handling), and then declares the endpoints "done". There is no need to copy the data into a separate buffer, whereas using a BSD socket model
Currently the code is in a beta state, so it is not in the master branch of zeptoforth but rather in the devel branch. You can find a guide to the installation and use of zeptoIP at:Hi Travis,
https://github.com/tabemann/zeptoforth/blob/devel/BUILDING_AND_USING_ZEPTOIP.md
Also, for some example programs, you can find a very rudimentary HTTP server using zeptoIP at:
https://github.com/tabemann/zeptoforth/blob/devel/test/rp2040/pico_w_net_http_led.fs
and a (warning - very insecure) TCP console server using zeptoIP at:
https://github.com/tabemann/zeptoforth/blob/devel/test/rp2040/pico_w_net_repl_notify.fs
Warning - there appear to be a few glitches in it - connections do not seem to always be correctly closed, for whatever reason.
Hope you find this useful or interesting,
Travis
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 475 |
Nodes: | 16 (2 / 14) |
Uptime: | 19:02:58 |
Calls: | 9,487 |
Calls today: | 6 |
Files: | 13,617 |
Messages: | 6,121,093 |