Raspberry Pi & Waveshare - raspberry-pi

I'm trying to hook up a Raspberry Pi model B to a waveshare e-Paper Hat (2.9 inch). Is this the correct pin connection:
E-paper --> Raspberry Pi
3V3 --> Pin 1
GND --> Pin 9
DIN --> Pin 38 (SPI1 MOSI)
CLK --> Pin 40 (SPI1 SCLK)
CS --> Pin 24 (CE0)
DC --> Pin 25 (GPIO 25)
RST --> Pin 11 (GPIO 17)
BUSY --> Pin 24 (GPIO 24)
How correct are they?
I made my selections by matching the keywords in the following two images, but I'm not very confident in my selection:
1) https://www.google.de/search?biw=1680&bih=919&tbm=isch&sa=1&ei=f1l0WrrRCsmvkwWR3qWoDg&q=raspberry+pi+3b+pins&oq=raspberry+pi+3b+&gs_l=psy-ab.3.1.0l10.13619.14818.0.16673.9.7.0.0.0.0.350.773.4j1j0j1.6.0....0...1c.1.64.psy-ab..4.5.684...0i24k1.0.aa6CSQJJX80#imgrc=uzJLoQO8mMNq7M:
2) https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT#Working_with_Raspberry_Pi

Related

How to add support for more than 4 chip-select to Beaglebone's SPI interface

Beaglebone's SPI1 interface has 2 native CS. I want to add 4 more GPIO CS to SPI1. Total 6 CS.
I added all 6 CS entries to the device tree's cs-gpios as shown below.
cs-gpios = <0>,
<0>,
<&gpio3 19 GPIO_ACTIVE_HIGH>,
<&gpio1 18 GPIO_ACTIVE_HIGH>,
<&gpio1 16 GPIO_ACTIVE_HIGH>,
<&gpio1 17 GPIO_ACTIVE_HIGH>;
While testing I observed that only devices connected to the first 4 CS works well. The transaction with the last 2 devices throws a timeout error (timeout error verified from dmesg).
After looking at am33xx.dtsi and spi-omap2-mcspi.c driver file, it seems like the SPI driver support only 4 CS.
How do I extend the SPI driver to support 6 CS?
Basically, I am trying to interface 6 mcp4921 devices via SPI1.
Using kernel version 4.14.108-ti-r134.
References
Beaglebone's version.sh output here
spi-omap2-mcspi driver
mcp4922 driver
omap2 dtsi
omap4 dtsi

I2C gives I/O- Errors and EEPROM only gives 0x00

I got some troubles with my Pi Zero W (Stretch) and my SparkFun AS7265x Sensor(https://cdn.sparkfun.com/assets/c/2/9/0 ... asheet.pdf):
I connected them over my GPIOs and created an I2C Bus:
I detected my sensor at 0x49 via "i2cdetect -y 1"
I configured my rapsi-config (enable i2c)
I installed the drivers i2c-tools, used the mods i2c-dev and i2c-bcm2708 and edited to my boot/config.txt additionally "dtoverlay=i2c1-bcm2708" and put pi to group i2c for no carrying any longer a sudo with myself.....
--> Now I want to read out some registers e.g. the temperature (0x06) but everything I get is a 0x00 ("i2cget -y 1 0x49 0x06 b")
--> The only register I can read is 0x00 and there I get 0x80 (but default should be 0x40)
so I tried pyserial, but when I want to use: serial.Serial("/dev/i2c-1", 115200) --> I get a cannot configure port error 25
if I write cat /dev/i2c-1 (as explained in some stack overflow topics) I get an I/O-Error.....
I am pretty keyless now.... Maybe there is a clock stretching, but none is mentioned in the data sheet ??
Would be likely if anybody could help me :)
Cheers!
raise SerialException("Could not configure port: {}".format(msg))
serial.serialutil.SerialException: Could not configure port: (25, 'Inappropriate ioctl for device')

Raspberry Pi, lost /dev/ttyUSB0 when plugged in second FTDI cable

I had a RPi setup with 1 FTDI cable. I was able to use /dev/ttyUSB0 in code without issues
When I plugged in a second FTDI cable, with the same vendor and product ID, /dev/ttyUSB1 never showed up, instead I lost /dev/ttyUSB0
lsusb shows that both devices are enumerated correctly.
Now, even when I plug in just one FTDI cable, /dev/ttyUSB0 still does not show up!
How can I get back the ttyUSB0 and ttyUSB1?
Here is the output from dir /dev lsusb and dmesg
Thanks,
pi#raspberrypi:~ $ dir /dev
autofs hwrng loop6 null ram2 serial1 tty13 tty23 tty33 tty43 tty53 tty63 vc-mem vcsa3
block initctl loop7 ptmx ram3 shm tty14 tty24 tty34 tty44 tty54 tty7 vcs vcsa4
bus input loop-control pts ram4 stderr tty15 tty25 tty35 tty45 tty55 tty8 vcs1 vcsa5
cachefiles kmsg mem ram0 ram5 stdin tty16 tty26 tty36 tty46 tty56 tty9 vcs2 vcsa6
char log memory_bandwidth ram1 ram6 stdout tty17 tty27 tty37 tty47 tty57 ttyAMA0 vcs3 vcsm
console loop0 mmcblk0 ram10 ram7 tty tty18 tty28 tty38 tty48 tty58 ttyprintk vcs4 xconsole
cpu_dma_latency loop1 mmcblk0p1 ram11 ram8 tty0 tty19 tty29 tty39 tty49 tty59 ttyS0 vcs5 zero
disk loop2 mmcblk0p2 ram12 ram9 tty1 tty2 tty3 tty4 tty5 tty6 urandom vcs6
fb0 loop3 mqueue ram13 random tty10 tty20 tty30 tty40 tty50 tty60 vc-cma vcsa
fd loop4 network_latency ram14 raw tty11 tty21 tty31 tty41 tty51 tty61 vchiq vcsa1
full loop5 network_throughput ram15 serial0 tty12 tty22 tty32 tty42 tty52 tty62 vcio vcsa2
pi#raspberrypi:~ $ lsusb
Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
…. dmesg
[ 208.091689] usb 1-1.5: new full-speed USB device number 5 using dwc_otg
[ 208.219273] usb 1-1.5: New USB device found, idVendor=0403, idProduct=6001
[ 208.219296] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 208.219309] usb 1-1.5: Product: FT232R USB UART
[ 208.219322] usb 1-1.5: Manufacturer: FTDI
[ 208.219334] usb 1-1.5: SerialNumber: A5052N9Z
Your udev rule should control device node creation, try this one.

How can I access GPIO with physical address?

I have a requirement that is accessing GPIO with ubuntu 14.04LTS.
Below information is my device information:
OS:Ubuntu 14.04 LTS 64bits
CPU:Intel® Celeron(R) CPU J1900 # 1.99GHz × 4
And bleow link is datasheet and driver code
code and datasheet here.
First I was checked the chip is it8785, and GPIO port is 32 to 39.
PIN of port GPIO 32 is 117, so I type the command:
echo 32 > /sys/class/gpio/export
and
echo 117 > /sys/class/gpio/export
but both show the error "bash - echo: write error: invalid argument"
I don't have any idea for this, so I contect with manufacturer.
They told me that if i want access GPIO, I must direct access CPU address like :
GPIO PORT Adderss
32 0xfed0e388
33 0xfed0e368
34 0xfed0e318
35 0xfed0e378
36 0xfed0e308
37 0xfed0e398
38 0xfed0e328
39 0xfed0e3A8
I have googled for a while, quantity of data are rarly.
It's thanksful for any advice.
Can you try and use sudo while exporting and see if the gpio could exported.
As the manufacturer has provided with register address you can map them to user space and access. On how to access them in user space you can have a look at dev2mem. Hope that helps.

“RAM check failed” when using j-Link to erase chip or readback

I closed SWD and JTAG by acident so that I can't download new program into developboard by j-Link.Then I try using j-flash ARM to erase chip, and error comes like this:
Connecting ...
- Connecting via USB to J-Link device 0
- J-Link firmware: V1.20 (J-Link ARM V8 compiled Dec 1 2009 11:42:48)
- JTAG speed: 2000 kHz (Auto)
- Initializing CPU core (Init sequence) ...
- Executing Reset (0, 0 ms)
- Initialized successfully
- JTAG speed: 2000 kHz (Auto)
- Connected successfully
Reading entire flash chip ...
- 64 sectors, 1 range, 0x8000000 - 0x800FFFF
- ERROR: RAM check failed # address 0x20000000.
- ERROR: Write: 0x03020100 07060504
- ERROR: Read: 0xAAAAAAAA AAAAAAAA
- ERROR: (0 bytes of RAM have been checked successfully)
- ERROR: Failed to read back target memory
Disconnecting ...
- Disconnected
I don't know how to use BOOT0 and BOOT1 to get into ISP mode. BOOT0 is connected to GND.
Post some information about your environment.
Are you using IAR EWARM? If you're not, you should download the size-limited trial version. Then, load one of the basic program examples, and try to flash it to your board.
What board are you using? And what do you mean you "closed" SWD and JTAG? I'm not sure what that refers to...jumpers? options window?
Help us out here.