ARM Linux DIY(八)USB 调试
前言
V3s 带有一个 USB 接口,将其设置为 HOST 或 OTG 模式,这样可以用来接入键盘、鼠标等 USB 外设。
USB 简介
USB 有两种设备:HOST 和 USB 功能设备。
在 USB2.0 中又引入了一个新的概念 OTG,即设备角色可以动态切换。
切换方式一:硬件
使用 USB_ID 引脚,默认上拉,处于 device 状态。
如果需要 OTG 控制器进入 HOST 状态,需要外接的 USB 口将 USB_ID 短接到地。
切换方式二:设备树
设备树直接配置
&usb_otg {dr_mode = "otg"; /* 三个可选项: otg / host / peripheral */status = "okay";
};
切换方式三:手动修改 /sys
进入 Linux 系统,执行,usb 将会被设置成为 host 模式
echo host > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode
我们使用硬件方式切换
硬件
USB 电路简单,只有两根线 D+、D-,器件也简单,就一个 USB 母座,甚至连电阻电容都不需要,其它外设如果也能像 USB 这样就好了。😊😊😊
焊接就很简单了,就一个 USB 母座,我使用的是 Type C 母座
设备树
arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
/ {soc {// 增加 ehci0 (usb2.0)、ohci0 (usb1.1) 这两个节点ehci0: usb@01c1a000 {compatible = "allwinner,sun8i-v3s-ehci", "generic-ehci";reg = <0x01c1a000 0x100>;interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>;resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;status = "okay";};ohci0: usb@01c1a400 {compatible = "allwinner,sun8i-v3s-ohci", "generic-ohci";reg = <0x01c1a400 0x100>;interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>,<&ccu CLK_USB_OHCI0>;resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;status = "okay";};};
};&usb_otg {dr_mode = "otg";status = "okay";
};&usbphy {usb0_id_det-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;status = "okay";
};
调试
# lsusb
Bus 003 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
插入键盘
#
[ 64.047789] usb 2-1: USB disconnect, device number 2
[ 69.109743] usb 2-1: new full-speed USB device number 3 using ohci-platform
[ 69.410757] usbhid 2-1:1.0: can't add hid device: -71
[ 69.417442] usbhid: probe of 2-1:1.0 failed with error -71
[ 69.438942] input: Gaming KB System Control as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0001/input/input1
[ 69.520323] input: Gaming KB Consumer Control as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0001/input/input2
[ 69.536532] input: Gaming KB Keyboard as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0001/input/input3
[ 69.558009] hid-generic 0003:258A:1006.0001: input: USB HID v1.11 Keyboard [Gaming KB ] on usb-1c1a400.usb-1/input1
[ 71.259791] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[ 73.019839] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[ 74.999799] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[ 76.809912] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[ 77.469746] usb 2-1: device not accepting address 3, error -62
[ 77.679753] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[ 79.639774] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[ 81.230445] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[ 83.079769] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[ 85.079781] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[ 85.354764] usb 2-1: device descriptor read/all, error -71
[ 85.569730] usb 2-1: reset full-speed USB device number 3 using ohci-platform
报错 usb 2-1: device descriptor read/all, error -71
拔插一次
#
[ 207.536060] usb 2-1: USB disconnect, device number 3
[ 210.899724] usb 2-1: new full-speed USB device number 4 using ohci-platform
[ 211.196755] usbhid 2-1:1.0: can't add hid device: -62
[ 211.203540] usbhid: probe of 2-1:1.0 failed with error -62
[ 211.231919] input: Gaming KB Gaming KB System Control as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0002/input/input4
[ 211.310302] input: Gaming KB Gaming KB Consumer Control as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0002/input/input5
[ 211.327496] input: Gaming KB Gaming KB Keyboard as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0002/input/input6
[ 211.359852] hid-generic 0003:258A:1006.0002: input: USB HID v1.11 Keyboard [Gaming KB Gaming KB ] on usb-1c1a400.usb-1/input1
还是报错 usbhid: probe of 2-1:1.0 failed with error -62
# ls /dev/input/ -lh
total 0
crw------- 1 root root 13, 64 Jan 1 00:00 event0
crw------- 1 root root 13, 65 Jan 1 00:03 event1 // 键盘
crw------- 1 root root 13, 66 Jan 1 00:03 event2 // 键盘
crw------- 1 root root 13, 67 Jan 1 00:03 event3 // 键盘
/dev/input
目录下虽然产生了键盘对应的 event 设备,但是监听这些设备,按下键盘,没有任何反应
# hexdump /dev/input/event1# hexdump /dev/input/event2# hexdump /dev/input/event3
起初怀疑是供电不足,于是使用一个电源适配器专门给 HUB 供电,还是报错。
又怀疑是 1 拖 4 的 USB HUB 质量不好,或者耗电太大,于是又买了个 1 拖 1 的 USB HUB(其实不能算是 HUB,应该只能算是 Type C 转 Type A 转换器),结果还是报错。
还怀疑是 USB_ID 引脚没有下拉,于是飞线到 GND 进行下拉,还是报错。
就这样调试了两天未果,最终从《USB 为什么一般选择48MHz》 这篇文章中找到了线索,
USB 的系统时钟需要时 bitrate 的 4 倍, 如低速 USB,传输速率是 1.5Mbps, 系统时钟需要选择为1.5*4 == 6Mhz,全速 usb 12MHz * 4 == 48Mhz
想到我使用的晶振是 26MHz,不是 4 的整数倍,难道是这个原因?
遂将晶振从 26MHz 换成了 24MHz,相应地,uboot 和 kernel dts 也修改成 24MHz,上电测试竟然还真的正常了。
测试
插入 USB HUB
#
[ 290.679671] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 290.881127] hub 1-1:1.0: USB hub found
[ 290.886219] hub 1-1:1.0: 4 ports detected# lsusb
Bus 003 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 1a40:0101 // USB HUB
Bus 002 Device 001: ID 1d6b:0001
插入键盘
#
[ 587.679662] usb 1-1.1: new full-speed USB device number 3 using ehci-platform
[ 587.936322] input: Gaming KB Gaming KB as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.1/1-1.1:1.0/0003:258A:1006.0001/input/input1
[ 588.020368] hid-generic 0003:258A:1006.0001: input: USB HID v1.11 Keyboard [Gaming KB Gaming KB ] on usb-1c1a000.usb-1.1/input0
[ 588.049607] input: Gaming KB Gaming KB System Control as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:258A:1006.0002/input/input2
[ 588.130279] input: Gaming KB Gaming KB Consumer Control as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:258A:1006.0002/input/input3
[ 588.147663] input: Gaming KB Gaming KB Keyboard as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:258A:1006.0002/input/input4
[ 588.170084] hid-generic 0003:258A:1006.0002: input: USB HID v1.11 Keyboard [Gaming KB Gaming KB ] on usb-1c1a000.usb-1.1/input1# lsusb
Bus 003 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 258a:1006 // 键盘
Bus 001 Device 002: ID 1a40:0101
Bus 002 Device 001: ID 1d6b:0001# ls /dev/input/ -lh
total 0
crw------- 1 root root 13, 64 Jan 1 00:00 event0
crw------- 1 root root 13, 65 Jan 1 02:04 event1 // 键盘
crw------- 1 root root 13, 66 Jan 1 02:04 event2 // 键盘
crw------- 1 root root 13, 67 Jan 1 02:04 event3 // 键盘
crw------- 1 root root 13, 68 Jan 1 02:04 event4 // 键盘
监听键盘按键
# hexdump /dev/input/event1
0000000 1dbd 0000 9338 0007 0004 0004 000b 0007
0000010 1dbd 0000 9338 0007 0001 0023 0001 0000
0000020 1dbd 0000 9338 0007 0000 0000 0000 0000
0000030 1dbd 0000 eaec 0008 0004 0004 000b 0007
0000040 1dbd 0000 eaec 0008 0001 0023 0000 0000
0000050 1dbd 0000 eaec 0008 0000 0000 0000 0000
0000060 1dbe 0000 01b8 0000 0004 0004 0009 0007
0000070 1dbe 0000 01b8 0000 0001 0021 0001 0000
0000080 1dbe 0000 01b8 0000 0000 0000 0000 0000
0000090 1dbe 0000 1ae3 0001 0004 0004 0009 0007
00000a0 1dbe 0000 1ae3 0001 0001 0021 0000 0000
00000b0 1dbe 0000 1ae3 0001 0000 0000 0000 0000
00000c0 1dbe 0000 d8e5 000b 0004 0004 0015 0007
00000d0 1dbe 0000 d8e5 000b 0001 0013 0001 0000
00000e0 1dbe 0000 d8e5 000b 0000 0000 0000 0000
00000f0 1dbe 0000 8e63 000d 0004 0004 0015 0007
0000100 1dbe 0000 8e63 000d 0001 0013 0000 0000
0000110 1dbe 0000 8e63 000d 0000 0000 0000 0000
插入鼠标
#
[ 806.739667] usb 1-1.4: new full-speed USB device number 4 using ehci-platform
[ 806.996984] input: Logitech G102 Prodigy Gaming Mouse as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C084.0003/input/input5
[ 807.022588] hid-generic 0003:046D:C084.0003: input: USB HID v1.11 Mouse [Logitech G102 Prodigy Gaming Mouse] on usb-1c1a000.usb-1.4/input0
[ 807.067548] input: Logitech G102 Prodigy Gaming Mouse Keyboard as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C084.0004/input/input6
[ 807.150288] input: Logitech G102 Prodigy Gaming Mouse Consumer Control as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C084.0004/input/input7
[ 807.168723] input: Logitech G102 Prodigy Gaming Mouse System Control as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C084.0004/input/input8
[ 807.193232] hid-generic 0003:046D:C084.0004: input: USB HID v1.11 Keyboard [Logitech G102 Prodigy Gaming Mouse] on usb-1c1a000.usb-1.4/input1# lsusb
Bus 003 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 258a:1006
Bus 001 Device 002: ID 1a40:0101
Bus 002 Device 001: ID 1d6b:0001
Bus 001 Device 004: ID 046d:c084 // 鼠标# ls /dev/input/ -lh
total 0
crw------- 1 root root 13, 64 Jan 1 00:00 event0
crw------- 1 root root 13, 65 Jan 1 02:04 event1
crw------- 1 root root 13, 66 Jan 1 02:04 event2
crw------- 1 root root 13, 67 Jan 1 02:04 event3
crw------- 1 root root 13, 68 Jan 1 02:04 event4
crw------- 1 root root 13, 69 Jan 1 02:08 event5 // 鼠标
crw------- 1 root root 13, 70 Jan 1 02:08 event6 // 鼠标
crw------- 1 root root 13, 71 Jan 1 02:08 event7 // 鼠标
crw------- 1 root root 13, 72 Jan 1 02:08 event8 // 鼠标
监听鼠标移动、点击
# hexdump /dev/input/event5
0000000 1e91 0000 9be6 000e 0002 0000 0001 0000
0000010 1e91 0000 9be6 000e 0000 0000 0000 0000
0000020 1e91 0000 befd 000e 0002 0000 0001 0000
0000030 1e91 0000 befd 000e 0000 0000 0000 0000
0000040 1e91 0000 caa5 000e 0002 0001 0001 0000
0000050 1e91 0000 caa5 000e 0000 0000 0000 0000
0000060 1e92 0000 3dfc 0001 0002 0000 0001 0000
0000070 1e92 0000 3dfc 0001 0000 0000 0000 0000
0000080 1e93 0000 cb9d 0008 0002 0000 0001 0000
0000090 1e93 0000 cb9d 0008 0000 0000 0000 0000
00000a0 1e93 0000 15c0 0009 0002 0000 0001 0000
00000b0 1e93 0000 15c0 0009 0000 0000 0000 0000
00000c0 1e93 0000 f24a 000a 0002 0000 0001 0000
00000d0 1e93 0000 f24a 000a 0000 0000 0000 0000
00000e0 1e93 0000 1950 000b 0002 0000 0001 0000
00000f0 1e93 0000 1950 000b 0000 0000 0000 0000
0000100 1e93 0000 3c95 000b 0002 0000 0001 0000
0000110 1e93 0000 3c95 000b 0000 0000 0000 0000
0000120 1e93 0000 5bc9 000b 0002 0000 0001 0000
0000130 1e93 0000 5bc9 000b 0000 0000 0000 0000
0000140 1e93 0000 7afe 000b 0002 0000 0001 0000
0000150 1e93 0000 7afe 000b 0000 0000 0000 0000
0000160 1e96 0000 5793 0000 0004 0004 0001 0009
0000170 1e96 0000 5793 0000 0001 0110 0001 0000
0000180 1e96 0000 5793 0000 0000 0000 0000 0000
0000190 1e96 0000 3fd6 0002 0004 0004 0001 0009
00001a0 1e96 0000 3fd6 0002 0001 0110 0000 0000
00001b0 1e96 0000 3fd6 0002 0000 0000 0000 0000
00001c0 1e96 0000 e13b 0007 0004 0004 0002 0009
00001d0 1e96 0000 e13b 0007 0001 0111 0001 0000
00001e0 1e96 0000 e13b 0007 0000 0000 0000 0000
00001f0 1e96 0000 d35f 0008 0004 0004 0002 0009
0000200 1e96 0000 d35f 0008 0001 0111 0000 0000
0000210 1e96 0000 d35f 0008 0000 0000 0000 0000
0000220 1e96 0000 3cce 0009 0004 0004 0002 0009
0000230 1e96 0000 3cce 0009 0001 0111 0001 0000
0000240 1e96 0000 3cce 0009 0000 0000 0000 0000
0000250 1e96 0000 ae11 0009 0004 0004 0002 0009
0000260 1e96 0000 ae11 0009 0001 0111 0000 0000
0000270 1e96 0000 ae11 0009 0000 0000 0000 0000
至此,USB 调试 OK
相关文章:

ARM Linux DIY(八)USB 调试
前言 V3s 带有一个 USB 接口,将其设置为 HOST 或 OTG 模式,这样可以用来接入键盘、鼠标等 USB 外设。 USB 简介 USB 有两种设备:HOST 和 USB 功能设备。 在 USB2.0 中又引入了一个新的概念 OTG,即设备角色可以动态切换。 切换方…...

编程小白的自学笔记十四(python办公自动化创建、复制、移动文件和文件夹)
系列文章目录 编程小白的自学笔记十三(python办公自动化读写文件) 编程小白的自学笔记十二(python爬虫入门四Selenium的使用实例二) 编程小白的自学笔记十一(python爬虫入门三Selenium的使用实例详解) …...

MySQL使用Xtrabackup备份到AWS存储桶
1.安装Xtrabackup cd /tmp wget https://downloads.percona.com/downloads/Percona-XtraBackup-8.0/Percona-XtraBackup-8.0.33-28/binary/redhat/7/x86_64/percona-xtrabackup-80-8.0.33-28.1.el7.x86_64.rpm yum -y localinstall percona-xtrabackup-80-8.0.33-28.1.el7.x86…...
(高阶)Redis 7 第11讲 BIGKEY 优化篇
面试题 问题答案如何在海量数据中查询某一固定前缀的Keyscan生产环境如何限制 keys */FLUSHDB/FLUSHALL 等危险命令,防止误删误用# 修改配置文件 rename-command keys "" rename-command flushdb "" rename-command flushall ""如何使用MEMORY U…...
一阶差分和二阶差分概念及其举例
一阶差分和二阶差分概念及其举例 目录 一阶差分和二阶差分概念及其举例1、一阶差分1.1 概念1.2 举例 2、二阶差分2.1 概念2.2 举例 1、一阶差分 1.1 概念 一阶差分是指对一个数列中的每个元素,计算其与其前一个元素之差的操作。 1.2 举例 举例来说,对…...

使用自定义注解和SpringAOP捕获Service层异常,并处理自定义异常
目录 一 自定义异常二 自定义注解三 注解切面处理类四 使用 一 自定义异常 /*** 自定义参数为null异常*/ public class NoParamsException extends Exception {//用详细信息指定一个异常public NoParamsException(String message){super(message);}//用指定的详细信息和原因构…...

Kotlin(六) 类
目录 创建类 调用类 类的继承------open 构造函数 创建类 创建类和创建java文件一样,选择需要创建的目录New→Kotlin File/Class Kotlin中也是使用class关键字来声明一个类的,这一点和Java一致。现在我们可以在这个类中加入字段和函数来丰富它的功…...
蓝桥杯官网练习题(灌溉)
题目描述 小蓝负责花园的灌溉工作。 花园可以看成一个 n 行 m 列的方格图形。中间有一部分位置上安装有出水管。 小蓝可以控制一个按钮同时打开所有的出水管,打开时,有出水管的位置可以被认为已经灌溉好。 每经过一分钟,水就会向四面扩展…...

数据结构:树的概念和结构
文章目录 1. 树的概念2. 树的结构3. 树的相关概念4. 树的表示孩子表示法双亲表示法孩子兄弟表示法 5. 树在实际中的应用5. 树在实际中的应用 1. 树的概念 树是一种非线性的数据结构,它是由 n (n > 0)个有限结点组成一个具有层次关系的. 把它叫做树是因为它看起来像一棵倒挂的…...

【GIS】栅格转面报错:ERROR 000864输入栅格: 输入不在定义的属性域内。 ERROR 000863: 无效的 GP 数据类型
问题: 栅格转面(矢量)时,ArcGIS窗口显示:ERROR 000864输入栅格: 输入不在定义的属性域内。 ERROR 000863: 无效的 GP 数据类型. 原因: 栅格转面时输入的栅格数据集的字段必须是整型. 解决办法: 使用Spatial Analyst中的转为整型工具,将栅格数据转为整型后再进行栅格转面的操作…...

32 WEB漏洞-文件操作之文件下载读取全解
目录 介绍利用获取数据库配置文件文件名,参数值,目录符号 涉及案例:Pikachu-文件下载测试-参数Zdns-文件下载真实测试-功能点小米路由器-文件读取真实测试-漏洞RoarCTF2019-文件读取真题复现-比赛百度杯2017二月-Zone真题复现-比赛拓展 下载和读取都差不…...

Linux之history、tab、alias、命令执行顺序、管道符以及exit
目录 Linux之history、tab、alias、命令执行顺序、管道符以及exit history历史命令 格式 参数 修改默认记录历史命令条数 案例 案例1 --- 显示history历史记录中出现次数最高的top10 案例2 --- 增加history显示的时间信息 命令与文件名补全 --- tab 命令别名 格式 案…...

vcomp100.dll丢失怎样修复?5个靠谱的修复方法分享
VCOMP100.DLL 是由微软打造的动态链接库,它对于一些图形密集型应用,例如Photoshop,以及多款知名游戏如巫师3的运行至关重要。 如果操作系统在启动应用程序时无法找到此vcomp100.dll,则会出现vcomp100.dll丢失或未找到错误。 如果D…...
Vue3自定义指令(directive)
文章目录 前言一、Vue3指令钩子函数二、自定义指令的两种方式1.局部使用例子1:鉴权例子2:拖拽 2.全局使用例子1:监听宽高指令例子2:监听是否出现在视口 总结 前言 此文章主要讲了vue3中自定义指令的使用,以及一些WebA…...
大数据课程L9——网站流量项目的实时业务处理代码
文章作者邮箱:yugongshiye@sina.cn 地址:广东惠州 ▲ 本章节目的 ⚪ 掌握网站流量项目的SparkStreaming代码; ⚪ 掌握网站流量项目的HBaseUtil代码; ⚪ 掌握网站流量项目的MysqlUtil代码; ⚪ 掌握网站流量项目的LogBean代码; ⚪ 掌握网站流量项目的To…...

【2023最新B站评论爬虫】用python爬取上千条哔哩哔哩评论
文章目录 一、爬取目标二、展示爬取结果三、爬虫代码四、同步视频五、附完整源码 您好,我是 马哥python说,一枚10年程序猿。 一、爬取目标 之前,我分享过一些B站的爬虫: 【Python爬虫案例】用Python爬取李子柒B站视频数据 【Pyt…...
mysql设置max_sp_recursion_depth,sql_mode
mysql 中设置 @@max_sp_recursion_depth select @@max_sp_recursion_depth; 今天在mysql 写存储过程递归调用时,发现老是报错(recovery limit 0(as set by the max_sp_recursion_depth));后来百度下发现 max_sp_recursion_depth设置不对; 这个修改涉及到全局和session级修…...

论文阅读:SERE: Exploring Feature Self-relation for Self-supervised Transformer
Related Work Self-supervised 学习目的是在无人工标注的情况下通过自定制的任务(hand-crafted pretext tasks)学习丰富的表示。 Abstract 使用自监督学习为卷积网络(CNN)学习表示已经被验证对视觉任务有效。作为CNN的一种替代…...

遥感数据与作物模型同化应用:PROSAIL模型、DSSAT模型、参数敏感性分析、数据同化算法、模型耦合、精度验证等主要环节
查看原文>>>遥感数据与作物模型同化实践技术应用 基于过程的作物生长模拟模型DSSAT是现代农业系统研究的有力工具,可以定量描述作物生长发育和产量形成过程及其与气候因子、土壤环境、品种类型和技术措施之间的关系,为不同条件下作物生长发育及…...

Navicat15工具连接PostgreSQL15失败
1.错误现象及原因 错误现象: 错误原因: postgresql 15版本中 pg_database 系统表把 datlastsysoid 列删除了,所以造成了此错误。 2.解决方法 (1)将Navicat工具更新到官网最新版本。 (2)更换…...

python打卡day49
知识点回顾: 通道注意力模块复习空间注意力模块CBAM的定义 作业:尝试对今天的模型检查参数数目,并用tensorboard查看训练过程 import torch import torch.nn as nn# 定义通道注意力 class ChannelAttention(nn.Module):def __init__(self,…...
【ROS】Nav2源码之nav2_behavior_tree-行为树节点列表
1、行为树节点分类 在 Nav2(Navigation2)的行为树框架中,行为树节点插件按照功能分为 Action(动作节点)、Condition(条件节点)、Control(控制节点) 和 Decorator(装饰节点) 四类。 1.1 动作节点 Action 执行具体的机器人操作或任务,直接与硬件、传感器或外部系统…...

Mac软件卸载指南,简单易懂!
刚和Adobe分手,它却总在Library里给你写"回忆录"?卸载的Final Cut Pro像电子幽灵般阴魂不散?总是会有残留文件,别慌!这份Mac软件卸载指南,将用最硬核的方式教你"数字分手术"࿰…...
Java 加密常用的各种算法及其选择
在数字化时代,数据安全至关重要,Java 作为广泛应用的编程语言,提供了丰富的加密算法来保障数据的保密性、完整性和真实性。了解这些常用加密算法及其适用场景,有助于开发者在不同的业务需求中做出正确的选择。 一、对称加密算法…...
Hive 存储格式深度解析:从 TextFile 到 ORC,如何选对数据存储方案?
在大数据处理领域,Hive 作为 Hadoop 生态中重要的数据仓库工具,其存储格式的选择直接影响数据存储成本、查询效率和计算资源消耗。面对 TextFile、SequenceFile、Parquet、RCFile、ORC 等多种存储格式,很多开发者常常陷入选择困境。本文将从底…...

Aspose.PDF 限制绕过方案:Java 字节码技术实战分享(仅供学习)
Aspose.PDF 限制绕过方案:Java 字节码技术实战分享(仅供学习) 一、Aspose.PDF 简介二、说明(⚠️仅供学习与研究使用)三、技术流程总览四、准备工作1. 下载 Jar 包2. Maven 项目依赖配置 五、字节码修改实现代码&#…...
快刀集(1): 一刀斩断视频片头广告
一刀流:用一个简单脚本,秒杀视频片头广告,还你清爽观影体验。 1. 引子 作为一个爱生活、爱学习、爱收藏高清资源的老码农,平时写代码之余看看电影、补补片,是再正常不过的事。 电影嘛,要沉浸,…...

并发编程 - go版
1.并发编程基础概念 进程和线程 A. 进程是程序在操作系统中的一次执行过程,系统进行资源分配和调度的一个独立单位。B. 线程是进程的一个执行实体,是CPU调度和分派的基本单位,它是比进程更小的能独立运行的基本单位。C.一个进程可以创建和撤销多个线程;同一个进程中…...

从 GreenPlum 到镜舟数据库:杭银消费金融湖仓一体转型实践
作者:吴岐诗,杭银消费金融大数据应用开发工程师 本文整理自杭银消费金融大数据应用开发工程师在StarRocks Summit Asia 2024的分享 引言:融合数据湖与数仓的创新之路 在数字金融时代,数据已成为金融机构的核心竞争力。杭银消费金…...

Linux部署私有文件管理系统MinIO
最近需要用到一个文件管理服务,但是又不想花钱,所以就想着自己搭建一个,刚好我们用的一个开源框架已经集成了MinIO,所以就选了这个 我这边对文件服务性能要求不是太高,单机版就可以 安装非常简单,几个命令就…...