Skip to content

Getting Started

Kris Winer edited this page Dec 29, 2017 · 5 revisions

When you first get your Ladybug, Butterfly, or Dragonfly it will have been programmed with a simple blink program and, if you connect a Micro B USB cable, you should see the led(s) blink and, if your pc assigns a COM port to the device, you will see board voltage and temperature printed to the Serial Monitor. Every Ladybug, Butterfly, and Dragonfly is tested and verified to work before you get it. Because we are still developing the Arduino core, however, setting up the Arduino IDE is not as easy and trouble free as it should, and eventually will, be.

In order to set up the Arduino IDE to program Ladybug or Butterfly yourself, first make sure you are using the latest Arduino IDE version. You can download the latest version here. In the boards manager, make sure you have uninstalled any previous version of the STM32L4 core and make sure you have installed the latest SAMD boards. The latter provide the compiler for STM32L4 sketches.

Download the latest STM32L4 core from here and copy into a directory on your computer wherever you keep your Arduino sketches as ../Arduino/hardware/grumpyoldpizza/STM32L4.

Close the Arduino IDE and restart it. You should now see in the board selector STM32L4 boards for Ladybug, Butterfly, etc. Choose the appropriate board in the board selector, choose a sketch, plug in your device. If a COM port has been assigned by your computer (this happens automatically on Windows 10) make sure you have selected this port before you attempt to compile and load the program.

At this point, you should be able to flash any Arduino program you choose using the sketches reposited here or here as a guide.

If at this point you are still having trouble loading a new sketch there are three things you can try.

First, unplug the Ladybug or Butterfly, close all serial monitors, quit the Arduino IDE, restart the Arduino IDE and reconnect the Ladybug or Butterfly. This is sometimes necessary if the serial port is disconnected, multiple unsuccessful flash attempts are made or the computer gets confused in some manner.

Second, press and hold the boot button (BTN, right most button) while pressing and releasing the RST button. Release the boot button. This puts the device into boot loader mode, which should not be required for the Arduino IDE, but is sometimes useful if your computer gets confused about open COM ports, etc.

Lastly, if none of these methods work, with the Ladybug or Butterfly in boot loader mode, run Zadig (for Windows machines), choose list all devices in options, select STM32 boot loader, and press the big button that says "Reinstall WCID Driver". Or with the Ladybug on normal mode click “Replace Driver” (drop down in the big button) with the box above it saying “WinUSB(v6.1.7600.26385)”. This is sometimes necessary if Windows associates the wrong driver (like the Teeniduino driver) for your Ladybug or Butterfly device.

If none of these steps results in a working, flashable Ladybug or Butterfly please e-mail me at tleracorp@gmail.com and I will help you figure out what the heck is going wrong.

Clone this wiki locally