This article is part of TechXchange: Chip Shortages and Counterfeits.
What you’ll learn:
- Access to development kits has been tremendously difficult during recent times, when supply-chain issues have wide impact.
- Why the lack of access severely hampers embedded software engineers in developing new products.
- How virtualization and remote monitoring can ensure that an implementation is thoroughly tested and already has the infrastructure to support fault monitoring and reporting.
- How Percepio's DevAlert Sandbox can be used to virtualize hardware and help engineers test their implementation without hardware, and add fault-monitoring and reporting capabilities.
One of the most difficult problems that Internet of Things (IoT) product companies face nowadays is hardware availability. Current supply-chain issues make production of existing products and development of new products problematic. For example, acquisition of electronic components, tablets, and new vehicles has made development difficult, if not impossible, for telematics solutions providers.
According to Gartner, any organization that relies on microchips and microprocessors are now constrained, whether it be in continuing operations or new product development. For instance, if we look at the availability of any model of the Raspberry Pi (at the time of this article’s writing) on Digi-Key, Figure 1 shows that the Pi is impossible to procure.
Similarly, if we check the availability of a Jetson Nano developer kit on Arrow, a common platform used by organizations developing AI/ML solutions, we can see that it essentially has an unknown lead time (Fig. 2).
It’s not only the lack of available microcontrollers and microprocessors that creates difficulties in product development. For embedded software engineers, supply-chain issues make it difficult to test their implementations.
Implementing Virtualization and Hardware Emulation
However, virtualization and hardware emulation are alternatives that can alleviate development issues. For example, QEMU is a popular platform that can be used to test and evaluate embedded software solutions without any custom hardware. It can run on any x86-based (i.e., Intel/AMD) development PC and emulate instructions from other architectures, such as Arm.
When the Linux community was introducing support for RISC-V in the kernel, the first task they undertook was to incorporate RISC-V support in QEMU. QEMU also has native support of popular microcontroller development boards.
Besides expediting development, virtualization enables companies to deliver solutions into the hands of their customers for initial testing. Rather than asking a potential customer to acquire the necessary hardware—in and of itself an almost impossible task, as we just discussed—and set up a dedicated test environment, an organization can package their solution with the necessary virtualization technologies to allow their customers to test drive an initial solution.
That saves both time and money for their customers and it can greatly speed up the feedback loop. Organizations that deliver edge/IoT-based solutions can quickly iterate based on the feedback received from their customers and improve the quality of their product offering.
DevAlert Sandbox
Percepio’s DevAlert Sandbox is an example of a complete solution that incorporates virtualization to emulate a non-trivial IoT elevator control application. It demonstrates detection and reporting of anomalous behavior to their cloud-based DevAlert service, along with detailed operating-system-level traces. The included application targets a STM32 F4 Discovery board.
Although DevAlert Sandbox primarily is a complete solution that demonstrates the capabilities of Percepio’s DevAlert offering, it also contains all of the necessary tooling to allow organizations to create their own FreeRTOS-based application with event monitoring.
Specifically, it contains the necessary scripts and services to listen for critical events that are being monitored and send them to the DevAlert cloud service. The virtual machine also incorporates QEMU (https://xpack.github.io/qemu-arm/) to emulate the STM32 F4 Discovery board, which can be used to emulate other microcontroller-based evaluation boards.
For instance, if we wanted to develop and “run” a simple application that monitors and reports when the button is pressed and illuminates an LED, we can do so with the DevAlert Sandbox. After compiling the FreeRTOS-based application, we can launch it in QEMU using the following invocation:
$> ~/.local/xPacks/@xpack-dev-tools/qemu-arm/7.0.0-1.1/.content/bin/qemu-system-gnuarmeclipse -board STM32F4-Discovery --image Debug/devalert-qemu-freertos-test.elf
After executing the above command, we would see the following UI in the Sandbox VM, and if we clicked on the blue pushbutton we would see the LED illuminate (Fig. 3).
In addition, if we log into the DevAlert backend (Fig. 4), we would be able to see that the events corresponding to these button presses have been registered.
Percepio’s DevAlert Sandbox is a representation of how virtualization and hardware-emulation technologies can be combined into a cohesive package, allowing organizations that provide edge/IoT offerings to continue developing their solutions without having to wait for hardware availability.
Furthermore, companies can quickly deliver these packages to their respective customers for initial testing and providing feedback, which would result in quicker iteration of their solution and a higher-quality product.
Read more articles in the TechXchange: Chip Shortages and Counterfeits.