Giter Club home page Giter Club logo

spi_slave_driver_implementation's Introduction

<img src="https://travis-ci.org/pmezydlo/SPI_slave_driver_implementation.svg?branch=master" alt=Travis Cl build" />

SPI slave driver implementation

This repository contains the code for SPI slave driver realization of my project for GSOC-2016.

Introduction

SPI slave driver implementation. The task is to create a driver controlling SPI hardware controller in slave mode, and to ensure optimal performance through the use of DMA and interrupt. Creating an easy to implement realization of SPI slave would definitely help the BeagleBone community members to write applications based on SPI much more easily. The first implementation of my protocol driver is going to example of a bidirectional data exchange. This application will provide the BeagleBone community with valuable experience and will be a good example of SPI slave. Hardware limitations make it impossible to perform any realization of the device using SPI slave. Sending away data to the master during one transaction is not possible. One transaction is enough to receive data by slave device. To receive and send back data, two transactions are needed. The data received from master device in a single transaction is transferred to the user after completing the transaction. The user's reply to received data is sent in the next transaction.

More information is here: https://github.com/pmezydlo/SPI_slave_driver_implementation/wiki

License

SPI slave driver is released under the GPLv2 license.

Images

spi_slave_driver_implementation's People

Contributors

lukasmaj avatar pmezydlo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spi_slave_driver_implementation's Issues

Cannot load dtbo file

When I try to execute echo 'SPI0_slave' > /sys/devices/platform/bone_capemgr/slots, I get the error bash: echo: write error: Invalid argument. A short look into dmesg shows this error: __of_adjust_tree_phandle_references: Illegal property (size) 'fixup' @/__local_fixups__

Do you know what this means? Was not able to find something useful

Documentation needs updating

Hi just a comment --

Referring to the installation instructions, they are great but please put curly braces, i.e. instead of $(CC) you need ${CC} or I get syntax errors everywhere.

Also, you should mention a full kernel build of the kernel source is required BEFORE attempting to build the spi slave module, otherwise the modules will refuse to load on the beaglebone with errors in dmesg like "no symbol version for module_layout"

Also, please include instruction to also upload spi-slave-core.ko and insmod that first, or you'll get unknown symbol errors when inserting the driver.

Finally I believe there is a minimum kernel version required, no? For me the 3.8 series did not work.

Thanks !

Compiling kernel source problem

Hello,

I have tried to follow the procedure, and I have a problem that I can't solve.

Once I get to this level (after retrieving the .config file) :
make -j3 modules ARCH=arm CROSS_COMPILE=$(CC) LOCALVERSION=-$SOURCE_VERSION 2>&1

I get the following error message:

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACC    scripts/kconfig/zconf.tab.c
/bin/sh: 1: bison: not found
make[2]: *** [scripts/Makefile.lib:196: scripts/kconfig/zconf.tab.c] Error 127
make[2]: *** Attente des tâches non terminées....
  LEX     scripts/kconfig/zconf.lex.c
/bin/sh: 1: flex: not found
make[2]: *** [scripts/Makefile.lib:188: scripts/kconfig/zconf.lex.c] Error 127
make[1]: *** [Makefile:534: syncconfig] Error 2
make: *** [Makefile:633: include/config/auto.conf.cmd] Error 2

Note: the previous compilation did not pose any problem:
make -j3 mrproper ARCH=arm CROSS_COMPILE=$(CC) LOCALVERSION=-$SOURCE_VERSION
It's OK.

Do you have any idea where the problem might come from?
I am working on the version : 4.19.94-ti-r42

Thanks!

Unable to send or receive data

If anyone happens to be watching this. Running 4.14.71-ti-r80 and I've managed to sort of get things going. The overlay and kernel modules load with no errors and device appears and can be opened but it doesn't seem like it's able to send or receive. I have it connected to another Beaglebone running as a master that loops back data just fine. Just running into a wall as how to further debug this.

SPI device node is not created

Hi

after loading the cape and drivers, there is no spi device created in /dev.
This is with kernel 4.4.30-ti-r64. I've 'successfully' used insmod - all I see in dmesg is, after loading spislave core, the message :

spislavecore: function: init

Then I loaded spi-mcspi-slave.ko.
Any ideas on what might have gone wrong? I have confirmed the SPI0_slave cape is the only one loaded and that spi_omap2_mcspi is blacklisted.

edit: I also tried the SPI1_slave cape to no effect. It doesn't look like the driver is properly initializing.

Can you let me know what kernel version I should be using for this to work?

Compile Problem

First I wanted to thank you.
i have a problem while compiling your driver
i edit the make file with my kernel version

ARCH := arm
COMPILER := /home/circle/Desktop/spi_proj/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
COMPILER_V := gcc
PWD := $(shell pwd)
KERN_V=3.8.13
BUILD_V=-bone79
SOURCE=linux-stable-rcn-ee
SUBDIRS=firmware/

KDIR := $(PWD)/$(SOURCE)-$(KERN_V)$(BUILD_V)

obj-m+= driver/spi-slave-core.o driver/spi-slave-debug.o driver/spi-slave-dev.o driver/spi-mcspi-slave.o 

all:
	$(MAKE) -C $(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(COMPILER) modules
	$(COMPILER)$(COMPILER_V) -o slave_app/slave_app slave_app/slave_app.c

clean:
	$(MAKE) -C $(KDIR) M=$(PWD) ARCH=$(ARCH) clean

when i try to compile i get a lot of
error: implicit declaration of function
from each c file
i try to add the prototype of function for each error from here
http://elixir.free-electrons.com/linux/latest/ident/
didnt help
and also try to include all the header file where the function is first Defined
still didnt mange to compile it
any ideas?

compiling error

Hello,

Since updating to your latest code, I am unable to compile.
I receive the following errors.
/root/github/SPI_slave_driver_implementation/driver/spi-slave-dev.c:279:3: error: implicit declaration of function 'idr_pre_get' [-Werror=implicit-function-declaration]
if (!idr_pre_get(&spislave_idr, GFP_KERNEL) == 0) {
^
/root/github/SPI_slave_driver_implementation/driver/spi-slave-dev.c:285:3: error: implicit declaration of function 'idr_get_new' [-Werror=implicit-function-declaration]
ret = idr_get_new(&spislave_idr, data, &data_id);
^

I've tried kernel 4.4.9-bone10 and 4.4.9-ti-r25

Any thoughts?

Thanks.

Great work!! Can you help me?

Hi,

Great work with your SPI slave driver. It seems to be working great as a stand alone SPI slave.
Unfortunately I can't complete a successful test when I am using only a single BBB in a master & slave configuration.
I am running 4.4.9-bone10.
I have pins:
P9_19 to P9_30
P9_20 TO P9_32
P9_23 TO P9_31
P9_24 TO P9_33
which matches your drawing.

Which dts files should I echo to slots? Do I need to blacklist spi_omap2_mcspi when running in this configuration?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.