From dea2868a82ceec2d6103f615285db21c930ed77c Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Fri, 10 Nov 2017 12:25:45 +0200 Subject: [PATCH] samples: net: Update compilation instructions for cmake Update network sample documentation for cmake. Signed-off-by: Jukka Rissanen --- samples/net/coap_client/README.rst | 6 +---- samples/net/coap_server/README.rst | 14 ++-------- samples/net/dhcpv4_client/README.rst | 19 +++++++------- samples/net/dns_resolve/README.rst | 26 +++++++------------ samples/net/echo_client/README.rst | 22 +++++++++------- samples/net/echo_server/README.rst | 20 +++++++------- samples/net/http_server/README.rst | 15 ++++++++--- samples/net/lwm2m_client/README.rst | 20 +++++++------- samples/net/mbedtls_sslclient/README | 4 ++- samples/net/mqtt_publisher/README.rst | 8 +++--- samples/net/rpl-node/README.rst | 9 ++++--- .../net/sockets/dumb_http_server/README.rst | 10 +++---- samples/net/sockets/echo/README.rst | 10 +++---- samples/net/sockets/echo_async/README.rst | 10 +++---- samples/net/sockets/http_get/README.rst | 10 +++---- samples/net/telnet/README.rst | 18 +++++++------ 16 files changed, 112 insertions(+), 109 deletions(-) diff --git a/samples/net/coap_client/README.rst b/samples/net/coap_client/README.rst index 1fb26199302..413913c3a1f 100644 --- a/samples/net/coap_client/README.rst +++ b/samples/net/coap_client/README.rst @@ -27,11 +27,7 @@ be obtained by using a tool like tcpdump or wireshark. See the `net-tools`_ project for more details. -It can be built and executed on QEMU as follows: - -.. code-block:: console - - make run +It can be built and executed on QEMU as described in :ref:`networking_with_qemu`. Sample output ============= diff --git a/samples/net/coap_server/README.rst b/samples/net/coap_server/README.rst index 46fc3ebc7d1..94c01750a0f 100644 --- a/samples/net/coap_server/README.rst +++ b/samples/net/coap_server/README.rst @@ -38,12 +38,7 @@ or wireshark. See the `net-tools`_ project for more details -It can be built and executed on QEMU as follows: - -.. code-block:: console - - make run - +It can be built and executed on QEMU as described in :ref:`networking_with_qemu`. Use this command on the host to run the`libcoap`_ implementation of the ETSI test cases: @@ -53,12 +48,7 @@ the ETSI test cases: sudo ./examples/etsi_coaptest.sh -i tap0 2001:db8::1 To build the version supporting the TI CC2520 radio, use the supplied -configuration file enabling IEEE 802.15.4: - -.. code-block:: console - - make CONF_FILE=prj_cc2520.conf run - +prj_cc2520.conf configuration file enabling IEEE 802.15.4. .. _`net-tools`: https://github.com/zephyrproject-rtos/net-tools diff --git a/samples/net/dhcpv4_client/README.rst b/samples/net/dhcpv4_client/README.rst index 90f9d569045..1f15d5218d0 100644 --- a/samples/net/dhcpv4_client/README.rst +++ b/samples/net/dhcpv4_client/README.rst @@ -49,10 +49,11 @@ using this conf file: Run Zephyr samples/net/dhcpv4_client application in QEMU: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/dhcpv4_client - $ make pristine && make run +.. zephyr-app-commands:: + :zephyr-app: samples/net/dhcpv4_client + :board: qemu_x86 + :goals: run + :compact: Once DHCPv4 client address negotiation completed with server, details are shown like this: @@ -117,11 +118,11 @@ using this conf file: Build Zephyr samples/net/dhcpv4_client application: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/dhcpv4_client - $ make pristine && make BOARD=frdm_k64f - $ cp outdir/frdm_k64f/zephyr.bin /media/rveerama/MBED/ +.. zephyr-app-commands:: + :zephyr-app: samples/net/dhcpv4_client + :board: frdm_k64f + :goals: build flash + :compact: Once DHCPv4 client address negotiation completed with server, details are shown like this: diff --git a/samples/net/dns_resolve/README.rst b/samples/net/dns_resolve/README.rst index b16161ab6e2..9e8003d4f80 100644 --- a/samples/net/dns_resolve/README.rst +++ b/samples/net/dns_resolve/README.rst @@ -122,18 +122,11 @@ FRDM K64F Open a terminal window and type: -.. code-block:: console - - $ make BOARD=frdm_k64f - - -The FRDM K64F board is detected as a USB storage device. The board -must be mounted (i.e. to /mnt) to 'flash' the binary: - -.. code-block:: console - - $ cp outdir/frdm_k64f/zephyr.bin /mnt - +.. zephyr-app-commands:: + :zephyr-app: samples/net/dns_resolve + :board: frdm_k64f + :goals: build flash + :compact: See :ref:`Freedom-K64F board documentation ` for more information about this board. @@ -154,10 +147,11 @@ Arduino 101 Open a terminal window and type: -.. code-block:: console - - $ make BOARD=arduino_101 - +.. zephyr-app-commands:: + :zephyr-app: samples/net/dns_resolve + :board: arduino_101 + :goals: build + :compact: To load the binary in the development board follow the steps in :ref:`arduino_101`. diff --git a/samples/net/echo_client/README.rst b/samples/net/echo_client/README.rst index 0a972a4cda8..fccfe6917fc 100644 --- a/samples/net/echo_client/README.rst +++ b/samples/net/echo_client/README.rst @@ -61,13 +61,14 @@ echo-client directory: Build echo-client sample application like this: -.. code-block:: console +.. zephyr-app-commands:: + :zephyr-app: samples/net/echo_client + :board: + :conf: + :goals: build + :compact: - $ cd $ZEPHYR_BASE/samples/net/echo_client - $ make pristine && make CONF_FILE= \ - BOARD= - -Make can select the default configuration file based on the BOARD you've +Cmake can select the default configuration file based on the BOARD you've specified automatically so you might not always need to mention it. Running echo-server in Linux Host @@ -86,7 +87,8 @@ In a terminal window: Run echo-client application in QEMU: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/echo_client - $ make pristine && make run +.. zephyr-app-commands:: + :zephyr-app: samples/net/echo_client + :board: qemu_x86 + :goals: run + :compact: diff --git a/samples/net/echo_server/README.rst b/samples/net/echo_server/README.rst index 273000df275..22dba9da539 100644 --- a/samples/net/echo_server/README.rst +++ b/samples/net/echo_server/README.rst @@ -62,11 +62,12 @@ echo-server directory: Build echo-server sample application like this: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/echo_server - $ make pristine && make CONF_FILE= \ - BOARD= +.. zephyr-app-commands:: + :zephyr-app: samples/net/echo_server + :board: + :conf: + :goals: build + :compact: Make can select the default configuration file based on the BOARD you've specified automatically so you might not always need to mention it. @@ -81,10 +82,11 @@ To use QEMU for testing, follow the :ref:`networking_with_qemu` guide. Run echo-server application in QEMU: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/echo_server - $ make pristine && make run +.. zephyr-app-commands:: + :zephyr-app: samples/net/echo_server + :board: qemu_x86 + :goals: run + :compact: In a terminal window: diff --git a/samples/net/http_server/README.rst b/samples/net/http_server/README.rst index 627c5f17166..2f2c39924d7 100644 --- a/samples/net/http_server/README.rst +++ b/samples/net/http_server/README.rst @@ -60,9 +60,12 @@ code with a 404 Not Found HTML body. To build this sample on your Linux host computer, open a terminal window, locate the source code of this sample application and type: -.. code-block:: console +.. zephyr-app-commands:: + :zephyr-app: samples/net/http_server + :board: qemu_x86 + :goals: run + :compact: - make run Sample Output ============= @@ -175,9 +178,13 @@ The sample code also includes a HTTPS (HTTP over TLS) server example running side by side with the HTTP server, this server runs on QEMU. In order to compile and run the code execute: -.. code-block:: console +.. zephyr-app-commands:: + :zephyr-app: samples/net/http_server + :board: qemu_x86 + :conf: prj_tls.conf + :goals: run + :compact: - make CONF_FILE=prj_tls.conf run Known Issues and Limitations ============================ diff --git a/samples/net/lwm2m_client/README.rst b/samples/net/lwm2m_client/README.rst index 9a70d71aa26..c5796d9f618 100644 --- a/samples/net/lwm2m_client/README.rst +++ b/samples/net/lwm2m_client/README.rst @@ -39,11 +39,12 @@ samples/net/lwm2m_client directory: Build the lwm2m-client sample application like this: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/lwm2m_client - $ make pristine && make CONF_FILE= \ - BOARD= +.. zephyr-app-commands:: + :zephyr-app: samples/net/lwm2m_client + :board: + :conf: + :goals: build + :compact: The easiest way to setup this sample application is to build and run it via QEMU using the default configuration :file:`prj.conf`. @@ -61,10 +62,11 @@ can watch and manage connected LwM2M devices. Build the lwm2m-client sample application for QEMU like this: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/lwm2m_client - $ make pristine && make run +.. zephyr-app-commands:: + :zephyr-app: samples/net/lwm2m_client + :board: qemu_x86 + :goals: run + :compact: The sample will start and automatically connect to the Leshan Demo Server with both an IPv4 client endpoint (qemu_x86-ipv4-########) and an IPV6 client diff --git a/samples/net/mbedtls_sslclient/README b/samples/net/mbedtls_sslclient/README index decda56516c..dfb60de7b56 100644 --- a/samples/net/mbedtls_sslclient/README +++ b/samples/net/mbedtls_sslclient/README @@ -22,7 +22,9 @@ a) Change the server, netmask and client addresses according to your network b) From a terminal window, type: - make pristine && make BOARD=galileo + $ cd $ZEPHYR_BASE/samples/net/mbedtls_sslclient + $ mkdir qemu_build && cd qemu_build + $ cmake -DBOARD= -DCONF_FILE= .. c) Copy the binary (outdir/zephyr.strip) to the Galileo's boot device. Insert the boot device. diff --git a/samples/net/mqtt_publisher/README.rst b/samples/net/mqtt_publisher/README.rst index 30990a2eb2b..af9461bd2a8 100644 --- a/samples/net/mqtt_publisher/README.rst +++ b/samples/net/mqtt_publisher/README.rst @@ -96,9 +96,11 @@ following macros to specify those values: On your Linux host computer, open a terminal window, locate the source code of this sample application (i.e. :file:`samples/net/mqtt_publisher`) and type: -.. code-block:: console - - $ make BOARD=frdm_k64f +.. zephyr-app-commands:: + :zephyr-app: samples/net/mqtt_publisher + :board: frdm_k64f + :goals: build flash + :compact: Open another terminal window and type: diff --git a/samples/net/rpl-node/README.rst b/samples/net/rpl-node/README.rst index 27663824dcb..c37a15e6810 100644 --- a/samples/net/rpl-node/README.rst +++ b/samples/net/rpl-node/README.rst @@ -66,8 +66,11 @@ Running RPL node To build and run RPL node, follow the below steps to build and install it on IEEE 802.15.4 radio supported board. -.. code-block:: console - - $ make pristine and make flash +.. zephyr-app-commands:: + :zephyr-app: samples/net/rpl-node + :board: + :conf: + :goals: build flash + :compact: Wait until the RPL node joins with Border-Router and updates the list in the web UI. diff --git a/samples/net/sockets/dumb_http_server/README.rst b/samples/net/sockets/dumb_http_server/README.rst index cec2a53f1e6..06842737309 100644 --- a/samples/net/sockets/dumb_http_server/README.rst +++ b/samples/net/sockets/dumb_http_server/README.rst @@ -31,11 +31,11 @@ Building and Running Build the Zephyr version of the sockets/echo application like this: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/sockets/dumb_http_server - $ make pristine - $ make BOARD= +.. zephyr-app-commands:: + :zephyr-app: samples/net/sockets/dump_http_server + :board: + :goals: build + :compact: ``board_to_use`` defaults to ``qemu_x86``. In this case, you can run the application in QEMU using ``make run``. If you used another BOARD, you diff --git a/samples/net/sockets/echo/README.rst b/samples/net/sockets/echo/README.rst index 65f1a49a46a..1faf0ab9630 100644 --- a/samples/net/sockets/echo/README.rst +++ b/samples/net/sockets/echo/README.rst @@ -25,11 +25,11 @@ Building and Running Build the Zephyr version of the sockets/echo application like this: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/sockets/echo - $ make pristine - $ make BOARD= +.. zephyr-app-commands:: + :zephyr-app: samples/net/sockets/echo + :board: + :goals: build + :compact: ``board_to_use`` defaults to ``qemu_x86``. In this case, you can run the application in QEMU using ``make run``. If you used another BOARD, you diff --git a/samples/net/sockets/echo_async/README.rst b/samples/net/sockets/echo_async/README.rst index 703f05b9d31..9bfafff1871 100644 --- a/samples/net/sockets/echo_async/README.rst +++ b/samples/net/sockets/echo_async/README.rst @@ -27,11 +27,11 @@ Building and Running Build the Zephyr version of the sockets/echo_async application like this: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/sockets/echo_async - $ make pristine - $ make BOARD= +.. zephyr-app-commands:: + :zephyr-app: samples/net/sockets/echo_async + :board: + :goals: build + :compact: ``board_to_use`` defaults to ``qemu_x86``. In this case, you can run the application in QEMU using ``make run``. If you used another BOARD, you diff --git a/samples/net/sockets/http_get/README.rst b/samples/net/sockets/http_get/README.rst index ea3b54905d1..b2aac13d536 100644 --- a/samples/net/sockets/http_get/README.rst +++ b/samples/net/sockets/http_get/README.rst @@ -28,11 +28,11 @@ Building and Running Build the Zephyr version of the application like this: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/sockets/http_get - $ make pristine - $ make BOARD= +.. zephyr-app-commands:: + :zephyr-app: samples/net/sockets/http_get + :board: + :goals: build + :compact: ``board_to_use`` defaults to ``qemu_x86``. In this case, you can run the application in QEMU using ``make run``. If you used another BOARD, you diff --git a/samples/net/telnet/README.rst b/samples/net/telnet/README.rst index 1f379062c27..30943ab206d 100644 --- a/samples/net/telnet/README.rst +++ b/samples/net/telnet/README.rst @@ -31,10 +31,11 @@ To use QEMU for testing, follow the :ref:`networking_with_qemu` guide. Run Zephyr samples/net/telnet application in QEMU: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/telnet - $ make pristine && make run +.. zephyr-app-commands:: + :zephyr-app: samples/net/telnet + :board: qemu_x86 + :goals: run + :compact: Once started, you should see you IP address details for example: @@ -76,10 +77,11 @@ DHCP server on a local network is not in the scope of this README. Build Zephyr samples/net/telnet application: -.. code-block:: console - - $ cd $ZEPHYR_BASE/samples/net/dhcpv4_client - $ make pristine && make BOARD=frdm_k64f +.. zephyr-app-commands:: + :zephyr-app: samples/net/telnet + :board: frdm_k64f + :goals: build + :compact: Flash the resulting Zephyr binary following the :ref:`Freedom-K64F ` board documentation noted above.