What system can stm32 run?

The STM32 family of 32-bit microcontrollers is based on the ARM Cortex-M3 processor. It supports a wide range of 32-bit applications, including high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation with a fully integrated and easy-to-use development.

There are four options for operating systems based on the STM platform that meet real-time control requirements. They are μC/OS-II, μClinux, eCos, FreeRTOS and Dujiangyan operating system (djyos). The following describes the characteristics and deficiencies of these five embedded operating systems.

1, μC/OS-II

μC/OS-II is a priority-based preemptive multitasking real-time operating system that includes real-time kernel, task management, time management, inter-task communication synchronization (semaphores, mailboxes, message queues) and memory management. It enables each task to work independently and without interference, making it easy to implement on time and error-free execution, making it easy to design and extend real-time applications, and greatly reducing the design process of the application.

μC/OS-II is developed on the basis of μC/OS. It is a compact and preemptive multitasking real-time kernel written in C language. μC/OS-II can manage 64 tasks and provide functions such as task scheduling and management, memory management, inter-task synchronization and communication, time management and interrupt service. It has high execution efficiency, small footprint, real-time performance and scalability. Strong and so on.

For real-time satisfaction, since the μC/OS-II core is designed and implemented for real-time system requirements, it only supports fixed-priority preemptive scheduling; the scheduling method is simple and can meet high real-time requirements. The distinctive feature of μC/OS-II is that the source code is open and easy to port and maintain.

In memory management, μC/OS-II manages successive large blocks of memory by partition. Each partition contains an integer number of memory blocks of the same size, but the size of memory between different partitions can be different. When the user dynamically allocates memory, it is only necessary to select an appropriate partition, allocate memory by block, and put the block back to the previously owned partition when released, thus eliminating the fragmentation problem caused by multiple dynamic allocation and release of memory. .

The μC/OS-II interrupt processing is relatively simple. Only one interrupt service subroutine ISR can be attached to an interrupt vector, and the user code must be completed in the ISR (Interrupt Service Routine).

The more things ISR needs to do, the longer the interrupt latency will be.

The maximum nesting depth that the kernel can support is 255.

In terms of file system support, since μC/OS-II is for small and medium-sized embedded systems, even if all functions are included, the compiled kernel is less than 10 KB, so the system itself does not provide support for the file system. However, μC/OS-II has good scalability and can be added to the contents of the file system if necessary.

In terms of hardware support, μC/OS-II can support most of the currently popular CPUs. μC/OS-II is very small due to its own kernel. The minimum size of the clipped code can be 2KB, and the minimum required data RAM space. For 4 KB, the porting of μC/OS-II is relatively simple, and only the code associated with the processor needs to be modified.

In summary, μC/OS-II is an embedded operating system kernel with simple structure, complete functions and real-time performance. It is very suitable for CPUs without MMU function. It requires very little kernel code space and data storage space, has good real-time performance, good scalability, and is open source. There are a lot of data and examples on the Internet, so it is suitable for porting to stm32.

2, μClinux

μClinux is an operating system that is fully compliant with the GNU/GPL convention. It is completely open source and is now supported by Line.

μClinux is an excellent embedded Linux version, which is called micro-control Linux. It literally means micro-control Linux. Compared to standard Linux, μClinux's kernel is very small, but it still inherits the main features of the Linux operating system, including good stability and portability, powerful network functions, excellent file system support, and standard rich APIs. And TCP/IP network protocols, etc. Because there is no MMU memory management unit, its multitasking implementation requires some skill.

μClinux inherits the standard multi-tasking implementation of Linux, which is divided into real-time process and common process. It adopts first-come first-served service and time-slice rotation scheduling respectively. It only improves the characteristics of low-end embedded CPU, and does not support kernel preemption. , real-time general.

In memory management, since μClinux is designed for processors without MMU, the virtual memory management technology of the processor cannot be used, and only the real memory management strategy can be adopted. The system uses the paged memory allocation method to page the actual memory at startup. The system's access to memory is straightforward. The operating system has no protection for memory space. Multiple processes can share a single running space. Therefore, even an unprivileged process calling an invalid pointer triggers an address error and may cause a program. Crash or even system crash.

The interrupt management of the μClinux operating system divides the interrupt processing into two parts: top half processing and bottom half processing. In the top half of the process, the interrupt must be turned off and only necessary, very few, and fast processing is performed, and the other processing is handed to the bottom half of the processing; the bottom half of the processing performs those complicated, time consuming processing, and accepts the interrupt. Because there are many bottom-down processing of interrupts in the system, it will cause delays in system interrupt processing.

μClinux supports the file system well. Since μClinux inherits the perfect file system performance of Linux, it supports ROMFS, NFS, ext2, MS-DOS, JFFS and other file systems. However, the ROMFS file system is generally used. This file system takes up less space than a normal file system (such as ext2). However, the ROMFS file system does not support dynamic erasing and saving. For the data that the system needs to dynamically save, it must be processed by the virtual RAM disk/JFFS method.

In terms of hardware support, since μClinux inherits most of the performance of Linux, it requires at least 512KB of RAM space and 1MB of ROM/Flash space.

In the porting of μClinux, μClinux is an improvement of Linux for embedded systems, and its structure is more complicated. To port μClinux, the target processor needs to have enough external ROM and RAM in addition to the processor-related code.

In summary, the biggest feature of μClinux is that it is designed for MMU-free processors. This is suitable for stm32f103 without MMU function, but porting this system requires at least 512KB of RAM space, 1MB of ROM/FLASH space, and stmf103 has 256K. FLASH requires external storage, which increases the cost of hardware design. μClinux is complex in structure, relatively difficult to port, and has a large kernel. Its real-time performance is also poor. If the embedded products developed are focused on file systems and network applications, μClinux is a good choice.

3, eCos

eCos (embedded Configurable operaTIng system), Chinese translation for embedded configurable operating system or embedded configurable real-time operating system. Suitable for deep embedded applications, the main application objects include consumer electronics, telecommunications, automotive equipment, handheld devices and other low-cost and portable applications. It is a configurable, portable, real-time operating system for deep embedded applications with open source code. The biggest feature is flexible configuration, modular design, the core part is composed of small components, including the kernel, C language library and the underlying running package. Each component can provide a large number of configuration options (the real-time kernel is also available as an optional configuration), which can be easily configured using the configuration tools provided by eCos, and enables eCos to meet different embedded application requirements through different configurations.

In real time, due to the rich eCos scheduling method, two priority-based schedulers (ie, bitmap scheduler and multi-level queue scheduler) are provided, which allows the user to select one of the schedulers when configuring, and the adaptability is good. Therefore, it performs well in terms of real-time performance.

In memory management, eCos allocates neither memory nor paging, but uses a dynamic memory allocation mechanism based on memory pool. Two memory management methods are implemented through two memory pools: one is a variable-length memory pool; the other is a fixed-length memory pool, similar to the VxWorks management scheme.

In interrupt management, eCos uses a layered interrupt handling mechanism to divide interrupt processing into a traditional ISR (interrupt service routine) and a lazy interrupt service routine DSR (deferred service program). Similar to μClinux's processing mechanism, this mechanism can run DSR when interrupts are enabled, thus allowing high priority interrupts and processing when dealing with lower priority interrupts. In order to greatly reduce the interrupt latency, the ISR should be able to run quickly. If the amount of service caused by the interrupt is small, the ISR can handle the interrupt separately; if the interrupt service is complex, the ISR only masks the interrupt source and then hands it over to the DSR (Deferred Service Program).

The eCos operating system is very configurable and users can join the required file system themselves. The eCos operating system also supports most popular embedded CPUs. The eCos operating system can be ported between 16-bit, 32-bit and 64-bit architectures. The eCos is small because of its own kernel. The clipped code can be as small as 10 KB and the minimum required data RAM is 10 KB.

The eCos operating system is very portable in terms of system migration, and is easier than μC/OS-II and μClinux.

In summary, eCos is characterized by flexible configuration and support for MMU-free CPU migration, open source and good portability, and is also suitable for porting to the CPU of the stm32 platform. However, the application of eCOS is not too extensive, it is not as common as μC/OS-II, and the data is not as much as μC/OS-II. eCos is suitable for some commercial or industrial cost-sensitive embedded systems, such as some applications in the consumer electronics arena.

4, Dujiangyan operating system (djyos)

Dujiangyan operating system, referred to as djyos, is named after a great water conservancy project: Dujiangyan.

Unlike traditional operating systems, djyos is not a thread but an event-based scheduling core. This scheduling algorithm frees the programmer from the way of thinking about the computer's execution process, but writes the application in the way of human cognitive world. As VC is introduced in embedded programming. Djyos' scheduling algorithm allows programmers to get rid of the constraints of threads and processes. DJyos has no API api, and a programmer who doesn't know thread knowledge can write applications under djyos smoothly.

Djyos is a brand new operating system. It is not related to any existing operating system. It is very prominent in several important aspects of operating system: scheduler, interrupt management, device management, resource management, etc. Innovation, even theoretical innovation. Through these innovations, djyos can provide outstanding features for application designers:

(1) In terms of the scheduler, it can be said to be a complete innovation, which almost subverts the traditional software design pattern. For embedded programming, it is almost a revolutionary progress. Its event-centric scheduling method has changed the programming mode that the operating system required the programmer to simulate the thinking mode of the computer in the past, so that it can write applications in the way of human thinking. Program; it allows programmers to get rid of the constraints of threads and processes, djyos does not have thread-related APIs. Especially in the field of embedded programmers, there are many experts with deep background in the industry, but often lack of knowledge of computer operating systems. They can program under djyos without having to learn thread knowledge.

(2) Natural matching multi-core and distributed computing, djyos scheduling algorithm is based on events, the application only processes the event handler, and the thread and CPU core are treated as resources necessary for processing events, which are assigned by the operating system. Events, this algorithm is inherently simpler to make multicore programming, and more multicore utilization. Many well-known, the current CPU is multi-core development, embedded CPU and even DSP is also the same, such as ADI's blackfin561 is a dual-core DSP with only tens of KB of memory, djyos has plans to transplant to blackfin561, is expected to be the first RTOS with perfect support for dual cores on CPUs with only a few tens of kilobytes of memory.

(3) Innovative loading mode and interrupt management module can achieve faster interrupt response speed than all operating systems, and within a few tens of US after CPU startup, the key part of the application can achieve control of the target system. During the operating system loading process, you can respond to the application's interrupt ISR.

(4) Real-time memory management. In the operating system component, the malloc function is generally considered to be a non-real-time component, because even if there is sufficient memory, the execution time of the malloc function is not predictable, and the execution time and result of the real-time system are not expected to be expected. the rules. But djyos memory management, as long as the system is designed with sufficient memory, malloc execution time is fast and predictable, and in a real-time system running only one application, memory is not exhaustive is easy to do.

(5) Tailor-made system architecture for project managers and system engineers, tailor-made API settings for engineers, especially for system engineers to divide project modules, which is conducive to project manager formation and management team, and helps engineers to write maintenance-friendly code.

The djysiV0.4.2 release, added support for the stm32 version, can be ported to cortex-m3 (the chip is stm32f103). The system is suitable for industrial control. The system source code is open but not always free.

What system can stm32 run?

In summary , for stm32, transplantation of μC/OS-II, μClinux, eCos, and Dujiangyan operating systems are suitable.

Mechanical Buzzer

Piezo Beeper,Mechanical Buzzer,Piezo Mechanical Buzzer,Ultrasonic Mechanical Buzzer

NINGBO SANCO ELECTRONICS CO., LTD. , https://www.sancobuzzer.com