-
-
Save wlgrd/17b3f8626fe3bff29a4bcad2622f2177 to your computer and use it in GitHub Desktop.
| 1. Create a rule for the DFU | |
| $ (echo '# DFU (Internal bootloader for STM32 MCUs)' echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"') | sudo tee /etc/udev/rules.d/45-stdfu-permissions.rules > /dev/null | |
| 2. Monitor connection and find your model (unplug/plug the fc while this cmd is active) | |
| $ udevadm monitor --environment --udev | grep ID_MODEL_ID | |
| 3. Update the /etc/udev/rules.d/45-stdfu-permissions.rules file with your model. E.g, my MODEL_ID is 5740, and the .rules file | |
| ends up like this: | |
| # DFU (Internal bootloader for STM32 MCUs) | |
| ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev" | |
| # ix5 | |
| ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev" | |
| 4. Now reload rules | |
| $ sudo udevadm control --reload-rules && udevadm trigger | |
| 5. You can then test the rule using when your FC is plugged in: | |
| $ udevadm test $(udevadm info -q path -n /dev/ttyACM0) | |
| Ensure line "MODE 0664 /etc/udev/rules.d/45-stdfu-permissions.rules" is present | |
| 6. Now check the group at which the device belongs to | |
| You can then test the rule using when your FC is plugged in: | |
| $ ls -lah /dev/ttyACM0 | |
| crw-rw---- 1 root dialout 166, 0 mars 17 21:57 /dev/ttyACM0 | |
| Here it is in dialout, obviosuly thinking it is a modem. | |
| 7. Stop the modem service | |
| $ sudo systemctl stop ModemManager.service | |
| 8. Add yourself to the group plugdev and dialout (don't know which one is the "correct one") | |
| $ sudo usermod -G plugdev -a <username> | |
| $ sudo usermod -G dialout -a <username> | |
| 9. I had to reboot for this to work. |
Ubuntu 22.04.2 LTS
Firstly, for Betaflight Configurator to actually work with flight controllers, current user was added to "dialout" group:
sudo usermod -aG dialout $USER ($USER - system variable that contains the current user login);
Then, created low-priority rule for STM32 devices:
(echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ACTION=="add", MODE="0664", GROUP="dialout"') | sudo tee /etc/udev/rules.d/80-local.rules
Then - reloaded udev rules:
sudo udevadm control --reload
That solved the problem for me.
Much appreciated the authors effort; used
https://betaflight.com/docs/wiki/archive/DFU-Hijacking#note and
https://opensource.com/article/18/11/udev resources to get things worked.
Dear NightCrack thank you very much!
Bro you are the goat
alongside with the reboot, i also had to run betaflight-configurator as super user
Works for me in Ubuntu 20.04. Then of connect my TinyGo, I set the necessary permissions using command (sudo chmod +666 /dev/ttyACM0), I made a consult (lsusb) to corroborate necessary idVendor and idProduct. It works for me when I don't use mi idProduct, ie ID_MODEL_ID=5740, instead I use the default ATTRS{idProduct}=="df11", set the mode to MODE="0666", and reload the rules. After add my user to both groups plugdev and dialout, finally I can install successful my new firmware Betaflight / STM32F411 (S411) 4.3.0 Jun 14 2022.