Cube Orange Plus: TELEM2/GPS2 UART troubleshooting

I’m currently trying to establish communication over the telem2 port on the CubePilot (with CubeOrange+) to a listening microcontroller device on the other side of the connector. I’m currently building and installing the PX4 1.14 firmware, cubepilot_cubeorangeplus, with the additional communicating program I plan to run on it.

I confirmed using the serial port guide (Serial Port Mapping | PX4 User Guide) and Cube Orange plus specific guide (PX4-user_guide/ at baea220ce593463b7837e96d218da2298cb8d22b · PX4/PX4-user_guide · GitHub) that USART3 (TELEM2) is mapped to /dev/ttyS1

I wrote a simple C program to try and send a message through that port. When the microcontroller did not receive any data, I hooked up a logic analyzer to the tx and rx lines on the other end, and verified no data was coming through (Both lines remained high at ~3.3v based on the analog recording)

Code I was using to communicate:

void serial_test(char* device_name)
struct termios tty;
int serial_port = open(device_name, O_RDWR | O_NOCTTY | O_NDELAY);

if(tcgetattr(serial_port, &tty) != 0) {
printf(“Error %i from tcgetattr: %s\n”, errno, strerror(errno));
cfsetspeed(&tty, B57600);
if (tcsetattr(serial_port, TCSANOW, &tty) != 0) {
printf(“Error %i from tcsetattr: %s\n”, errno, strerror(errno));
PX4_INFO(“Sending over %s”, device_name);
unsigned char msg[] = { ‘H’, ‘e’, ‘l’, ‘l’, ‘o’, ‘\r’ };
int bytes = write(serial_port, msg, sizeof(msg));
PX4_INFO(“Sent %d bytes”, bytes);

My question is if there is any additional configuration needed to make it work. I would expect the lines to still toggle voltage, even if some of the parity/stop configurations on the receiver weren’t correct. I used tried hooking the connector to GPS2 instead of TELEM2 and using /dev/ttyS5 to see if there was any activity there, but also did not find any.

Ok, so first things first, the first try was to just enable Telem2, right? And that didn’t work?

If so, I can check it on my side.

Ok, so first things first, the first try was to just enable Telem2, right? And that didn’t work?

I verified the following:
/dev/ttyS1 is the TEL2 tty port when running make cubepilot_cubeorangeplus boardconfig
verified SER_TEL2_BAUD is 57600 8N1 in QGroundControl on the herelink

I’m not sure what else I should check to verify TELEM2 is enabled.

Ok, and was that with a SiK radio or FTDI cable connected? I’m asking if this would be with flow control or without connected.

Using a cable, no flow control lines (RTS/CTS) connected. I’ve attached the connection on the CubePilot side.

I managed to resolve the issue by setting flow control off on both via QGroundControl (MAV_1_FLOW_CTRL to Force Off) as well as in the test program by explicitly turning off the RTS/CTS flag (tty.c_cflag &= ~CRTSCTS;)

Ok, this is good to know. It might require a pull down like other boards with DMA + flow control. I’m checking this Monday.

So I checked and DMA is not enabled for USART2 and USART3, so flow control in auto-mode as set by default for Telem1 and Telem2 should work fine.

I just tested connecting to Telem1 via FTDI cable with flow control not connected and it worked fine when flow control was set to auto or off but it did not work - as expected - when set to on.