embeded/raspberry pi2021. 9. 29. 16:43

1주일 정도 켜놨더니 USB HUB 가 맛이 가서 장치를 인식하지 않는데

원격접속은 문제가 없어서 의아해 하는 중.

 

rpi 2b는 USB 2.0 HUB에 랜 + USB 4port 허브로 구성된 녀석으로 알고 있었는데

3 이후로 바뀐건지 4부터 바뀐건진 모르겠지만

USB가 죽는다고 원격을 못하는 상황은 아니니 훨신 나은 듯?

 

 

+

전체 회로 공개 안하는걸로 정책이 바뀌었나?

[링크 : https://www.raspberrypi.org/documentation/computers/raspberry-pi.html]

[링크 : https://datasheets.raspberrypi.org/]

 

라즈베리 3b 까지는 USB lan 이었는지 랜포트도 그려져 있지 않은데

3b+ 이후 부터는 랜이 따로 나오는 듯?

rpi 4

GbE / TRD[0123]_[NP]

[링크 : https://datasheets.raspberrypi.org/rpi4/raspberry-pi-4-reduced-schematics.pdf]

bcm54213

https://www.hackster.io/news/meet-the-new-raspberry-pi-4-model-b-9b4698c284

 

rpi 3b+

ETH, PoE , TR[0123][np]

[링크 : https://datasheets.raspberrypi.org/rpi3/raspberry-pi-3-b-plus-reduced-schematics.pdf]

보드에서 방열판 떼어보니 LAN7515칩이 발견됨

Hi-Speed USB 2.0 to 10/100/1000 Gigabit Ethernet controller

[링크 : https://www.microchip.com/en-us/product/LAN7500]

 

rpi 3b

[링크 : https://datasheets.raspberrypi.org/rpi3/raspberry-pi-3-b-reduced-schematics.pdf]

 

rpi 2b

[링크 : https://datasheets.raspberrypi.org/rpi2/raspberry-pi-2-b-reduced-schematics.pdf]

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

rpi pico usb sound  (0) 2021.11.08
rpi3 2초만에 부팅하기  (0) 2021.10.30
rpi zero otg  (0) 2021.09.27
스피커가 부실했군..  (0) 2021.09.26
rpi 2b g_mass_storage  (0) 2021.09.25
Posted by 구차니
embeded/odroid2021. 9. 28. 23:37

dd 해서 파일기반 파일시스템을 만들고 mkfs를 하지 않으면 g_mass_storage에 연결은 되어있지만

USB HOST 측에서 마운트를 할 수 없다(파일 시스템을 알 수 없어 마운트 불가)

// odroid c2 에서 작업
# dd if=/dev/zero of=otg.drive bs=1M count=128
# mkfs -t ext4 otg.drive
# modprobe g_mass_storage filename=otg.drive

 

USB HOST 측에서는 단순하게 마운트 해서 쓰면 되는데

// rpi 2b 에서 작업
$ sudo mount /dev/sda /mnt
$ sudo touch /mnt/tt
$ sudo umount /mnt

 

odroid의 mmcblk0p1을 연결했을 때는 sync 하면 쓰이는게 보였던 것 같은데

파일 기반 파일시스템이라 그런가 rpi 2b에서 파일을 생성하고 sync 해도 변화가 없고, umount를 해도 변화가 없었다.

odroid c2 에서 해당 파일을 umount 하고 mount 해야 변경점이 보이는데

물리 장칙 아니라 그런진 모르겠다.

 

[링크 : https://linuxconfig.org/how-to-create-a-file-based-filesystem-using-dd-command-on-linux]

[링크 : https://www.kernel.org/doc/Documentation/usb/mass-storage.txt]

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

wayland on odroid-c2  (0) 2021.11.22
odroid c2 gpio 와 wiringpi  (0) 2021.09.29
g_mass_storage ins/rm 실패  (0) 2021.09.28
odroid c2 ubuntu 18.04, 20.04 kernel 버전 정보  (0) 2021.09.27
odroid c2 usb otg, libcomposite usb hid  (0) 2021.09.26
Posted by 구차니
embeded/odroid2021. 9. 28. 22:32

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

 

[링크 : https://linuxlink.timesys.com/docs/wiki/engineering/HOWTO_Use_USB_Gadget_File_Storage]

[링크 : https://www.kernel.org/doc/Documentation/usb/mass-storage.txt]

[링크 : https://linux-sunxi.org/USB_Gadget/Mass_storage]

 

 

# modprobe g_mass_storage file=/dev/mmcblk0p1 removable=y
# dmesg
[   41.197852] Mass Storage Function, version: 2009/09/11
[   41.197867] LUN: removable file: (no medium)
[   41.197950] LUN: removable file: /dev/mmcblk0p1
[   41.197956] Number of LUNs=1
[   41.197965] Number of LUNs=1
[   41.198085] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
[   41.198092] g_mass_storage gadget: userspace failed to provide iSerialNumber
[   41.198097] g_mass_storage gadget: g_mass_storage ready
[   41.504544] USB RESET
[   41.583840] usb 1-1.3: new high-speed USB device number 3 using dwc_otg
[   41.587991] USB RESET
[   41.685839] g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage
[   41.686316] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[   41.686873] usb-storage 1-1.3:1.0: Quirks match for vid 0525 pid a4a5: 10000
[   41.686927] scsi0 : usb-storage 1-1.3:1.0
[   42.684797] scsi 0:0:0:0: Direct-Access     Linux    File-Stor Gadget 0316 PQ: 0 ANSI: 2
[   42.688020] sd 0:0:0:0: [sda] 262144 512-byte logical blocks: (134 MB/128 MiB)
[   42.688133] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   42.696834] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   42.794589] sd 0:0:0:0: [sda] Write Protect is off
[   42.794603] sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
[   42.794783] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   42.904614] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   42.906940] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   43.014729] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   43.125146]  sda:
[   43.127871] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   43.235032] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[   43.344734] sd 0:0:0:0: [sda] Attached SCSI removable disk
# lsmod
Module                  Size  Used by
sg                     31094  0
g_mass_storage          2587  0
usb_f_mass_storage     35010  2 g_mass_storage
libcomposite           46311  2 usb_f_mass_storage,g_mass_storage
ir_lirc_codec           4934  3
lirc_dev               10879  1 ir_lirc_codec
ir_mce_kbd_decoder      3426  0
ir_rc6_decoder          2010  0
ir_sanyo_decoder        1657  0
ir_sony_decoder         1663  0
ir_jvc_decoder          1725  0
ir_rc5_decoder          1586  0
ir_nec_decoder          1789  0
meson_ir                3356  0
w1_gpio                 3801  0
wire                   28614  1 w1_gpio
gxbb_wdt                3395  0
meson_gpiomem           4040  0
sch_fq_codel            7827  2
ip_tables              17220  0
ipv6                  387317  18
autofs4                27592  2
# rmmod g_mass_storage
root@odroid:~# lsmod
Module                  Size  Used by
sg                     31094  0
usb_f_mass_storage     35010  0
libcomposite           46311  1 usb_f_mass_storage
ir_lirc_codec           4934  3
lirc_dev               10879  1 ir_lirc_codec
ir_mce_kbd_decoder      3426  0
ir_rc6_decoder          2010  0
ir_sanyo_decoder        1657  0
ir_sony_decoder         1663  0
ir_jvc_decoder          1725  0
ir_rc5_decoder          1586  0
ir_nec_decoder          1789  0
meson_ir                3356  0
w1_gpio                 3801  0
wire                   28614  1 w1_gpio
gxbb_wdt                3395  0
meson_gpiomem           4040  0
sch_fq_codel            7827  2
ip_tables              17220  0
ipv6                  387317  18
autofs4                27592  2
# modprobe g_mass_storage file=/dev/mmcblk0p1 removable=y
modprobe: ERROR: could not insert 'g_mass_storage': Device or resource busy

[링크 : https://developer.ridgerun.com/wiki/index.php?title=How_to_use_mass_storage_gadget]

Posted by 구차니
embeded/raspberry pi2021. 9. 27. 18:00

rpi 4 cm 에서 usb를 쓰려면 config.txt에 다음의 내용을 추가해야 하는데

dtoverlay=dwc2,dr_mode=host

 

$ modinfo dwc2
filename:       /lib/modules/5.10.60-v7+/kernel/drivers/usb/dwc2/dwc2.ko
license:        Dual BSD/GPL
author:         Synopsys, Inc.
description:    DESIGNWARE HS OTG Core
license:        Dual BSD/GPL
author:         Matthijs Kooijman <matthijs@stdin.nl>
description:    DESIGNWARE HS OTG Platform Glue
srcversion:     C0FF7C976DCDD3E4810AFB1
alias:          of:N*T*Cst,stm32mp15-hsotgC*
alias:          of:N*T*Cst,stm32mp15-hsotg
alias:          of:N*T*Cst,stm32mp15-fsotgC*
alias:          of:N*T*Cst,stm32mp15-fsotg
alias:          of:N*T*Cst,stm32f7-hsotgC*
alias:          of:N*T*Cst,stm32f7-hsotg
alias:          of:N*T*Cst,stm32f4x9-hsotgC*
alias:          of:N*T*Cst,stm32f4x9-hsotg
alias:          of:N*T*Cst,stm32f4x9-fsotgC*
alias:          of:N*T*Cst,stm32f4x9-fsotg
alias:          of:N*T*Capm,apm82181-dwc-otgC*
alias:          of:N*T*Capm,apm82181-dwc-otg
alias:          of:N*T*Camcc,dwc-otgC*
alias:          of:N*T*Camcc,dwc-otg
alias:          of:N*T*Camlogic,meson-g12a-usbC*
alias:          of:N*T*Camlogic,meson-g12a-usb
alias:          of:N*T*Camlogic,meson-gxbb-usbC*
alias:          of:N*T*Camlogic,meson-gxbb-usb
alias:          of:N*T*Camlogic,meson8b-usbC*
alias:          of:N*T*Camlogic,meson8b-usb
alias:          of:N*T*Camlogic,meson8-usbC*
alias:          of:N*T*Camlogic,meson8-usb
alias:          of:N*T*Csamsung,s3c6400-hsotgC*
alias:          of:N*T*Csamsung,s3c6400-hsotg
alias:          of:N*T*Csnps,dwc2C*
alias:          of:N*T*Csnps,dwc2
alias:          of:N*T*Clantiq,xrx200-usbC*
alias:          of:N*T*Clantiq,xrx200-usb
alias:          of:N*T*Clantiq,arx100-usbC*
alias:          of:N*T*Clantiq,arx100-usb
alias:          of:N*T*Crockchip,rk3066-usbC*
alias:          of:N*T*Crockchip,rk3066-usb
alias:          of:N*T*Chisilicon,hi6220-usbC*
alias:          of:N*T*Chisilicon,hi6220-usb
alias:          of:N*T*Cbrcm,bcm2835-usbC*
alias:          of:N*T*Cbrcm,bcm2835-usb
depends:        udc-core,roles
intree:         Y
name:           dwc2
vermagic:       5.10.60-v7+ SMP mod_unload modversions ARMv7 p2v8
pi@raspberrypi:~ $ modinfo dwc2 -v

 

dtoverlay 상으로는 dr_mode 에 host / peripheral / otg를 넣을수 있다고 한다.

$ sudo dtoverlay -h dwc2
Name:   dwc2

Info:   Selects the dwc2 USB controller driver

Usage:  dtoverlay=dwc2,<param>=<val>

Params: dr_mode                 Dual role mode: "host", "peripheral" or "otg"

        g-rx-fifo-size          Size of rx fifo size in gadget mode

        g-np-tx-fifo-size       Size of non-periodic tx fifo size in gadget
                                mode

 

otg 설정에 주변기기로 인식을 시키네..?

dtoverlay=dwc2,dr_mode=peripheral in file /boot/config.txt.

[링크 : https://gist.github.com/gbaman/50b6cca61dd1c3f88f41]

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

rpi3 2초만에 부팅하기  (0) 2021.10.30
rpi 4는 USB to Ethernet이 아닌가?  (0) 2021.09.29
스피커가 부실했군..  (0) 2021.09.26
rpi 2b g_mass_storage  (0) 2021.09.25
rpi4에서 gpio readall 실행 안될 때  (0) 2021.09.24
Posted by 구차니
embeded/odroid2021. 9. 27. 17:21

odroid c2용 18.04 버전정보를 보니 커널이 3.16

# uname -a
Linux odroid 3.16.72-46 #1 SMP PREEMPT Tue Aug 13 18:09:58 -03 2019 aarch64 aarch64 aarch64 GNU/Linux

 

20.04는 커널 버전이 올라갔으려나?

ubuntu-18.04.3-3.16-minimal-odroid-c2-20190814.img
ubuntu-20.04-3.16-minimal-odroid-c2-20210201.img

파일명을 보아하니.. 커널은 둘다 동일하게 3.16이고 배포판 버전만 올라간듯..

 

[링크 : https://wiki.odroid.com/getting_started/os_installation_guide#tab__odroid-c2]

[링크 : https://dn.odroid.com/S905/Ubuntu/]

 

4.17에 대한 글은 2018년도에 멈춰있네..

[링크 : https://www.hardkernel.com/ko/tag/odroid-c2/]

[링크 : https://forum.odroid.com/viewtopic.php?f=135&t=22717&start=850#p226092]

 

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

g_mass_storage rpi - odroid c2  (0) 2021.09.28
g_mass_storage ins/rm 실패  (0) 2021.09.28
odroid c2 usb otg, libcomposite usb hid  (0) 2021.09.26
odorid c2 usb otg gadget keyboard as hid  (0) 2021.09.23
odroid c2 OTG와 mass storage  (0) 2021.09.19
Posted by 구차니
embeded/raspberry pi2021. 9. 26. 17:33

일단 앰프는 class D 앰프고

얘는 PWM 어쩌구 하던데 원리까지 알아보려니 급 귀찮고..

 

The PAM8403 is a 3W, class-D audio amplifier.

[링크 : https://pdf1.alldatasheet.com/datasheet-pdf/view/1132029/DIODES/PAM8403.html]

[링크 : https://blog.naver.com/iknowiknow/40021691136]

 

지금보니 스피커는 0.5W

드라이브는 3W+3W 가능한데 오늘 odroid에 연결해서 5V 어댑터 전원 끌어오니 음질이 썩 나쁘진 않은것 같기도?

0.5W 면은 5V * 0.1A 일텐데, 두개니까 0.2A

전에도 그렇겠지만 딱히 커버 불가능한 수준은 아닌것 같은데 왜였을까..

[링크 : https://blog.naver.com/damtaja/221848352426]

2020.04.17 - [embeded/arduino(genuino)] - PAM8403 3W 스테레오 오디오 앰프

 

다른 저가형 사운드바를 봐도 3W 를 많이 쓰는데 비슷한 등급의 부품을 써서 만드는 것 같네.

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

rpi 4는 USB to Ethernet이 아닌가?  (0) 2021.09.29
rpi zero otg  (0) 2021.09.27
rpi 2b g_mass_storage  (0) 2021.09.25
rpi4에서 gpio readall 실행 안될 때  (0) 2021.09.24
rpi 4 lirc tx, rx  (0) 2021.09.23
Posted by 구차니
embeded/odroid2021. 9. 26. 08:51

방법들은 비슷한데.. 따라하는데 영 안되네?

functions 디렉토리에 hid.usb0 디렉토리를 생성하는데 에러가 발생.

#!/bin/bash
# From the README at https://github.com/girst/hardpass

dtoverlay dwc2
modprobe dwc2
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir -p g1
cd g1
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2
mkdir -p strings/0x409
echo "fedcba9876543210" > strings/0x409/serialnumber
echo "girst" > strings/0x409/manufacturer
echo "Hardpass" > strings/0x409/product

N="usb0"
mkdir -p functions/hid.$N
echo 1 > functions/hid.usb0/protocol
echo 1 > functions/hid.usb0/subclass
echo 8 > functions/hid.usb0/report_length

echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x85\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x05\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0\\x05\\x01\\x09\\x02\\xa1\\x01\\x09\\x01\\xa1\\x00\\x85\\x02\\x05\\x09\\x19\\x01\\x29\\x03\\x15\\x00\\x25\\x01\\x95\\x03\\x75\\x01\\x81\\x02\\x95\\x01\\x75\\x05\\x81\\x03\\x05\\x01\\x09\\x30\\x09\\x31\\x15\\x81\\x25\\x7f\\x75\\x08\\x95\\x02\\x81\\x06\\xC0\\xC0 > functions/hid.usb0/report_desc

C=1
mkdir -p configs/c.$C/strings/0x409
echo "Config $C: ECM network" > configs/c.$C/strings/0x409/configuration
echo 250 > configs/c.$C/MaxPower
ln -s functions/hid.usb0 configs/c.$C/

ls /sys/class/udc > UDC

[링크 : https://ndb796.tistory.com/481]

[링크 : https://www.isticktoit.net/?p=1383]

[링크 : https://www.sysnet.pe.kr/2/0/11363]

 

혹시 권한 문제인가 해서 추가해도 안되고..

sysfs 특성이라 드라이버에서 허가되지 않는 파일은 생성이 안되는 것 같은데 왜 일까..

# ls -al
drwxr-xr-x 2 root root    0 Sep 26 09:15 functions

# chmod 777 functions/
# ls -al
drwxrwxrwx 2 root root    0 Sep 26 09:15 functions

# mkdir hid.usb0
mkdir: cannot create directory 'hid.usb0': No such file or directory
# touch hid.usb0
touch: cannot touch 'hid.usb0': Permission denied

 

 

+

3.16 커널인데 3.19 이후 부터 된다고. 드라이버 지원(하드웨어 가속)을 포기하고 신버전을 써봐야 할지도?

# ll /lib/modules/3.16.72-46/kernel/drivers/usb/gadget/
total 804
drwxr-xr-x 2 root root  4096 Aug 13  2019 ./
drwxr-xr-x 7 root root  4096 Aug 13  2019 ../
-rw-r--r-- 1 root root 14424 Aug 13  2019 g_acm_ms.ko
-rw-r--r-- 1 root root 23784 Aug 13  2019 g_audio.ko
-rw-r--r-- 1 root root 12048 Aug 13  2019 g_cdc.ko
-rw-r--r-- 1 root root 14920 Aug 13  2019 g_ether.ko
-rw-r--r-- 1 root root 19632 Aug 13  2019 g_ffs.ko
-rw-r--r-- 1 root root 24208 Aug 13  2019 g_hid.ko

# insmod g_hid
insmod: ERROR: could not load module g_hid: No such file or directory

# modprobe g_hid
modprobe: ERROR: could not insert 'g_hid': No such device

# uname -a
Linux odroid 3.16.72-46 #1 SMP PREEMPT Tue Aug 13 18:09:58 -03 2019 aarch64 aarch64 aarch64 GNU/Linux

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

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

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

g_mass_storage ins/rm 실패  (0) 2021.09.28
odroid c2 ubuntu 18.04, 20.04 kernel 버전 정보  (0) 2021.09.27
odorid c2 usb otg gadget keyboard as hid  (0) 2021.09.23
odroid c2 OTG와 mass storage  (0) 2021.09.19
odroid c2 ADC  (0) 2021.09.19
Posted by 구차니
embeded/raspberry pi2021. 9. 25. 00:49

존재는 하는데 쓸 수 있긴 한건가?

$ modinfo g_mass_storage
filename:       /lib/modules/5.10.60-v7+/kernel/drivers/usb/gadget/legacy/g_mass_storage.ko
license:        GPL
author:         Michal Nazarewicz
description:    Mass Storage Gadget
srcversion:     B6D70CE605D2CF6CF116805
depends:        usb_f_mass_storage,libcomposite
intree:         Y
name:           g_mass_storage
vermagic:       5.10.60-v7+ SMP mod_unload modversions ARMv7 p2v8
parm:           idVendor:USB Vendor ID (ushort)
parm:           idProduct:USB Product ID (ushort)
parm:           bcdDevice:USB Device version (BCD) (ushort)
parm:           iSerialNumber:SerialNumber string (charp)
parm:           iManufacturer:USB Manufacturer string (charp)
parm:           iProduct:USB Product string (charp)
parm:           file:names of backing files or devices (array of charp)
parm:           ro:true to force read-only (array of bool)
parm:           removable:true to simulate removable media (array of bool)
parm:           cdrom:true to simulate CD-ROM instead of disk (array of bool)
parm:           nofua:true to ignore SCSI WRITE(10,12) FUA bit (array of bool)
parm:           luns:number of LUNs (uint)
parm:           stall:false to prevent bulk stalls (bool)

 

$ lsmod | grep g_mass
g_mass_storage         16384  0
usb_f_mass_storage     49152  1 g_mass_storage
libcomposite           57344  2 g_mass_storage,usb_f_mass_storage

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

rpi zero otg  (0) 2021.09.27
스피커가 부실했군..  (0) 2021.09.26
rpi4에서 gpio readall 실행 안될 때  (0) 2021.09.24
rpi 4 lirc tx, rx  (0) 2021.09.23
rpi USB 메모리 스틱처럼 만들기? rpi zero  (0) 2021.09.17
Posted by 구차니
embeded/raspberry pi2021. 9. 24. 10:26

항상 라즈3에서 하다가 라즈4에서 하려니 헉.. 뭥미?

아무튼 유지보수 안한다고 하던 wiringpi까지 업데이트 되어서 패키지 만들 정도라니!

$ gpio readall
Oops - unable to determine board type... model: 17

$ gpio -v
gpio version: 2.50
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Unknown17, Revision: 02, Memory: 0MB, Maker: Sony
  * Device tree is enabled.
  *--> Raspberry Pi 4 Model B Rev 1.2
  * This Raspberry Pi supports user-level GPIO access.

$ wget https://project-downloads.drogon.net/wiringpi-latest.deb
--2021-09-24 10:25:41--  https://project-downloads.drogon.net/wiringpi-latest.deb
Resolving project-downloads.drogon.net (project-downloads.drogon.net)... 188.246.205.22, 2a03:9800:10:7b::2
Connecting to project-downloads.drogon.net (project-downloads.drogon.net)|188.246.205.22|:443...
connected.
HTTP request sent, awaiting response... 200 OK
Length: 52260 (51K) [application/x-debian-package]
Saving to: ‘wiringpi-latest.deb’

wiringpi-latest.deb    100%[==========================>]  51.04K  59.8KB/s    in 0.9s

2021-09-24 10:25:43 (59.8 KB/s) - ‘wiringpi-latest.deb’ saved [52260/52260]

$ sudo dpkg -i wiringpi-latest.deb
Selecting previously unselected package wiringpi.
(Reading database ... 170594 files and directories currently installed.)
Preparing to unpack wiringpi-latest.deb ...
Unpacking wiringpi (2.52) ...
Setting up wiringpi (2.52) ...
Processing triggers for man-db (2.8.5-2) ...

$ gpio -v
gpio version: 2.52
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Pi 4B, Revision: 02, Memory: 4096MB, Maker: Sony
  * Device tree is enabled.
  *--> Raspberry Pi 4 Model B Rev 1.2
  * This Raspberry Pi supports user-level GPIO access.

$ gpio readall
 +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5v      |     |     |
 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | IN   | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |  OUT | 1 | 11 || 12 | 1 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 1 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+


 

[링크 : http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/]

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

[링크 : https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=kiyeonah&logNo=221308783013]

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

스피커가 부실했군..  (0) 2021.09.26
rpi 2b g_mass_storage  (0) 2021.09.25
rpi 4 lirc tx, rx  (0) 2021.09.23
rpi USB 메모리 스틱처럼 만들기? rpi zero  (0) 2021.09.17
rpi stretch lirc irrecord 실패  (0) 2021.09.16
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 구차니