Update the Firmware

Flash Marlin onto the motherboard.

This step is optional. Your motherboard comes with a correct build of Marlin pre-installed, but if you’d like to update the firmware or change settings, this will help you do so!

Using the Auto Build Marlin VSCode Extension

  1. Download the latest Marlin firmware and unzip it.

  2. Install VSCode and its PlatformIO extension.

  3. Open Marlin firmware’s folder on VSCode.

  4. Grab Marlin configuration files (Configuration.h and Configuration_adv.h) and replace the files in the Marlin/Marlin folder with those new ones.

  5. Install the Auto Build Marlin plugin using this Marlin Documentation page, or download it directly from the Visual Studio Marketplace.

  6. Try to build Marlin using the build button with the hammer icon as shown below:

    Marlin auto-build UI

  7. If this is successful, attach the LumenPnP Mobo to your computer with the USB cable. If it isn’t, this might help:

    • Check the error messages for configuration errors and fix them, or replace it with the default config
    • If this fails, check that your config file version is the same as your Marlin version (e.g. a bugfix-2.0.x config file won’t work in a bugfix-2.1.x)
    • When in doubt, re-downlaod Marlin and the configuration files from the links above
  8. Boot your motherboard into DFU Mode

    1. Press and hold the BOOT button
    2. Press the Reset button and hold for 10 seconds
    3. Release the Reset button and wait for 10 seconds
    4. Release the BOOT button
      BOOT and RESET buttons
  1. Flash the Motherboard using dfu-util by running the command dfu-util -d 0x0483:0xdf11 -s 0x08000000:leave -a 0 -D ./.pio/build/Opulo_Lumen_REV3/firmware.bin in the integrated terminal in the root of the repository.
    integrated terminal in VSCode with DFU-Util command
  1. Wait for the process to finish.

  2. The machine should show up as a COM/Serial Port on your PC now, and you should be able to access it via OpenPNP. If it doesn’t, press the Reset button on the board, or power-cycle the machine after the flashing is completed.

This is how you can check whether your machine is connected properly:

  • Windows:
    STM32 shows up as a COM/Serial Port
  • Mac/Linux:
    STM32 shows up on lsusb

Manually Configuring PlatformIO (for flashing via PIO)

  1. Download the latest Marlin firmware and unzip it.

  2. Install VSCode and its PlatformIO extension

  3. Open Marlin firmware’s folder on VSCode

  4. Grab Marlin configuration files (Configuration.h and Configuration_adv.h) and replace the files in the Marlin/Marlin folder with those new ones.

  5. Edit the platformio.ini file to indicate which board you’re uploading to. Update default_envs to read Index_Mobo_Rev03.

    BOOT and RESET buttons

  6. Attach the LumenPnP Mobo to your computer with the USB cable.

  7. Boot your motherboard into DFU Mode

    1. Press and hold the BOOT button
    2. Press the Reset button and hold for 10 seconds
    3. Release the Reset button and wait for 10 seconds
    4. Release the BOOT button
      BOOT and RESET buttons
  1. Upload firmware to the board via PlatformIO:

    Upload firmware via PIO

  2. Wait for the process to finish:

    PIO firmware upload done

  3. Press Reset on the board, or power-cycle the machine after the flashing is completed. Now it should show up as a COM/Serial Port on your PC:

  • Windows:
    STM32 shows up as a COM/Serial Port
  • Mac/Linux:
    STM32 shows up on lsusb

Flashing Factory Firmware

If you’ve put new firmware on your motherboard, but just want to get back to the firmware that your machine was flashed with, check the release for your build number and download the .bin firmware file attached to it. Put your board into DFU mode as described above, connect to your computer, and flash the binary to the board using the following command:

`dfu-util -d 0x0483:0xdf11 -s 0x08000000:leave -a 0 -D ~/path/to/firmware.bin`

Once flashing is completed, the machine should automatically exit DFU mode, and be accessible to OpenPNP again. For more information see Step 9 of the update firmware guide.

Troubleshooting

If you aren’t able to upload, you can check to see if your motherboard is booting into DFU mode correctly:

  • Windows:

    STM32 in DFU mode in Device Manager

  • Mac/Linux:

    STM32 in DFU mode in lsusb

Also, reference the Marlin instructions for uploading. Be sure to use bugfix-2.1.x if uploading using these instructions.

This method requires an ST-Link (V2 Clone or equivalent). Additionally you need the software STM32CubeProgrammer by ST. This method is a bit more involved and takes longer than just using the DFU mode.

  1. Compile (build) the project normally with PIO

  2. This generates a .bin-file that contains the firmware

  3. Connect your board to your ST-Link through the SWD header on board

  4. Start STM32CubeProgrammer

  5. Connect to the MCU:

    Connecting to the STM programmer

  6. Click on Open file and navigate to the firmware.bin file in PROJECT_DIRECTORY/.pio/build/STM32F407VE_black

    Opening the compiled firmware file

  7. Click on Download. This will flash the SMT32F4 with the provided firmware

    Downloading (flashing) the firmware

  8. Done! Now you just have to disconnect the ST-Link and press the reset button on the board.

Next steps

Continue to wiring and pneumatics.