2019-10-22 12:30 AM
I am working on a tool for embedded Linux that can update MCU firmware on a NUCLEO-L4A6ZG. I power up the MCU in DFU mode and connect using LibUsb in user mode.
I get an error when a try to read from address: 0x08000000
First I successfull write the address using DFU_DNLOAD (0x01) and read the status 2 times to execute the command. The MCU state is then DOWNLOAD_IDLE (0x05) and status is OK (0x00). Now using libusb_control_transfer DFU_UPLOAD (0x02) and wValue = 2 to read from the flash but the function returns LIBUSB_ERROR_PIPE (-9).
What om I during wrong?
debug info:
[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
...
[13.471933] [00001823] libusb: debug [libusb_alloc_transfer] transfer 0x55555578ae50
[13.471953] [00001823] libusb: debug [libusb_submit_transfer] transfer 0x55555578ae50
[13.471956] [00001823] libusb: debug [add_to_flying_list] arm timerfd for timeout in 20000ms (first in line)
[13.472008] [00001823] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[13.472016] [00001823] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[13.479324] [00001823] libusb: debug [handle_events] poll() returned 1
[13.479365] [00001823] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=5
[13.479369] [00001823] libusb: debug [handle_control_completion] handling completion status 0
[13.479375] [00001823] libusb: debug [disarm_timerfd]
[13.479384] [00001823] libusb: debug [usbi_handle_transfer_completion] transfer 0x55555578ae50 has callback 0x7ffff7bc7b30
[13.479391] [00001823] libusb: debug [sync_transfer_cb] actual_length=5
[13.479395] [00001823] libusb: debug [libusb_free_transfer] transfer 0x55555578ae50
[13.479401] [00001823] libusb: debug [libusb_alloc_transfer] transfer 0x55555578ae50
[13.479404] [00001823] libusb: debug [libusb_submit_transfer] transfer 0x55555578ae50
[13.479410] [00001823] libusb: debug [add_to_flying_list] arm timerfd for timeout in 20000ms (first in line)
[13.479438] [00001823] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[13.479445] [00001823] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[13.484252] [00001823] libusb: debug [handle_events] poll() returned 1
[13.484287] [00001823] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=6
[13.484292] [00001823] libusb: debug [handle_control_completion] handling completion status 0
[13.484298] [00001823] libusb: debug [disarm_timerfd]
[13.484307] [00001823] libusb: debug [usbi_handle_transfer_completion] transfer 0x55555578ae50 has callback 0x7ffff7bc7b30
[13.484313] [00001823] libusb: debug [sync_transfer_cb] actual_length=6
[13.484318] [00001823] libusb: debug [libusb_free_transfer] transfer 0x55555578ae50
[13.484322] [00001823] libusb: debug [libusb_alloc_transfer] transfer 0x55555578ae50
[13.484325] [00001823] libusb: debug [libusb_submit_transfer] transfer 0x55555578ae50
[13.484332] [00001823] libusb: debug [add_to_flying_list] arm timerfd for timeout in 20000ms (first in line)
[13.484355] [00001823] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[13.484362] [00001823] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[13.489273] [00001823] libusb: debug [handle_events] poll() returned 1
[13.489369] [00001823] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=6
[13.489379] [00001823] libusb: debug [handle_control_completion] handling completion status 0
[13.489388] [00001823] libusb: debug [disarm_timerfd]
[13.489398] [00001823] libusb: debug [usbi_handle_transfer_completion] transfer 0x55555578ae50 has callback 0x7ffff7bc7b30
[13.489404] [00001823] libusb: debug [sync_transfer_cb] actual_length=6
[13.489412] [00001823] libusb: debug [libusb_free_transfer] transfer 0x55555578ae50
[13.489423] [00001823] libusb: debug [libusb_alloc_transfer] transfer 0x55555578ae50
[13.489429] [00001823] libusb: debug [libusb_submit_transfer] transfer 0x55555578ae50
[13.489435] [00001823] libusb: debug [add_to_flying_list] arm timerfd for timeout in 20000ms (first in line)
[13.489467] [00001823] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[13.489475] [00001823] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[13.493226] [00001823] libusb: debug [handle_events] poll() returned 1
[13.493271] [00001823] libusb: debug [reap_for_handle] urb type=2 status=0 transferred=6
[13.493289] [00001823] libusb: debug [handle_control_completion] handling completion status 0
[13.493299] [00001823] libusb: debug [disarm_timerfd]
[13.493308] [00001823] libusb: debug [usbi_handle_transfer_completion] transfer 0x55555578ae50 has callback 0x7ffff7bc7b30
[13.493317] [00001823] libusb: debug [sync_transfer_cb] actual_length=6
[13.493326] [00001823] libusb: debug [libusb_free_transfer] transfer 0x55555578ae50
[13.493337] [00001823] libusb: debug [libusb_alloc_transfer] transfer 0x55555578ae50
[13.493345] [00001823] libusb: debug [libusb_submit_transfer] transfer 0x55555578ae50
[13.493354] [00001823] libusb: debug [add_to_flying_list] arm timerfd for timeout in 20000ms (first in line)
[13.493382] [00001823] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[13.493392] [00001823] libusb: debug [handle_events] poll() 3 fds with timeout in 60000ms
[13.497202] [00001823] libusb: debug [handle_events] poll() returned 1
[13.497253] [00001823] libusb: debug [reap_for_handle] urb type=2 status=-32 transferred=2048
[13.497260] [00001823] libusb: debug [handle_control_completion] handling completion status -32
[13.497267] [00001823] libusb: debug [handle_control_completion] unsupported control request
[13.497274] [00001823] libusb: debug [disarm_timerfd]
[13.497283] [00001823] libusb: debug [usbi_handle_transfer_completion] transfer 0x55555578ae50 has callback 0x7ffff7bc7b30
[13.497288] [00001823] libusb: debug [sync_transfer_cb] actual_length=2048
[13.497297] [00001823] libusb: debug [libusb_free_transfer] transfer 0x55555578ae50