B.00 Arduino Setup

simondlevy edited this page Jan 6, 2019 · 11 revisions

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:

  1. Go to Arduino/hardware/grumpyoldpizza/stm32l4/drivers/linux/
  2. sudo cp *.rules /etc/udev/rules.d
  3. reboot
  1. Download Zadig
  2. Plugin STM32L4 board and toggle the RESET button while holding down the BOOT button
  3. Let Windows finish searching for drivers
  4. Start Zadig
  5. Select Options -> List All Devices
  6. Select STM32 BOOTLOADER from the device dropdown
  7. Select WinUSB (v6.1.7600.16385) as new driver
  8. Click Replace Driver
  9. Window 7s only:
    1. Go to Arduino/hardware/grumpypoldpizza/stm32l4/drivers/windows
    2. Right-click on dpinst_x86.exe (32 bit Windows) or dpinst_amd64.exe (64 bit Windows) and select Run as administrator
    3. Click on Install this driver software anyway at the Windows Security popup 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.

Adding the Ultimate Sensor Fusion Solution

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.