Forum Discussion
Altera_Forum
Honored Contributor
19 years agoi2ctools in lm_sensors
NB: This is really a continuation from i2c drivers, but more on the application side.
Hippo, I tried to include lm_sensors (which includes i2ctools) in menuconfig, but it got error. Please helpmake: Entering directory `/home/uclinux/uClinux-dist/lib/sysfsutils'
rm -rf build
mkdir build
(cd build; sh ../configure --host=nios2-linux-uclibc --build=i686-pc-linux-gnu --target=nios2-linux-uclibc )
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for nios2-linux-uclibc-strip... nios2-linux-uclibc-strip
checking build system type... i686-pc-linux-gnu
checking host system type... Invalid configuration `nios2-linux-uclibc': machine `nios2-linux' not recognized
configure: error: /bin/sh ../config.sub nios2-linux-uclibc failed
make: *** Error 1
make: Leaving directory `/home/uclinux/uClinux-dist/lib/sysfsutils'
make: *** Error 2
make: Leaving directory `/home/uclinux/uClinux-dist/lib'
make: *** Error 2
make: Leaving directory `/home/uclinux/uClinux-dist/lib'
make: *** Error 1
uclinux@colinux:~/uClinux-dist$9 Replies
- Altera_Forum
Honored Contributor
The uClinux-dist/lib/sysfsutils/config.sub file needs update for Nios2 support.
Please try search config.sub files in user/* dir. I had added Nios2 to some of them. You can learn how to add Nios2 support. I will try to add it on Monday or later. I didn't have the sources on hand. - Altera_Forum
Honored Contributor
Hi Hippo,
Thanks for your great help. I will try it out on Monday ... I compiled i2ctools sucessfully on a saperately. However, when I start to use it to test some i2c devices connected to the system, it some errors which I don't understand. I have added /dev/i2c-0 in romfs_list. The kernel seems to understand that there is i2c driver, and opencores algorithm. Using a scope to probe those signals, but just cannot get anything. Any ideas ? Perhaps something I missed or overlooked. Happy weekend. - Altera_Forum
Honored Contributor
You may enable debug messages for the drivers.
Then try to access the basic i2c char dev. You need to make sure the i2c access works onto the bus. - Altera_Forum
Honored Contributor
Hippo,
Any news on the compiling lm_sensors in make menuconfig ? - Altera_Forum
Honored Contributor
Hippo,
I have scratching my head on this. With the mysys.ptf, make generates uClinux-dist/linux-2.6.x/include/nios2_system.h which contains the avalon bus hardware address for my i2c as shown below ...# define na_pio_eigen_0_end 0x022208c4# define na_i2c_0 0x822208e0# define na_i2c_0_irq 7 ... I have lookedi n the i2c source code, and cannot find any references to na_i2c_0. Can you help ? This may get me somewhere if I know where these things are referenced. Thanks. - Altera_Forum
Honored Contributor
I also notice when I do a make, I notice the following warnings
WARNING: "enable_irq" [drivers/i2c/busses/i2c-oc.ko] undefined! WARNING: "disable_irq" [drivers/i2c/busses/i2c-oc.ko] undefined! Now, is that something that is important ? I know it's only a warning. - Altera_Forum
Honored Contributor
Hippo,
When I built the driver into the kernel, and boot up the system, I get the following
Does it mean the drivers are in ? Also, when I try to do i2cdetect, I get this.Uncompressing Linux... Ok, booting the kernel. Linux version 2.6.Uncompressing Linux... Ok, booting the kernel. Linux version 2.6.17-uc1 (uclinux@colinux) (gcc version 3.4.6)# 36 PREEMPT Mon N ov 6 11:12:34 EST 2006 uClinux/Nios II Altera Nios II support (C) 2004 Microtronix Datacom Ltd. Built 1 zonelists Kernel command line: PID hash table entries: 256 (order: 8, 1024 bytes) ... smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <[email protected]> eth0: SMC91C11xFD (rev 1) at 82210300 IRQ 6 eth0: Ethernet addr: 00:07:ed:0f:06:92 i2c /dev entries driver i2c-oc: i2c Opencores adapter driver Opencores i2c algorithm module TCP bic registered NET: Registered protocol family 1 ...
It looks like the algorithm is NOT available. but, when I try modprobe i2c-algo-oc, I get the following/nios2bin> ./i2cdetect Error: No i2c-bus specified! Syntax: i2cdetect I2CBUS I2CBUS is an integer With -f, scans all addresses (NOT RECOMMENDED) With -q, uses only quick write commands for probing (NOT RECOMMENDED) With -r, uses only read byte commands for probing (NOT RECOMMENDED) If provided, FIRST and LAST limit the probing range. i2cdetect -l lists installed busses only Installed I2C busses: i2c-0 unknown Opencores i2c 0 Algorithm unavailable /nios2bin>
This is very confusing for me. Please help./nios2bin> modprobe i2c-algo-oc modprobe: could not parse modules.dep - Altera_Forum
Honored Contributor
Hippo,
I don't what went wrong. After exhausting the code in uclinux (with limited knowledge), I decided to rebuild the sof file in Quartus II. And also regenerate NIOS II in SOPC builder. And things are more promising now. At least I am seeing some signals coming out of the hardware, which is really good news. Thanks for your help. Once I got something working, I shall post it to the wiki for the benefits of others. - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by albertyong88@Nov 6 2006, 11:33 PM hippo,i don't what went wrong. after exhausting the code in uclinux (with limited knowledge), i decided to rebuild the sof file in quartus ii. and also regenerate nios ii in sopc builder.
and things are more promising now. at least i am seeing some signals coming out of the hardware, which is really good news.
thanks for your help.
once i got something working, i shall post it to the wiki for the benefits of others.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=19220)
--- quote end ---
--- Quote End --- I have updated the nios2 patches, ver 13. The sysfs lib can build now. But there are still a lot of problems in lm_senses . I think the lm_senses may become very big, due to the lack of shared suport in nios2. You should try chip drivers in kernel. It may be easier. The modules may be confsing. You should disable modules for the tests.