What is the background of AWorks? What is AWorks?

This article guides reading

After more than ten years of continuous R&D, accumulation and improvement, Guangzhou Zhiyuan Electronics Co., Ltd. has launched a new AWorks platform, the IoT IoT ecosystem. And has been successfully applied to ZLG's oscilloscopes, power meters, power analyzers, voltage monitors, power quality analyzers, data recorders and industrial communications and other series of high-performance instruments and industrial IoT products. The birth of AWorks greatly reduces the developer's threshold and provides convenience for developers, enabling developers to ignore the underlying technical details, focus on the product's "core domain", and quickly develop competitive products. At the same time, AWorks provides developers with a highly abstract generic interface. The software based on the AWorks platform has nothing to do with the underlying hardware and can be used to cross-platform multiplexing (such as replacing MCUs, etc.).

What is the background of AWorks? What is AWorks? How to use AWorks? This article, as a brief introduction to AWorks, will answer these questions and give readers a preliminary understanding of AWorks.

1.1 Background of birth

Although the embedded system and the common computer system are homologous, due to the differences in the application fields and the R&D personnel, the embedded system has come to a relatively independent development path very early. General-purpose computer software has helped people solve a variety of complicated problems. With the increase in demand, the problems faced have become more and more complicated. Masters in the field of software have conducted in-depth research and practice on these issues, thus creating a scientific software project. Theory, needless to say, the development of general-purpose computer software is obvious to all of us.

Looking back at the development of embedded systems, the demand for them is relatively simple. For example, through the use of thermal resistance sensors for temperature measurement, upper and lower limit alarms, and relay actions, application development of embedded systems does not seem to require the use of sophisticated software. Engineering methods, so general computer systems and embedded systems embarked on a different path of development.

When the embedded system develops to today, the problems it faces are becoming more and more complex, and the programming model has not made much progress. This is the dilemma faced. I believe we all feel more or less that the environment of the embedded system industry has begun to fundamentally change. Smart hardware and industrial Internet are all unexpected, and a sense of crisis arises.

Although the company has invested heavily in the establishment of a huge development team, when the product development is completed, the gross profit is good from the perspective of raw material BOM and manufacturing cost. When the R&D investment and reasonable marketing costs are deducted, the profits of the company are running out. Even if employees still feel unsatisfied, this is the dilemma of traditional enterprise managers.

Although the ZLG has invested a lot of human resources, the losses caused by repeated labor are in the hundreds of millions. Thousands of MCUs, a large number of on-chip peripherals, and numerous peripheral devices operate in different ways. Due to the lack of platform-based technology, even if the same peripheral device, almost all of the corresponding code and documentation must be rewritten and tested, it is difficult for all application software to be perfectly reused.

When developing the same series of products of high, medium and low levels, such problems are often encountered. The main chip may use ARM9, dual-core A9, and DSP. Its operating systems are μC/OS-II, Linux, and SysBIOS. Not only is the driver code incompatible, but also the application layer code is different. As a result, maintaining just these different codes requires a lot of human resources. At the same time, it is difficult for developers to focus on the product itself and discover new innovations.

The threshold of traditional embedded development is very high, from hardware to software, from the bottom to the various protocol stacks, middleware, and applications, these are the skills that embedded development must master. For example, using a new MCU requires reading thousands of pages of data sheets; using the OS has to go deeper, understand the principles and port the underlying core code; the products need to be networked and have to learn rich communication technologies and IoT protocols (NB -IoT, Lora, Bluetooth, WIF, HTTP, MQTT, LWM2M, TLS...).

I believe that many developers have had the project begin with the lowest level of register operations, step by step to build the painful experience of the entire development platform. The project has invested a lot of manpower, material resources, and financial resources, but the results are often not ideal. This is because we are not experts in every aspect. It is impossible to do a good job on each side. The project will naturally pay a huge cost for this.

Everything is done, but nothing can be done well. This is the true portrayal of the current embedded development. At the same time, for a specific product, these technologies are only the basic "tools" of the product, not the "core domain," and the value of the product lies in the innovation of the product itself. Before developing products, developers need to spend a lot of time and energy to learn these new technologies and new knowledge, which not only seriously affect the development progress of the products, but also consume the original ideas and initial inspiration. These technical details have been defeated and have been exhausted. It is difficult to develop competitive products. In order to solve various pain points, after more than ten years of continuous research, development, accumulation and improvement, ZLG has launched the AWorks platform.

1.2 Overview

Figure 1.1 AWorks

Figure 1.1 shows the AWorks identifier. Conceptually speaking, AWorks is the IoT IoT ecosystem that ZLG has accumulated and developed over more than a decade. The purpose of the AWorks platform is to "software define everything", which allows the application to be completely separated from the specific hardware platform and achieve "one-time programming, lifetime use" and "cross-platform". AWorks provides a large number of high-quality, reusable components. Industry partners can directly develop applications on the platform, collect, manage, and process data through wired access and wireless access. Thus liberating programmers from the hardships of "developing and learning various protocols from the bottom layer registers", developers can return to the nature of products, focus on the application, and concentrate on the business logic of requirements, algorithms, and user experience. on. Specifically, AWorks can be understood from two aspects.

First, AWorks is a platform. It provides a generic mechanism that can organically integrate various software components to provide users with a large number of high-quality, high-value services. These components have been carefully designed and implemented, and great efforts have been made in terms of code size, efficiency, reliability, and ease of use.

Second, AWorks is cross-platform, where the platform refers to the implementation of the underlying hardware platform or specific software. AWorks standardizes the generic interfaces for various types of components. These generic interfaces are a highly abstract result of a certain type of functionality and are not related to a specific chip, peripheral, device, or implementation. For example, a set of file system interfaces are defined, interfaces and specific storage hardware, and the specific file system implementation methods (FAT, YaFFS, UFFS, etc.) are irrelevant. In other words, the implementation of storage hardware and file system can be replaced arbitrarily without affecting the universal interface. Based on this, as long as the application is developed based on these common interfaces. Then, the application can be used across platforms, and replacing the underlying hardware does not affect the application. In other words, no matter how the MCU changes, application software based on the AWorks platform can be reused.

Below, first briefly describe the basic features of AWorks, and then show the reader the architecture of AWorks.

1.2.1 Features

AWorks has the following features:

All internal components can be instantiated statically to avoid memory leaks and improve the system's determinism and real-time performance.

Deeply optimizes the component initialization process so that the system can be started in a very short time (usually less than 1s);

All components are pluggable, replaceable, configurable (can be done with a convenient graphical configuration tool)

Leading driver management framework: AWbus-lite, enabling maximum reuse of drivers;

Advanced power management module to minimize power consumption;

Provide common common components: file system, TCP/IP stack, USB stack, etc.

Main target areas: IoT Internet of Things, wireless access methods such as WiFi, Bluetooth, Zigbee, GPRS, and 3G, and key protocol stacks for Internet of Things such as 6LoWPAN, TLS, DTLS, CoAP, MQTT, and LWM2M. In terms of cloud access, support for cloud service platform application frameworks such as Gizwits, IBM, and Alibaba Cloud, will soon launch the ZLG self-developed cloud platform.

Contains tiny native kernels, unlimited number of tasks, up to 1024 priority, support for same-priority tasks, minimal operation in 1K RAM, 2K ROM, multi-tasking management, semaphores, mutexes, message queues, and more OS service;

In addition to native kernels, real-time operating systems such as ucCOS and FreeRTOS can also be used as AWorks kernels.

Provide adapters for third-party components to facilitate users to skip the migration phase and use third-party components directly, such as LWIP, FatFS, and SQLite.

Simply put, the AWorks platform provides standardized hardware expansion interfaces and hardware-independent standardized API function interfaces, providing a large number of high-quality components that are tailorable and configurable. Based on a large number of components in AWorks, developers do not need to care about the basic knowledge related to MCU and OS, as long as C language can develop the requirements into products.

To help users quickly build product prototypes, ZLG also provides a wealth of hardware modules for developers to choose from, such as i.MX28x backplane and series of core boards, M3352 backplane and series of core boards, M6748 backplane and series of core boards and a series of peripheral expansion accessories (Industrial IoT commonly used accessories such as sensor accessories, ZigBee accessories, WI-FI accessories, 3G accessories, etc.).

1.2.2 Architecture

The AWorks architecture diagram is shown in Figure 1.2.

Figure 1.2 Architecture of AWorks

You can simply think of AWorks as a three-tier structure: application layer, middle layer, and hardware layer.

1, the application layer

Contains user-written applications. Applications can be developed using C or C++. For some hardware platforms, AWorks also provides Python (MicroPython) support, users can directly use the Python language to develop applications.

2, the middle layer

The middle layer is the main part of AWorks. It contains a variety of components. In AWorks, all software can be regarded as components. The common ones are: driver software (for example, PCF85063 driver) and general-purpose tool software (for example, linked list , ring buffers), some large protocol stacks (for example, TCP/IP), etc.

Although AWorks integrates many components, it can be tailored. AWorks can even run on a small resource platform with only a few K of memory. Among them, AMetal is a special component that is located on the peripherals and peripheral devices. It is essentially a bare metal support package. It is responsible for dealing with the underlying hardware, completing register-level operations, encapsulating the underlying hardware functions, and completing basic functions. Abstraction provides a unified hardware operation interface for the upper layer of the system. In other words, AMetal handles the differences in the underlying hardware, allowing the upper layers of the system to focus on the use of hardware functions, eliminating the need to handle the differences between multiple devices and writing different drivers for each type of device.

With the exception of AMetal, all other components can be divided into 5 categories (black rectangles are used in the architecture diagram and the components are named in the upper left corner of the rectangle): Application Frameworks & Applications Libs), Base Facilities, Real-Time Kernel, Networking, and Device Management.

Application Framework & Library

(Application Frameworks & Libs)

The application framework directly serves the application program and mainly includes some large-scale system frameworks such as: GUI, script engine, database, Bootloader, and so on.

AWorks is compatible with Posix, enabling applications based on Posix interfaces to be seamlessly ported to the AWorks platform. For the convenience of users, AWorks also provides a series of algorithm libraries.

Here, I particularly explain a concept that is relatively unfamiliar to readers: "AWPI C++ Framework", which was also launched by Guangzhou Zhiyuan Electronics Co., Ltd. AWPI provides a set of C++ interfaces that are independent of the operating system and platform and can be used anywhere. Similar to the Posix interface, AWPI-based applications can be run on a system that is AWPI-compatible.

Currently, AWPI already supports AWorks, Windows, and Linux systems. As a result, C++ programmers who are accustomed to development on Windows or Linux can use AWPI to develop C++ applications. These applications can then be run in AWorks, which is an ecosystem that targets the IoT Internet of Things. In other words, C++ programmers can use C++ to develop IoT-related applications without having to understand the underlying embedded environment.

Basic services

AWorks provides a series of basic services, which are some efficient and fully functional components, including: file system, I/O system, shell service, encryption (security) service, power management (low power consumption), test framework, status Machine frames, event management frameworks, etc.

Real-time kernel

The real-time kernel can be seen as an OS kernel, providing OS basic services: time management, thread services, synchronization (mutual exclusion locks, semaphores, message mailboxes, etc.), atomic operations, data transfer, memory management, and so on.

Under normal circumstances, the OS kernel that AWorks uses by default is the light-weight RTOS independently developed by Guangzhou Zhiyuan Electronics Co., Ltd.: AWorks OS (RTK). But in fact, AWorks does not restrict the use of a particular operating system. The operating system, like the driver code, is just a component that can be replaced as needed.

In AWorks, to use an operating system, you only need to provide a corresponding adapter. The operating system adapter resides directly on the operating system interface, and is mainly used to shield the differences between various operating systems and hardware interfaces, thereby greatly enhancing the portability and maintainability of AWorks.

Currently, AWorks has provided adapters for common operating systems, such as SYSBIOS Adaptor, Windows Adaptor, and Linux Adaptor. To support the use of these operating systems in AWorks.

The internet

The network is a very important part of AWorks and it is also a prerequisite for the IoT ecosystem. Under the trend of the Internet of Everything, network-related technologies have also developed rapidly. AWorks is closely following the trend and supports many common protocols and the latest protocols. Based on the AWorks platform development, users do not need to further research network protocols and can directly use these protocols.

At present, AWorks supports common communication technologies, mainly including: ModBus protocol, CAN protocol (where CAN focuses on CAN protocol stack, CAN in device management focuses on CAN hardware communication interface), Cellular (cellular), WIFI, Ethernet, Lora WAN, NB-IoT, Bluetooth, zigbee, etc.

At the same time, AWorks has a TCP/IP protocol stack, supports IPv6, supports TLS (using TLS encrypted communication), and a large number of TCP/IP-based application protocols such as FTP, SMTP, HTTP, MQTT, CoAP, and LWM2M.

In particular, with the development of the Internet of Things, more and more devices need to access the “cloud”. AWorks has adapted to third-party clouds (mainly including Ali cloud, wit cloud, etc.), and applications based on AWorks can be easily Access to these "clouds", third-party cloud support can facilitate the user to migrate the previous program to the AWorks platform. In addition, the AWorks platform will also launch a self-developed cloud platform.

Equipment Management

Device management is used to manage a series of hardware devices. In embedded systems, there are many types of devices, such as GPIO, PWM, ADC, ADC, I2C, SPI, CAN, Serial, USB, PCIe, sensors, human-machine interface, and media. Equipment, storage devices, etc. Using a device management framework allows for "orderly" management of these devices.

3, the hardware layer

The hardware layer represents the current AWorks supported hardware devices. Mainly divided into two categories:

Supported CPU cores

Currently supported CPU cores include: Cortex-M0/3/4/7, Coterx-A7/8/9, ARM7/9, DSP, and other common cores.

Supported Peripherals & Peripherals

Peripherals mainly refer to MCU's on-chip peripherals, such as ADC, DAC, GPIO, UART, SPI, I2C, etc. Peripheral devices mainly refer to some IC chips. Common types include: various types of sensor chips, memory chips, and interface expansion chips ( For example, UART to two-way SPI), special chip (such as Ethernet PHY chip) and so on.

1.3 Release Form

Figure 1.3 SDK Release Form

AWorks is released as a software development kit (SDK). The SDK includes documents, tools, sample code, and template projects. See Figure 1.3 for details.

Detailed documentation is designed to help users quickly get started with AWorks. For example, the "Quick Start Guide" can help users quickly build a good development environment; the "User Manual" allows users to have a deeper understanding of the SDK, such as directory structure, platform resources (the number of ADC channels, the number of PWM channels, etc.), and Understand the definition and configuration of hardware platform related resources (such as LED0 corresponding I/O port).

The sample code shows the use of some components, such as multitasking, file system, timers, memory management, and so on. When users use a new component, they can refer to the sample code provided in the SDK to quickly understand how to use each interface. Template engineering is used for users to quickly create their own application projects. It is very easy to create new projects. Copy a template project and rename it.

AWorks is not open source. The internal core functional components are provided in the form of libraries. The relevant interfaces are derived from the header files. Users directly use the interfaces provided by the various components to develop applications and focus on application development without worrying about the underlying implementation. It should be noted that the AWorks SDK corresponds to a specific hardware development kit, and the SDK used by different hardware platforms is different. Guangzhou Zhiyuan Electronics Co., Ltd. has launched a series of embedded hardware development kits for secondary development by users and quickly build prototypes. For example, the EPC-AW280 chassis can be divided into 3 development kits with A280-W64F8AWI (WIFI core board), A280-Z64F8AWI (zigbee core board) and A280-M64F8AWI (wireless reader core board), as shown in Figure 1.4.

Figure 1.4 Baseboard and 3 Core Boards Can Form 3 Development Kits

In order to facilitate customer use, Guangzhou Zhiyuan Electronics Co., Ltd. provides the corresponding AWorks SDK for each set of hardware, that is, the SDK corresponds to the specific hardware development kit. Before using AWorks, you need to contact Guangzhou Zhiyuan Electronics Co., Ltd. to get the corresponding hardware SDK.

Different hardware corresponding to the SDK is different, it is not recommended mixed. Different SDKs deal with the difference of the underlying hardware separately, shielding the differences of the underlying hardware. For users, no matter what kind of hardware is used, the API used by the application is exactly the same, and because of this, the application will not Bundled with a hardware platform, cross-platform reuse can be easily implemented.

1.4 How to use

For users, after getting AWorks SDK, you can quickly develop applications based on AWorks. Before you can develop an application, you need to create a new project. In the AWorks SDK, you already have a template project. Simply copy the "New Project".

The template project is the template folder located in the projects_keil5\applications directory. The new project is to recopy the template folder and rename the copied folder to the application-specific name. For example, to write an LED flashing application, you can name it as: led_blinking. Then open the led_blinking folder and rename the project template.uvprojx to led_blinking.uvprojx. At this point, the project is completed. If the user has properly installed keil software, double-click the led_blinking.uvprojx project file to open the project. (For more detailed operation details, see the "Quick Start Guide" in the accompanying development materials, which contains detailed software installation procedures). After opening the project, you can add specific application code in the main.c file under the user_code grouping.

As an example, you can write a simple LED flash program, as shown in Listing 1.1.

List of procedures 1.1 LED flash sample program

After compiling and linking the program, the program firmware can be generated and can be downloaded to the development board for operation. Please refer to the “Quick Start Guide” in the SDK for the specific operation method.

In AWorks, the function's name starts with "aw_", where aw_led_toggle() is declared in the aw_led.h file to flip the LED; aw_mdelay() is declared in the aw_delay.h file to delay the specified time ( Unit: millisecond). The detailed use of these interfaces will be described in the subsequent related chapters. It is important to note that when writing applications on the AWorks platform, all source files should first include the aworks.h file.

Here, the initial experience of the LED and delay service API API, in fact, the use of any module or service are similar. First, include the corresponding header file for the module or service ("aw_xxx.h"); then, use the API provided in the header file. Subsequent chapters will introduce in detail some of the basic services provided by AWorks, such as commonly used devices (LEDs, buttons, digital tubes, etc.), commonly used peripherals (GPIO, PWM, SPI, etc.), time management, memory management, OS kernel, file system, etc. .

Watch & Apple Airtag Protector

TPU Watch Screen Protector, Transparent ​Watch Screen Protector, Watch Screen Protector Case, Apple Watch Case, Apple Watch Case Protector, Apple Watch Protective Case

Shenzhen Jianjiantong Technology Co., Ltd. , https://www.jjthydrogelprotector.com