Working SPI on OlinuxIno-Wifi

Started by ozbekmert, December 12, 2012, 02:34:10 AM

Previous topic - Next topic

ozbekmert

I can successfully connected my device using I2C and getting data. Now i am trying to make a connection using spi interface. 
Basic Note on how i can use I2C

# i2cdetect -r 0
# i2cdump 0 0x40

When i using I2C , there are some commands to find my device data adresses.
Now, i found spidev library under usr/include/linux/spi/spidev.

My problem is , is there any command to find data adress of my module?

Fadil Berisha

Hi ozbekmert,

Quote from: ozbekmert on December 12, 2012, 02:34:10 AM
My problem is , is there any command to find data adress of my module?
There is not command like i2cdetect for SPI devices. If you add new device, need to  include respective driver  in kernel and in <board>.c file need to initialize spi_board_info structure:
http://kernel.org/doc/htmldocs/device-drivers/API-struct-spi-board-info.html.
This topic is discussed also in following threat: https://www.olimex.com/forum/index.php?topic=462.msg1742#msg1742

Fadil Berisha

ozbekmert

Thank you for reply, but make menuconfig is not working. It says no rule to make target 'menuconfig'. Stop. Moreover i tried following way to access config menu, but i could not reach menuconfig and there is no file in usr/bin/src. In gives sites src directory includes linux directory.

# Kernel .config
Error is => bash: Kernel: command not found.


In given sites experts says that
#sudo apt-get update && sudo apt-get upgrade -y
#reboot
#git clone --depth 1 https://github.com/raspberrypi/linux.git
#cd linux
#zcat /proc/config.gz >.config
#edit .config and enable
#CONFIG_ENC28J6
#make modules
#sudo make modules_install
It seems i need to upgrade my linux. My second question is where i can found <board>.c file?



Info:
-uname
Linux debian 3.0.42 #7 PREEMPT Thu Oct 15:15:02 EEST 2012 armv7l GNU/Linux




leo

Hi,

why do you use RaspberryPi git repository?

Try:

git clone https://github.com/linux-sunxi/linux-sunxi
cd linux-sunxi
make ARCH=arm a13_defconfig
make ARCH=arm menuconfig


Take a look at http://olimex.wordpress.com/tag/linux/

The path to the board config file is
linux-sunxi/arch/arm/mach-sun5i

Kind Regards

Leo

ozbekmert

Thank you sir , it was very helpful. The code i putted was just an example.

ozbekmert

#5
When i tried to install linux-sunxi by using following command

# git clone https://github.com/linux-sunxi/linux-sunxi

It succesfully downloads data which is approximately 800MB then it tried to resolve deltas however , after complete %100 resolving delta, it gives an error.

Error: index-pack died of Signal  (Some Number)
Fatal: index-pack failed


I searched solutions for that problem. What i found is

1) Some people recommends that download this file(linux-sunxi) into a flash drive then try to update.
But, it does not look lika a solution.

2) Some people says to change GIT_TRACE=1 and i really do not know what GIT_TRACE is.

3) some other people says it is caused by out of memory. It seems logical because

"Git uses delta encoding to store change sets. However, you don't want to have to play back every single change ever on a given file in order to get the current version, so Git also has occasional snapshots of the file contents stored as well. "Resolving deltas" is the step that deals with making sure all of that stays consistent."*

According to my thoughts , it might be the reason but i am really not sure.
What do you suggest me to do?

Best
Mert





*:http://stackoverflow.com/questions/4689844/what-is-git-actually-doing-when-it-says-it-is-resolving-deltas

leo

Hi Mert,

i think this problem is not Olimex related but i had some problems with this large git repository too. My development environment was running in a virtual machine with only 512 mb ram allocated. After doubling the ram everythink worked fine. But i can not remember if i had the same error message like you. Its just a hint.

Kind regards

Leo

ozbekmert

I am going to search more about this problem, if i can overcome this problem, i will post here.

There is couple of things that i would like to ask.

As i said earlier, i sucessfully establish I2C connection and got data from my chip. Now, i basically keep those data in storage lets say SD card using uext MOD SD-MMC module. As far as i understand that UEXT cover 3 serial communation pins(SPI,I2C,(TX,RX)). I bought MOD SD-MMC and pluged UEXT. When i type
i2cdetect -r 2
system cannot found any devices connected to board. Does MOD-SD/MMC use SPI as well?