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

Programmer initialization failed #194

Closed
Kreyren opened this issue Mar 4, 2021 · 1 comment
Closed

Programmer initialization failed #194

Kreyren opened this issue Mar 4, 2021 · 1 comment

Comments

@Kreyren
Copy link

Kreyren commented Mar 4, 2021

kreyren@leonid:~$ sudo flashrom --programmer ch341a_spi -r backup1.bin
[sudo] password for kreyren: 
flashrom v1.2 on Linux 5.9.0-5-amd64 (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Couldn't open device 1a86:5512.
Error: Programmer initialization failed.

What can i do to fix this error?

Self-diagnostics

Seems to be triggered at

msg_perr("Error: Programmer initialization failed.\n");

strace:

readlink("/sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.6", 0x7ffc379f2450, 1024) = -1 EINVAL (Invalid argument)
stat("/sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.6/uevent", {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0
openat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.6/uevent", O_RDONLY|O_CLOEXEC) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0
read(5, "MAJOR=189\nMINOR=260\nDEVNAME=bus/"..., 4096) = 130
read(5, "", 4096)                       = 0
close(5)                                = 0
openat(AT_FDCWD, "/sys/bus/usb/devices/3-1.6/busnum", O_RDONLY|O_CLOEXEC) = 5
read(5, "3\n", 20)                      = 2
close(5)                                = 0
openat(AT_FDCWD, "/sys/bus/usb/devices/3-1.6/devnum", O_RDONLY|O_CLOEXEC) = 5
read(5, "5\n", 20)                      = 2
close(5)                                = 0
openat(AT_FDCWD, "/sys/bus/usb/devices/3-1.6/speed", O_RDONLY|O_CLOEXEC) = 5
read(5, "480\n", 20)                    = 4
close(5)                                = 0
openat(AT_FDCWD, "/sys/bus/usb/devices/3-1.6/descriptors", O_RDONLY|O_CLOEXEC) = 5
read(5, "\22\1\0\2\357\2\1@N\6\"\242G\10\2\1\3\1\t\2\277\2\2\1\0\200\372\10\v\0\2\16"..., 256) = 256
read(5, "\0\0\240\214\0\0\226\0\0\25\26\5\0\1\25\26\5\0\36$\5\4\0 \3X\2\0\300'\t\0"..., 256) = 256
read(5, "M\250\16\0\26s\5\0\2\26s\5\0 \241\7\0\36$\7\5\0\0\5\320\0020(`\0320("..., 256) = 209
close(5)                                = 0
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 5
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC|TFD_NONBLOCK) = 6
recvmsg(3, {msg_namelen=128}, 0)        = -1 EAGAIN (Resource temporarily unavailable)
write(2, "Couldn't open device 1a86:5512.\n", 32Couldn't open device 1a86:5512.
) = 32
write(2, "Error: Programmer initialization"..., 41Error: Programmer initialization failed.
) = 41
exit_group(1)                           = ?
+++ exited with 1 +++

Does not seem to be visible in lsusb:

Bus 003 Device 005: ID 064e:a222 Suyin Corp. Lenovo EasyCamera
Bus 003 Device 093: ID 413c:2113 Dell Computer Corp. Dell KB216 Wired Keyboard
Bus 003 Device 092: ID 093a:2521 Pixart Imaging, Inc. Optical Mouse
Bus 003 Device 091: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Assuming linux kernel driver issue, found https://github.com/gschorcht/spi-ch341-usb

Installing https://github.com/gschorcht/spi-ch341-usb with a patch gschorcht/spi-ch341-usb#10 does not solve the issue

DMESG:

[Mar 5 01:23] spi_ch341_usb: loading out-of-tree module taints kernel.
[  +0.000061] spi_ch341_usb: module verification failed: signature and/or required key missing - tainting kernel
[  +0.000485] usbcore: registered new interface driver spi-ch341-usb

https://www.suse.com/support/kb/doc/?id=000018677 was referenced

This taint has no effect on system functionality or supportability. It should be considered informational only. For more details including the possibility to remove the taint using the UEFI key db see the additional information below. For legacy boot systems, there is no option around the taint message when using kernel modules not delivered with the SUSE products.

Setup:
image

Solved: It didn't like my USB cable extender

Relevants

  1. https://github.com/kreyware/repairs/issues/1
  2. Sending Serial Peripheral Interface (SPI) payload over USB on linux Kreyren/kreyren#71
@Kreyren
Copy link
Author

Kreyren commented Mar 4, 2021

Reserved

@Kreyren Kreyren closed this as completed Mar 5, 2021
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

1 participant