# SPI implementation in FreeRTOS

**URL:** <https://forums.freertos.org/t/spi-implementation-in-freertos/8087>\
**Category:** Kernel\
**Created:** [September 30, 2019, 4:17pm UTC](https://forums.freertos.org/t/spi-implementation-in-freertos/8087 "2019-09-30T16:17:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [September 30, 2019, 4:17pm UTC](https://forums.freertos.org/t/spi-implementation-in-freertos/8087/1 "2019-09-30T16:17:57Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Monday, September 30, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/2965ab27e8/#d6fa):

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.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [September 30, 2019, 4:26pm UTC](https://forums.freertos.org/t/spi-implementation-in-freertos/8087/2 "2019-09-30T16:26:06Z")

</div>

**[richard\_damon](https://sourceforge.net/u/richard_damon/)** wrote on [Monday, September 30, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/2965ab27e8/#77f6):

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.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [September 30, 2019, 4:33pm UTC](https://forums.freertos.org/t/spi-implementation-in-freertos/8087/3 "2019-09-30T16:33:03Z")

</div>

**[deepakseshan](https://sourceforge.net/u/deepakseshan/)** wrote on [Monday, September 30, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/2965ab27e8/#263c):

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.
