SC20-GPIO, UART and I2C Test


We are trying to interface the external peripherals to the SC20 Smart EVB kit with Android Version 7.1.2 SDK. We are facing problem when we are trying to test GPIO, UART with demo app. We are getting a error stating “/dev/ttyHSL0 Open Failure!” for UART and “Error: Value read numerical failure” for GPIO. We also need the demo apk to test I2C. Please do revert back with the solution and provide a link to the demo apk to test the I2C at the earliest.

Thanks in Advance,

the errors maybe caused by permission.
So you need change the permission of the device node and the selinux.

For I2C, you can use the i2c interfaces in user space.

set permission for /dev/ttyHSL0 in

  1. add following lines in device/qcom/common/rootdir/etc/init.qcom.rc
    chmod 0777 /dev/ttyHSL0
    chown root root /dev/ttyHSL0


Thanks for your response @jax.zhang.

  1. UART: We have provided the permissions using chmod 0666 in the init.qcom.rc as shown in the attachment(labeled as 1). Even after providing the permission, the below highlighted error in attachment( labeled as 2) was observed on the Debug UART while trying to access the port on the demo apk.
  2. GPIO: We are getting the error as observed, in the attachment(labeled as 3). Please help us in solving this error.
    NOTE: If any particular permissions for accessing GPIO is required, please do let us know with steps to get the GPIO working.
  3. I2C: We would request you to provide more details or link, where we could find the steps to implement the I2C in standard user interface. Any example of how to test the I2C would be helpful.


yes, you need modify the selinux to allow the application to control the uart and gpio.

for i2c, you can reference to the attachment.
it show you how to control a device with addr 0x50 on the i2c-3

Thanks for the quick response @jax.zhang .

  1. Could you please let us know, how we can modify the selinux to allow the application to control the uart and gpio in a detailed manner.
  2. Regarding I2C, I would like to know where exactly the attached part needs to be added in the SDK(i.e. path where we need to add the testi2c.c file).