Note: This manual is based on the latest version of SL_RTE. The SL_RTE in the current board supporting project is the previous version and has not been updated. The main difference between the old and new versions of RTE is that the maintenance methods of modules such as SoftTimer and Shell are different. The old version is statically maintained, and the new version is dynamically maintained.
1. General description
[attach]368298 [/attach]
The project structure of TuringBoard is shown in the figure above, where CMSIS is the middleware that comes with KEIL, including NN-LIB, RTX, CMSIS header files, etc. (The reason why it is used here is to facilitate the use of RTOS VIEW during simulation).
Except the above-mentioned CMSIS part, the other source codes of the project are added to the IDE in the form of source files. They are introduced one by one here: Main includes the main function and the interrupt function. The threads in the current program are not maintained in the form of separate .c files. They will be updated later for easy management; Boot includes the startup file and system_stm32h7xx.c, which completes the configuration work before entering the main function; HAL_Lib is the driver library provided by ST, and the dcmi part has been modified; Board_BSP is a driver library adapted for the board, which is introduced as follows:
The configuration of each module is statically managed in the form of a structure for easy maintenance, and a callback function is provided:
It is convenient to combine with CubeMX to achieve fool-proof configuration.
The Board_HALCallback.c file is a collection of the callback functions mentioned above, and is also a collection of HAL interrupt callback functions. In the interrupt callback function, thread switching is implemented through thread flags or flags.
SL_APP, SL_BSP, SL_Config, and SL_ThirdParty are components of SL_RTE, which will be described in detail in the next chapter.
SL_MV is the core algorithm and its supporting components for implementing machine vision, which will be described in detail in the other documents related to this development board.
2. SL_RTE
2.1. Introduction
In general, SL_RTE is a "collection of useful wheels". In my coding career for so many years, I have experienced a lot of "tragic tones" of reinventing the wheel when changing a platform or a project. It is undeniable that reinventing the wheel can definitely improve personal business level to a certain extent, but it means a great consumption of time resources. In the process of this game, I sorted out various wheels I used, reconstructed or innovated them, sorted them into SL_RTE, and open sourced them here, hoping to help everyone.
2.2, Composition
SL_RTE mainly consists of the following four parts:
Config part: that is, the configuration of the modules used by the entire RTE is completed in the form of header files, and graphical configuration can be achieved with the MDK environment:
As shown above, open the RTE_Config.h header file, click the Configuration Wizard label in the lower left corner, and switch to the graphical configuration interface:
Here you can choose to use each module, as well as some configurations that may exist inside the module:
RTE part:
This is the essence of the entire SL_RTE wheel collection. Including multi-block memory management, redirection files for implementing stdio logic, a shell-like interactive component, circular queues and message queues, time slice round-robin scheduling, state machine templates, and a GUI that I have just started.
--RTE_BGet
For those who don't understand BGet memory allocation, please refer to the original code first:
SL_RTE simplifies some functions and rewrites them for multi-block memory management.
--RTE_Shell
Provides a framework for users to quickly interact with MCU. Compared with statically writing called functions, RTE_Shell uses RTE_BGet for dynamic management. It is necessary to add and delete cmd in the following format. RTE_Shell_AddCommand("Help",RTE_Shell_CMD_Help,"Shell help") RTE_Shell_DeleteCommand("Help") The format of Shell function is as follows: The two parameters argc and argv are the number of parameters input by the user and the pointer of each parameter respectively. 368305 Everyone should be familiar with the circular queue and time slice scheduling. I won't say much here. It should be noted that SoftTimer is also dynamically managed. BSP part: Provides basic drivers for different MCUs, mainly LED, KEY and COM. Board_Driver part: Provides board-level drivers for different development platforms, mainly various sensors, LCD and the like.
Actual operation:
You can see the use of various cmds, as well as the addition and deletion of an LED timer.
The latest version of RTE is open in the group.
My machine vision development board group number is: 858707065. Welcome everyone to learn and communicate.
This content is originally created by EEWORLD forum user shannon2014. If you need to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source