Git Product home page Git Product logo

picosoc-uip's Introduction

PicoSoC uIP port

Introduction

A port of uIP 0.9 (a minimal TCP/IP stack and web server) to PicoSoC (a RISC-V SoC for the iCE40 HX8K breakout board based on the PicoRV32 CPU). It uses the Serial Line Internet Protocol (SLIP) to send IP packets over the serial port to the host computer.

Dependencies

Building and testing

Run git submodule update --init to clone a patched copy of PicoSoC. The changes are minimal: the size of the SRAM was bumped to 8 KiB and the frequency was bumped to 24 MHz.

Configure the jumpers on the breakout board for flash programming and then run make flash.

Run the following commands as root to create the SLIP interface:

slattach -L -p slip -s 57600 /dev/ttyUSB1 &
ip addr add 192.168.0.1 peer 192.168.0.2 dev sl0
ip link set mtu 1500 up dev sl0

The path to the serial port may vary depending on your system.

Pinging the board should then work:

$ ping -c 4 192.168.0.2
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=55.1 ms
64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=61.8 ms
64 bytes from 192.168.0.2: icmp_seq=3 ttl=64 time=52.1 ms
64 bytes from 192.168.0.2: icmp_seq=4 ttl=64 time=58.8 ms

--- 192.168.0.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 52.120/56.990/61.844/3.682 ms
$

as should fetching a page from the web server:

$ curl http://192.168.0.2
<html>
<head><title>uIP web server test page</title></head>

<frameset cols="*" rows="120,*" frameborder="no">
  <frame src="control.html">
  <frame src="about.html" name="main">
</frameset>

<noframes>
<body>
Your browser must support frames
</body>
</noframes>
</html>
$

If you're brave you can also try visiting http://192.168.0.2 in your web browser. This doesn't seem to work as well as curl - I think it's because modern web browsers send lots of headers.

After a few tries you should see the index page:

uIP index page

The "CGI" pages don't work. I'm not sure why - I suspect that the PicoSoC isn't fast enough to keep up, or perhaps there's a bug somewhere in uIP's web server (the C code is rather old and crufy!)

picosoc-uip's People

Contributors

grahamedgecombe avatar

Stargazers

Timothy avatar  avatar Rangel Ivanov avatar Mark Loomis avatar  avatar Matt avatar  avatar Tim 'mithro' Ansell avatar

Watchers

Tim 'mithro' Ansell avatar James Cloos avatar Juan Manuel Rico avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.