SPI driver development


Jiří Kubias <jiri.kubias@...>
 

Hi,
I would like to try develop SPI driver for SAME70. However by looking to ./drivers/spi/ it seems that every driver is implemented by its own way (some needs workarounds in dts.fixup). Is there some spi driver which I can take as reference? Im quite new to this so any help is appreciate.

Best regards,
Jiri  


--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================


Tomasz Bursztyka
 

Hi Jiri,

One thing is common over all drivers is how it iterates through the r/w
buffers (drivers/spi/spi_context.h) but rest depends on hardware and
whether or not you use a HAL to access it (nrfx, stm32 are doing it for
instance).

Up to you to decide if you want to use a HAL (from Atmel's ASF) or not
then.

Br,

Tomasz

Hi,
I would like to try develop SPI driver for SAME70. However by looking
to ./drivers/spi/ it seems that every driver is implemented by its
own way (some needs workarounds in dts.fixup). Is there some spi
driver which I can take as reference? Im quite new to this so any
help is appreciate.

Best regards,
Jiri


Justin
 

Hi Jiri,

I have a good bit of a SPI driver done. It needs the reading side completed and tested. For my purposes I only did the writing side. Would you like to take it from where I left off or do you want to do your own? You are welcome either way to message me on IRC. I have written a portion of the SAM supporting code.

On Wed, Sep 5, 2018 at 12:15 AM Tomasz Bursztyka <tomasz.bursztyka@...> wrote:
Hi Jiri,

One thing is common over all drivers is how it iterates through the r/w
buffers (drivers/spi/spi_context.h) but rest depends on hardware and
whether or not you use a HAL to access it (nrfx, stm32 are doing it for
instance).

Up to you to decide if you want to use a HAL (from Atmel's ASF) or not
then.

Br,

Tomasz

> Hi,
> I would like to try develop SPI driver for SAME70. However by looking
> to ./drivers/spi/ it seems that every driver is implemented by its
> own way (some needs workarounds in dts.fixup). Is there some spi
> driver which I can take as reference? Im quite new to this so any
> help is appreciate.
>
> Best regards,
> Jiri 
>
>





Jiří Kubias <jiri.kubias@...>
 

Hi Justin,
actually I made it yesterday (adopted stm32 code), at least it is looks like that it is working somehow (both direction), but also it need some testing. However Im still missing IRQ and DMA support.  So if your code support IRQ and DMA I would like to take look at it as I need DMA support.  Im also still missing some initialization part check... Lot of stuff to do. 

Im still dont know how to handle the possibility to have various configuration for different chip select under one peripheral in Zephyr.  But I dont need this functionality and Zephyr is not ready for this.... 

Just to be clear Im using SPI peripheral not USART. 

Regards,
Jiri


2018-09-06 6:17 GMT+02:00 Justin Watson <jwatson5@...>:

Hi Jiri,

I have a good bit of a SPI driver done. It needs the reading side completed and tested. For my purposes I only did the writing side. Would you like to take it from where I left off or do you want to do your own? You are welcome either way to message me on IRC. I have written a portion of the SAM supporting code.

On Wed, Sep 5, 2018 at 12:15 AM Tomasz Bursztyka <tomasz.bursztyka@....com> wrote:
Hi Jiri,

One thing is common over all drivers is how it iterates through the r/w
buffers (drivers/spi/spi_context.h) but rest depends on hardware and
whether or not you use a HAL to access it (nrfx, stm32 are doing it for
instance).

Up to you to decide if you want to use a HAL (from Atmel's ASF) or not
then.

Br,

Tomasz

> Hi,
> I would like to try develop SPI driver for SAME70. However by looking
> to ./drivers/spi/ it seems that every driver is implemented by its
> own way (some needs workarounds in dts.fixup). Is there some spi
> driver which I can take as reference? Im quite new to this so any
> help is appreciate.
>
> Best regards,
> Jiri 
>
>







--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================


Vincent - VLoTech
 

Hi Jiri, 

I'm was planning a SPI driver for the SAM4S and later on the SAMe70. 
I have sufficient boards to test the SPI driver, with displays, flash, IMU and transceivers on them to push its boundries. I can add the IRQ and DMA also, as I was using both with another RTOS before. 

Perhaps we can combine effort for this. 

Kind regards,
Vincent 


Jiří Kubias <jiri.kubias@...>
 

Hi Vincent,
Im open minded 8-). I have implemented SPI driver with polling - seems to be working fine for moth ways. But configuration stuff need some recheck and only one CS is supported.  I have tried to implement the DMA (I can compile it) into my driver but it fails when I bind the DMA - I have received MPU protection fault. Unfortunately there not many examples with DMA so it is not so simply to implement it... In another thread was reported also MPU fault with v1.13 which Im using. But it seems to be fixed in GIT so I have to recheck it again to see if the problem is still there or not.  I would like to finish it this week but Im sharing my time with another projects.... 

I will also try to implement the flash driver - but I didnt started yet.

Regards, 
Jiri


2018-09-17 15:07 GMT+02:00 <vincent@...>:

Hi Jiri, 

I'm was planning a SPI driver for the SAM4S and later on the SAMe70. 
I have sufficient boards to test the SPI driver, with displays, flash, IMU and transceivers on them to push its boundries. I can add the IRQ and DMA also, as I was using both with another RTOS before. 

Perhaps we can combine effort for this. 

Kind regards,
Vincent 




--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================


Vincent - VLoTech
 

Hi Jiri,

Sorry for my late reply. I was out of the office  a few days.

Good to hear you've made good progress. I've spoken with Justin, who maintains the SAM drivers. He proposed to take a look at the ADC and UART driver as example.
He offered to help testing where needed. Would you be open to share your current progress and compare implementations? I can also create a github fork we can work into together or so?
I would say, whatever works for you.

Looking forward to your response.

Kind regards,

Vincent


On 09/17/2018 03:17 PM, Jiří Kubias wrote:
Hi Vincent,
Im open minded 8-). I have implemented SPI driver with polling - seems to be working fine for moth ways. But configuration stuff need some recheck and only one CS is supported.  I have tried to implement the DMA (I can compile it) into my driver but it fails when I bind the DMA - I have received MPU protection fault. Unfortunately there not many examples with DMA so it is not so simply to implement it... In another thread was reported also MPU fault with v1.13 which Im using. But it seems to be fixed in GIT so I have to recheck it again to see if the problem is still there or not.  I would like to finish it this week but Im sharing my time with another projects.... 

I will also try to implement the flash driver - but I didnt started yet.

Regards, 
Jiri


2018-09-17 15:07 GMT+02:00 <vincent@...>:

Hi Jiri, 

I'm was planning a SPI driver for the SAM4S and later on the SAMe70. 
I have sufficient boards to test the SPI driver, with displays, flash, IMU and transceivers on them to push its boundries. I can add the IRQ and DMA also, as I was using both with another RTOS before. 

Perhaps we can combine effort for this. 

Kind regards,
Vincent 




--
===================================================
Ing. Jiri Kubias
 
e-mail: jiri.kubias@...
mobile: 775 593 956
===================================================

-- 
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient's and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

TERMS AND CONDITIONS : All contracts & agreements are carried out in accordance with VLoTech's general terms and conditions. Entry into the contract implies acceptance of the applicability of the general terms and conditions of VLoTech. The general terms and conditions are stated on our web page ( www.VLoTech.com - click on "terms and conditions" - ), and a printed copy can be sent free of charge on request.