RPi Header SPI & GPIO support


#1

Hello,

I have been struggling with the configuration for a couple days now for the RPi header. I ended up building the Yocto and enabling the CP2130 driver in the kernel to be able to get it loaded into the system.

I have spidev0.0 in my /dev

I am now having a few issues understanding how to configure the CP2130.

The board I am connecting to CS is connected to pin 24 on RPi header. As well, pin 26 I need configured as a GPIO to control the reset of the board.

I have issued the following command to configure SPI:

echo -n 1,1,-1,1,1,1,4,0,0,0,0,spidev > /sys/devices/platform/msm_hsic_host/usb1/1-1/1-1.1/1-1.1:1.0/channel_config

It takes and creates a spidev32766.1

But, I am struggling on how to configure the GPIO.2 on the CP2130. I can see that when booting up linux finds the chips and creates gpiochip501 (it also says it has 11 ports). I am not sure what to export here using sysfs to create the gpio to then control.

Can someone please provide some confirmation on the SPI configuration as well as what commands I need to issue to configure the GPIO.2 to be an output?

Thanks

Tim


#2

No one at all has any information on this? been trying to figure out how to configure this with libusb to find out that doesn’t work either… Am I to assume that the RPi header is really just not supported?


#3

spidev0.0 is the native SPI bus of the WP module that is available on the IoT slot interface. The cp2130 usb to SPI creates another SPI master. The mangOH Red SDEF loads a kernel driver in support of the cp2130.

The echo command you pasted above creates a spidev device. The first number is the bus number and the second is the chip select. Do you need access to another GPIO in addition to the chip select? Can you say which device you are trying to control?


#4

I have moved my board over to the IOT connector to use the native SPI and GPIO.

I have that somewhat functional now.

But, how much current can the 5V output form the IOT supply? It says in the manual 300 mA typ/500mA max. It also shows “5V peripherals” connected to the 5V supply stating 100mA/500mA max.

From the schematic, I can seem to find anything else that this 5V is powering so does that mean I can pull the full current from IOT connector?

My board that I am connected to has a typical current of 560mA with 660mA Peak. Am I able to supply that much current from the 5V source? When I tried to power it from the 5V and it starts to run the board resets.

Any advise would be great to power from the 5V off the IOT connector.

BTW, the TI chip used for the boost says it can supply up to 2A from a 3.3V input… Is that the case or am I seeing a different issue here?

Thanks


#5

How are you powering the mangOH Red?


#6

Currently via the USB port. Not the console one.


#7

Maybe your USB supply is not giving enough power. Can you connect the USB supply to a wall adapter USB ? Also we don’t support hot plugging on the iot slot