I set up a usart link and can send data fine. I can also send data with an expected reply just fine. However, if I sit idle and wait for data, I get a time out flag when it comes in?
for example while(1)//wait ford command { if (_listen && _IN_FLAG) {//do stuff } }
and if (event & ARM_USART_EVENT_RECEIVE_COMPLETE) _IN_FLAG=1;
I never see my _IN_FLAG because the call back issues a ARM_USART_EVENT_RECEIVE_COMPLETE. On some occasions it does turn on the ARM_USART_EVENT_RECEIVE_COMPLETE bit.
What exactly is it timing out for, is it waiting for at terminating character? Data looks fine on the scope.
using - stm32f205 vision v5.06 build750 CMSIS V1.02
Receive Timeout (ARM_USART_EVENT_RX_TIMEOUT) is an optional event generated when timeout is detected between consecutive characters.
Driver Capabilities indicate if this event generation is supported.
It’s exact timing is hardware dependent. For example on NXP LPC17/18/43 families it is 3.5 to 4.5 character times.
Take a look at the documentation for USART driver: www.keil.com/.../group__usart__interface__gr.html
That is what I gathered so far but I didnt see the bit about the consecutive charters. Still though this does not add up.
If it is optional, then how do I stop it? If I remove the breakpoint trigger it still is not sending the ARM_USART_EVENT_RECEIVE_COMPLETE because of the error.
The timing in between my charters is .1 ms and takes 1ms for a character. So whats wrong whit that?
Also how the heck could it possibly know I have more then one charter?
> If it is optional, then how do I stop it? If it is implemented in the driver (indicated in the capabilities) then it can’t be disabled.
Depending on your application you may consider reading a smaller number of characters in one call. You may also re-trigger receive after the timeout.
I get this error with exactly one character sent? I was able to get data by constantly running the receive (shown below) but getting 0s20 errors now.
all my thread consists of is this
USARTdrv->Receive(dataBuffer, 64); osDelay(1);
yet as soon as I send a character of any kind I get this 0x40 error. If I ignore this error and only one character was sent I get the 0x02. Though if multiple were send I not get an ox20 instead of the 0x02.
So:
send 'q' ARM_USART_EVENT_RX_TIMEOUT ARM_USART_EVENT_RECEIVE_COMPLETE send 'qq' ARM_USART_EVENT_RX_TIMEOUT ARM_USART_EVENT_RX_OVERFLOW
Just not following the reason I'm getting these.
Just out of curiosity, is this drive expecting me to know the size before its delivered?
USARTdrv->Receive(dataBuffer, 9); //packet must be 9 characters (i.e 12345678\r )
I hope not, because I'm not sure how I'd ever know that unless I use padding.
but I saw this.
sent : abc456789 USARTdrv->Receive(dataBuffer, 9); saw : c456 ?
After some experimentation and examples found online I came to this conclusion.
1) You need to set the size you expect in USARTdrv->Receive 2) Most all examples always assume 1 charter in size. 3) the doc implies you can set the designed size. 4) No matter what the value you put in the driver will not allow more then 2.
examples
USARTdrv->Receive(&dataBuffer, 0); //fails USARTdrv->Receive(&dataBuffer, 1); //works when one char comes in USARTdrv->Receive(&dataBuffer, 2); //works when tow chars comes in USARTdrv->Receive(&dataBuffer, 2); //works when tow chars comes in, 3 trigger an over flow.
It does not matter if it is in one sting of chanters or single characters, only 2 are premeditated. After the second an over flow is triggers and thusly ever charter after that also trigger an overflow. Not sure how you kill the receiver and wait for the next.