Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subsys: greybus: uart transport fixes #62

Merged
merged 2 commits into from
Jan 1, 2021

Conversation

vaishnavachath
Copy link
Contributor

@vaishnavachath vaishnavachath commented Dec 31, 2020

Previously I2C and SPI was not working over the UART transport due to the incorrect msg pointer, also the greybus dependency configs were not added in the uart samples causing unmet dependencies :
https://github.com/cfriedt/greybus-for-zephyr/runs/1620317608#step:13:27

Tested the changes on CC1352R Sensortag, now GPIO, I2C and SPI are working simultaneously without any issues.

fix to point msg to data after realloc()
this fixes the issue of i2c, spi not working over uart

Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
@vaishnavachath
Copy link
Contributor Author

Hi @cfriedt can you review these changes

@vaishnavachath
Copy link
Contributor Author

vaishnavachath commented Dec 31, 2020

Test performed of CC1352 SensorTag :

Before Fix:
Zephyr Console:

*** Booting Zephyr OS build zephyr-v2.4.0-2599-g03a1d04c8492  ***
[00:00:00.012,023] <inf> greybus_xsport_uart: binding UART_0
[00:00:00.012,023] <inf> greybus_xsport_uart: Greybus UART Transport initialized
[00:00:00.012,145] <inf> greybus_manifest: Registering CONTROL greybus driver.
[00:00:00.012,451] <inf> greybus_manifest: Registering GPIO greybus driver.
[00:00:00.012,756] <inf> greybus_manifest: Registering I2C greybus driver.
[00:00:00.013,000] <inf> greybus_manifest: Registering SPI greybus driver.
[00:00:00.013,275] <inf> greybus_service: Greybus is active
[00:00:55.014,984] <err> greybus: Dropping garbage request due to  sizeof(*hdr)[8] > size[0]

dmesg:

[ 1541.629586] greybus 1-2.2: GMP VID=0x00000126, PID=0x00000126
[ 1541.629587] greybus 1-2.2: DDBL1 Manufacturer=0x00000126, Product=0x00000126
[ 1566.496541] i2c gbphy2: transfer operation failed (-110)
[ 1566.496563] opt3001 8-0044: failed to read register 7e
[ 1566.496596] opt3001: probe of 8-0044 failed with error -110

After Fix:
Zephyr Console:

*** Booting Zephyr OS build zephyr-v2.4.0-2599-g03a1d04c8492  ***
[00:00:00.012,145] <inf> greybus_xsport_uart: binding UART_0
[00:00:00.012,145] <inf> greybus_xsport_uart: Greybus UART Transport initialized
[00:00:00.012,268] <inf> greybus_manifest: Registering CONTROL greybus driver.
[00:00:00.012,603] <inf> greybus_manifest: Registering GPIO greybus driver.
[00:00:00.012,908] <inf> greybus_manifest: Registering I2C greybus driver.
[00:00:00.013,183] <inf> greybus_manifest: Registering SPI greybus driver.
[00:00:00.013,427] <inf> greybus_service: Greybus is active

dmesg:

[  813.071775] greybus 1-2.2: Interface added (greybus)
[  813.071782] greybus 1-2.2: GMP VID=0x00000126, PID=0x00000126
[  813.071787] greybus 1-2.2: DDBL1 Manufacturer=0x00000126, Product=0x00000126
[ 1316.523046] i2c i2c-8: new_device: Instantiated device opt3001 at 0x44
[ 1316.972704] opt3001 8-0044: Found TI OPT3001
root@ubuntu:/home/vaishnav/greybus# cat /sys/bus/iio/devices/iio\:device0
iio:device0/
root@ubuntu:/home/vaishnav/greybus# cat /sys/bus/iio/devices/iio\:device0/
current_timestamp_clock          events/                          in_illuminance_integration_time  name                             subsystem/                       
dev                              in_illuminance_input             integration_time_available       power/                           uevent                           
root@ubuntu:/home/vaishnav/greybus# cat /sys/bus/iio/devices/iio\:device0/in_illuminance_input 
121.040000
root@ubuntu:/home/vaishnav/greybus# cat /sys/bus/iio/devices/iio\:device0/in_illuminance_input 
120.960000
root@ubuntu:/home/vaishnav/greybus# cat /sys/bus/iio/devices/iio\:device0/in_illuminance_input 
7.680000
root@ubuntu:/home/vaishnav/greybus# 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants