From 8e3fc793d3bcb66ef347685bd4d610e04806a59b Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 24 Jan 2023 11:07:08 +0200 Subject: [PATCH] samples: net: lwm2m_client: Use Ethernet in QEMU Cortex-M3 By default, qemu_coxtex_m3 target selected SLIP driver as a network backend. This requires some unstandard tool (tunslip6), which are error prone and might not necessary work. Ethernet backend work equally well as in native_posix so use the same for both. Change the default emulation platform from X86 to Cortex-M3 because it supports Ethernet by default. Signed-off-by: Seppo Takalo --- samples/net/lwm2m_client/README.rst | 6 +++--- .../net/lwm2m_client/boards/qemu_cortex_m3.conf | 4 ++++ samples/net/lwm2m_client/sample.yaml | 16 ++++++++++++---- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 samples/net/lwm2m_client/boards/qemu_cortex_m3.conf diff --git a/samples/net/lwm2m_client/README.rst b/samples/net/lwm2m_client/README.rst index bf5e8b4dff3..6299c097cf6 100644 --- a/samples/net/lwm2m_client/README.rst +++ b/samples/net/lwm2m_client/README.rst @@ -24,7 +24,7 @@ The source code for this sample application can be found at: Requirements ************ -- :ref:`networking_with_qemu` +- :ref:`networking_with_eth_qemu`, :ref:`networking_with_qemu` or :ref:`networking_with_native_posix` - Linux machine - Leshan Demo Server (https://eclipse.org/leshan/) @@ -62,8 +62,8 @@ Build the lwm2m-client sample application like this: :compact: The easiest way to setup this sample application is to build and run it -via QEMU using the default configuration :file:`prj.conf`. -This requires a small amount of setup described in :ref:`networking_with_qemu`. +as native POSIX application or as a QEMU target using the default configuration :file:`prj.conf`. +This requires a small amount of setup described in :ref:`networking_with_eth_qemu`, :ref:`networking_with_qemu` and :ref:`networking_with_native_posix`. Download and run the latest build of the Leshan Demo Server: diff --git a/samples/net/lwm2m_client/boards/qemu_cortex_m3.conf b/samples/net/lwm2m_client/boards/qemu_cortex_m3.conf new file mode 100644 index 00000000000..dc256b47832 --- /dev/null +++ b/samples/net/lwm2m_client/boards/qemu_cortex_m3.conf @@ -0,0 +1,4 @@ +CONFIG_NET_L2_ETHERNET=y +CONFIG_ETH_DRIVER=y +CONFIG_ETH_STELLARIS=y +CONFIG_NET_QEMU_ETHERNET=y diff --git a/samples/net/lwm2m_client/sample.yaml b/samples/net/lwm2m_client/sample.yaml index 80ea283de7a..70620ccc93a 100644 --- a/samples/net/lwm2m_client/sample.yaml +++ b/samples/net/lwm2m_client/sample.yaml @@ -5,16 +5,20 @@ tests: sample.net.lwm2m_client: harness: net depends_on: netif - platform_allow: qemu_x86 frdm_k64f pinnacle_100_dvk mg100 + platform_allow: qemu_cortex_m3 qemu_x86 native_posix frdm_k64f pinnacle_100_dvk mg100 integration_platforms: - qemu_x86 + - qemu_cortex_m3 + - native_posix tags: net lwm2m sample.net.lwm2m_client.all_objects: harness: net depends_on: netif - platform_allow: qemu_x86 + platform_allow: qemu_cortex_m3 qemu_x86 native_posix integration_platforms: - qemu_x86 + - qemu_cortex_m3 + - native_posix tags: net lwm2m extra_configs: - CONFIG_LWM2M_CONN_MON_OBJ_SUPPORT=y @@ -30,9 +34,11 @@ tests: harness: net depends_on: netif extra_args: OVERLAY_CONFIG=overlay-dtls.conf - platform_allow: qemu_x86 frdm_k64f pinnacle_100_dvk mg100 + platform_allow: qemu_cortex_m3 qemu_x86 native_posix frdm_k64f pinnacle_100_dvk mg100 integration_platforms: - qemu_x86 + - qemu_cortex_m3 + - native_posix tags: net lwm2m sample.net.lwm2m_client.bt: harness: net @@ -45,9 +51,11 @@ tests: harness: net depends_on: netif extra_args: OVERLAY_CONFIG=overlay-queue.conf - platform_allow: qemu_x86 + platform_allow: qemu_cortex_m3 qemu_x86 native_posix integration_platforms: - qemu_x86 + - qemu_cortex_m3 + - native_posix tags: net lwm2m sample.net.lwm2m_client.wnc_m14a2a: harness: net