Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for the info. So this issue might have something to do with the board design itself and not with the kernel driver or H3 itself. In NanoPi Neo, only SPI0 is exposed. So there is only spidev0.0. Will have to try a different Pi board then. It's sad cause NanoPi Neo is cheap and excellent otherwise.
  2. azmathmoosa

    H3 SPI

    I am using mainline kernel 4.11.2 and NanoPi Neo board (H3 chipset). SPIDEV works and shows up in /dev/spidev0.0. But I am having trouble communicating with an SPI device. I hooked up a logic analyzer and observed that in SPI Mode 0 (CPOL=0, CPHA=0), right before the chip select goes down (Active Low), the SCK suddenly rises and falls. This causes my spi module (an NRF24L01 chip) to not output proper register values. That module only supports SPI Mode 0. For testing purposes I am using a speed of 10KHz but 8MHz exhibits the same behaviour. When I use SPI Mode 3, (which is logical inverse of Mode 0 for SCK line) it works properly. But my module nrf24 module only supports Mode 0. I have also tried kernel 4.14.0, 4.10.0 and same issue. Can someone tell me which exact kernel version works with spidev?
  3. Hi, I have a nanopi neo based on allwinner h3 chipset. I am trying to use an SPIDEV based driver for RF2401L (2.4 Ghz wireless module). I have used npi-config to enable the /dev/spidev0.0 device. However, when I try to use it to read status register of my module, I get wrong values. My SPI settings are Speed: 10kHz Bits: 8 Mode: 0 (CPOL=0, CPHA=0) To debug the issue I used a logic analyzer and found the clock signal rising up just before the MISO/MOSI activity. It shouldn't do that. When CPOL = 0, clock should be idle at 0. I am setting the SPI mode to 0. Here is the code void SPI::init() { uint8_t bits = RF24_SPIDEV_BITS; uint32_t speed = RF24_SPIDEV_SPEED; uint8_t mode = 0; int ret; /* * spi mode */ ret = ioctl(this->fd, SPI_IOC_WR_MODE, &mode); if (ret == -1) { perror("can't set spi mode"); abort(); } ret = ioctl(this->fd, SPI_IOC_RD_MODE, &mode); if (ret == -1) { perror("can't set spi mode"); abort(); } /* * bits per word */ ret = ioctl(this->fd, SPI_IOC_WR_BITS_PER_WORD, &bits); if (ret == -1) { perror("can't set bits per word"); abort(); } ret = ioctl(this->fd, SPI_IOC_RD_BITS_PER_WORD, &bits); if (ret == -1) { perror("can't set bits per word"); abort(); } /* * max speed hz */ ret = ioctl(this->fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed); if (ret == -1) { perror("can't set max speed hz"); abort(); } ret = ioctl(this->fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed); if (ret == -1) { perror("can't set max speed hz"); abort(); } } Please someone help!
  • Create New...