Skip to content

Uploading Sketch

Chris Barr edited this page May 1, 2019 · 9 revisions

Neither of these upload methods depend on any custom bootloader on the RUMBA32 board - they use the built-in STM bootloader which cannot be overwritten. It is always possible to use these upload methods, provided everything is connected and configured correctly - i.e., there is no way to "brick" a RUMBA32 board.

Method 1: Upload via USB DFU

This method uploads from the Arduino IDE over a USB connection using the DFU protocol. This upload method is natively supported by the STM32 microcontroller and does not require any special bootloader/firmware to be running. RUMBA32 needs to be reset into bootloader mode for the upload to work.

Arduino IDE setup:

  1. If you are testing the upload, open a test sketch (File > Examples > Basics > Blink). Otherwise, have the sketch you intend to upload open.
  2. Set Upload Method to USB DFU (Tools > Upload Method > DFU Upload)

Hardware setup:

  1. Connect RUMBA32 to the computer via a micro USB cable.

Upload process:

  1. Press and hold RUMBA32 BOOT button.
  2. Press and release RUMBA32 RESET button.
  3. Release RUMBA32 BOOT button.
  4. RUMBA32 is now in hardware bootloader mode and will accept firmware upload via USB DFU.
  5. Press "Upload" in Arduino IDE. If correctly configured and connected, the upload should be successful:

You can safely ignore the warning messages about "Invalid DFU suffix signature" - this warning will always appear, and does not mean that the upload failed. If what you see looks like the above, congratulations - DFU upload is working! You are done with this section.

Troubleshooting

If the upload does fail, you will likely see something like the below:

If the upload fails, there are two things we need to check:

  • That the board is in DFU upload mode. Double-check that you followed the steps in the Upload Process section correctly.
  • That your computer can detect the board and has loaded appropriate drivers. Here's how we can check that on Windows:

Open Device Manager (Start Search > Device Manager). With RUMBA32 connected via USB and in DFU mode (awaiting an upload, so buttons pressed as in the Upload Process), RUMBA32 should appear under Universal Serial Bus devices as STM32 BOOTLOADER:

If you can't see RUMBA32 there, look for it under a different heading in the Device Manager. If you disconnect/reconnect RUMBA32 (or reset it), and bring it back into DFU mode, Device Manager should flash and update as it detects the device disconnecting & reconnecting.

If you can locate RUMBA32 in Device Manager, then we have confirmed that it is being detected by the computer. If upload is still not working, then it is possible that the wrong driver has been loaded. Follow these steps to ensure the correct driver is in use:

  1. Download Zadig. Zadig is a tool for changing the driver on USB devices.
  2. Open Zadig, and click Options > List all Devices. The dropdown select in the main window should then have a list containing all of the USB devices attached to your computer.

  1. Select the list item that corresponds to RUMBA32. Once selected, check the USB ID boxes - they should read 0483 and DF11. If that is the case, this confirms you have selected RUMBA32 (or another device with the same microcontroller - which is unlikely).

  1. Make sure that the right-hand box (the one with the arrow pointing to it) has WinUSB selected. If not, scroll through the options until WinUSB is selected.
  2. Press the large button - this should say Replace Driver or Reinstall Driver, depending on whether or not WinUSB was already in use.
  3. Wait for the process to finish - this shouldn't take longer than a minute at most.
  4. Go back to the Device Manager, and check that you can still locate RUMBA32. Its name and position may have changed if the driver was changed.
    • If you can locate RUMBA32, try uploading from the Arduino IDE again.
    • If not, disconnect RUMBA32, reconnect it, put it back in DFU mode, and try the driver update again.
    • If you still can't get upload to work, try a different USB port, or a different computer.

Method 2: Upload via Serial

Notes:

  • Requires USB to Serial adaptor
  • Board can be powered externally (12/24V etc.) or from USB-UART adaptor

This method uploads from the Arduino IDE using one of the serial interfaces on the RUMBA32 board. This upload method is natively supported by the STM32 microcontroller and does not require any special bootloader/firmware to be running. RUMBA32 needs to be reset into bootloader mode for the upload to work.

Arduino IDE setup:

  1. If you are testing the upload, open a test sketch (File > Examples > Basics > Blink). Otherwise, have the sketch you intend to upload open.
  2. Set Upload Method to Serial (Tools > Upload Method > Serial)
  3. Connect USB-UART adaptor and identify+select the COM port it presents as (Tools > Port > COMX)

Hardware setup:

  1. Connect USB-UART adaptor to pins on EXP3 header as shown.
  2. Ensure board is powered, either via USB-UART adaptor, USB, or external power.

Upload process:

  1. Press and hold RUMBA32 BOOT button.
  2. Press and release RUMBA32 RESET button.
  3. Release RUMBA32 BOOT button.
  4. RUMBA32 is now in hardware bootloader mode and will accept firmware upload via USART1 on EXP3 header.
  5. Press "Upload" in Arduino IDE. If correctly configured and connected, the upload should be successful: