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
Add USB to Serial Config for MicroDDS #21233
base: main
Are you sure you want to change the base?
Conversation
Thanks @AlexKlimaj ! |
Yeah, I don't see why not. |
I think this is the right direction, but needs to be coordinated with the existing autostart stuff. |
It appears to play nice with the mavlink usb auto start. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe to do this properly we need to slip in sercon
somewhere to start NuttX CDCACM, and then in the autostart code have it skip if sercon already start or /dev/ttyACM0 exists.
PX4-Autopilot/platforms/nuttx/src/px4/common/cdc_acm_check.cpp
Lines 117 to 122 in e5d5fcd
case UsbAutoStartState::disconnected: | |
if (vbus_present && vbus_present_prev) { | |
if (sercon_main(0, nullptr) == EXIT_SUCCESS) { | |
usb_auto_start_state = UsbAutoStartState::connecting; | |
rescheduled = work_queue(LPWORK, &usb_serial_work, mavlink_usb_check, nullptr, USEC2TICK(100000)); | |
} |
It's also critical that we don't perform the disconnect cleanup because most of these apps will not fail gracefully if /dev/ttyACM0 disappears.
PX4-Autopilot/platforms/nuttx/src/px4/common/cdc_acm_check.cpp
Lines 355 to 359 in e5d5fcd
case UsbAutoStartState::disconnecting: | |
// serial disconnect if unused | |
serdis_main(0, NULL); | |
usb_auto_start_state = UsbAutoStartState::disconnected; | |
break; |
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: https://discuss.px4.io/t/setting-up-the-px4-fast-rtps-dds-bridge-with-real-hardware/29876/3 |
Maybe dumb question, but we can't connect the QGC or HITL interface through the USB port when the DDS is in use right? I ended up in a situation where I can't connect to the FC anymore because the DDS is running 😆. Did you run into this problem too? If so, how did you access the FC to change the config (e.g. disable DDS on USB) @AlexKlimaj ? |
I tried this method, but it still didn't work. I use CUAV x7 pro with px4 firmware, set UXRCE_DDS_CFG "TELEM1", and have disabled MAVLink. The baud rate "SER_TEL1_BAUD" is set the same as the value after "-b". I also start Micro XRCE-DDS on /dev/ttyACM0. I'm wondering what happened. |
This PR adds USB to the serial port configurations in order to use USB for microdds.
On the Jetson