I've got my FTDI USB<->Serial converter working perfectly on Mac now. It does not work on Windows. I was under the impression that the Xojo code (apart from initially finding the right serial port) would be the same for Mac and Windows. Is there any reason the Windows code would need to be different?
It looks like it's working at first, and then fails ...
Hurdle 1: The UART is recognised as a COM serial port, and I can send the command to init the bootloader of my connected device.
Hurdle 2: I can then send one command and the device will respond as long as it's a simple query and doesn't involve *sending* multiple bytes.
The device at Hurdle 2 only responds to single-byte queries. If I try to do something like send an address that takes two bytes, that fails.
After Hurdle 2, communication stops. If I try to send another command, the device does not respond.
To get communication back, I can do this:
- close, reopen, and then repeat the above process.
Sometimes I do this and the device remains unresponsive, so I have to do it again. Usually the second time it works, sometimes the 3rd time.
My first thought was (based on advice received previously on this forum) this must be a driver problem. So I manually installed the FTDI drivers for Windows. This made absolutely no difference.
As I mentioned, on Mac everything works perfectly. On Mac I can send and receive up to 256 bytes at a time at any baud rate, and I did not have to install any drivers. The USB<->UART chip is an FT232RQ from FTDI. The connected device is an STM32.