vdudouyt / stm8flash

program your stm8 devices with SWIM/stlinkv(1,2)
GNU General Public License v2.0
403 stars 182 forks source link

Error on Mac OS X #9

Closed MartianZ closed 8 years ago

MartianZ commented 10 years ago

Hi,

I tried flash over STLink v2 on Mac OS X, but get libusb error:

./stm8flash -c stlinkv2 -p stm8s103 -w /Users/MartianZ/Documents/STM8_INITIAL/x.inx
Determine FLASH area libusb:info [process_new_device] allocating new device for location 0xfa000000 libusb:info [process_new_device] found device with address 1 at 001-05ac-8006-09-00 libusb:info [process_new_device] allocating new device for location 0xfd000000 libusb:info [process_new_device] found device with address 1 at 001-05ac-8006-09-00 libusb:info [process_new_device] allocating new device for location 0xfd100000 libusb:info [process_new_device] found device with address 2 at 002-0424-2513-09-00 libusb:info [process_new_device] allocating new device for location 0xfa100000 libusb:info [process_new_device] found device with address 2 at 002-0424-2513-09-00 libusb:info [process_new_device] allocating new device for location 0xfa110000 libusb:warning [process_new_device] could not retrieve device descriptor: device not responding. skipping device libusb:info [process_new_device] allocating new device for location 0xfd120000 libusb:info [process_new_device] found device with address 4 at 004-0424-5534-09-00 libusb:info [process_new_device] allocating new device for location 0xfa130000 libusb:info [process_new_device] found device with address 6 at 006-0409-005a-09-00 libusb:info [process_new_device] allocating new device for location 0xfa200000 libusb:info [process_new_device] found device with address 3 at 003-05ac-8509-ef-02 libusb:info [process_new_device] allocating new device for location 0xfd110000 libusb:info [process_new_device] found device with address 3 at 003-05ac-8242-00-00 libusb:info [process_new_device] allocating new device for location 0xfa120000 libusb:info [process_new_device] found device with address 4 at 004-05ac-0245-00-00 libusb:info [process_new_device] allocating new device for location 0xfa113000 libusb:warning [process_new_device] could not retrieve device descriptor: pipe is stalled. skipping device libusb:info [process_new_device] allocating new device for location 0xfa133000 libusb:info [process_new_device] found device with address 9 at 009-1532-0016-00-00 libusb:info [process_new_device] allocating new device for location 0xfa131000 libusb:info [process_new_device] found device with address 8 at 008-0853-0100-00-00 libusb:info [process_new_device] allocating new device for location 0xfd124000 libusb:info [process_new_device] found device with address 5 at 005-0483-3748-00-00 libusb:info [process_new_device] using existing device for location 0xfa000000 libusb:info [process_new_device] found device with address 1 at 001-05ac-8006-09-00 libusb:info [process_new_device] using existing device for location 0xfd000000 libusb:info [process_new_device] found device with address 1 at 001-05ac-8006-09-00 libusb:info [process_new_device] using existing device for location 0xfd100000 libusb:info [process_new_device] found device with address 2 at 002-0424-2513-09-00 libusb:info [process_new_device] using existing device for location 0xfa100000 libusb:info [process_new_device] found device with address 2 at 002-0424-2513-09-00 libusb:info [process_new_device] allocating new device for location 0xfa110000 libusb:warning [process_new_device] could not retrieve device descriptor: device not responding. skipping device libusb:info [process_new_device] using existing device for location 0xfd120000 libusb:info [process_new_device] found device with address 4 at 004-0424-5534-09-00 libusb:info [process_new_device] using existing device for location 0xfa130000 libusb:info [process_new_device] found device with address 6 at 006-0409-005a-09-00 libusb:info [process_new_device] using existing device for location 0xfa200000 libusb:info [process_new_device] found device with address 3 at 003-05ac-8509-ef-02 libusb:info [process_new_device] using existing device for location 0xfd110000 libusb:info [process_new_device] found device with address 3 at 003-05ac-8242-00-00 libusb:info [process_new_device] using existing device for location 0xfa120000 libusb:info [process_new_device] found device with address 4 at 004-05ac-0245-00-00 libusb:info [process_new_device] allocating new device for location 0xfa113000 libusb:warning [process_new_device] could not retrieve device descriptor: pipe is stalled. skipping device libusb:info [process_new_device] using existing device for location 0xfa133000 libusb:info [process_new_device] found device with address 9 at 009-1532-0016-00-00 libusb:info [process_new_device] using existing device for location 0xfa131000 libusb:info [process_new_device] found device with address 8 at 008-0853-0100-00-00 libusb:info [process_new_device] using existing device for location 0xfd124000 libusb:info [process_new_device] found device with address 5 at 005-0483-3748-00-00 libusb:info [darwin_open] device open for access libusb:info [ep_to_pipeRef] converting ep address 0x02 to pipeRef and interface libusb:warning [ep_to_pipeRef] no pipeRef found with endpoint address 0x02. libusb:error [submit_bulk_transfer] endpoint not found on any open interface IO error: expected 16 bytes but 0 bytes transferred

I'm using OS X 10.9.4 and libusb 1.0.19 version. any help would be appreciated

tcr commented 9 years ago

The issue is OS X trying to claim the device as a mass storage device.

sudo kextunload -b com.apple.driver.AppleUSBCardReader
sudo kextunload -b com.apple.iokit.IOUSBMassStorageClass

Then plugging in the device worked for me.

tcr commented 9 years ago

Also I had to apply the patch in #16.

gicking commented 9 years ago

with the most recent version as of today (i.e. patch #16 merged) and the above unloading of kernel extensions flashing works for me under MacOSX.

I already started a new point on the kernel extension, so I propose to close this point...!? MartianZ, do you agree?