|
| 1 | +==== |
| 2 | +SLIP |
| 3 | +==== |
| 4 | + |
| 5 | +SLIP Configuration |
| 6 | +================== |
| 7 | + |
| 8 | +#. Configure and build NuttX with SLIP enabled in the configuration. Load this |
| 9 | + into FLASH and start the device. |
| 10 | + |
| 11 | +#. Connect to a Linux box using a serial cable. This dicussion assumes that the |
| 12 | + serial device is ``/dev/ttyS0`` on both the target and the Linux box. |
| 13 | + |
| 14 | +#. Reset on the target side and attach SLIP on the Linux side: |
| 15 | + |
| 16 | + .. code-block:: bash |
| 17 | +
|
| 18 | + $ modprobe slip |
| 19 | + $ slattach -L -p slip -s 57600 /dev/ttyS0 & |
| 20 | +
|
| 21 | + This should create an interface with a name like sl0, or sl1, etc. Add -d to |
| 22 | + get debug output. This will show the interface name. |
| 23 | + |
| 24 | + NOTE: The -L option is included to suppress use of hardware flow control. |
| 25 | + This is necessary only if you are not supporting hardware flow control on |
| 26 | + the target. |
| 27 | + |
| 28 | + NOTE: The Linux slip module hard-codes its MTU size to 296. So you might |
| 29 | + as well set ``CONFIG_NET_ETH_MTU`` to 296 as well. |
| 30 | + |
| 31 | +#. After turning over the line to the SLIP driver, you must configure the |
| 32 | + network interface. Again, you do this using the standard ifconfig and |
| 33 | + route commands. Assume that we have connected to a host PC with address |
| 34 | + 192.168.0.101 from your target with address 10.0.0.2. On the Linux PC |
| 35 | + you would execute the following as root (assuming the SLIP is attached |
| 36 | + to device sl0): |
| 37 | + |
| 38 | + .. code-block:: bash |
| 39 | +
|
| 40 | + $ ifconfig sl0 10.0.0.1 pointopoint 10.0.0.2 up |
| 41 | + $ route add 10.0.0.2 dev sl0 |
| 42 | +
|
| 43 | +#. For monitoring/debugging traffic: |
| 44 | + |
| 45 | + .. code-block:: bash |
| 46 | +
|
| 47 | + $ tcpdump -n -nn -i sl0 -x -X -s 1500 |
| 48 | +
|
| 49 | + NOTE: If hardware handshake is not available, then you might try the |
| 50 | + slattach option-L which is supposed to enable "3-wire operation." |
0 commit comments