Trouble writing to tty4

I’m attempting to write to tty4 and the code I’m using is failing.

The simple test of ‘echo asdf > /dev/ttyO4’ gets the expected output on the CRO.

But the following segments of code result in a roughly appropriately sized dip in the TX line, but not data (the TX line goes low for long enough to have sent the 256 bytes it is trying to send, but it should be going up and down for that period).

int fd;
struct termios uart4, old;

void UART_Initialize()
char buf[30] = “/dev/ttyO4”;
fd = open(buf, O_RDWR | O_NOCTTY);
int flags = fcntl(fd, F_GETFL, 0);
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
if (fd < 0)
printf(“port failed to open\n”);
tcgetattr(fd, &old);
bzero(&uart4, sizeof(uart4));
uart4.c_cflag = B9600 | CS8 | CLOCAL | CREAD | PARENB;
uart4.c_iflag = IGNPAR | ICRNL;
uart4.c_oflag = 0;
uart4.c_lflag = 0;

uart4.c_cc[VTIME] = 0;
uart4.c_cc[VMIN] = 1;

tcflush(fd, TCIFLUSH);
tcsetattr(fd, TCSANOW, &uart4);

void UART_SendByteArray(uint8_t * byteArray, uint16_t size)
write(fd, byteArray, size);

void main()
uint8_t password[256] = {0};
uint16_t loopIndex = 0;

for (loopIndex = 0; loopIndex < 256; loopIndex++)
password[loopIndex] = 0xFF;

UART_SendByteArray(password, 256);

I have read the definitions of each of the parameters used in the init function and they all make sense, so I’m at a lost to why the UART does not send the data correctly.

Any pointers will be very helpful.