2022-12-08 05:31 PM
I'm really trying to tell if the board is connected to an external comm port to turn off usart sends so they don't potentially backup and slow things down. I know other products expose thinks like vbus sensing? Don't know much about it. I tried to find it in the board support code but unless there is another include file, I haven't had any luck.
Thanks
2022-12-09 10:10 AM
You can route VBUS to a GPIO pin (typically with a resistor bridge) and monitor that. If it disappears, de-initialize the USB. The schematic would show if this is done on that board.
2022-12-09 10:20 AM
I saw some things about that yesterday and that 's pretty easy to implement. The real issue, and I don't know if so on the stm boards, but on an arduino, if you send data that isn't received, further sends will start backing up and slowing down the processor mainline. Now that I think about it more, I think what I'm really looking for is something to tell if nobody is listening on the virtual comm port. I looked at the usart registers as I brought up and down a serial monitor and they didn't seem to change. Maybe I need to implement some kind of flow control.
jerry
2022-12-09 10:33 AM
If you're talking about the VCP provided on ST-boards, there's no way for the chip to know if the other end is connected. The signals get converted to UART signals.
If the other side isn't connected, the signal will still be sent.
2022-12-09 02:35 PM
I can test this, but what about the transmit timeouts? Do they expire if the device on the other end of the vcom port don't receive them? Short of the other device sending an ack of some type, can you think of another way using the vcp to accomplish this?
2022-12-09 02:45 PM