In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "Linux-c Test example Analysis". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1 driver introduction and configuration
Enter the kernel source directory, as shown in the following figure.
The kernel watchdog driver is "drivers/watchdog/nxp_wdt.c", as shown in the following figure.
The macro CONFIG_NXP_WATCHDOG_DEFAULT_TIME corresponding to the driver is not configured by default. Use the command
"export ARCH=arm", then use the command "make menuconfig", as shown in the following figure, select
"Device Drivers-- >".
After entering "Device Drivers->", select "Watchdog Timer Support->", as follows
As shown in the figure.
Enter "Watchdog Timer Support-- >", select "NXP Watchdog" and
"/ sys/devices/platform/wdt/soft (sysfs interface)", as shown in the following figure.
The do keepalive using watchdog task for cpu reset in task hung state of the watchdog
(NEW) "this function runs a process that feeds the dog regularly in the kernel. If the kernel is abnormal, it will cause the watchdog to resume.
Bit, we don't have the configuration here, we use the upper application to feed the dog.
Then save and exit, generate a new .config file, recompile and generate a new kernel image, and burn it to the development board.
As shown in the following figure, after rewriting the image, you can see the device node with the watchdog on the serial console.
2 Test
As shown in the following figure, the test routine is compiled and then copied to the development board to modify permissions.
Using the command ". / topeet_watchdogtest / dev/watchdog 10", parameter 1 is the watchdog equipment section
Point, parameter 2 is the watchdog time, in seconds, as shown in the following figure. .
After the test program is run, as shown in the following figure, the watchdog is set to 10 seconds, and after 9 seconds, feed the dog for 10 seconds.
After the system runs for 10 seconds, the whole system restarts. It shows that it is normal for watchdog to turn on and feed dog to restart.
This is the end of "Linux-c Test example Analysis". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.