STM32F4 serial.Available()?
Posted: Wed Nov 04, 2020 8:30 pm
Hello everyone
I have started very recently with ARMs, specifically with the STM32F407 VG DISCO
I am experimenting with the USART port and I have some doubts.
In the same way as in the arduino IDE for avr, I have always used serial.Available () to know the number of bytes that are going to arrive, I need to do the same for the STM32F4, but I have not found anything about it. All they suggest to me is to set the number of bytes to receive.
I am doing some tests with a machine to which I send from the STM32F4 discovery, a command of two bytes, for example (0x01, 0x11) and it responds with a frame of bytes of variable length. For some commands I know the length of bytes that are received, in those cases the reception is OK, but if I don't know how many bytes are going to arrive I can't get the answer.
I have read about using circular DMA for these cases, but this machine only responds once for every command sent, it is not a constant frame.
I appreciate any example, suggestion or advice to achieve my goal
Regards
I have started very recently with ARMs, specifically with the STM32F407 VG DISCO
I am experimenting with the USART port and I have some doubts.
In the same way as in the arduino IDE for avr, I have always used serial.Available () to know the number of bytes that are going to arrive, I need to do the same for the STM32F4, but I have not found anything about it. All they suggest to me is to set the number of bytes to receive.
I am doing some tests with a machine to which I send from the STM32F4 discovery, a command of two bytes, for example (0x01, 0x11) and it responds with a frame of bytes of variable length. For some commands I know the length of bytes that are received, in those cases the reception is OK, but if I don't know how many bytes are going to arrive I can't get the answer.
I have read about using circular DMA for these cases, but this machine only responds once for every command sent, it is not a constant frame.
I appreciate any example, suggestion or advice to achieve my goal
Regards