SPI implementation in FreeRTOS

deepakseshan wrote on Monday, September 30, 2019:

hello All,
i am trying to implment SPI in the FreeRTOS. i have already running SPI code in my target board and I just wanted to integrate it in the FReeRTOS envronment.
For example, i have got functions called SPI_init() and SPI_run() which will transferring 10 bytes from Master SPI transmit to Slave SPI receive.
How to configure the above two functions in the FreeRTOS evvironment.
i am using Infineon Tricore TC277 Aurix microcontroller.

Kindly do not hesitate to ask me for more information .

Kindly i request you all shed some thoughts on it.

Kind Regards,
Deepak R.

richard_damon wrote on Monday, September 30, 2019:

Generally to convert a driver to work in a FreeRTOS environment, you want to convert any ‘Spin Waits’ where youa are waiting any significant period of time on a signal into some form of blocking action waiting for an ISR that is triggered by that signal.

You also may need to add some form of resource sharing handling to make sure that two tasks don’t try to talk to a given piece of hardware at once.

deepakseshan wrote on Monday, September 30, 2019:

hello Richard,
Thank you very much for the quick response, As this is the first time i am trying to implement, Please, can you provide any examples or document regarding the basic setup of SPI driver implmentation so that i can understand better technically.
many thanks again, kindly help me in this regard.