'2021/09/23'에 해당되는 글 3건

  1. 2021.09.23 usb dwc
  2. 2021.09.23 odorid c2 usb otg gadget keyboard as hid
  3. 2021.09.23 rpi 4 lirc tx, rx

리눅스 커널에서 보다 보니 USB에는 DWC 라는게 붙길래 찾아보니

DesignWare Core 라는 용어가 나온다.

synopsys는 회사명 designware(r)은 IP의 명칭이라고 해야하려나?

 

[링크 : https://www.synopsys.com/dw/ipdir.php?ds=dwc_usb_2_0_digital_controllers]

[링크 : https://www.kernel.org/doc/html/v5.0/driver-api/usb/dwc3.html]

 

'이론 관련 > 컴퓨터 관련' 카테고리의 다른 글

digital twin  (0) 2022.04.13
current loop to rs232  (0) 2021.10.22
fp16  (0) 2021.05.10
gps 체크섬  (0) 2020.11.17
GPX, NMEA 포맷 변환  (0) 2020.11.05
Posted by 구차니
embeded/odroid2021. 9. 23. 18:57

 

# zcat /proc/config.gz  | grep -i dwc
CONFIG_USB_DWC_OTG_HCD=y
# CONFIG_USB_DWC3 is not set
# CONFIG_USB_DWC2 is not set

# dmesg | grep dwc2
[    2.488359] dwc_otg dwc2_b: DWC OTG Controller
[    2.492647] dwc_otg dwc2_b: new USB bus registered, assigned bus number 1
[    2.499387] dwc_otg dwc2_b: irq 63, io mem 0x00000000
[    2.572237] dwc_otg dwc2_a: DWC OTG Controller
[    2.576584] dwc_otg dwc2_a: new USB bus registered, assigned bus number 2
[    2.583313] dwc_otg dwc2_a: irq 62, io mem 0x00000000

# modprobe libcomposite
# lsmod | grep -i libcomposite
libcomposite           46311  0

# dmesg | tail
[  119.062507] SRP: Device mode
[  119.062520] SRP Fail

# ls -al /sys/kernel/config/usb_gadget/
total 0
drwxr-xr-x 2 root root 0 Sep 26 08:44 .
drwxr-xr-x 3 root root 0 Sep 26 08:44 ..

[링크 : https://forum.odroid.com/viewtopic.php?t=36602]

 

hid.usb0 라는걸 생성하려고 하니 생성이 불가능하다고 나온다. 왜일까 ㅠㅠ

# /usr/bin/isticktoit_usb
mkdir: cannot create directory 'functions/hid.usb0': No such file or directory
/usr/bin/isticktoit_usb: line 19: functions/hid.usb0/protocol: No such file or directory
/usr/bin/isticktoit_usb: line 20: functions/hid.usb0/subclass: No such file or directory
/usr/bin/isticktoit_usb: line 21: functions/hid.usb0/report_length: No such file or directory
/usr/bin/isticktoit_usb: line 22: functions/hid.usb0/report_desc: No such file or directory
ln: failed to create symbolic link 'configs/c.1/hid.usb0': No such file or directory
ls: write error: Invalid argument

[링크 : https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/]

 

'embeded > odroid' 카테고리의 다른 글

odroid c2 ubuntu 18.04, 20.04 kernel 버전 정보  (0) 2021.09.27
odroid c2 usb otg, libcomposite usb hid  (0) 2021.09.26
odroid c2 OTG와 mass storage  (0) 2021.09.19
odroid c2 ADC  (0) 2021.09.19
odroid c2 lircd output 성공  (0) 2021.09.18
Posted by 구차니
embeded/raspberry pi2021. 9. 23. 14:43

config.txt에서 gpio-ir 관련해서 두개를 활성화 한다.

rx,tx를 반대로 하는게 영향을 주는진 모르겠지만, 아무튼 바꾸라고 하는데가 많으니 바꾸어서 시도

2018의 경우 lirc-gpio 였나? 이런 명칭인데 2020 이후에는 바뀐 것 같은데 changelog를 좀 추적해 봐야 할 듯.

$ cat /boot/config.txt 
# Uncomment this to enable infrared communication.
dtoverlay=gpio-ir-tx,gpio_pin=17,invert=1
dtoverlay=gpio-ir,gpio_pin=18

 

하드웨어는

gpio 17핀에 IR LED의 +극(좁은 쪽) / GND에 IR LED의 -극(넓은쪽)

gpio 18핀에 IR 리시버의 signal / VCC에 3.3 / GND에 적당히 연결

 

lircd 환경설정은 아래와 같이

device /dev/lirc1 으로 하면 입력은 되는데 출력이 안되는 듯 하다.

그리고 irsend는 output 항목의 socket을 통해 전송하게 되니 참조.

$ cat lirc_options.conf
# These are the default options to lircd, if installed as
# /etc/lirc/lirc_options.conf. See the lircd(8) and lircmd(8)
# manpages for info on the different options.
#
# Some tools including mode2 and irw uses values such as
# driver, device, plugindir and loglevel as fallback values
# in not defined elsewhere.

[lircd]
nodaemon        = False
#driver          = devinput
#device          = auto
driver          = default
device          = /dev/lirc0
output          = /var/run/lirc/lircd
pidfile         = /var/run/lirc/lircd.pid
plugindir       = /usr/lib/arm-linux-gnueabihf/lirc/plugins
permission      = 666
allow-simulate  = No
repeat-max      = 600
#effective-user =
#listen         = [address:]port
#connect        = host[:port]
#loglevel       = 6
#release        = true
#release_suffix = _EVUP
#logfile        = ...
#driver-options = ...

[lircmd]
uinput          = False
nodaemon        = False

# [modinit]
# code = /usr/sbin/modprobe lirc_serial
# code1 = /usr/bin/setfacl -m g:lirc:rw /dev/uinput
# code2 = ...


# [lircd-uinput]
# add-release-events = False
# release-timeout    = 200
# release-suffix     = _EVUP

 

odroid에서 modprobe에서 invert=1을 해서 했었으니 얘도 동일하게 dtoverlay에 invert=1를 추가해서 해보니 성공

$ dtoverlay -h gpio-ir-tx
Name:   gpio-ir-tx

Info:   Use GPIO pin as bit-banged infrared transmitter output.
        This is an alternative to "pwm-ir-tx". gpio-ir-tx doesn't require
        a PWM so it can be used together with onboard analog audio.

Usage:  dtoverlay=gpio-ir-tx,<param>=<val>

Params: gpio_pin                Output GPIO (default 18)

        invert                  "1" = invert the output (make it active-low).
                                Default is "0" (active-high).

 

아래의 명령을 통해서 저장한 리모컨 명령을 전송!

$ irsend send_once samsung key_power -d /var/run/lirc/lircd

 

는 실패 ㅋ

hardware does not support sending

 

의외로 장치를 lirc1으로 하면 tx가 안되는 문제가 있는 것 같아서 /dev/lirc0으로 하니 문제 없이 되네

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=263689]

 

+

root 권한이 필요한데

/sys/kernel/debug/gpio 파일을 열어 보면 현재 gpio이 설정 상태를 볼 수 있다.

근데 별.. 도움은 안됨 ㅠㅠ

[링크 : https://youtu.be/TSJ2gYvsVGc?t=59]

 

+

아래는 invert 넣지 않은 것

$ sudo cat  /sys/kernel/debug/gpio
 gpio-17  (GPIO17              |gpio-ir-transmitter@) out lo
 gpio-18  (GPIO18              |ir-receiver@12      ) in  hi IRQ ACTIVE LOW

 

아래는 invert 넣은 것

$ sudo cat  /sys/kernel/debug/gpio
 gpio-17  (GPIO17              |gpio-ir-transmitter@) out hi ACTIVE LOW
 gpio-18  (GPIO18              |ir-receiver@12      ) in  hi IRQ ACTIVE LOW

'embeded > raspberry pi' 카테고리의 다른 글

rpi 2b g_mass_storage  (0) 2021.09.25
rpi4에서 gpio readall 실행 안될 때  (0) 2021.09.24
rpi USB 메모리 스틱처럼 만들기? rpi zero  (0) 2021.09.17
rpi stretch lirc irrecord 실패  (0) 2021.09.16
lirc 제조사별 키코드  (0) 2021.09.16
Posted by 구차니