作者:chenzhufly QQ:36886052 (转载请注明出处)
硬件环境:Beaglebone black+ AT070TN83(群创7寸屏)
软件环境:Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.06.20.img.xz
相关链接:
最近也见到网友在制作7寸屏cape的过程遇到了一些问题,现把我的制作过程和大家进行分享,供参考,有问题一起讨论,共同进步!
其实BBB 已经支持7寸屏,并且有相关的dts文件,可以在/lib/fireware下面看到
-
- BB-BONE-LCD7-01-00A2.dts
- BB-BONE-LCD7-01-00A3.dts
- BB-BONE-LCD7-01-00A4.dts
此次修改的蓝本为BB-BONE-LCD7-01-00A2.dts 把它修改为我设计的BBB LCD CAPE,相关的原理图和PCB间上面的链接。我把它改名称为cape-eeworld-lcd-00A0.dts,LCD接口部分不需要任何修改,主要修改了按键和LED的对应关系。
- /*
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
- /dts-v1/;
- /plugin/;
-
- / {
- compatible = "ti,beaglebone", "ti,beaglebone-black";
-
- /* identification */
- <b> part-number = "cape-eeworld-lcd7";
- version = "00A0";</b>
-
- /* state the resources this cape uses */
- exclusive-use =
- /* the pin header uses */
- "P8.45", /* lcd: lcd_data0 */
- "P8.46", /* lcd: lcd_data1 */
- "P8.43", /* lcd: lcd_data2 */
- "P8.44", /* lcd: lcd_data3 */
- "P8.41", /* lcd: lcd_data4 */
- "P8.42", /* lcd: lcd_data5 */
- "P8.39", /* lcd: lcd_data6 */
- "P8.40", /* lcd: lcd_data7 */
- "P8.37", /* lcd: lcd_data8 */
- "P8.38", /* lcd: lcd_data9 */
- "P8.36", /* lcd: lcd_data10 */
- "P8.34", /* lcd: lcd_data11 */
- "P8.35", /* lcd: lcd_data12 */
- "P8.33", /* lcd: lcd_data13 */
- "P8.31", /* lcd: lcd_data14 */
- "P8.32", /* lcd: lcd_data15 */
- "P8.27", /* lcd: lcd_vsync */
- "P8.29", /* lcd: lcd_hsync */
- "P8.28", /* lcd: lcd_pclk */
- "P8.30", /* lcd: lcd_ac_bias_en */
- "P8.20", /* lcd: gpio1_31 */
- "P9.12", /* led: gpio1_28 */
- "P9.14", /* pwm: ehrpwm1a */
- "P9.15", /* keys: gpio1_16 */
- "P9.23", /* keys: gpio1_17 */
- "P9.16", /* keys: gpio1_19 */
- "P9.27", /* keys: gpio3_19 */
- /* the hardware IP uses */
- "gpio1_31",
- "gpio1_28",
- "gpio1_16",
- "gpio1_17",
- "gpio1_19",
- "gpio3_19",
- "lcd",
- "ehrpwm1a";
-
- fragment@0 {
- target = <&am33xx_pinmux>;
- __overlay__ {
-
- bone_lcd7_cape_led_00A2_pins: pinmux_bone_lcd7_cape_led_00A2_pins {
- pinctrl-single,pins = <
- 0x078 0x2f /* gpmc_be1n.gpio1_28, INPUT | PULLDIS | MODE7 */
- >;
- };
-
- bone_lcd7_cape_lcd_pins: pinmux_bone_lcd7_cape_lcd_pins {
- pinctrl-single,pins = <
- 0x84 0x07 /* gpmc_csn2.gpio1_31, OUTPUT | MODE7 - AVDD_EN */
- 0xa0 0x08 /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xa4 0x08 /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xa8 0x08 /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xac 0x08 /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb0 0x08 /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb4 0x08 /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb8 0x08 /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xbc 0x08 /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc0 0x08 /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc4 0x08 /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc8 0x08 /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xcc 0x08 /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd0 0x08 /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd4 0x08 /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd8 0x08 /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xdc 0x08 /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xe0 0x00 /* lcd_vsync.lcd_vsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xe4 0x00 /* lcd_hsync.lcd_hsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xe8 0x00 /* lcd_pclk.lcd_pclk, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xec 0x00 /* lcd_ac_bias_en.lcd_ac_bias_en, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- >;
- };
-
- <b> bone_lcd7_cape_keys_00A2_pins: pinmux_bone_lcd7_cape_keys_00A2_pins {
- pinctrl-single,pins = <
- 0x040 0x2f /* KEY_LEFT gpmc_a0.gpio1_16, INPUT | PULLDIS | MODE7 */
- 0x1ac 0x2f /* KEY_RIGHT gpio3_21, INPUT | PULLDIS | MODE7 */
- 0x198 0x2f /* KEY_UP mcasp0_axr0.gpio3_16, INPUT | PULLDIS | MODE7 */
- 0x044 0x2f /* KEY_DOWN gpmc_a1.gpio1_17, INPUT | PULLDIS | MODE7 */
- 0x1a4 0x2f /* KEY_ENTER mcasp0_fsr.gpio3_19, INPUT | PULLDIS | MODE7 */</b>
- >;
- };
-
- };
- };
-
- fragment@1 {
- target = <&epwmss1>;
- __overlay__ {
- status = "okay";
- };
- };
-
- fragment@2 {
- target = <&ehrpwm1>;
- __overlay__ {
- status = "okay";
- };
- };
-
- fragment@3 {
- target = <&ocp>;
-
- __overlay__ {
-
- /* avoid stupid warning */
- #address-cells = <1>;
- #size-cells = <1>;
-
- tscadc {
- compatible = "ti,ti-tscadc";
- reg = <0x44e0d000 0x1000>;
-
- interrupt-parent = <&intc>;
- interrupts = <16>;
- ti,hwmods = "adc_tsc";
- status = "okay";
-
- tsc {
- ti,wires = <4>;
- ti,x-plate-resistance = <200>;
- ti,coordinate-readouts = <5>;
- ti,wire-config = <0x00 0x11 0x22 0x33>;
- };
-
- adc {
- ti,adc-channels = <4 5 6 7>;
- };
- };
-
- gpio-leds-cape-lcd7 {
- compatible = "gpio-leds";
- pinctrl-names = "default";
-
- pinctrl-0 = <&bone_lcd7_cape_led_00A2_pins>;
-
- <b> lcd7-led0 {
- label = "lcd7:green:usr0";
- gpios = <&gpio2 28 0>;
- linux,default-trigger = "heartbeat";
- default-state = "off";
- };</b>
-
- };
-
- gpio_keys {
- compatible = "gpio-keys";
- pinctrl-names = "default";
- pinctrl-0 = <&bone_lcd7_cape_keys_00A2_pins>;
-
- #address-cells = <1>;
- #size-cells = <0>;
-
- button@1 {
- debounce_interval = <50>;
- linux,code = <105>;
- label = "left";
- gpios = <&gpio2 16 0x1>;
- gpio-key,wakeup;
- autorepeat;
- };
- button@2 {
- debounce_interval = <50>;
- linux,code = <106>;
- label = "right";
- gpios = <&gpio4 21 0x1>;
- gpio-key,wakeup;
- autorepeat;
- };
- button@3 {
- debounce_interval = <50>;
- linux,code = <103>;
- label = "up";
- gpios = <&gpio4 16 0x1>;
- gpio-key,wakeup;
- autorepeat;
- };
- button@4 {
- debounce_interval = <50>;
- linux,code = <108>;
- label = "down";
- gpios = <&gpio2 17 0x1>;
- gpio-key,wakeup;
- autorepeat;
- };
- button@5 {
- debounce_interval = <50>;
- linux,code = <28>;
- label = "enter";
- gpios = <&gpio4 19 0x1>;
- gpio-key,wakeup;
- };
- };
-
- /* Settings for ThreeFive S9700RTWV35TR / LCD7 cape: */
- panel {
- compatible = "tilcdc,panel";
- pinctrl-names = "default";
- pinctrl-0 = <&bone_lcd7_cape_lcd_pins>;
- panel-info {
- ac-bias = <255>;
- ac-bias-intrpt = <0>;
- dma-burst-sz = <16>;
- bpp = <16>;
- fdd = <0x80>;
- tft-alt-mode = <0>;
- stn-565-mode = <0>;
- mono-8bit-mode = <0>;
- sync-edge = <0>;
- sync-ctrl = <1>;
- raster-order = <0>;
- fifo-th = <0>;
- };
- display-timings {
- native-mode = <&timing0>;
- timing0: 800x480 {
- <b> hactive = <800>;
- vactive = <480>;</b>
- hback-porch = <40>;
- hfront-porch = <40>;
- hsync-len = <48>;
- vback-porch = <30>;
- vfront-porch = <13>;
- vsync-len = <3>;
- clock-frequency = <30000000>;
- hsync-active = <0>;
- vsync-active = <0>;
- };
- };
- };
-
- fb {
- compatible = "ti,am33xx-tilcdc";
- reg = <0x4830e000 0x1000>;
- interrupt-parent = <&intc>;
- interrupts = <36>;
- ti,hwmods = "lcdc";
- ti,power-gpio = <&gpio2 31 0x0>;
- ti,allow-non-reduced-blanking-modes;
- };
-
- };
- };
- };
可从这里下载文件:
把这个文件拷贝到/lib/fireware,执行以下命令,生成cape-eeworld-lcd-00A0.dtbo
- dtc -I dts -O dtb -@ cape-eeworld-lcd-00A0.dts > cape-eeworld-lcd-00A0.dtbo
接着修改启动uEnv.txt
- optargs=run_hardware_test capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,
- BB-BONE-EMMC-2G capemgr.enable_partno=cape-eeworld-lcd
这个时候重启板子可以看到以下信息
启动信息:- [ 1.334823] bone-capemgr bone_capemgr.8: loader: check slot-7 cape-eeworld-lcd:00A0 (prio 0)
-
- [ 1.363181] bone-capemgr bone_capemgr.8: loader: after slot-7 cape-eeworld-lcd:00A0 (prio 0)
-
- [ 1.378235] bone-capemgr bone_capemgr.8: slot #7: Requesting part number/version based 'cape-eeworld-lcd-00A0.dtbo
-
- [ 1.401466] bone-capemgr bone_capemgr.8: slot #7: Requesting firmware 'cape-eeworld-lcd-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
-
- [ 5.824022] bone-capemgr bone_capemgr.8: slot #7: dtbo 'cape-eeworld-lcd-00A0.dtbo' loaded; converting to live tree
-
- [ 5.844223] bone-capemgr bone_capemgr.8: slot #7: #4 overlays
-
- [ 6.089835] bone-capemgr bone_capemgr.8: slot #7: Applied #4 overlays.
-
- [ 6.097471] bone-capemgr bone_capemgr.8: loader: done slot-7 cape-eeworld-lcd:00A0 (prio 0)
-
进入系统后,执行cat /sys/devices/bone_capemgr.8/slots,可看到cape-eeworld-cape已经加载成功
- 0: 54:PF---
- 1: 55:PF---
- 2: 56:PF---
- 3: 57:PF---
- 4: ff:P-O-- Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
- 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
- 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
- <b> 7: ff:P-O-L Override Board Name,00A0,Override Manuf,cape-eeworld-lcd</b>
启动画面:
登陆界面如下
进图系统后的界面
至此BBB LCD CAPE的图形界面已经启动成功!
本帖最后由 chenzhufly 于 2014-4-6 15:06 编辑