| 1 | = RS232C x1 cape = |
| 2 | |
| 3 | 以前作成した[http://cerldev.kek.jp/trac/EpicsUsersJP/wiki/epics/bbb#Serialx4Box Serialx4 Box]の1ポート版。[[br]] |
| 4 | 以前基板は作ったけど、安く作成するためのケースが決まらなかったのと、Debian7になって独自に作成したcapeを自動で認識しなくなってしまったので放置してた。[[br]] |
| 5 | Debian8になって、cape周りが改善された(?)ようなので再開することにした。 |
| 6 | |
| 7 | |
| 8 | == cape == |
| 9 | |
| 10 | 以前作っておいたcapeのEEPROMに書き込んでおいたものがあったので、起動時に認識されているかを見てみた。 |
| 11 | |
| 12 | {{{ |
| 13 | [ 2.343774] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,00C0,3115BBBK0805' |
| 14 | [ 2.343809] bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4 |
| 15 | [ 2.382159] bone_capemgr bone_capemgr: slot #0: 'RS232C Tiny Cape,00A0,KEK cERL CTRL,cape-uart-tiny' |
| 16 | [ 2.422019] bone_capemgr bone_capemgr: slot #1: No cape found |
| 17 | [ 2.462015] bone_capemgr bone_capemgr: slot #2: No cape found |
| 18 | [ 2.502015] bone_capemgr bone_capemgr: slot #3: No cape found |
| 19 | [ 2.502280] bone_capemgr bone_capemgr: initialized OK. |
| 20 | [ 2.504321] PM: bootloader does not support rtc-only! |
| 21 | [ 2.505368] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800) |
| 22 | [ 2.505400] of_cfs_init |
| 23 | [ 2.505523] of_cfs_init: OK |
| 24 | [ 2.511353] PM: Hibernation image not present or could not be loaded. |
| 25 | : |
| 26 | [ 3.514385] bone_capemgr bone_capemgr: loader: failed to load slot-0 cape-uart-tiny:00A0 (prio 0) |
| 27 | }}} |
| 28 | |
| 29 | まだ、firmwareを入れてないので、認識はするけどその後エラーになっている。ここまでは以前と同じ。[[br]] |
| 30 | firmwareをインストールして再度起動してみたけど、やはりダメだった。[[br]] |
| 31 | |
| 32 | firmwareの内容は以前とちょっと変わったので、修正してある。[[br]] |
| 33 | |
| 34 | {{{ |
| 35 | /* |
| 36 | * Copyright (C) 2013-2017 Tetsuya Michikawa <hig-mchi@post.kek.jp> |
| 37 | * |
| 38 | * BeagleBone Black UART 1,2 used RS232c cape |
| 39 | */ |
| 40 | /dts-v1/; |
| 41 | /plugin/; |
| 42 | |
| 43 | |
| 44 | |
| 45 | / { |
| 46 | compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green"; |
| 47 | |
| 48 | /* identification */ |
| 49 | /*part-number = "cape-bone-uart-tiny";*/ |
| 50 | part-number = "cape-uart-tiny"; |
| 51 | version = "00A0"; |
| 52 | |
| 53 | /* state the resources this cape uses */ |
| 54 | exclusive-use = |
| 55 | /* the pin header uses */ |
| 56 | "P9.24", /* uart1_txd */ |
| 57 | "P9.26", /* uart1_rxd */ |
| 58 | "P9.21", /* uart2_txd */ |
| 59 | "P9.22", /* uart2_rxd */ |
| 60 | /* the hardware ip uses */ |
| 61 | "uart1", |
| 62 | "uart2"; |
| 63 | fragment@0 { |
| 64 | target = <&am33xx_pinmux>; |
| 65 | __overlay__ { |
| 66 | bb_uart1_pins: pinmux_bb_uart1_pins { |
| 67 | pinctrl-single,pins = < |
| 68 | /*0x180 0x20*/ /* P9.26 uart1_rxd.uart1_rxd INPUT */ |
| 69 | /*0x184 0x20*/ /* P9.24 uart1_txd.uart1_txd OUTPUT */ |
| 70 | 0x184 0 // uart1_txd.uart1_txd |
| 71 | 0x180 (1<<8) // uart1_rxd.uart1_rxd |
| 72 | >; |
| 73 | }; |
| 74 | bb_uart2_pins: pinmux_bb_uart2_pins { |
| 75 | pinctrl-single,pins = < |
| 76 | /*0x150 0x21*/ /* P9.22 spi0_sclk.uart2_rxd | MODE1 */ |
| 77 | /*0x154 0x01*/ /* P9.21 spi0_d0.uart2_txd | MODE1 */ |
| 78 | 0x154 1 // spi0_d0.uart2_txd |
| 79 | 0x150 ((1<<8) | 1) // spi0_sclk.uart2_rxd |
| 80 | >; |
| 81 | }; |
| 82 | }; |
| 83 | }; |
| 84 | |
| 85 | fragment@1 { |
| 86 | target = <&uart1>; |
| 87 | __overlay__ { |
| 88 | status = "okay"; |
| 89 | pinctrl-names = "default"; |
| 90 | pinctrl-0 = <&bb_uart1_pins>; |
| 91 | }; |
| 92 | }; |
| 93 | fragment@2 { |
| 94 | target = <&uart2>; |
| 95 | __overlay__ { |
| 96 | status = "okay"; |
| 97 | pinctrl-names = "default"; |
| 98 | pinctrl-0 = <&bb_uart2_pins>; |
| 99 | }; |
| 100 | }; |
| 101 | }; |
| 102 | }}} |
| 103 | |
| 104 | 起動後に手動でbone-capemgrに登録すれば認識はされるので、firmwareが間違っているわけでもなさそう。[[br]] |
| 105 | |
| 106 | {{{ |
| 107 | root@beaglebone:~# echo cape-uart-tiny > /sys/devices/platform/bone_capemgr/slots |
| 108 | root@beaglebone:~# cat /sys/devices/platform/bone_capemgr/slots |
| 109 | 0: P----- -1 RS232C Tiny Cape,00A0,KEK cERL CTRL,cape-uart-tiny |
| 110 | 1: PF---- -1 |
| 111 | 2: PF---- -1 |
| 112 | 3: PF---- -1 |
| 113 | 4: P-O-L- 0 Override Board Name,00A0,Override Manuf,cape-uart-tiny |
| 114 | |
| 115 | root@beaglebone:~# dmesg |
| 116 | : |
| 117 | [ 224.894311] bone_capemgr bone_capemgr: part_number 'cape-uart-tiny', version 'N/A' |
| 118 | [ 224.894397] bone_capemgr bone_capemgr: slot #4: override |
| 119 | [ 224.894439] bone_capemgr bone_capemgr: Using override eeprom data at slot 4 |
| 120 | [ 224.894488] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,cape-uart-tiny' |
| 121 | [ 224.931576] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 199, base_baud = 3000000) is a 8250 |
| 122 | [ 224.946064] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 200, base_baud = 3000000) is a 8250 |
| 123 | [ 224.956129] bone_capemgr bone_capemgr: slot #4: dtbo 'cape-uart-tiny-00A0.dtbo' loaded; overlay id #0 |
| 124 | }}} |
| 125 | |
| 126 | 以前は、{{{ttyO1,ttyO2}}}だったが、{{{ttyS1,ttyS2}}}に変わったみたい。[[br]] |
| 127 | |
| 128 | {{{/boot/uEnv.txt}}}を修正しても、結果は同じだった。[[br]] |
| 129 | |
| 130 | {{{ |
| 131 | #enable_uboot_overlays=1 |
| 132 | enable_uboot_overlays=1 |
| 133 | #uboot_overlay_addr0=/lib/firmware/<file0>.dtbo |
| 134 | uboot_overlay_addr0=/lib/firmware/cape-uart-tiny-00A0.dtbo |
| 135 | ###Custom Cape |
| 136 | dtb_overlay=/lib/firmware/cape-uart-tiny-00A0.dtbo |
| 137 | #disable_uboot_overlay_emmc=1 |
| 138 | disable_uboot_overlay_video=1 |
| 139 | |
| 140 | #cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=enable |
| 141 | cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=disable |
| 142 | }}} |