You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A call to ring_buf_put_claim() does not return the free space in the buffer, but the number of bytes that can be written into the also returned buffer pointer until the wrap around point it hit.
In my case the ERPC packets are 26 bytes long, the default buffer size appears to be 256 bytes.
When sending the 1st packet ring_buf_put_claim() will return 256. When the 2nd packet is received however it will only return 230. On the next packet 204 and so on.
The problem now is that when the 10th packet arrives ring_buf_put_claim() will only return 22 and the current implementation thus does not empty the receive fifo.
The problematic condition is actually even tested for, but the 'Error' is not handled
As a consequence the erpc server on the device will stop responding - with the given example of 26 byte sized service requests this will happen at the 10th invocation.
With a 'regular' UART this current implementation should normally not be a problem as you get an Interrupt per single byte received, but of course that depends on actual HW used.
To Reproduce
Create an erpc server on MCU running ZephyrRTOS, create a service that results in packets with size
Expected behavior
Client should be able to invoke the service on the device indefinltely as many times as desired
Screenshots
n/a
Desktop (please complete the following information)
OS:
Linux (Ubuntu23.10) on Host PC running erpc client.
Zephyr RTOS v3.6.0 on MCU
eRPC Version
PC: Using python 3.10, erpc installed from pypi (v3.12.0)
…ork after a few transactions when using USB-CDC (#421)
* fix for issue 420
fixes issue 420.
Not yet happy about error handling though ....
fixes: #420
* fix formatting
* fixing formatting 2nd attempt
this time replacing file with one provided via
#421 (comment)
Describe the bug
Problem is the way how ring buffer is used.
erpc/erpc_c/transports/erpc_uart_zephyr_transport.cpp
Lines 65 to 91 in f9af0f6
A call to
ring_buf_put_claim()
does not return the free space in the buffer, but the number of bytes that can be written into the also returned buffer pointer until the wrap around point it hit.In my case the ERPC packets are 26 bytes long, the default buffer size appears to be 256 bytes.
When sending the 1st packet
ring_buf_put_claim()
will return 256. When the 2nd packet is received however it will only return 230. On the next packet 204 and so on.The problem now is that when the 10th packet arrives
ring_buf_put_claim()
will only return 22 and the current implementation thus does not empty the receive fifo.The problematic condition is actually even tested for, but the 'Error' is not handled
erpc/erpc_c/transports/erpc_uart_zephyr_transport.cpp
Lines 91 to 97 in f9af0f6
As a consequence the erpc server on the device will stop responding - with the given example of 26 byte sized service requests this will happen at the 10th invocation.
With a 'regular' UART this current implementation should normally not be a problem as you get an Interrupt per single byte received, but of course that depends on actual HW used.
To Reproduce
Create an erpc server on MCU running ZephyrRTOS, create a service that results in packets with size
Expected behavior
Client should be able to invoke the service on the device indefinltely as many times as desired
Screenshots
n/a
Desktop (please complete the following information)
Steps you didn't forgot to do
Additional context
The text was updated successfully, but these errors were encountered: