Full Speed device @ 4 (0x1D140000): ... Composite device: "NIKON WPA PD-10-PTP" Device Descriptor Descriptor Version Number: 0x0200 Device Class: 0 (Composite) Device Subclass: 0 Device Protocol: 0 Device MaxPacketSize: 64 Device VendorID/ProductID: 0x04B0/0x0F03 (Nikon Corporation) Device Version Number: 0x0100 Number of Configurations: 1 Manufacturer String: 1 "NIKON" Product String: 2 "NIKON WPA PD-10-PTP" Serial Number String: 0 (none) Configuration Descriptor Length (and contents): 39 Raw Descriptor (hex) 0000: 09 02 27 00 01 01 00 80 64 09 04 00 00 03 06 01 Raw Descriptor (hex) 0010: 01 00 07 05 82 02 40 00 00 07 05 03 02 40 00 00 Raw Descriptor (hex) 0020: 07 05 81 03 08 00 0A Number of Interfaces: 1 Configuration Value: 1 Attributes: 0x80 (bus-powered) MaxPower: 200 ma Interface #0 - Image Alternate Setting 0 Number of Endpoints 3 Interface Class: 6 (Image) Interface Subclass; 1 Interface Protocol: 1 Endpoint 0x82 - Bulk Input Address: 0x82 (IN) Attributes: 0x02 (Bulk no synchronization data endpoint) Max Packet Size: 64 Polling Interval: 0 ms Endpoint 0x03 - Bulk Output Address: 0x03 (OUT) Attributes: 0x02 (Bulk no synchronization data endpoint) Max Packet Size: 64 Polling Interval: 0 ms Endpoint 0x81 - Interrupt Input Address: 0x81 (IN) Attributes: 0x03 (Interrupt no synchronization data endpoint) Max Packet Size: 8 Polling Interval: 10 ms Device Qualifier Descriptor Descriptor Version Number: 0x0110 Device Class 0 (Composite) Device Subclass 0 Device Protocol 0 Device MaxPacketSize: 64 Number of Configurations: 1 bReserved: 0 Configuration Descriptor Device did not respond to request for first 4 bytes of descriptor Configuration Descriptor Device did not respond to request for first 9 bytes of descriptor
CFE version 1.0.37 for BCM947XX (32bit,SP,LE) Build Date: Tue Aug 9 14:39:48 IDT 2005 (igor@linuxbox.fotonation.local) Copyright (C) 2000,2001,2002,2003 Broadcom Corporation. Initializing Arena Initializing Devices. et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 1.0.1.0 rndis0: Broadcom USB RNDIS Network Adapter (P-t-P) CPU type 0x29007: 200MHz Total memory: 8192 KBytes Total memory used by CFE: 0x80300000 - 0x803A5830 (677936) Initialized Data: 0x8033B840 - 0x8033E080 (10304) BSS Area: 0x8033E080 - 0x8033F830 (6064) Local Heap: 0x8033F830 - 0x803A3830 (409600) Stack Area: 0x803A3830 - 0x803A5830 (8192) Text (code) segment: 0x80300000 - 0x8033B840 (243776) Boot area (physical): 0x003A6000 - 0x003E6000 Relocation Factor: I:00000000 - D:00000000 Device eth0: hwaddr 00-90-4C-68-00-40, ipaddr 192.168.0.206, mask 255.255.255.0 gateway not set, nameserver not set Loader:raw Filesys:raw Dev:flash0.os File: Options:(null) Loading: ..... 1302528 bytes read Entry at 0x80001000 Closing network. Starting program at 0x80001000 CPU revision is: 00029007 Primary instruction cache 8kb, linesize 16 bytes (2 ways) Primary data cache 4kb, linesize 16 bytes (2 ways) Linux version 2.4.20 (igor@linuxbox.fotonation.local) (gcc version 3.2.3 with Br oadcom modifications) #228 Tue Sep 6 19:49:46 IDT 2005 Determined physical RAM map: memory: 00800000 @ 00000000 (usable) On node 0 totalpages: 2048 zone(0): 2048 pages. zone(1): 0 pages. zone(2): 0 pages. Kernel command line: root=/dev/mtdblock2 noinitrd console=ttyS0,115200 CPU: BCM4712 rev 2 at 200 MHz Calibrating delay loop... 199.47 BogoMIPS Memory: 6612k/8192k available (1095k kernel code, 1580k reserved, 104k data, 52k init, 0k highmem) Dentry cache hash table entries: 1024 (order: 1, 8192 bytes) Inode cache hash table entries: 512 (order: 0, 4096 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 2048 (order: 1, 8192 bytes) Checking for 'wait' instruction... unavailable. POSIX conformance testing by UNIFIX PCI: Disabled PCI: Fixing up bus 0 Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au) devfs: boot_options: 0x1 Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI en abled ttyS00 at 0xb8000300 (irq = 3) is a 16550A ttyS01 at 0xb8000400 (irq = 0) is a 16550A pflash: found no supported devices sflash: cramfs filesystem found at block 794 Creating 4 MTD partitions on "sflash": 0x00000000-0x00040000 : "boot" 0x00040000-0x001f0000 : "linux" 0x000c6aa0-0x001f0000 : "rootfs" 0x001f0000-0x00200000 : "nvram" NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP, IGMP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 1024) NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. VFS: Mounted root (cramfs filesystem) readonly. Mounted devfs on /dev Freeing unused kernel memory: 52k freed Using /lib/modules/2.4.20/kernel/drivers/net/wl/wl.o Hit enter to continue...eth0: Bad address Obtained AutoIP address: 169.254.1.10 Using /lib/modules/2.4.20/kernel/drivers/usb/gadget/bcm4712.o Using /lib/modules/2.4.20/kernel/drivers/usb/gadget/gadgetfs.o Firmware Version 1.0.1 (built Sep 6 2005 19:49:15) Starting Dongle App Hit enter to continue...Hit enter to continue...Starting Gateway... Please turn on network cameraUARTの探し方はHacking Embedded Linuxというドキュメントも参考にしたが 自分なりの探し方は次のような方法になる。まず2ピン(TX/RX),3ピン(+GND), 4ピン(+VCC)のパターンを探す。3ピン以上の場合はGNDはテスターの抵抗測定 で他のGNDパターンとの抵抗値が0になるのですぐにわかる。次に電源を入れて 電圧が出ているところを探す。これがTXになる可能性がある。逆に出ていない ところはRXになる可能性がある。GNDとTXと思われるとところだけをRS232 モジュールと接続して、電源をいれてブートログが出たら大当たり。
# ls var tmp proc lib dongle bin usr sbin mnt etc dev # ls bin sh pwd mv mknod ln dmesg cat rmdir ps msh mkdir kill cp busybox rm ping more ls echo chmod # ls sbin write rmmod rc lsmod init erase wlconf reboot nvrdeflts insmod ifconfig # ls etc ld.so.conf ld.so.cache # ls usr/bin killall free # ls usr/sbin wltest wl startmfg nvram epi_ttcp diag # ls /dev gadget gpio cua console random port mem root mtdblock tts tty full null nvram mtd pty urandom zero kmem # busybox BusyBox v0.60.0 (2005.09.06-16:49+0000) multi-call binary Usage: busybox [function] [arguments]... or: [function] [arguments]... BusyBox is a multi-call binary that combines many common Unix utilities into a single executable. Most people will create a link to busybox for each function they wish to use, and BusyBox will act like whatever it was invoked as. Currently defined functions: busybox, cat, chmod, cp, dmesg, echo, free, ifconfig, insmod, kill, killall, ln, ls, lsmod, mkdir, mknod, more, msh, mv, ping, ps, pwd, reboot, rm, rmdir, rmmod, sh # nvram show opo=16 os_ram_addr=80001000 wl0_frameburst=off ... gpio_led_cam_y=2 size: 1717 bytes (31051 left) # ps -ax PID Uid Stat Command 1 0 S init noinitrd 2 0 S [keventd] 3 0 S [ksoftirqd_CPU0] 4 0 S [kswapd] 5 0 S [bdflush] 6 0 S [kupdated] 7 0 S [mtdblockd] ... 29 0 S /bin/sh 30 0 R ps -ax # lsmod Module Size Used by gadgetfs 16624 0 (unused) bcm4712 16880 0 [gadgetfs] wl 442400 0 (unused) # ifconfig eth0 Link encap:Ethernet HWaddr 00:90:B5:00:00:00 inet addr:169.254.1.10 Bcast:169.254.255.255 Mask:255.255.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:106 errors:0 dropped:0 overruns:0 frame:819 TX packets:90 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:12942 (12.6 kb) TX bytes:9058 (8.8 kb) Interrupt:4 Base address:0x1000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MULTICAST MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) # dmesg CPU revision is: 00029007 Primary instruction cache 8kb, linesize 16 bytes (2 ways) Primary data cache 4kb, linesize 16 bytes (2 ways) Linux version 2.4.20 (igor@linuxbox.fotonation.local) (gcc version 3.2.3 with Br oadcom modifications) #228 Tue Sep 6 19:49:46 IDT 2005 Determined physical RAM map: memory: 00800000 @ 00000000 (usable) On node 0 totalpages: 2048 zone(0): 2048 pages. zone(1): 0 pages. zone(2): 0 pages. Kernel command line: root=/dev/mtdblock2 noinitrd console=ttyS0,115200 CPU: BCM4712 rev 2 at 200 MHz Calibrating delay loop... 199.47 BogoMIPS Memory: 6612k/8192k available (1095k kernel code, 1580k reserved, 104k data, 52k init, 0k highmem) Dentry cache hash table entries: 1024 (order: 1, 8192 bytes) Inode cache hash table entries: 512 (order: 0, 4096 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 2048 (order: 1, 8192 bytes) Checking for 'wait' instruction... unavailable. POSIX conformance testing by UNIFIX PCI: Disabled PCI: Fixing up bus 0 Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au) devfs: boot_options: 0x1 Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI en abled ttyS00 at 0xb8000300 (irq = 3) is a 16550A ttyS01 at 0xb8000400 (irq = 0) is a 16550A pflash: found no supported devices sflash: cramfs filesystem found at block 794 Creating 4 MTD partitions on "sflash": 0x00000000-0x00040000 : "boot" 0x00040000-0x001f0000 : "linux" 0x000c6aa0-0x001f0000 : "rootfs" 0x001f0000-0x00200000 : "nvram" NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP, IGMP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 1024) NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. VFS: Mounted root (cramfs filesystem) readonly. Mounted devfs on /dev Freeing unused kernel memory: 52k freed eth0: Broadcom BCM4320 802.11 Wireless Controller 3.130.3.0 init uses obsolete (PF_INET,SOCK_PACKET) gadgetfs: using char major 240 gadgetfs: USB Gadget filesystem, version 20 Aug 2003 Algorithmics/MIPS FPU Emulator v1.5ttcpを修正したコマンドが用意さているのでこれでファイル転送が出来る。 無線のパスワードは"nvram get wl0_key1"で確認できる。Mac側のコマンドは LinkSysなどのGPLソースに含まれるepi_ttcp.cをビルドして使う。 Mac側は下記を先に実行
sh-3.2$ ./epi_ttcp -r > nvramLinux側で以下のように実行
# ./epi_ttcp -t 169.254.201.70 < nvram ttcp-t: buflen=8192, nbuf=2048, align=16384/0, port=5010 sockbufsndsize=16384, sockbufrcvsize=43689, sockbufsize=30036, # tcp sender -> 169.254.201.70 # ttcp-t: cpu time too short set at nan usec, NOT accurate result. ttcp-t: nan bytes in nan real seconds = nan MB/sec +++ ttcp-t: 2 I/O calls, nan msec(real)/call, nan msec(cpu)/call ttcp-t: 0.000000user 0.000000sys 0:00real nan% 0i+0d 0maxrss 2+0pf 0+0csw ttcp done.Mac側には以下のような表示がでる
ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5010 sockbufsndsize=131070, sockbufrcvsize=262140, sockbufsize=196605, # tcp receiver # ttcp-r: accept from 169.254.1.10 ttcp-r: 9872 bytes in 0.015362 real seconds = 627.563 KB/sec +++ ttcp-r: 8 I/O calls, 1.920 msec(real)/call, 0.055 msec(cpu)/call ttcp-r: 0.000063user 0.000376sys 0:00real 2.9% 0i+0d 0maxrss 0+0pf 8+0csw ttcp done. sh-3.2$ file nvram nvram: ELF 32-bit LSB executable, MIPS, MIPS-I version 1 (SYSV), dynamically lin ked (uses shared libs), strippedBCM4712を使ったようなマイコンはファームウエアとOSによって機能を 提供している。昔はPROMなどにファームを入れておいて、外部記憶装置から OSを読み込むのが一般的だった。フラッシュを使ったマイコンの場合はJTAG という基盤テスト用の端子からファームを流し込んで、ネットワークなどか らOSをフラッシュに焼いててつかっているようだ。フラッシュのアップデート に失敗しメーカに送って対応してもら場合はこのような対応なのだと思う。
# nvram set boot_wait="on" # nvram commitこれで起動時に"Reading :: "と出たところで^CするとCFEのプロンプトになる。 nvramコマンドはnvramエリアのデータを読み書きするコマンドでLinuxとCFEの 両方に用意されている。
CFE> help Available commands: rndis Broadcom USB RNDIS utility. et Broadcom Ethernet utility. nvram NVRAM utility. reboot Reboot. set console Change the active console device loop Loop a command flash Update a flash memory device memtest Test memory. f Fill contents of memory. e Modify contents of memory. d Dump memory. u Disassemble instructions. autoboot Automatic system bootstrap. batch Load a batch file into memory and execute it go Verify and boot OS image. boot Load an executable file into memory and execute it load Load an executable file into memory without executing it save Save a region of memory to a remote file via TFTP ping Ping a remote IP host. arp Display or modify the ARP Table ifconfig Configure the Ethernet interface show heap Display information about CFE's heap show memory Display the system physical memory map. show devices Display information about the installed devices. unsetenv Delete an environment variable. printenv Display the environment variables setenv Set an environment variable. help Obtain help for CFE commands For more information about a command, enter 'help command-name' *** command status = 0 CFE> show heap Total bytes: 409600 Free bytes: 343120 Free nodes: 3 Allocated bytes: 60648 Allocated nodes: 240 Largest free node: 342128 Heap status: CONSISTENT *** command status = 0 CFE> show memory Range Start Range End Range Size Description ------------ ------------ -------------- -------------------- 000000000000-0000002FFFFF (000000300000) DRAM (available) 0000003A6000-0000007FFFFF (00000045A000) DRAM (available) *** command status = 0 CFE> show devices Device Name Description ------------------- --------------------------------------------------------- uart0 NS16550 UART at 0x18000300 uart1 NS16550 UART at 0x18000400 flash0.boot ST Serial flash offset 00000000 size 256KB flash0.trx ST Serial flash offset 00040000 size 1KB flash0.os ST Serial flash offset 0004001C size 1760KB flash0.nvram ST Serial flash offset 001F8000 size 32KB flash1.boot ST Serial flash offset 00000000 size 256KB flash1.trx ST Serial flash offset 00040000 size 1760KB flash1.nvram ST Serial flash offset 001F8000 size 32KB flash0 ST Serial flash size 2048KB eth0 Broadcom BCM47xx 10/100 Mbps Ethernet Controller eth1 Broadcom USB RNDIS Network Adapter (P-t-P) *** command status = 0 CFE> printenv Variable Name Value -------------------- -------------------------------------------------- BOOT_CONSOLE uart0 CFE_VERSION 1.0.37 CFE_BOARDNAME BCM947XX CFE_MEMORYSIZE 8192 STARTUP go; *** command status = 0 CFE>推測なのだが、このモジュールではBCM4712のビルドインのUSBとWIFIのチップの BCM2050に入っているUSBの二つのUSBがあるように思われる。
sh-3.2$ ls rndis.o rndis_cfe.o usbdev_rndis.o usbdev_sb.obcm94333u.txtというファイルに入っていた以下の設定は意味がないのかな。。。
# USB and RNDIS variables manf=Broadcom productname=Remote NDIS 802.11 Wireless Adapter vendor_id=0x0a5c product_id=0xd11b
Resetting Pairing Information Done. Restarting system.LEDが5個あるがこのうちPowerをのぞく4つはGPIOに接続されているのではないかと思う。 またアクセスがないと数分でPowerDownするが、この処理もGPIOで制御しているのでは ないだろうか。
Powering Off (No Activity) error: can not initialize the responder object ***POWER OFF電源はUSBと乾電池なのだが、PowerONのコントロールはSP706というExar Corporation という会社のチップを使用している。
Chip Select | S | 1 | 8 | VCC | Supply Voltage |
Serial Data Output | Q | 2 | 7 | HOLD | Hold |
Write Protect | W | 3 | 6 | C | Serial Clock |
Ground | VSS | 4 | 5 | D | Serial Data Input |
10:08:15.532205 IP 169.254.1.10.15740 > 169.254.255.255.15740: UDP, length 64 0x0000: 4500 005c 0000 4000 4011 e58a a9fe 010a E..\..@.@....... 0x0010: a9fe ffff 3d7c 3d7c 0048 d99f fb8e db0f ....=|=|.H...... 0x0020: 6869 3447 a0cf 4869 4382 a3d7 0100 5e03 hi4G..HiC.....^. 0x0030: d1c9 0090 b500 0010 fa98 f793 2f3e 5000 ............/>P. 0x0040: 5200 4900 4e00 5400 4500 5200 2d00 4400 R.I.N.T.E.R.-.D. 0x0050: 4f00 4e00 4700 4c00 4500 0000 O.N.G.L.E...gPhotoのソースはここにあった。 上記のデータでは29バイト目の0x8eから始まるのだが、先頭の18バイトが意味不明だ。 gPhotoのドキュメントではlength,typeの8バイトのはずなのだが、サイズが違う上に 構造も全く分からない。。。
後から始めたRT3050はFreeBSDにできたが、こちらはFlashがWSONなパッケージで基板 から外すのが難しいので、放置したままになっている。(2015/01/07)
残りの一つのnvramをいじっていたら、起動してすぐに落ちるようになってしまったので とりえあずヒートガンでFlashをはがしました。Flashの中身は吸い出しました。本体は 確認してませんが、壊してはいないはずなので、Flashをつなげれば起動すると思い ます。 このターゲットはOTGのUSBが出ているので、ちょっと貴重なのでまたいつか試すと 思います。 このターゲットはEtherがないので難易度極めて高いです。(2019/01/08)
二台目でnvramにまずいデバイス設定を書き込んでしまい、起動できなくなったので Flashを剥がして中身を読み出して、Fiashを付けられるように直してmrubyが動くように できました。(2023/9/28)