/Developing IoT software using most advanced Arm hardware virtual model

Developing IoT software using most advanced Arm hardware virtual model

Note: The following post was originally posted at: https://blogs.oracle.com/startup/post/developing-iot-arm

In an increasingly connected world, technologies like Internet of Things (IoT), 5G, Machine learning (ML) and Artificial Intelligence (AI) are redefining the industry and the way we work and live.

Today, almost any device you can image (e.g. your watch, your fridge, your car, and even your cleaner) is connected to the network. The number of IoT devices is exponentially growing as new technologies, like 5G, are rolling out. The demands of managing the immense amount of data with minimal latency (and privacy) will make the edge of the network the new processing. To put this in context, Gartner estimates that by 2025, 75% of data will be processes outside of the traditional data center or cloud. This brings some challenges, from the ability to develop software at scale without the burdens of physical silicon’s, up to the automation of the end-to-end IoT software lifecycle.To help designers and developers, Oracle and Arm have collaborated on a preview of Arm Virtual Hardware (AVH) on Oracle Cloud Infrastructure (OCI). Using OCI Ampere A1, Oracle’s Arm-based compute instances and AVH, software developers can build and test applications without the need for physical hardware, enabling new solutions that fuels the Arm-based ecosystem.

How it works

Arm Virtual Hardware provides models of Arm-based processors, systems, third party hardware in the cloud. The AVH model now featured on OCI incorporates the ArmCortex-M55, Arm’s most AI-capable Cortex-M processor, and Arm Ethos-U55, a configurable and efficient microNPU. It runs as an application on OCI, including the simulation of memory and peripherals.

It is available on OCI Free Tier, where you can deploy up to 4 cores and 24GB RAM in a single virtual machine.

Figure 1 Arm Virtual Hardware
Arm Virtual Hardware

One of the things that makes Cortex-M55 processor unique is that it provides a unified software development flow. Developers can write traditional embedded code and mix it with DSP code as well as machine learning code. By adding the scalability of the cloud, embedded developers can now adopt more modern and agile development methodologies, like continuous integration – continuous delivery (CI/CD) and use MLOps to simplify the model evaluation and the system validation.

Let’s get started

Follow these steps to launch an Arm instance on Oracle Cloud Infrastructure by using the AVH community image:

Step 1. Deploy Arm Community Image

1. Log in to the Oracle Cloud Infrastructure Console.
2. From the navigation menu, select Compute tab, and then select Instances.

Compute > Instances
Compute > Instances

 

2. Choose a compartment in which you have permission to work.
3. Click Create Instance.

Compartment > Create Instance
Compartment > Create Instance

4. In the Create Instance dialog box, provide the following information:

  • Enter a name for the instance: AVH
  • Choose an availability domain: AD1
  • Change Image, and select Community Image from the Source Image menu.
  • Select the AVH image to use.
  • Change Shape . Select Virtual Machine as the shape type. Choose Ampere A1 instances: VM.Standard.A1.Flex. 
  • Select the number of CPU and memory. In our case 4 cores and 24GB RAM.
  • Click Select Shape
  • Choose a VCN.
  • Choose a subnet.
  • Select Public IP address.
  • Choose to upload or paste SSH keys (public keys).

5. Click Create Instance

Create compute instance

Networking

After the instance is launched, it appears in the Console.

6. Click the instance name to see the public IP address of the instance. The Image field on the right side shows that this instance is based on the AVH custom image.

AVH running on Ampere A1 instance
AVH running on Ampere A1 instance

Step 2. Connect to the AVH custom image instance

Connect to the new instance by using its public IP address. For example:

$ssh -i <private_SSH_Key> ubuntu@<public_IP_AVH_Instance>

AVH login

Step 3. Verify that AVH is installed on the new instance.

Confirm that Arm VHT, Arm Compiler and build utilities files are available in the /opt directory, reserved for the installation of external or third party application software packages. The CMSIS packs are installed at /home/ubuntu/packs.

Arm AHV files
Arm AVH files

Step 4. Test AVH is working.

We will run a program that analyzes an audio input with a voice recognition model implemented with TensorFlow Lite for Microcontrollers. The model will detect 2 keywords – yes and no and will print them into a serial interface with their time stamps in the audio stream. Additional info, like CPU stats will be provided.

For setup, please follow the instructions from GitHub.

Micro speech example with Tensorflow Lite
Micro speech example with Tensorflow Lite

1.    Clone the Arm Git repository using your github personal access token.

$git clone https://<github_user>:<github_token> @github.com/ARM-software/AVH-TFLmicrospeech

2.    Access the Corstone FVP folder and install the packlist that contains Arm drivers, the CMSIS build, and Tensorflow packages:

$ cd VHT-TFLmicrospeech/Platform_FVP_Corstone_SSE-300_Ethos-U55/
$ cp_install.sh packlist

3.    Compile with CMSIS-Build using microspeech.Example.cprj project.

$ cbuild.sh microspeech.Example.cprj

4.    Run the example. You will see it takes less than one minute and will exit:

$ ./run_example.sh

Fast Models [11.16.14 (Sep 29 2021)]
Copyright 2000-2021 ARM Limited.
All Rights Reserved.

telnetterminal0: Listening for serial connection on port 5000
telnetterminal1: Listening for serial connection on port 5001
telnetterminal2: Listening for serial connection on port 5002
telnetterminal5: Listening for serial connection on port 5003

    Ethos-U rev afc78a99 --- Aug 31 2021 22:36:26
(C) COPYRIGHT 2019-2021 Arm Limited
ALL RIGHTS RESERVED

WARNING: This run of FastModels is using a prototype translator that is for evaluation purposes only.
Heard yes (146) @1000ms
Heard no (145) @5600ms

Info: Simulation is stopping. Reason: Cycle limit has been exceeded.

Info: /OSCI/SystemC: Simulation stopped by user.
[warning ][main@0][01 ns] Simulation stopped by user

--- cpu_core statistics: ---------------------------------------------------
Simulated time                          : 7.680001s
User time                               : 53.521364s
System time                             : 0.003727s
Wall time                               : 53.523797s
Performance index                       : 0.14
cpu_core.cpu0                           :  14.35 MIPS (   768000000 Inst)
----------------------------------------------------------------------------

Conclusion

Combining OCI Ampere A1 compute instances with Arm Virtual Hardware, developers have the opportunity for rapid IoT device development, leveraging the level of innovation and diversity while still preserving and embracing software development.

If you want to learn more about OCI Ampere instances and AVH, sign up for an Oracle Cloud Infrastructure FREE tier account and start testing today. To find out more, please check the following resources: