OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 2336|回复: 1

usb键盘和鼠标不能使用,跟着教程做到LCD实验了

[复制链接]

4

主题

14

帖子

0

精华

初级会员

Rank: 2

积分
187
金钱
187
注册时间
2020-11-11
在线时间
27 小时
发表于 2022-7-15 15:14:27 | 显示全部楼层 |阅读模式
10金钱
跟着驱动开发教程做到第40章的 LCD 实验了,lcd屏幕有了正常的显示,
想着插上USB键盘试试,但是插上没有任何反应,
使用命令 lsusb 也没有显示usb设备,难道是设备树上没有写吗?
大佬们怎么办啊?
下面是 stm32mp157d-atk.dts 的内容
  1. // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
  2. /*
  3. * Copyright (C) STMicroelectronics 2019 - All Rights Reserved
  4. * Author: Alexandre Torgue <alexandre.torgue@st.com> for STMicroelectronics.
  5. */
  6. /dts-v1/;

  7. #include "stm32mp157.dtsi"
  8. #include "stm32mp15xc.dtsi"
  9. #include "stm32mp15-pinctrl.dtsi"
  10. #include "stm32mp15xxaa-pinctrl.dtsi"
  11. #include "stm32mp157-m4-srm.dtsi"
  12. #include "stm32mp157-m4-srm-pinctrl.dtsi"
  13. #include "stm32mp157d-atk.dtsi"

  14. / {
  15.         model = "STMicroelectronics STM32MP157C eval daughter";
  16.         compatible = "st,stm32mp157c-ed1","st,stm32mp157";

  17.         chosen {
  18.                 stdout-path = "serial0:115200n8";
  19.         };

  20.         aliases {
  21.                 serial0 = &uart4;
  22.         };

  23.         reserved-memory {
  24.                 gpu_reserved: gpu@f6000000 {
  25.                         reg = <0xf6000000 0x8000000>;
  26.                         no-map;
  27.                 };

  28.                 optee_memory: optee@fe000000 {
  29.                         reg = <0xfe000000 0x02000000>;
  30.                         no-map;
  31.                 };
  32.         };

  33.         key{
  34.                 compatible = "alientek,key";
  35.                 key-gpio = <&gpiog 3 GPIO_ACTIVE_LOW>;
  36.                 status = "okay";
  37.                 pinctrl-name = "default";
  38.                 pinctrl-0 = <&key_pins_a>;
  39.                 interrupt-parent = <&gpiog>;
  40.                 interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
  41.         };

  42.         dtsleds{
  43.                 compatible = "gpio-leds";
  44.                 pinctrl-0 = <&led_pins_a>;

  45.                 led0{
  46.                         label = "red";
  47.                         gpios = <&gpioi 0 GPIO_ACTIVE_LOW>;
  48.                         linux,default-trigger = "heartbeat";
  49.                         default-state = "on";
  50.                 };
  51.                 led1{
  52.                         label = "green";
  53.                         gpios = <&gpiof 3 GPIO_ACTIVE_LOW>;
  54.                         default-state = "off";
  55.                 };
  56.         };

  57.         beep{
  58.                 compatible = "alientek,beep";
  59.                 status = "okay";
  60.                 pinctrl-name = "default";
  61.                 pinctrl-0 = <&beep_pins_a>;
  62.                 beep-gpio = <&gpioc 7 GPIO_ACTIVE_HIGH>;
  63.         };

  64.         // 使用rgb转hdmi时这个节点不能使用
  65.         // panel_rgb: panel-rgb {
  66.         //         compatible = "alientek,lcd-rgb";
  67.         //         backlight = <&backlight>;
  68.         //         status = "okay";

  69.         //         port {
  70.         //                 rgb_panel_in: endpoint {
  71.         //                         remote-endpoint = <<dc_ep0_out>;
  72.         //                 };
  73.         //         };
  74.         // };

  75.         backlight: backlight{
  76.                 compatible = "pwm-backlight";
  77.                 pwms = <&pwm4 1 5000000>;
  78.                 brightness-levels = <0 4 8 16 32 64 128 255>;
  79.                 power-supply = <&v3v3>;
  80.                 default-brightness-level = <7>;
  81.                 status = "okay";
  82.         };

  83.         v1v2_hdmi: regulator-v1v2-hdmi {
  84.                 compatible = "regulator-fixed";
  85.                 regulator-name = "v1v2_hdmi";
  86.                 regulator-min-microvolt = <1200000>;
  87.                 regulator-max-microvolt = <1200000>;
  88.                 regulator-always-on;
  89.                 regulator-boot-on;
  90.         };
  91. };

  92. &timers1 {
  93.         status = "okay";
  94.         /* spare all DMA channels since they are not needed for PWM output */
  95.         /delete-property/dmas;
  96.         /delete-property/dma-names;
  97.         pwm1: pwm {
  98.                 pinctrl-0 = <&pwm1_pins_a>;
  99.                 pinctrl-1 = <&pwm1_sleep_pins_a>;
  100.                 pinctrl-names = "default", "sleep";
  101.                 #pwm-cells = <2>;
  102.                 status = "okay";
  103.         };
  104. };

  105. <dc{
  106.         pinctrl-names = "default","sleep";
  107.         pinctrl-0 = <<dc_pins_b>;
  108.         pinctrl-1 = <<dc_pins_sleep_b>;
  109.         status = "okay";

  110.         port{
  111.                 #address-cells = <1>;
  112.                 #size-cells = <0>;

  113.                 ltdc_ep0_out: endpoint@0{
  114.                         reg = <0>;
  115.                         remote-endpoint = <&sii9022_in>;
  116.                 };
  117.         };
  118. };

  119. /* LCD 背光通过PWM调节 */
  120. &timers4{
  121.         status = "okay";
  122.         /* spare dmas for other usage */
  123.         /delete-property/dmas;
  124.         /delete-property/dma-names;
  125.         pwm4: pwm{
  126.                 pinctrl-0 = <&pwm4_pins_b>;
  127.                 pinctrl-1 = <&pwm4_sleep_pins_b>;
  128.                 pinctrl-names = "default", "sleep";
  129.                 #pwm-cells = <2>;
  130.                 status = "okay";
  131.         };
  132. };

  133. &i2c5 {
  134.         pinctrl-names = "default", "sleep";
  135.         pinctrl-0 = <&i2c5_pins_a>;
  136.         pinctrl-1 = <&i2c5_pins_sleep_a>;
  137.         status = "okay";

  138.         ap3216c@1e {
  139.                 compatible = "alientek,ap3216c";
  140.                 reg = <0x1e>;
  141.         };
  142. };

  143. &i2c2 {
  144.         pinctrl-names = "default", "sleep";
  145.         pinctrl-0 = <&i2c2_pins_a>;
  146.         pinctrl-1 = <&i2c2_pins_sleep_a>;
  147.         status = "okay";

  148.         hdmi: hdmi-transmitter@39 {
  149.                 compatible = "sil,sii9022";
  150.                 reg = <0x39>;
  151.                 iovcc-supply = <&v3v3>;
  152.                 cvcc12-supply = <&v1v2_hdmi>;
  153.                 reset-gpios = <&gpioa 3 GPIO_ACTIVE_LOW>;
  154.                 interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
  155.                 interrupt-parent = <&gpioh>;
  156.                 #sound-dai-cells = <1>;
  157.                 status = "okay";
  158.                 ports {
  159.                         #address-cells = <1>;
  160.                         #size-cells = <0>;

  161.                         port@0 {
  162.                                 reg = <0>;
  163.                                 sii9022_in: endpoint {
  164.                                         remote-endpoint = <<dc_ep0_out>;
  165.                                 };
  166.                         };
  167.                 };
  168.         };
  169. };

  170. &cpu1{
  171.         cpu-supply = <&vddcore>;
  172. };

  173. &cryp1 {
  174.         status="okay";
  175. };

  176. &gpu {
  177.         contiguous-area = <&gpu_reserved>;
  178.         status = "okay";
  179. };

  180. &optee {
  181.         status = "okay";
  182. };
复制代码


最佳答案

查看完整内容[请看2#楼]

因为你没在设备树上加usb host 驱动,系统是检测不到你是否插入usb 设备的。建议你看一下usb驱动实验章节
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

4

主题

67

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1011
金钱
1011
注册时间
2021-5-25
在线时间
185 小时
发表于 2022-7-15 15:14:28 | 显示全部楼层
因为你没在设备树上加usb host 驱动,系统是检测不到你是否插入usb 设备的。建议你看一下usb驱动实验章节
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-6-11 05:50

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表