Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to see the px4_debug(…) information #12093

Closed
Evaneee opened this issue May 28, 2019 · 3 comments
Closed

How to see the px4_debug(…) information #12093

Evaneee opened this issue May 28, 2019 · 3 comments

Comments

@Evaneee
Copy link

Evaneee commented May 28, 2019

Found it that when do pwm test, the program will execute
D:\PX4\home\Firmware\src\systemcmds\pwm\pwm.cpp ,and in this file DO
int fd = px4_open(dev, 0);
PX4_INFO("dev ============:%s",dev);
PX4_INFO("dev's fd========:%d",fd);
Adding two lines above to see the value of dev and fd, I got this picture, The dev is changed but fd value is 3 all the time,…

image

trace it, go to \PX4\home\Firmware\src\lib\cdev\posix\cdev_platform.cpp
Add one line PX4_INFO("Do px4_opennnnnnnnnnn"); before PX4_DEBUG("px4_open");
Build and upload the program
But I cant get any information in nsh mavlink console about px4_open

And I don’t want to Add PX4_INFO() every time
How to see the PX4_DEBUG() info??
image

@Evaneee
Copy link
Author

Evaneee commented Jun 3, 2019 via email

@stale
Copy link

stale bot commented Sep 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Admin: Wont fix label Sep 1, 2019
@julianoes
Copy link
Contributor

The file descriptor fd is just a number that open returns (per NuttX task). It has nohas no global meaning. So it makes sense that it's always 3 for your case.

To enable PX4_DEBUG for a module, I usually do something like this at the beginning of the file:

#undef PX4_DEBUG
#define PX4_DEBUG PX4_INFO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants