Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hpm_manufacturing_tool linux 版本 选择 hidraw 连接等待超时 #1

Open
taotieren opened this issue Apr 19, 2024 · 5 comments
Open

Comments

@taotieren
Copy link

hpm_manufacturing_tool linux 版本在哪里下在呢?
image
文档中有写支持 Linux Windows 但是提供的 tag 里面没有 linux 相关的包。如果获取呢?

@taotieren
Copy link
Author

Arch 用户可以通过 AUR 安装 hpmicro-manufacturing-tool

yay -Syu hpmicro-manufacturing-tool-bin
#
yay -Syu hpmicro-manufacturing-cmd
#
yay -Syu hpmicro-manufacturing-gui

@taotieren taotieren changed the title hpm_manufacturing_tool linux 版本在哪里下在呢? hpm_manufacturing_tool linux 版本 选择 hidraw 连接等待超时 Aug 7, 2024
@taotieren
Copy link
Author

taotieren commented Aug 7, 2024

hpm_manufacturing_tool_gui linux 版本 选择 hidraw 连接 HPM6750 芯片,能识别到 hidraw 设备,单击连接是提示重启芯片这个时候会等待超时然后软件报错,此时查看 lsusb 设备是检测不到 hpm6750 设备,重新插拔 usb 线,lsusb 又能检测到 hpm6750 设备。用 UART 方式烧录。

image

日志信息

[16:33:56] 刷新 USB-HID 列表
[16:33:56] 检测到USB: /dev/hidraw0, vid: 6785, pid: 8275
[16:33:56] 检测到USB: /dev/hidraw1, vid: 6785, pid: 8275
[16:33:56] 检测到USB: /dev/hidraw2, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw3, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw4, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw5, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw6, vid: 3190, pid: 5439
[16:33:56] 检测到USB: /dev/hidraw8, vid: 13495, pid: 1
[16:33:56] 检测到USB: /dev/hidraw7, vid: 2362, pid: 597
[16:33:56] 刷新 USB-HID 列表完毕!
[16:33:56] 刷新 USB-HID 列表
[16:33:56] 检测到USB: /dev/hidraw0, vid: 6785, pid: 8275
[16:33:56] 检测到USB: /dev/hidraw1, vid: 6785, pid: 8275
[16:33:56] 检测到USB: /dev/hidraw2, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw3, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw4, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw5, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw6, vid: 3190, pid: 5439
[16:33:56] 检测到USB: /dev/hidraw8, vid: 13495, pid: 1
[16:33:56] 检测到USB: /dev/hidraw7, vid: 2362, pid: 597
[16:33:56] 刷新 USB-HID 列表完毕!
[16:34:20] 刷新串口列表
[16:34:20] 检测到串口: ttyACM1
[16:34:20] 检测到串口: ttyACM2
[16:34:20] 检测到串口: ttyS0
[16:34:20] 检测到串口: ttyS1
[16:34:20] 检测到串口: ttyS10
[16:34:20] 检测到串口: ttyS11
[16:34:20] 检测到串口: ttyS12
[16:34:20] 检测到串口: ttyS13
[16:34:20] 检测到串口: ttyS14
[16:34:20] 检测到串口: ttyS15
[16:34:20] 检测到串口: ttyS16
[16:34:20] 检测到串口: ttyS17
[16:34:20] 检测到串口: ttyS18
[16:34:20] 检测到串口: ttyS19
[16:34:20] 检测到串口: ttyS2
[16:34:20] 检测到串口: ttyS20
[16:34:20] 检测到串口: ttyS21
[16:34:20] 检测到串口: ttyS22
[16:34:20] 检测到串口: ttyS23
[16:34:20] 检测到串口: ttyS24
[16:34:20] 检测到串口: ttyS25
[16:34:20] 检测到串口: ttyS26
[16:34:20] 检测到串口: ttyS27
[16:34:20] 检测到串口: ttyS28
[16:34:20] 检测到串口: ttyS29
[16:34:20] 检测到串口: ttyS3
[16:34:20] 检测到串口: ttyS30
[16:34:20] 检测到串口: ttyS31
[16:34:20] 检测到串口: ttyS4
[16:34:20] 检测到串口: ttyS5
[16:34:20] 检测到串口: ttyS6
[16:34:20] 检测到串口: ttyS7
[16:34:20] 检测到串口: ttyS8
[16:34:20] 检测到串口: ttyS9
[16:34:20] 刷新串口列表完毕!
[16:34:23] 刷新 USB-HID 列表
[16:34:23] 检测到USB: /dev/hidraw0, vid: 6785, pid: 8275
[16:34:23] 检测到USB: /dev/hidraw1, vid: 6785, pid: 8275
[16:34:23] 检测到USB: /dev/hidraw2, vid: 7511, pid: 64097
[16:34:23] 检测到USB: /dev/hidraw3, vid: 7511, pid: 64097
[16:34:23] 检测到USB: /dev/hidraw4, vid: 7511, pid: 64097
[16:34:23] 检测到USB: /dev/hidraw5, vid: 7511, pid: 64097
[16:34:23] 检测到USB: /dev/hidraw6, vid: 3190, pid: 5439
[16:34:23] 检测到USB: /dev/hidraw8, vid: 13495, pid: 1
[16:34:23] 检测到USB: /dev/hidraw7, vid: 2362, pid: 597
[16:34:23] 刷新 USB-HID 列表完毕!
[16:34:33] 连接设备: /dev/hidraw8, vid: 13495, pid: 1
[16:34:33] 命令开始运行!
[16:34:34] DeviceId: /dev/hidraw8
ROM Version: V1.0.0
SoC Revision: V1.1.0
SoC LifeCycle: 04
Support Primary Boot
Support Serial Boot
Support ISP Boot
Support Secure Boot
Support Encrypted Boot
Support Command Container
Support Device Configuration Block
Support ECDSA-P256
Support SM2
Support AES-CCM(128-bit key)
Support AES-CCM(256-bit key)
Support SM4-CCM

[16:34:34] Rom version: V1.0.0, Soc revision: V1.1.0 life cycle: 4
[16:34:34] 查找 bootlooader 固件并加载...次数: 1
[16:34:34] load firmware: hpm6700_hpm6400_blfw_unsigned.bin 077fc599b4af4a98
[16:34:34] Load Image. DeviceId: /dev/hidraw8 Progress: 76320 Total: 76320
[16:34:34] 正等待设备重启!请不要操作设备!
[16:34:44] 无法自动检测到设备连接。请重置设备并尝试再次连接。

@JoeYin1991
Copy link

hpm_manufacturing_tool_gui linux 版本 选择 hidraw 连接 HPM6750 芯片,能识别到 hidraw 设备,单击连接是提示重启芯片这个时候会等待超时然后软件报错,此时查看 lsusb 设备是检测不到 hpm6750 设备,重新插拔 usb 线,lsusb 又能检测到 hpm6750 设备。用 UART 方式烧录。

image

日志信息

[16:33:56] 刷新 USB-HID 列表
[16:33:56] 检测到USB: /dev/hidraw0, vid: 6785, pid: 8275
[16:33:56] 检测到USB: /dev/hidraw1, vid: 6785, pid: 8275
[16:33:56] 检测到USB: /dev/hidraw2, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw3, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw4, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw5, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw6, vid: 3190, pid: 5439
[16:33:56] 检测到USB: /dev/hidraw8, vid: 13495, pid: 1
[16:33:56] 检测到USB: /dev/hidraw7, vid: 2362, pid: 597
[16:33:56] 刷新 USB-HID 列表完毕!
[16:33:56] 刷新 USB-HID 列表
[16:33:56] 检测到USB: /dev/hidraw0, vid: 6785, pid: 8275
[16:33:56] 检测到USB: /dev/hidraw1, vid: 6785, pid: 8275
[16:33:56] 检测到USB: /dev/hidraw2, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw3, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw4, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw5, vid: 7511, pid: 64097
[16:33:56] 检测到USB: /dev/hidraw6, vid: 3190, pid: 5439
[16:33:56] 检测到USB: /dev/hidraw8, vid: 13495, pid: 1
[16:33:56] 检测到USB: /dev/hidraw7, vid: 2362, pid: 597
[16:33:56] 刷新 USB-HID 列表完毕!
[16:34:20] 刷新串口列表
[16:34:20] 检测到串口: ttyACM1
[16:34:20] 检测到串口: ttyACM2
[16:34:20] 检测到串口: ttyS0
[16:34:20] 检测到串口: ttyS1
[16:34:20] 检测到串口: ttyS10
[16:34:20] 检测到串口: ttyS11
[16:34:20] 检测到串口: ttyS12
[16:34:20] 检测到串口: ttyS13
[16:34:20] 检测到串口: ttyS14
[16:34:20] 检测到串口: ttyS15
[16:34:20] 检测到串口: ttyS16
[16:34:20] 检测到串口: ttyS17
[16:34:20] 检测到串口: ttyS18
[16:34:20] 检测到串口: ttyS19
[16:34:20] 检测到串口: ttyS2
[16:34:20] 检测到串口: ttyS20
[16:34:20] 检测到串口: ttyS21
[16:34:20] 检测到串口: ttyS22
[16:34:20] 检测到串口: ttyS23
[16:34:20] 检测到串口: ttyS24
[16:34:20] 检测到串口: ttyS25
[16:34:20] 检测到串口: ttyS26
[16:34:20] 检测到串口: ttyS27
[16:34:20] 检测到串口: ttyS28
[16:34:20] 检测到串口: ttyS29
[16:34:20] 检测到串口: ttyS3
[16:34:20] 检测到串口: ttyS30
[16:34:20] 检测到串口: ttyS31
[16:34:20] 检测到串口: ttyS4
[16:34:20] 检测到串口: ttyS5
[16:34:20] 检测到串口: ttyS6
[16:34:20] 检测到串口: ttyS7
[16:34:20] 检测到串口: ttyS8
[16:34:20] 检测到串口: ttyS9
[16:34:20] 刷新串口列表完毕!
[16:34:23] 刷新 USB-HID 列表
[16:34:23] 检测到USB: /dev/hidraw0, vid: 6785, pid: 8275
[16:34:23] 检测到USB: /dev/hidraw1, vid: 6785, pid: 8275
[16:34:23] 检测到USB: /dev/hidraw2, vid: 7511, pid: 64097
[16:34:23] 检测到USB: /dev/hidraw3, vid: 7511, pid: 64097
[16:34:23] 检测到USB: /dev/hidraw4, vid: 7511, pid: 64097
[16:34:23] 检测到USB: /dev/hidraw5, vid: 7511, pid: 64097
[16:34:23] 检测到USB: /dev/hidraw6, vid: 3190, pid: 5439
[16:34:23] 检测到USB: /dev/hidraw8, vid: 13495, pid: 1
[16:34:23] 检测到USB: /dev/hidraw7, vid: 2362, pid: 597
[16:34:23] 刷新 USB-HID 列表完毕!
[16:34:33] 连接设备: /dev/hidraw8, vid: 13495, pid: 1
[16:34:33] 命令开始运行!
[16:34:34] DeviceId: /dev/hidraw8
ROM Version: V1.0.0
SoC Revision: V1.1.0
SoC LifeCycle: 04
Support Primary Boot
Support Serial Boot
Support ISP Boot
Support Secure Boot
Support Encrypted Boot
Support Command Container
Support Device Configuration Block
Support ECDSA-P256
Support SM2
Support AES-CCM(128-bit key)
Support AES-CCM(256-bit key)
Support SM4-CCM

[16:34:34] Rom version: V1.0.0, Soc revision: V1.1.0 life cycle: 4
[16:34:34] 查找 bootlooader 固件并加载...次数: 1
[16:34:34] load firmware: hpm6700_hpm6400_blfw_unsigned.bin 077fc599b4af4a98
[16:34:34] Load Image. DeviceId: /dev/hidraw8 Progress: 76320 Total: 76320
[16:34:34] 正等待设备重启!请不要操作设备!
[16:34:44] 无法自动检测到设备连接。请重置设备并尝试再次连接。

您那边 Linux 环境是虚拟机还是物理机?虚拟机的话,在下载了 Boot loader 固件之后,自动上电检测非常慢,超过了工具的超时检测时间,所以会提示超时,但是工具仍然会继续等待连接,您可以继续等待一会看能否自动上电检测,如果检测到了开发板后续应该是可以正常连接的。

@taotieren
Copy link
Author

taotieren commented Aug 7, 2024

使用的是物理机,系统是 Arch Linux,软件包是根据最新版本进行了修改,修改细节参考上面的 AUR 地址里面的 PKGBUILD 文件。现在是单击 连接 按钮后 USB 识别不到芯片,然后软件等待卡死,

arch 下 udev 组是 uucp 这点不一样。
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=hpmicro-manufacturing-tool-bin

# Maintainer: taotieren <[email protected]>

pkgbase=hpmicro-manufacturing-tool-bin
pkgname=${pkgbase}
_pkgname=HPMicro_Manufacturing_Tool
pkgver=0.4.1
pkgrel=3
pkgdesc="HPMicro Manufacturing Tool 是 HPMicro 公司推出的配置及批量烧写工具,旨在帮助企业用户快速批量的对 HPMicro 公司推出的芯片进行镜像配置及烧写。"
arch=(x86_64)
url="https://github.com/hpmicro/hpm_manufacturing_tool"
license=('LGPL-3.0-only')
groups=()
provides=(${pkgname%-bin}
    hpm-manufacturing-cmd
    hpm-manufacturing-gui)
conflicts=(${pkgname%-bin}
    hpm-manufacturing-cmd
    hpm-manufacturing-gui)
replaces=()
depends=(
    gcc-libs
    glibc
    libgpg-error
    perl
    zlib)
makedepends=()
checkdepends=()
optdepends=()
source=("${_pkgname}_v${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}_v${pkgver}_linux.tar.gz"
    "hpmicro.png")
sha256sums=('1a14d31a1896488bf78b1f2ab36d4f9216e9f72ef1d232cd6e73c3e9a0b255e9'
            '07d6adc954e732986889ddbc8e972a69404b0097be541f61f0e23e0521a79e7f')
options=('!strip' '!debug')

package() {
    install -dm775 ${pkgdir}/opt/hpmicro/${pkgname%-bin}
    install -dm755 ${pkgdir}/usr/bin \
        ${pkgdir}/usr/share/applications \
        ${pkgdir}/usr/lib/udev/rules.d

    install -Dm644 "${srcdir}/hpmicro.png" -t "${pkgdir}/usr/share/pixmaps"

    install -Dm755 /dev/stdin ${pkgdir}/usr/lib/udev/rules.d/71-hpmicro.usbhid.rules << EOF
# Copy this file to /etc/udev/rules.d/ or /usr/lib/udev/rules.d/
# If rules fail to reload automatically, you can refresh udev rules
# with the command "sudo udevadm control --reload"

ACTION!="add|change", SUBSYSTEM!="usb_device", GOTO="hpmicro_rules_end"

#SUBSYSTEM=="gpio", MODE="0666", GROUP="uucp", TAG+="uaccess"

SUBSYSTEM!="usb|tty|hidraw", GOTO="hpmicro_rules_end"

# Please keep this list sorted by VID:PID

# Arch Linux hpmicro
ATTRS{idVendor}=="c251", MODE="0666", GROUP="uucp", TAG+="uaccess"

# Debian/Ubuntu Linux hpmicro
# ATTRS{idVendor}=="c251", MODE="0666", GROUP="dialout", TAG+="uaccess"

LABEL="hpmicro_rules_end"
EOF

    install -Dm644 /dev/stdin ${pkgdir}/usr/share/applications/${pkgname%-bin}-user-manual-html.desktop <<EOF
[Desktop Entry]
Type=Application
Name=HPMicro Manufacturing Tool HTML User Manual
Name[zh_CN]=先辑制造工具 HTML 版用户手册
GenericName=HPMicro Manufacturing Tool HTML User Manual
GenericName[zh_CN]=先辑制造工具 HTML 版用户手册
Comment=electronics html
Exec=xdg-open /opt/hpmicro/${pkgname%-bin}/doc/user_manual.html
Icon=hpmicro.png
Terminal=false
Categories=Development;IDE;Electronics;
Keywords=embedded electronics;risc-v;microcontroller;
EOF
    install -Dm644 /dev/stdin ${pkgdir}/usr/share/applications/${pkgname%-bin}-gui.desktop <<EOF
[Desktop Entry]
Type=Application
Name=HPMicro Manufacturing Tool GUI
Name[zh_CN]=先辑制造工具 GUI
GenericName=HPMicro Manufacturing Tool GUI
GenericName[zh_CN]=先辑制造工具 GUI
Comment=electronics gui
Exec=/opt/hpmicro/${pkgname%-bin}/hpm_manufacturing_gui
Icon=hpmicro.png
Terminal=false
Categories=Development;IDE;Electronics;
Keywords=embedded electronics;risc-v;microcontroller;
EOF
    install -Dm644 /dev/stdin ${pkgdir}/usr/share/applications/${pkgname%-bin}-image-helper.desktop <<EOF
[Desktop Entry]
Type=Application
Name=HPMicro Manufacturing Tool Image Helper
Name[zh_CN]=先辑制造工具镜像帮助程序
GenericName=HPMicro Manufacturing Image Helper
GenericName[zh_CN]=先辑制造工具镜像帮助程序
Comment=electronics gui
Exec=/opt/hpmicro/${pkgname%-bin}/hpm_image_helper
Icon=hpmicro.png
Terminal=false
Categories=Development;IDE;Electronics;
Keywords=embedded electronics;risc-v;microcontroller;
EOF

    cd "${srcdir}/${_pkgname}_v${pkgver}"
    cp --preserve=mode -r . ${pkgdir}/opt/hpmicro/${pkgname%-bin}
    ln -sf /opt/hpmicro/${pkgname%-bin}/hpm_image_helper ${pkgdir}/usr/bin/hpm-image-helper
    ln -sf /opt/hpmicro/${pkgname%-bin}/hpm_img_util ${pkgdir}/usr/bin/hpm-img-util
    ln -sf /opt/hpmicro/${pkgname%-bin}/hpm_manufacturing_cmd ${pkgdir}/usr/bin/hpm-manufacturing-cmd
    ln -sf /opt/hpmicro/${pkgname%-bin}/hpm_manufacturing_gui ${pkgdir}/usr/bin/hpm-manufacturing-gui
}

@taotieren
Copy link
Author

编译的包可以在这里下载 http://home.taotieren.com:12380/aur-repo/x86_64/hpmicro-manufacturing-tool-bin-0.4.1-3-x86_64.pkg.tar.zst
你们那边可以测试下能不能复现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants