android - USB HOST not displaying text (Nexus 6p and stm32) -
i trying write serial /dev/ttyacm0 ( stm32). andorid see stm32 /dev/bus/usb/001/002.
i have rooted phone nexus 6p , stm32 connected via usb.
i saw google usb host example try same.
i have connection stm , granted permissions
usbdeviceconnection connection = mmanager.opendevice(mdevice); string simpletext = "a"; byte[] data = simpletext.getbytes(charset.forname("utf-8")); int timeout = 10;
and trying
usbendpoint endpoint = mdevice.getinterface(0).getendpoint(0); connection.claiminterface(mdevice.getinterface(0), true); connection.bulktransfer(endpoint, data, data.length, timeout);
and have small program in stm reading serial
#include "mbed.h" #include "lcd_disco_l476vg.h" lcd_disco_l476vg lcd; serial pc(usbtx, usbrx); digitalout led_green(led1); char c; uint8_t buff[1]; int main() { lcd.clear(); while(1) { if(pc.readable()) { buff[0] = pc.getc(); lcd.displaystring(buff); } } }
but nothing displaying in stm32 lcd.
permissions:
permission granted device usbdevice[mname=/dev/bus/usb/001/002,mvendorid=1155,mproductid=14155,mclass=239,msubclass=2,mprotocol=1,mmanufacturername=stmicroelectronics,mproductname=stm32 stlink,mversion=2.0,mserialnumber=066fff485649785087165544,mconfigurations=[ usbconfiguration[mid=1,mname=null,mattributes=128,mmaxpower=150,minterfaces=[ usbinterface[mid=0,malternatesetting=0,mname=st-link debug,mclass=255,msubclass=255,mprotocol=255,mendpoints=[ usbendpoint[maddress=129,mattributes=2,mmaxpacketsize=64,minterval=0] usbendpoint[maddress=1,mattributes=2,mmaxpacketsize=64,minterval=0] usbendpoint[maddress=130,mattributes=2,mmaxpacketsize=32,minterval=0]] usbinterface[mid=1,malternatesetting=0,mname=st-link mass storage,mclass=8,msubclass=6,mprotocol=80,mendpoints=[ usbendpoint[maddress=131,mattributes=2,mmaxpacketsize=64,minterval=0] usbendpoint[maddress=3,mattributes=2,mmaxpacketsize=64,minterval=0]] usbinterface[mid=2,malternatesetting=0,mname=st-link vcp ctr,mclass=2,msubclass=2,mprotocol=1,mendpoints=[ usbendpoint[maddress=132,mattributes=3,mmaxpacketsize=2,minterval=255]] usbinterface[mid=3,malternatesetting=0,mname=st-link vcp dat,mclass=10,msubclass=0,mprotocol=0,mendpoints=[ usbendpoint[maddress=5,mattributes=2,mmaxpacketsize=8,minterval=0] usbendpoint[maddress=133,mattributes=2,mmaxpacketsize=16,minterval=0]]]]
meybe wrong?
usbendpoint endpoint = mdevice.getinterface(0).getendpoint(0);
any advice? : )
Comments
Post a Comment