erpc icon indicating copy to clipboard operation
erpc copied to clipboard

error handling on erpc server exit

Open bastivi opened this issue 4 years ago • 3 comments

Hi,

I'm using following setup:

erpc Client

  • Xilinx UltraScale+
  • petalinux
  • SPI Master

erpc Server

  • NXP LPC54605
  • FreeRTOS
  • SPI Slave

I've problems to do proper error handling if the erpc server fails with e.g. CRC error. Then I have to restart the erpc server again. But the erpc client stuck into endless loop within erpc lib (erpc_spi_master_transport.cpp - SpidevMasterTransport_WaitForSlaveReadyGpio()) waiting for the markers transferred via SPI. The erpc server do not release this loop (do not send markers) on restart so it is hard to get them out there.

What’s the correct way doing this or is there a erpc server to erpc client function missing to tell the erpc client to abort this request?

It's also already posted on NXP: https://community.nxp.com/t5/LPC-Microcontrollers/eRPC-error-handling-for-SPI-transfer/m-p/1354498/highlight/false#M46747

Thank you a lot and best regards Sebastian

bastivi avatar Oct 13 '21 06:10 bastivi

Hi eRPC user. Thank you for your interest and welcome. We hope you will enjoy this framework well.

github-actions[bot] avatar Oct 13 '21 06:10 github-actions[bot]

Hello Sebastian, thanks for this report. The comment has been provided via the NXP community already but I agree the solution is not ideal in this case. There is no mechanism inside the erpc that would cover that transport error situation. The rootcause is in the SPI transport layer implementation that uses blocking SPI driver API without the timeout possibility. We should think of this transport rewrite with non-blocking API and the timeout possibility. I would recommend now to use any other mechanism for the error state signalling like you do with the GPIO.

MichalPrincNXP avatar Oct 15 '21 12:10 MichalPrincNXP

Hi, thank you for your answer. I'll go on with the GPIO signalling, anyway, if there is the possibility to use GPIO for this task this is the more performant solution.

bastivi avatar Oct 18 '21 05:10 bastivi