This document describes the basic features of RT-Thread Nano 3.0.3 and describes how to download and use RT-Thread Nano 3.0.3 and related BSP routines. RT-Thread Nano 3.0.3 has some new changes compared to the previous version 2.1.1: Added V2M-MPS2 BSP support Fix MDK 5.14 can not copy license problem Update board.c template to simplify unnecessary configuration The msh command export adds the RT_USED attribute by default. No additional keep option is required. Update the uart code for the stm32_msh and lpc824_msh examples, no longer relying on the drivers ipc section Remove driver ipc part of the source code 1 Purpose and structure of this paper 1.1 Purpose and background of this article RT-Thread Nano is a minimal-time real-time operating system introduced by RT-Thread. It is suitable for 32-bit ARM entry-level MCUs used in home appliances, consumer electronics, medical equipment, industrial control and other fields. This document is a quick start document that allows users to quickly get started with RT-Thread Nano 3.0.3. 1.2 Structure of this paper This article first introduces the basic functions of RT-Thread Nano 3.0.3, then explains how to install and configure RT-Thread Nano 3.0.3 and how to get RT-Thread Nano 3.0.3 related routines. 2 Introduction to RT-Thread Nano The RT-Thread Nano is a refined hard real-time kernel with minimal memory resources and features relatively complete real-time operating system features such as task processing, software timers, semaphores, mailboxes, and real-time scheduling. After MDK5, the package management chip and various related components are adopted. The RT-Thread Nano is also released by MDK pack. The RT-Thread Nano pack includes device drivers, kernel and shell (msh). Users can run from MDK. The time environment is loaded as needed. Figure 2-1 Main functions of RT-Thread Nano With support for the semaphore and mailbox features, and running two threads (main thread + idle thread), ROM and RAM still maintain a very small size. Based on an example of the Cortex M0 MCU, the compiled size (ROM: 3.25K, RAM: 1.04K), except for the ROM and RAM required by the MCU, the ROM required by the RT-Thread Nano itself is 2.5K, and the RAM is 1K. Figure 2-2 RT-Thread Nano memory usage User-based Nano-based applications can be migrated directly to the full RT-Thread version. Next, we will describe how to create a small system project of RT-Thread RTOS from bare metal based on RTE (Run-Time Environment) on MDK5. 3 Pack installation Packs can be installed via MDK or offline. Let's start with two installation methods. Pack Installer installation Open the MDK software and click the Pack Installer icon on the toolbar: Figure 3-1 Packs installation Click on the Pack on the right, expand General, you can find rt-thread::rthread, click the Install of the corresponding Action, you can install the Pack online. After the installation is successful, the Action bar displays "Up to date". Figure 3-2 Packs Management Manual installation We can also download the installation file from the official website, RT-Thread Nano offline installation package download, double-click the downloaded file to install: Figure 3-3 Manual installation of Packs 4 Foundation engineering preparation Before we start creating a small RT-Thread system, we need to prepare a bare metal project that works. As an example, this article uses an LED flashing program based on the STM32L072-Discovery and Low-Level Library. The main screenshots of the program are as follows: Figure 4-1 STM32L072-Discovery example In our routine, after compiling the download program, you can see that the three LEDs flash alternately. Readers can use other chips to complete a simple bare-metal project. 5 Add RT-Thread Nano to the project Based on a bare metal program that can be run, let's add RT-Thread to the project. Click on Manage Run-Time Environment as shown below. Figure 5-1 MDK RTE Find the RTOS in the "Software Component" column of the Manage Rum-Time Environment, select the RT-Thread in the Variant column, then check the kernel, and click "OK" to add the RT-Thread kernel to the project. Figure 5-2 Nano Kernel Add Now you can see that the RT-Thread RTOS has been added to the Project. Expand the RTOS and you can see the files added to the project: Figure 5-3 Project with RTOS added Kernel files include: Clock.c components.c device.c idle.c ipc.c irq.c kservice.c mem.c object.c scheduler.c thread.c timer.c Cortex-M chip kernel porting code: Cpuport.c context_rvds.s Application code and configuration file: Board.c rtconfig.h 6 Adapt RTThread RT-Thread will use the exception handler HardFault_Handler() and the suspend handler PendSV_Handler(), and the Systick interrupt service function SysTick_Handler(), so the user code needs to ensure that these functions are not used. If the compile prompt function is repeatedly defined, please Delete the function you defined. RT-Thread Nano 3.0.3 The systick configuration is done by default in board.c. You can modify the value of the macro RT_TICK_PER_SECOND to configure the number of systicks per second. Figure 6-1 systick configuration RT-Thread Nano 3.0.3 by default uses an array as a heap. Figure 6-2 Heap configuration Replace the delay function in the routine: 1). Related header files containing RT-Thread 2). Replace the delay() function with rt_thread_delay(RT_TICK_PER_SECOND) Here is the code to complete the modification: Figure 6-3 Exception processing modification After downloading the program and downloading it to the chip, you can see that the RT-Thread based program is running. 7 RT-Thread Nano configuration RT-Thread is a highly configurable embedded real-time operating system with a configuration file of rtconfig.h. Nano is a kernel application that implements 2.5K ROM and 1K RAM under rtconfig.h configuration. Users can configure the corresponding functions by modifying the macro definition in the rtconfig.h file according to their needs. RT-Thread Nano does not enable macro RT_USING_HEAP by default, so it only supports static creation of tasks and semaphores. To create an object dynamically, you need to enable the RT_USING_HEAP macro definition in the rtconfig.h file. MDK configuration wizard configuration wizard can be very convenient to configure the project, Value column can select the corresponding function and modify the relevant value, which is equivalent to directly modify the configuration file rtconfig.h. Figure 7-1 Nano configuration 8 BSP routines There are currently five RT-Thread Nano reference routines, two stm32l0 based routines, two lpc824 based routines, and a new V2M-MPS2-based routine for Nano 3.0.3. All routines can be found on the MDK via the Pack Installer. Click the Pack Installer icon: Figure 8-1 pack installer Enter stm32l0 in Search, click STM32L0 Serials in Device, and then click on Example on the right to see two routines based on stm32l0 on the right. Figure 8-2 Routine Introduction to the V2M-MPS2 msh routine V2M-MPS2 is a development board provided by MDK. With the Fast Models Debugger (requires MDK-ARM Professional license and only supports 64-bit systems), you can debug code on the Cortex-M platform without relying on any hardware. To use V2M-MPS2 you need to open the telnet client for windows: Win7 open telnet client (https://jingyan.baidu.com/article/eb9f7b6d8701ae869364e826.html) Win10 open telnet client (https://jingyan.baidu.com/article/ceb9fb10a9a1b48cad2ba0c4.html) After opening telnet, select Device in Device of MDK Pack Installer, click on example on the right, you can see a msh routine based on V2M_MPS2. Figure 8-3 V2M_MPS2 msh routine Click Copy to export the example and compile the project simulation run. Below is a screenshot of the successful run. Figure 8-4 V2M_MPS2 msh routine running successfully screenshot RT-Thread also provides a BSP (Board Support Package) based on the full version of RT-Thread V2M-MPS2 (https://github.com/RT-Thread/rt-thread/tree/master/bsp/v2m-mps2) ), users can get it through github.
Aluminum Laptop Stand, eight highlights, powerful functions, bid farewell to the sultry heat, and welcome the cool moments of summer. Desktop Laptop Stand Adjustable height, hollow heat dissipation, block angle design, multiple compatibility, strong stability, portable and easy to carry. Portable Laptop Stand guiding a healthy posture to raise your head to work, a small figure is great for magic, unlock a new posture, you can put mobile phones, tablets, books, computers.
Laptop Stand Upright,Desktops Laptop Stand Upright,Laptop Support Adjustable Upright,Alloy Upright Laptop Stand Shenzhen ChengRong Technology Co.,Ltd. , https://www.dglaptopstandsupplier.com