<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>RTOS | Academic OSS ELC</title><link>https://academic-oss-elc.netlify.app/tags/rtos/</link><atom:link href="https://academic-oss-elc.netlify.app/tags/rtos/index.xml" rel="self" type="application/rss+xml"/><description>RTOS</description><generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Wed, 01 Jul 2020 00:00:00 +0000</lastBuildDate><image><url>https://academic-oss-elc.netlify.app/images/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_512x512_fill_lanczos_center_2.png</url><title>RTOS</title><link>https://academic-oss-elc.netlify.app/tags/rtos/</link></image><item><title>Managing the Wind: Remote Management for Zephyr Devices With LwM2M</title><link>https://academic-oss-elc.netlify.app/talk/2020-oss-elc/managing-the-wind-remote-management-for-zephyr-devices-with-lwm2m-frederic-desbiens-eclipse-foundation/</link><pubDate>Wed, 01 Jul 2020 00:00:00 +0000</pubDate><guid>https://academic-oss-elc.netlify.app/talk/2020-oss-elc/managing-the-wind-remote-management-for-zephyr-devices-with-lwm2m-frederic-desbiens-eclipse-foundation/</guid><description>&lt;blockquote>
&lt;p>LightweightM2M (LwM2M) by OMA SpecWorks is a device management protocol designed for sensor networks and the demands of a machine-to-machine (M2M) environment. It is designed for the remote management of devices and is based on the Contrained Application Protocol (CoAP, RFC 7252), which itself provides an interaction model similar to the client/server model of HTTP.&lt;/p>
&lt;p>The Zephyr RTOS from the Linux Foundation possesses built-in support for LwM2M. In this presentation, you will discover how to leverage LwM2M to manage Zephyr-based devices. You will understand the pros and cons of using Zephyr&amp;rsquo;s built-in LwM2M client. You will also learn about various LwM2m servers, including the Eclipse Leshan open source project, which you can use to build your own LwM2M management server.&lt;/p>
&lt;/blockquote>
&lt;h2 id="lwm2m-features">LwM2M features&lt;/h2>
&lt;ul>
&lt;li>bootstrapping&lt;/li>
&lt;li>Device Configuration&lt;/li>
&lt;li>Firmware Update&lt;/li>
&lt;li>Fault management&lt;/li>
&lt;li>Configuration and Control&lt;/li>
&lt;li>Reporting&lt;/li>
&lt;/ul>
&lt;h2 id="lwm2m-in-the-zephyr-arch">LwM2M in the Zephyr Arch&lt;/h2>
&lt;ul>
&lt;li>IPSP
&lt;ul>
&lt;li>Bluetooth profile leveraging 6LoWPAN (IPv6 over BLE)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>LwM2M Client
&lt;ul>
&lt;li>Runs on QEMU&lt;/li>
&lt;li>Runs on actual board&lt;/li>
&lt;li>requires server&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h2 id="a-server-eclipse-leshan">A Server: Eclipse Leshan&lt;/h2>
&lt;ul>
&lt;li>Java library for implementing clients and servers&lt;/li>
&lt;li>Simple (no framework, few dpenecneies)&lt;/li>
&lt;li>Web UI for discovering&lt;/li>
&lt;li>build using &lt;code>mvn install&lt;/code>&lt;/li>
&lt;li>based on Eclipse Californium (an implementation of CoAP)&lt;/li>
&lt;/ul>
&lt;h2 id="lwm2m-sample">LwM2m sample&lt;/h2>
&lt;ul>
&lt;li>lwm2m is lightweight. &lt;code>net/lwm2m.h&lt;/code>.&lt;/li>
&lt;li>Includes&lt;/li>
&lt;li>main&lt;/li>
&lt;li>Setup&lt;/li>
&lt;li>Event processing&lt;/li>
&lt;/ul>
&lt;h2 id="demo">Demo&lt;/h2>
&lt;h3 id="deploy">Deploy&lt;/h3>
&lt;pre>&lt;code class="language-sh">west build -b nrf52_adafruit_feather samples/net/lwm2m_client -- - DCONF_FILE=&amp;quot;prj.conf overlay-bt.conf&amp;quot;
west flash --runner jlink
sudo minicom -D /dev/ttyUSB0 -b 115200
&lt;/code>&lt;/pre>
&lt;h3 id="6lowpan-and-assign-ipv6-address">6lowpan and assign IPv6 address&lt;/h3>
&lt;pre>&lt;code class="language-sh">sudo su
modprobe bluetooth_6lowpan
echo 1 &amp;gt; /sys/kernel/debug/bluetooth/6lowpan_enable
hcitool lescan
echo &amp;quot;connect C2:FA:8D:93:21:DD 2&amp;quot; &amp;gt; /sys/kernel/debug/bluetooth/6lowpan_control
ip address add 2001:db8::2/64 dev bt0
ping6 2001:db8::1
&lt;/code>&lt;/pre>
&lt;h3 id="getting-and-starting-leshan-demo-server">Getting and starting Leshan Demo Server&lt;/h3>
&lt;pre>&lt;code class="language-sh">wget
https://ci.eclipse.org/leshan/job/leshan/lastSuccessfulBuild/artifact/le
shan-server-demo.jar
java -Djava.net.preferIPv6Addresses=true
-jar leshan-server-demo.jar
&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>you can read, write and modify values&lt;/li>
&lt;li>Some are built into sample
&lt;ul>
&lt;li>temperature sensor&lt;/li>
&lt;li>lights&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul></description></item><item><title>Software Update (OTA) for Zephyr</title><link>https://academic-oss-elc.netlify.app/talk/2020-oss-elc/software-update-ota-for-zephyr-parthiban-nallathambi-linumiz/</link><pubDate>Wed, 01 Jul 2020 00:00:00 +0000</pubDate><guid>https://academic-oss-elc.netlify.app/talk/2020-oss-elc/software-update-ota-for-zephyr-parthiban-nallathambi-linumiz/</guid><description>&lt;blockquote>
&lt;p>Zephyr devices can be connected in two possible (direct and in-direct) ways to the internet. Directly using Modem/WiFi/Ethernet medium or in-directly via local radio through Gateways like Linux. Upgrading such Zephyr system in the field is a complex task and must be robust, secure.&lt;/p>
&lt;p>This talk will details various possible update solutions available like UpdateHub, Hawkbit, SWUpdate for Zephyr. Using a NXP FRDM-K64F board as an example, we will discuss and demo different possible ways for updating Zephyr system.&lt;/p>
&lt;/blockquote>
&lt;h2 id="agenda">Agenda&lt;/h2>
&lt;ul>
&lt;li>McuBoot&lt;/li>
&lt;li>Updatehub&lt;/li>
&lt;li>mcumgr&lt;/li>
&lt;li>ZUpdate&lt;/li>
&lt;li>ZUpdate -Hawkbit&lt;/li>
&lt;li>Future work&lt;/li>
&lt;/ul>
&lt;h3 id="linux-vs-zephyra">Linux vs Zephyra&lt;/h3>
&lt;ul>
&lt;li>
&lt;p>on linux it handles both download and install&lt;/p>
&lt;/li>
&lt;li>
&lt;p>for zephyr this is split into two&lt;/p>
&lt;ul>
&lt;li>download handled by application&lt;/li>
&lt;li>install is handled by MCUBoot&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>First we focus on download.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Then we look at install&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="mcuboot">MCUBoot&lt;/h2>
&lt;ul>
&lt;li>Bootloader for Zephyr and mynewt&lt;/li>
&lt;li>integrity and security check&lt;/li>
&lt;li>multi image boot support&lt;/li>
&lt;li>softwre update heavy lifting&lt;/li>
&lt;/ul>
&lt;p>MCUBoot Memory Layout&lt;/p>
&lt;ul>
&lt;li>NXP Freedom kit&lt;/li>
&lt;/ul>
&lt;pre>&lt;code class="language-javascript">chosen {
zephyr,code-partition = &amp;amp;slot0_partition;
};
&amp;amp;flash0 {
partitions {
compatible = &amp;quot;fixed-partitions&amp;quot;;
#address-cells = &amp;lt;1&amp;gt;;
#size-cells = &amp;lt;1&amp;gt;;
boot_partition: partition@0 {
label = &amp;quot;mcuboot&amp;quot;;
reg = &amp;lt;0x00000000 0x00010000&amp;gt;;
read-only;
};
slot0_partition: partition@20000 {
label = &amp;quot;image-0&amp;quot;;
reg = &amp;lt;0x00020000 0x00060000&amp;gt;;
};
slot1_partition: partition@80000 {
label = &amp;quot;image-1&amp;quot;;
reg = &amp;lt;0x00080000 0x00060000&amp;gt;;
};
scratch_partition: partition@e0000 {
label = &amp;quot;image-scratch&amp;quot;;
reg = &amp;lt;0x000e0000 0x00020000&amp;gt;;
};
};
};
&lt;/code>&lt;/pre>
&lt;p>Paritions&lt;/p>
&lt;ul>
&lt;li>Mcuboot&lt;/li>
&lt;li>slot0&lt;/li>
&lt;li>slot1&lt;/li>
&lt;li>scratch&lt;/li>
&lt;/ul>
&lt;p>MCUBoot operation&lt;/p>
&lt;ul>
&lt;li>conditions: Interrupt swap, request swap, valid image&lt;/li>
&lt;li>Video from Youtube&lt;/li>
&lt;/ul>
&lt;p>MCUBoot swap&lt;/p>
&lt;ul>
&lt;li>swap status
&lt;ul>
&lt;li>three stage operation&lt;/li>
&lt;li>slot1 to slot0&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;p>API&lt;/p>
&lt;ul>
&lt;li>image confirmed&lt;/li>
&lt;li>write image&lt;/li>
&lt;li>request upgrade&lt;/li>
&lt;li>erase&lt;/li>
&lt;/ul>
&lt;p>Live share&lt;/p>
&lt;pre>&lt;code class="language-sh">west flash -d ./frdm_mcuboot/
&lt;/code>&lt;/pre>
&lt;h2 id="software-update">Software Update&lt;/h2>
&lt;h3 id="updatehub">Updatehub&lt;/h3>
&lt;ul>
&lt;li>What is it?&lt;/li>
&lt;li>Polling Mode&lt;/li>
&lt;li>Manual mode&lt;/li>
&lt;li>Community vs Enterprise&lt;/li>
&lt;/ul>
&lt;p>Live Share&lt;/p>
&lt;pre>&lt;code class="language-sh">~/work/west/native/zephyr/samples/net/updatehub
west flash
~/work/west/native/zephyr/samples/net/updatehub
west flash -bin-file ./build/zephyr/zephyr-signed.bin
&lt;/code>&lt;/pre>
&lt;p>Web UI&lt;/p>
&lt;ul>
&lt;li>Overview&lt;/li>
&lt;li>Devices&lt;/li>
&lt;li>Pakcages&lt;/li>
&lt;li>Rollouts&lt;/li>
&lt;/ul>
&lt;p>Each rollout has&lt;/p>
&lt;ul>
&lt;li>UID, version, hardware&lt;/li>
&lt;/ul>
&lt;h3 id="mcumgr">MCUmgr&lt;/h3>
&lt;ul>
&lt;li>Management library for Zephyr and mynewt&lt;/li>
&lt;li>OS and hwardware agnostic&lt;/li>
&lt;/ul>
&lt;p>Layered modular design&lt;/p>
&lt;ul>
&lt;li>1: img_mgmt,fs_mgmt,log_mgmt,os_mgmt&lt;/li>
&lt;li>2: mgmt&lt;/li>
&lt;li>3: SMP&lt;/li>
&lt;li>4: BLuetooth, Shell, UDP&lt;/li>
&lt;/ul>
&lt;p>Reference Screenshots&lt;/p>
&lt;ul>
&lt;li>STM32 target initial slot list&lt;/li>
&lt;li>Uploading the OTA image via the Bluetooth interface&lt;/li>
&lt;li>STM32 target initial slot list after OTA push&lt;/li>
&lt;/ul>
&lt;h3 id="zupdate-architecture">ZUpdate architecture&lt;/h3>
&lt;ul>
&lt;li>Configuration Manager&lt;/li>
&lt;li>ZUpdate Core&lt;/li>
&lt;li>Download Handler
&lt;ul>
&lt;li>Hawkbit&lt;/li>
&lt;li>updatehub&lt;/li>
&lt;li>SWUpdate&lt;/li>
&lt;li>Custom&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>StorageHandler
&lt;ul>
&lt;li>SPI NOR&lt;/li>
&lt;li>FLash&lt;/li>
&lt;li>MMC&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Low-Level Comm
&lt;ul>
&lt;li>BLE&lt;/li>
&lt;li>WiFI&lt;/li>
&lt;li>LoRa&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul></description></item></channel></rss>