In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
1. SylixOS debugging method introduction
SylixOS implements a powerful debugging stub that allows you to debug applications online on the device or simulator, and RealEvo-IDE also provides a companion debugging plug-in. RealEvo-IDE currently supports both automatic push debugging and traditional debugging by manually starting gdbserver. In the official published manual does not write in detail in the daily development of several very practical debugging methods, this article mainly introduces a comprehensive debugging method from the bottom layer to the application layer.
2. SylixOS comprehensive case debugging steps detailed explanation 2.1 comprehensive case demonstration demo
The demo consists of three parts: user_app (application layer), calc_lib (middle layer dynamic library), pwm_driver (bottom layer driver module). This document comprehensively demonstrates how to use the system by introducing application layer calls to the TTY interface (pwm_driver) and calc_lib. user_app is mainly to open the PWM device and call the algorithm in the dynamic library, the code is shown in Listing 21;calc_lib is a dynamic library, the code is shown in Listing 22; the program pwm_driver is a TTY device interface function.
Listing 21 user_app code
#include
int main (int argc, char **argv)
{
int icalc_result;
/*
* Turn on PWM device
*/
int pwm_fd = open("/dev/pwm/pwm", O_RDWR);
/*
* Open Set Step Speed
*/
ioctl(pwm_fd,1,2);
while (1) {
/*
* Get algorithm results
*/
icalc_result = lib_func (10);
malloc(100);
/*
* Control PWM output
*/
write(pwm_fd, &icalc_result, sizeof(icalc_result));
sleep(1);
}
return (0);
}
Listing 22 calc_lib code
#include
int lib_func (int ivalue)
{
int iresult = 0;
iresult += 100;
return iresult;
}
2.2 Middle-tier calc_lib (dynamic library) call
Right-click the application and select Properties to add and associate dynamic libraries to the application, as shown in Figure 21.
Figure 21. Adding dynamic libraries
After association, deploy user_app (application layer program), calc_lib (middle layer dynamic library), pwm_driver (bottom layer driver module) to the simulator.
2.3 Load driver module (pwm_driver)
Under " /lib/modules," check whether the driver module is uploaded successfully, as shown in Figure 22.
Figure 22 Successful upload of driver module
Load the driver module with the "modulereg" command, as shown in Figure 23.
Figure 23 Loading the driver module
Run the application, and the result is shown in Figure 24, calling the algorithm in the dynamic library.
Figure 24. Application results
3. summary
In SylixOS, you can use a variety of debugging methods to debug the program according to the actual situation. This section mainly describes the basic use process from the application layer to the bottom layer through a complete project file.
4. resources
SylixOS Application Development Manual
RealEvo-IDE User Manual
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.