Project

General

Profile

Activity

From 01/21/2016 to 02/19/2016

02/01/2016

JC 10:49 AM Software Development: RE: Spidev issues
Fred, I'm not sure what is wrong. Perhaps if you sent us your schematic someone could look it over.
I'm pretty sure the spidev driver works. However you could try implementing a simple kernel driver to access the spi calls directly....
Jonathan Cormier

01/29/2016

FF 03:08 PM Software Development: RE: Spidev issues
A single IOCTL call with len=4 returns 4 bytes of 0 value instead of 2 with no difference in the SPI signals. Fred Frantz
JC 12:04 PM Software Development: RE: Spidev issues
I believe you want a single IOCTL. See the attached source code duplex method.
Example usage
Jonathan Cormier
FF 11:51 AM Software Development: RE: Spidev issues
Correction in above code
fd = open(devname, O_RDWR|O_SYNC);
should be
fd = open(devname, O_RDWR);
Fred Frantz
FF 11:49 AM Software Development: RE: Spidev issues
This is based on spidev_test.c and other examples. There are two devices on the bus that have to be configured to read address input pins before they can be configured. That is working fine since the correct device is responding to the ... Fred Frantz
JC 11:06 AM Software Development: RE: Spidev issues
Fred Frantz wrote:
> Yes, I am looking at all the SPI0 signals on a scope, and they are correct. The transmitted data is configuring the devices correctly, and the received data from the device on d1 is correct, but it is not returned ...
Jonathan Cormier
FF 11:02 AM Software Development: RE: Spidev issues
Yes, I am looking at all the SPI0 signals on a scope, and they are correct. The transmitted data is configuring the devices correctly, and the received data from the device on d1 is correct, but it is not returned from ioctl(). I have v... Fred Frantz
JC 10:44 AM Software Development: RE: Spidev issues
Fred Frantz wrote:
> The data is now being clocked out correctly, and the device is responding with the correct data on the spi0_d1 line.
Does this mean you have a spi analyser attached to the bus?
Jonathan Cormier
JC 10:42 AM Software Development: RE: Spidev issues
Fred Frantz wrote:
> Mike, are you referring to the .d0_is_mosi parameter in the ompa2_mcspi_device_config structure?
Yes. You should have it correct if you are seeing the data output coming on the correct pin.
> ...
Not that I can th...
Jonathan Cormier
FF 10:36 AM Software Development: RE: Spidev issues
Mike, are you referring to the .d0_is_mosi parameter in the ompa2_mcspi_device_config structure? That is set to 1, but all of the SPI_MODE's give a similar result. All the data bytes returned are the same value, which is not what is be... Fred Frantz

01/28/2016

MW 12:12 PM Software Development: RE: Spidev issues
I think there is also a control for the McSPI that can swap the din / dout pins between "d0" and "d1". We had trouble with this in the past.
-Mike
Michael Williamson
JC 12:06 PM Software Development: RE: Spidev issues
Fred Frantz wrote:
> Thanks for the correction. Setting the .bus_num = 1 solved the module issue, and the .controller_data information is required for the spi0_d0 line to be used as MOSI.
> ...
It should be correct. If data is coming...
Jonathan Cormier
FF 11:59 AM Software Development: RE: Spidev issues
Thanks for the correction. Setting the .bus_num = 1 solved the module issue, and the .controller_data information is required for the spi0_d0 line to be used as MOSI.
The data is now being clocked out correctly, and the device is re...
Fred Frantz

01/26/2016

JC 05:02 PM Software Development: RE: Spidev issues
Fred Frantz wrote:
> After erasing the NAND, the ECC errors are resolved. Thanks, that was a self inflicted problem due to misinterpretation of our documentation.
Glad that helped.
> ...
The SOM is using the spi1 bus to talk to the NO...
Jonathan Cormier
JC 04:54 PM Software Development: RE: Spidev issues
Michael Williamson wrote:
> SPIDEV sits on top of McSPI. It's an abstraction layer on top of the specific SPI driver. That may be the problem.
What Mike said. The McSPI driver is necessary for the spidev driver to work.
> ...
He h...
Jonathan Cormier
MW 03:49 PM Software Development: RE: Spidev issues
SPIDEV sits on top of McSPI. It's an abstraction layer on top of the specific SPI driver. That may be the problem.
You may need to configure (either via a platform file or via device tree) a SPIDEV device that is attached to a speci...
Michael Williamson
FF 03:36 PM Software Development: RE: Spidev issues
After erasing the NAND, the ECC errors are resolved. Thanks, that was a self inflicted problem due to misinterpretation of our documentation.
Can the McSPI conflict with SPIDEV if both are trying to access the same port? Disabling Mc...
Fred Frantz
JC 11:44 AM Software Development: RE: Spidev issues
Jonathan Cormier wrote:
> For your case you just need to erase the kernel section.
> ...
Do double check my math on this, if wrong it could erase part of your filesystem image.
Jonathan Cormier
JC 11:43 AM Software Development: RE: Spidev issues
> U-Boot# tftp 0x82000000 $serverip:uImage
> ...
By writing the nand like this without erasing, you will corrupt the image stored including the ECC. Nand flash must be erased before writing to it.
Note in the following guide I erase ...
Jonathan Cormier
FF 11:17 AM Software Development: RE: Spidev issues
The kernel and environment were reloaded just to get to a known point where everything was working previously. The kernel is being loaded via tftp.
U-Boot# tftp 0x82000000 $serverip:uImage
U-Boot# nand write.i 0x82000000 0x340000 $...
Fred Frantz
JC 10:39 AM Software Development: RE: Spidev issues
Just checked and the 0x340000 address the ECC errors mention is the location of the kernel not the environment I initially assumed. How are you loading the kernel to boot the system if loading it from nand isn't working (tftp)? How are... Jonathan Cormier
JC 09:35 AM Software Development: RE: Spidev issues
Fred Frantz wrote:
> Thanks for the suggestions, but ZCAT on the target indicates that SPIDEV is enabled.
Interesting. My troubleshooting steps when trying to diagnose a driver not loading is the following.
* Check the boot log for ...
Jonathan Cormier
FF 09:13 AM Software Development: RE: Spidev issues
Thanks for the suggestions, but ZCAT on the target indicates that SPIDEV is enabled. Regarding the ECC errors, I reloaded an earlier version of the kernel and an environment variable file that was working without any problems, but the E... Fred Frantz

01/25/2016

JC 05:33 PM Software Development: RE: Spidev issues
Hmm no noticeable errors. You can double check the kernel, on the booted device for the spidev support: Jonathan Cormier
FF 04:21 PM Software Development: RE: Spidev issues
I added the boot log for the ECC errors also. Fred Frantz
FF 03:39 PM Software Development: RE: Spidev issues
Hope this helps. Fred Frantz
JC 03:15 PM Software Development: RE: Spidev issues
Can you attach the bootlog for the device? Jonathan Cormier
FF 03:09 PM Software Development: RE: Spidev issues
It looks like it is enabled to me.
Fred Frantz
JC 01:41 PM Software Development: RE: Spidev issues
A pinmux conflict would likely cause the device not to work but it would not affect the creation of the spidev device file.
You need to make sure that SPIDEV is enabled in the kernel. It doesn't look like it is by default.
Jonathan Cormier
FF 01:33 PM Software Development: Spidev issues
The dev kit baseboard file has been modified to include a "spidev" device, and the kernel was compiled to include the SPI device driver for users. However, the expected /dev/spidev0.1 file is not generated. Can a pinmux conflict with o... Fred Frantz

01/21/2016

FF 08:56 AM Software Development: RE: SocketCAN configuration
After the links were corrected on my system, it works using iproute2 also.
Thanks
Fred Frantz
 

Also available in: Atom