Black STM32F407VET6: deploy issue

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
yuanyanhui
Posts: 10
Joined: Wed Mar 20, 2019 11:25 am

Black STM32F407VET6: deploy issue

Post by yuanyanhui » Mon Jul 29, 2019 12:01 pm

The message says access to usb is denied. How to solve this problem? Please help, thanks.

Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Writing build-BLACK_F407VE/firmware.dfu to the board
Traceback (most recent call last):
File "../../tools/pydfu.py", line 586, in <module>
main()
File "../../tools/pydfu.py", line 566, in main
init()
File "../../tools/pydfu.py", line 101, in init
__dev.set_configuration()
File "/usr/lib/python3/dist-packages/usb/core.py", line 869, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "/usr/lib/python3/dist-packages/usb/core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/usb/core.py", line 147, in managed_set_configuration
self.managed_open()
File "/usr/lib/python3/dist-packages/usb/core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/usb/core.py", line 120, in managed_open
self.handle = self.backend.open_device(self.dev)
File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 786, in open_device
return _DeviceHandle(dev)
File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 643, in __init__
_check(_lib.libusb_open(self.devid, byref(self.handle)))
File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 595, in _check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
Makefile:479: recipe for target 'deploy' failed
make: *** [deploy] Error 1

yuanyanhui
Posts: 10
Joined: Wed Mar 20, 2019 11:25 am

Re: Black STM32F407VET6: deploy issue

Post by yuanyanhui » Mon Jul 29, 2019 12:25 pm

FYI. The issue was solved by running the command with sudo.

User avatar
jimmo
Posts: 512
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Black STM32F407VET6: deploy issue

Post by jimmo » Mon Jul 29, 2019 1:25 pm

Instead of using sudo, you can also create a udev rule to change permissions on the device.

yuanyanhui
Posts: 10
Joined: Wed Mar 20, 2019 11:25 am

Re: Black STM32F407VET6: deploy issue

Post by yuanyanhui » Mon Jul 29, 2019 2:01 pm

@jimmo can you elaborate a bit? I use windows and know very little of ubuntu.

User avatar
jimmo
Posts: 512
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Black STM32F407VET6: deploy issue

Post by jimmo » Tue Jul 30, 2019 12:54 am

udev is resposible for making your devices accessible on linux. It has a bunch of default rules that work for many things, but it doesn't know what to do for a ST DFU device. You need to tell it what the permissions should be, using a udev rule (which in this case we say "usb device, with this VID/PID, give acess to this group").

Here's a random page I found that has the exact right instructions for Ubuntu https://github.com/cleanflight/cleanfli ... ific-linux

yuanyanhui
Posts: 10
Joined: Wed Mar 20, 2019 11:25 am

Re: Black STM32F407VET6: deploy issue

Post by yuanyanhui » Tue Jul 30, 2019 1:36 am

Thanks a lot. Will look into it.


yuanyanhui
Posts: 10
Joined: Wed Mar 20, 2019 11:25 am

Re: Black STM32F407VET6: deploy issue

Post by yuanyanhui » Tue Jul 30, 2019 3:04 am

@dhylands Thank you! This is very helpful.

Post Reply