Reduce DELAY time of a function?

Dear Community,

This is in continuation with my previous query posted in toradex community. link attached

https://www.toradex.com/community/questions/27160/adjust-spi-frequency-in-imx7d.html?childToView=27701#comment-27701

While using a function, There is delay happening for the function to be called, executed and returns back. This causes my application to delay. how can i reduce this delay time.

On capturing signals from both PIC micro controller and Toradex output. [upload|taVKdMJoKALGXHGE+K3dAVO+hRM=]

upon close zoom of pic16f8ffa signals [upload|/6O47XHCm8Ng2TO13mlpNjdpBro=]

Toradex with shift register [upload|OmAn5rSW0qEoQghX35qt4PZIlAM=]

The 43microseconds delay is caused by using spi ioctl function.

how can i reduce this delay.

hi @narayanamohan

Please put your question in private only, if there is some confidential information you don’t want to share.

Could you provide the software version of your module?

Concerning your issue: It is not clear what exactly is your issue. Could you describe clearly the pictures you uploaded. The second and third picture are the same.

Further, there will be always a delay between the sending of SPI data and then processing of received data. You have to understand that ARM-A7 with Linux is different than a bare metal micro controller. If your application requires micro-controller functionality, then please read the following article.