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

GPS driver debugging best method #9446

Closed
trgiman opened this issue May 10, 2018 · 6 comments
Closed

GPS driver debugging best method #9446

trgiman opened this issue May 10, 2018 · 6 comments

Comments

@trgiman
Copy link
Contributor

trgiman commented May 10, 2018

Hi. I would like to better understand GPS driver section in the PX4 code. Especially ashtech driver, that I am modifying for "indoor gps module". Using gdb would be the best option. I need to debug step by step usage of buffers in the code. But while in the SITL mode GPS driver is not used actually.

And since I am using Aero RTF I do not know if it would be the option to connect STLinkv2 for debugging?

I must be missing something fundamental. Thanks for suggestions.

@bkueng
Copy link
Member

bkueng commented May 11, 2018

The gps driver should work with SITL as well, you just have to start it and specify the device accordingly:
gps start -d /dev/ttyACMx

@trgiman
Copy link
Contributor Author

trgiman commented May 11, 2018

@bkueng Thanks. It means that in the case of gps driver in SITL. -d can be for instance "GPS" unit connected to /dev/ttyUSB0 (in case of Ubuntu). Correct?

@bkueng
Copy link
Member

bkueng commented May 11, 2018

-d can be for instance "GPS" unit connected to /dev/ttyUSB0 (in case of Ubuntu). Correct?

Yes it's the UART device

@trgiman
Copy link
Contributor Author

trgiman commented May 12, 2018

Hi @bkueng. It works as you suggested. While I am in the pxh shell, listener command for vehicle_gps_location topic returns the indoor GPS values (since I already modified ashtech driver a bit in rgrds of NMEA readings). But when I start the gdb session and set some brake point for ashtechdriver.ccp. It seems I can not "arrive" to break point since gdb for step or next commands reports messages as for example following:

Thread 8 "wkr_hrt" received signal SIGINT, Interrupt.
[Switching to Thread 0x7ffff5543700 (LWP 4239)]
0x00007ffff702930d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.

SITL simulation without gdb is otherwise working as expected as described above. Any suggestions?

@LorenzMeier
Copy link
Member

You need to disable interrupt signals in GDB. Nothing is wrong with this, it just stops by default on signals.

@trgiman
Copy link
Contributor Author

trgiman commented May 12, 2018

Hi @LorenzMeier thank you for guidance. I just handled Thread 4 "hpwork" received signal SIGCONT, Continued and it works as needed.

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

No branches or pull requests

3 participants