Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
B.00 Arduino Setup
Butterfly DIY Flight Controller: Arduino setup
If you haven't already installed the latest version of the Arduino IDE, you should do that now. If you're running Windows, you should choose to top-listed item, Windows installer (instead of the Windows app store). Linux users can follow these instructions, and Mac OS X users can follow these. Whichever OS you're running, please consider donating to the Arduino Project as part of the download!
To get 32-bit Arduino support, go to Tools/Board/Boards Manager ... (top of the Boards menu), and select the box for Arduino SAM Boards (32-bits ARM Cortex M3), and click the Install button. Although the STM32L4 line are an ARM Cortex M4 boards, this step will install the gnu-arm compiler that will work with these and other ARM Cortex boards.
If you haven't already cloned the Hackflight repository into your Arduino/libraries folder, do that now. You will also need to clone this repository for sensor support. (Typically, your Arduino folder is in your Documents folder on Windows and OS X, and in your home folder on Linux. Keeping your hardware support and libraries in this folder, instead of in the Arduino IDE installation folder, will ensure that they persist after you download subsequent versions of the Arduino IDE.) Next, clone this repository into your Arduino/hardware folder. Launch the Arduino IDE and under Tools/Boards you should see several new boards toward the bottom of the menu, including Butterfly-L433CC.
Finally, you're going to add some OS-specific support allowing your computer to talk to the STM32L4 boards:
- Go to Arduino/hardware/grumpyoldpizza/stm32l4/drivers/linux/
- sudo cp *.rules /etc/udev/rules.d
- Download Zadig
- Plugin STM32L4 board and toggle the RESET button while holding down the BOOT button
- Let Windows finish searching for drivers
Options -> List All Devices
STM32 BOOTLOADERfrom the device dropdown
WinUSB (v6.1.7600.16385)as new driver
- Window 7s only:
- Go to Arduino/hardware/grumpypoldpizza/stm32l4/drivers/windows
- Right-click on
dpinst_x86.exe(32 bit Windows) or
dpinst_amd64.exe(64 bit Windows) and select
Run as administrator
- Click on
Install this driver software anywayat the
Windows Securitypopup as the driver is unsigned
Of course, no Arduino setup can be complete until you test your board with the beloved Blink sketch! Having launched the Arduino IDE, under Tools/Board choose Butterfly-L433C and under Tools/Port select the serial port on which your board is connected.
Under File/Examples/01. Basics chose Blink. Flash the Blink sketch, and the LED on the board should start blinking on and off. If you can't flash the sketch (countdown 10 9 .. 1 FAIL), disconnect the board, reconnect it while holding down the Boot button (labeled BTN), and try again.