Embedded System reuse Software Design Based on Component Technology

Source: Internet
Author: User

Introduction

For the embedded software component platform, its support platform is first an embedded real-time multi-task operating system, and secondly provides development tools and an integrated environment for the design of the entire software component. In the design process of the supporting platform, the whole embedded real-time multi-task operating system can be designed into a system-level Software Component Library. This not only achieves the scalability of embedded operating systems, but also because the design from embedded operating systems to applications is based on discrete software components, therefore, it facilitates the integration and debugging of embedded control application software. To facilitate the management of software components, system-level and application-level software component libraries can be integrated into a fully functional software component library. It includes all the software components required from the system layer, support layer, and application layer of the embedded control system, thus providing functional integrity.

1 architecture of embedded software component platform

The architecture 1 of the embedded software component platform consists of three parts: system layer, connection layer (support layer), and application layer. The system layer belongs to the field engineering category. It analyzes, abstracts, and refines the embedded control system using the analysis method of the field engineering, and breaks down it into the corresponding System and Application functional modules. The connection layer is an embedded software component platform that enables seamless connection between the system layer and the application layer. It provides an integrated development platform for software components. The Application Layer belongs to the scope of application engineering. You can select the required software components from the software component library based on the actual control requirements and objectives of the embedded control system, after integration, a real embedded control application is generated.

2 design of embedded software component platform

The software component platform is a componentized embedded real-time multi-task operating system based on the DSP chip. The design concept described in the platform architecture is fully utilized during the design, and the program readability and cropping are very good. It has the following features:

① Two data structures are designed: the operating system and the system. In order to facilitate the design of the Support Platform and the centralized management of system resources, the operating system data structure is designed. The data structure is exclusive to the platform designer and the user has no permission to access the data structure. In addition, in order to facilitate interaction between user programs and operating systems and access and application for system resources, the system data structure is designed. This data structure is visible to users and is the only way for applications to access the operating system.

② A minimum system is configured. Its main function is to confirm the command after receiving the startup command and determine the startup mode. Then, the CPU registers and some peripheral registers of the microprocessor are initialized according to the startup mode, and assign values to the data structures of the operating system and the system. However, it cannot implement any control function. After initialization, it is in the system scanning status.

③ The number of tasks designed by the system is smaller than or equal to 16 (that is, a word long). This makes the scheduling algorithm of the task relatively simple and fully able to meet the requirements of embedded real-time control system applications. Each task specifies a unique priority. The task priority is the same as the task ID. The higher the priority, the lower the priority ID of a task. The priority ID range for tasks is 0 ~ 15. The system retains the highest and lowest priority tasks. The semaphores (Scalable) method is used for communication and system synchronization. Two software components, P operation and V operation, are designed for communication and synchronization management of the system, two software components, task creation and task start, are designed to provide system management for task creation and end.

④ Software components such as task scheduling, task switching, task locking, and virtual messages are designed to control and manage multiple tasks. To facilitate system task switching, two types of stacks, system stack and task stack, are designed for the entire support platform system.

2.1 Component Interface Software Design

Because the component assembly is a language-configured software component integration method, the interface definition is similar to the configuration entry parameter sequence. It mainly contains the software component identification information, software component registration information, and software component configuration information. Identify the software component currently used, and provide the entry point (virtual address pointer) of the software component ); the registration information includes the system services and system resources that the software component applies to the operating system. After obtaining the registration information, the operating system provides the corresponding system services for the software component and allocates the required system resources; configuration information includes the parameter information required by the Software Component in different system states, which can be given in the data or address status. Interface Software is mainly used to complete the interaction between the application and the support platform. It serves as a system interface, facilitating users' access to the support platform. It includes WatchErr () for error observation, SysCom-pReg for parameter registration, GetAddN for integer x GetAddN (), GetAddF for floating point X GetAddF (), GetAddS for struct x GetAddS () sys_GetBit (), storage switch Sys_BitGetvalue (), floating point upper/lower limit Sys_Fmaxmin (), integer upper/lower limit Sys_Nmaxmin (), and other functions.

2.2 Design of System Configuration Software Components

This type of component can only be used once during system software integration. It mainly configures system resources and enables some system functions, including system start, system end, expansion, and memory expansion.

2.2.1 design system start component

An embedded control application must contain only one system start component, which is located at the end of the software component configuration integration sequence. At the beginning of the system cyclic scan, the component is first entered. The function of this component is to configure system parameters and program spaces based on the system status of the system. Its interface is defined as follows:

Interface Description: The component number is the unique identifier and entry point of the component (Virtual program address pointer of the component entry). The startup selection method is mainly used to set the system startup mode; the default communication mode is to select a default communication mode from can, mortana, and industrial Ethernet. The external high-speed and low-speed clock frequencies are used to set the clock frequencies required for high-speed and low-speed peripherals, the initial configuration of the minimum system can be modified. The system password ensures the security of the system and does not allow you to modify the configuration integration format at will. The system model and assembly date provide some text information about system software integration. Designers can freely configure component configuration integration based on system design requirements.

2.2.2 design extension Components

During system design, the maximum number of original components is less than or equal to 511 in the System Configuration form. Therefore, when the number of system components exceeds the number of original components, system components must be extended by extension components. The interfaces of extended components are defined as follows:

Interface Description: to facilitate the expansion of components, this interface is designed to be more flexible. It only specifies the address of the extended component, and the number of extended components ends the configuration interface parameter settings by the end ID 0 of the configuration integration.

2.2.3 Design of extended memory components

In the design of the support platform, according to the needs of embedded control applications, the entire system memory space is divided into four blocks, each with a fixed length and use domain. When the application needs more memory than the designed range, you can use the extended memory component to expand the memory. Its interface is defined as follows:

2.2.4 Design System end component

The system end component is fixed at the front end of the software configuration integration sequence, that is, the configuration integration number is 0. After the system software component configuration is integrated, it is enabled when the system is about to run, that is, at the end of the system loop. It works in the system working status and returns the starting address of the software configuration integration sequence. When the system initialization status is complete, the calibration data and general data are obtained and saved, and the system functions such as starting the system clock and watchdog, and returning the starting address of the configuration sequence are executed. The interface parameter has only one component ID 0 that identifies the component.

2.3 design of system task Software Components

Task creation component Task: Before a multi-Task operating system runs, the system must create at least one Task, which is generally an idle Task. Other tasks can be created during the running process. However, in the design of this support platform, given that the number of tasks of an actual embedded control application can be determined in advance, the task creation component is designed, you can use this component to create the required tasks in the software integration process of the application. The configuration integration interface of this component is defined as follows:

Design Description: This component is used every time a task is defined. The task number is an external pointer, which is visible to the user and contains information such as the virtual program address pointer and task priority. The system allocates stack space for each task, the requirements for system resources may vary. To save the memory space of the entire system, you can directly specify the size of the task stack from the configuration integration interface. to track the running time and task timing of a task, the time unit and time length parameters are designed in the interface to calculate the running time of the task and count it regularly. In addition, to facilitate task switching, two types of stacks are designed for the entire support platform: System stack and task stack. Therefore, when creating a task, initialize the task stack of each task based on the system status.

2.4 Design of Communication and synchronization Management Software Components

There are two ways to communicate between tasks: By using full-process variables or sending messages to another task. When using the full-process variable, you must ensure that each task or interrupted service program excludes this variable. The only way to ensure exclusive service interruption is to disconnect the service. If the two tasks share a variable, the way for each task to exclusive to the variable can be to disconnect and interrupt again, or use a semaphore. In the design of the support platform, semaphores are used for system communication and synchronization management, including P operation PSema and V Operation VSema.

The P operation software component provides the following functions: complete registry filling in the system registration status, apply for required system resources from the system, and complete semaphore Data Structure initialization in the system parameter initialization status; in the system working status, if the semaphores are greater than zero (that is, the semaphores are available), the semaphores are reduced by 1. Otherwise, the semaphores are unavailable, and task suspension operations and task switching are performed. Its interface is defined as follows:

Interface Description: The semaphore address is an external pointer. As you can see, it is the entry point of the semaphore data structure. If the initial semaphore value is set to 1, it indicates task communication. If it is set to 0, it indicates task synchronization.

The V operation software component only works in the system working state, and shares a data structure with the P operation software component. It first reduces the semaphores by 1 and then determines whether the semaphores are greater than zero. If the value is greater than zero, public resources are available, the given task is ready, and the task is scheduled and switched. The interface is as follows:

Due to the component-based design, the system communication and synchronization modes can be freely expanded. For example, you can add the mailbox or Message Queue component on the support platform. The communication and synchronization modes are mainly determined based on the system design requirements.

3. Integrated Development Environment

The research team adopted the micro-message bus MMB embedded system integrated development environment (mmbide) application programming language to introduce the iec611 31-3 standard, structured statement (structured text) describes the programming language used as the programming language for embedded system application software. This mainly takes into account the application of MMB embedded systems in the field of industrial control, requiring itself to be able to complete more complex control operations, at the same time requiring clear and easy-to-understand statements, with programming tasks highly compressed expression format. The cross-development method is used to develop the target machine connected to the host on the Windows host platform. The development environment includes your own customizable micro-kernel real-time multi-task operating system, compilation, debugging, viewing, and other tools on the host, as well as connection tools for the serial port, network, and target machine. Its main functions include basic application framework for industrial applications, reusable component libraries, source program compilers, configuration download user tools, parameter Download user tools, and real-time parameter monitoring interfaces. various user tools for application development, it is an important foundation for users to develop applications. It emphasizes the accumulation and reuse of knowledge achievements and is a concentrated embodiment of the platform development model.

Knot

The application software component technology of this software development platform mainly solves the following problems: Interface Definition of software components, and interaction between software components, systems, and software components, it also provides a basis for the design and encapsulation of software components. The development and integration of software components provides necessary development tools for the design and integration of software components. This article introduces the development methods of the main system-level software components, provides an overall framework for system integration of various application-level software, and solves the problems of difficult maintenance and inheritance of control system application software, it provides a basis for the development of control applications.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.