Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use RT-Thread to test the performance of raspberry pie 4

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use RT-Thread to test the performance of raspberry pie 4. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Build the compilation environment

Raspberry pie's RTT system uses RT-Studio as IDE under windows, and the compilation environment is implemented through the ENV tool, where the compiler ARM GCC is integrated into the ENV tool. Of course, you can also customize and minimize the build environment as I do.

I installed the env tool first. Notice the blue underlined hyperlink symbol on the previous "env tool"? You can click in and download. Download the env tool and unzip it to your favorite path.

Then install the gcc tools to the compiled tools directory under the env folder. I used gcc-arm-8.3-2019.03-i686-mingw32-aarch74-elf. Did you find that the "gcc tool" here has hyperlink symbols again? You can click in and download again.

Next, extract the gcc-arm-8.3-2019.03-i686-mingw32-aarch74-elf and put it in the env tool directory. The completed path should look like this (I omitted the drive letter and the directory one level above env when describing the path. Maybe some students put it in the program files directory and some students put it directly in the root directory):

Env/tools/gnu_gcc/arm_gcc/gcc-arm-8.3-2019.03-i686-mingw32-aarch74-elf

Finally, download the source code for RTT with the following command:

Git clone https://github.com/RT-Thread/rt-thread.git

After downloading the RTT source code, go to the rt-thread/bsp/raspberry-pi/raspi4-64 path, modify the rtconfig.py file, and change the value of EXEC_PATH to the bin directory that points to gcc-arm-8.3-2019.03-i686-mingw32-aarch74-elf. Then, open env under the current path (raspi4-64) and enter scons in env.

If you find that the compilation error message after scons enter is as follows, this indicates that the environment has been built. As for how to solve this error, we will fill in the hole later.

Don't go away, the following section 3 teaches you how to fix it.

Error repair method for scons compilation

Maybe you follow the readme tutorial in the RTT source code step by step and get stuck in scons, so my tutorial in this section can help you.

The principle of scons error reporting is simple, which is related to the fact that the source code has been compiled by other projects.

The solution is simple. We just need to clean it up first.

Cleanup commands:

Scons-c

Then you can compile normally using scons.

The screenshot of the resolution process is as follows:

After compilation, a rtthread.bin file will be generated in the raspi4-64 directory, put it in the boot directory of the raspberry pie TF card, and modify the contents of config.txt in the boot directory as follows:

Enable_uart=1

Arm_64bit=1

Kernel=rtthread.bin

Core_freq=250

The above config.txt file sets up serial debugging and kernel files, and sets the main frequency to 250MHz. Friends who can play can also set the main frequency a little higher.

How to debug raspberry pie 4 serial port

Connect the serial debug cable to the debug serial port of the raspberry pie. Note that the 5V interface does not need to be connected, we only use GND, TX and RX.

After making sure that the TF card is plugged in, first plug the USB to serial port module into the computer, start the serial port debugging tool, and then power the raspberry. Note that the raspberry pie is electrified at the end, not in reverse order. You should be able to see the startup printout of the following image in the serial debugging assistant. My RTT system is newly compiled, so the compilation date is today, January 20th. The serial debugging print is shown in the following figure:

Add Dhrystone software to RTT system

Let's go back to the RTT system compilation environment and remake a system with performance score software.

Enter menuconfig in the previous env environment to enter the RTT kernel settings, find DHRYSTONE in the tools packages in online packages, and tick it with a space, as shown in the following figure.

Dhrystone is one of the most common benchmark programs to measure the computing power of processors, and it is often used to measure the performance of integer operations of processors. The program is written in C language, so the compilation efficiency of C compiler also has a great impact on the test results. Therefore, when we test, we must also consider the compiler version and the optimization level at compile time, and try not to compare programs with different optimization levels.

In addition, the other CoreMark in the picture above is also a running software, but I have some problems with the test, regardless of that CoreMark.

The compiler settings file is located in rtconfig.py, and the gcc version used this time is 8.3, as shown in the following figure

The default optimization level is O2. As shown in the following figure, we first use this default optimization level to get through the compilation process of Dhrystone, and then do the O0 level optimization test in the next section.

Dhrystone belongs to online package, which is not integrated in the default source code and needs to be downloaded online. After finishing menuconfig, you also need to download the source code of Dhrystone with the command pkgs update, as shown in the following figure. This step is very important, don't forget to download, or it will take a lot of compilation time.

Compile the new rtthread.bin with the scones command and replace it in the boot directory of the raspberry pie. After this startup, you can use the help command to view the available commands and find dhrystone_test, as shown in the following figure:

Give it a try. The default parameter is 320000 cycles, as shown in the following figure:

The test failed because it was too fast to time, as shown in the following figure:

So, next, we're going to go back and modify the setting parameters of menuconfig to add two more zeros to the number of loops.

This is the end of the article on "how to use RT-Thread to test the performance of raspberry pie 4". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report