I have recently started to play with the CrazyFlie Port of PX4. As part of that I have also attached an uBlox M8 GNSS receiver.
While setting up the receiver using NuttX Shell I noticed that on the CrazyFlie-port still the default serial is defined /dev/ttyS3 as per drv_gps.h.
The crazyflie comes up with ttyS0 to ttyS2 (USART_2_1, USART_3_2, USART_6_1), they correspond in this order to Rx2 + Tx2 , Rx1 + Tx1 and NRF-Link on crazyflie.
As I am using USART_2_1 (Rx2 + Tx2 on CF Deck) → dev/ttyS0, GPS wont work out of the box - so had to change that. I already confirmed it working by stopping and then restarting the GPS-thread with ttyS0 as device. Now to make it stick, I do wonder what a proper way of remapping would be?
I had a look through the init.d scripts, but I could just find one file that starts the GPS-thread (rcS).
I’d do a platform check for crazyflie here, and then start GPS with -d /dev/ttyS0 as device…
But maybe there is another way? Is it possible to rename a device? Or create a link to a device? So ttyS3 would point to ttyS0.
For now I could just hardcode the default device… but I do wonder how to do it properly as I also would like to gain some more understanding how PX4 stack and NuttX works.
Any other ideas are appreciated as well