Understanding serial IO misbehavior
I've been trying to adapt an example piece of code that utilizes a UART from the Visual GDB website.
The adaptations are:
- Using an STM32F769 Discovery board.
- Communicate with an ESP8266 device plugged into the board's WiFi socket.
I managed to work out that I need to use UART5 and PD2 as the UART's RX and PC12 as the UART's TX.
The serial details are the same as the example so need to alter those.
Well when I run this code the send appears to do something because the blue data LED on the ESP8266 flashes briefly (during the send) so this tells me either the send is working or at least the TX pin is fluctuating in some way.
However the receive hangs, the only to stop it hanging is a finite timeout or pass 1 as the buffer length. When I pass 1 as the length I can see that it does indeed write to the buffer and in fact writes a 0x00 but nothing more.
Repeated receives hang, so trying to receive 1 byte then again trying that leads to a hang, only the first read of 1 byte ever returns (with an OK status too).
I have two of these ESP8266 devices and they work fine, I can use a USB adapter for them and chat to them via a terminal program and I also have a sophisticated .Net class library I developed that can hammer these devices asynchronously (via the USB COM port) for long periods and they behave very well.
Any ideas about where I'm going wrong are appreciated.
Thanks
Hugh

...a short time later... Hmm, I wonder if I must force the device's reset pin high as part of this...
