Try to isolate the problem,
make a loop test at the device side, connect the FTDI tx signal to the FTDI rx signal,
disconnect the FTDI rx signal from the uC.
try to run a loop test python script,
then you have only the Raspi OS -> USB -> FTDI
prepare python virtuel enviroment
linux
cd testdir
python -m venv virtenv
source virtenv/bin/activate
pip install pyserial
the run
./testserial1
file testserial1
#!virtenv/bin/python
import serial
import time
from datetime import datetime
# timeout in sec
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=3.0, parity=serial.PARITY_NONE)
count=0;
txs=""
while(1):
ts=datetime.now().strftime('%H:%M:%S.%f')[:-3]
count=count+1
txs=f'{count:06d} test\n\r'
txb=txs.encode('utf-8')
print(f'{ts} tx:{txb}')
ser.write(txb)
rxb=ser.read(len(txs))
ts=datetime.now().strftime('%H:%M:%S.%f')[:-3]
print(f'{ts} rx:{rxb}')
if(rxb!=txb):
print(f'Error rx:{rxb}')
time.sleep(0.1)
ser.close()
output will be
(virtenv) fischer@raspberrypi:~/work/python $ ./testserial1.py
20:16:52.507 tx:b'000001 test\n\r'
20:16:52.521 rx:b'000001 test\n\r'
20:16:52.621 tx:b'000002 test\n\r'
20:16:52.633 rx:b'000002 test\n\r'
20:16:52.733 tx:b'000003 test\n\r'
20:16:52.745 rx:b'000003 test\n\r'
20:16:52.845 tx:b'000004 test\n\r'
20:16:52.857 rx:b'000004 test\n\r'
20:16:52.957 tx:b'000005 test\n\r'
20:16:52.969 rx:b'000005 test\n\r'
20:16:53.069 tx:b'000006 test\n\r'
20:16:53.081 rx:b'000006 test\n\r'
20:16:53.181 tx:b'000007 test\n\r'
20:16:53.193 rx:b'000007 test\n\r'
20:16:53.293 tx:b'000008 test\n\r' // !!! here bridge removed !!!
20:16:56.296 rx:b''
Error rx:b''
20:16:56.396 tx:b'000009 test\n\r'
20:16:59.399 rx:b''
Error rx:b''
20:16:59.500 tx:b'000010 test\n\r'
tested on a PI4 with FTDI serial cable TX and RX bridged