Update the Firmware
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
MARLIN VERSION
Building an older version of Marlin with the recommended config files won't work. If you are unsure whether a previously-downloaded local version of Marlin is the newest one, re-downloading it is the safest choice.
- Download the latest Marlin firmware and unzip it.
- Install VSCode and its PlatformIO extension.
- Open Marlin firmware's folder on VSCode.
- Grab Marlin configuration files here and replace the files in the Marlin/Marlin folder with those new ones.
- Install the Auto Build Marlin plugin using this Marlin Documentation page, or download it directly from the Visual Studio Marketplace.
-
Try to build Marlin using the build button with the hammer icon as shown below:
-
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-download Marlin and the configuration files from the links above
-
Boot your motherboard into DFU Mode
- Press and hold the
BOOT
button - Press the Reset button and hold for 10 seconds
- Release the Reset button and wait for 10 seconds
- Release the
BOOT
button
NOTE
If you have a hard time getting your board to enter DFU mode, instead try powering off the machine entirely, holding the 'BOOT' button, plugging in power, waiting 10 seconds, then release the
BOOT
button. - Press and hold the
-
Flash the Motherboard using
dfu-util
by running the commanddfu-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.COMMAND EXPLANATION
dfu-util
is a flash tool available on all platforms.-d 0x0483:0x0df11
tells the tool to flash the STM32 chip on the motherboard. This is optional if you only have one dfu device connected.-s 0x8000000:leave
is the target memory address that the firmware is flashed to. The:leave
part will cause the chip to reset on its own, making the machine accessible in OpenPNP without rebooting it.-a 0
makes the tool use the alt setting required for flashing the ESP32.-D ./.pio/build/Opulo_Lumen_REV3/firmware.bin
is the path to the to-be-flashed firmware. If you want to flash another file, change this.
-
Wait for the process to finish.
-
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:
FLASHING VIA PLATFORMIO
Note that flashing the firmware using the Auto Build Marlin Plugin might work, but seems error-prone for most people. Therefore, if you want to try it, you can, but using dfu-util
is generally a better idea.
If you're absolutely sure that ABM is the way to go, do this:
- Boot your motherboard into DFU Mode
- Press and hold the
BOOT
button - Press the Reset button and hold for 10 seconds
- Release the Reset button and wait for 10 seconds
- Release the
BOOT
button - Now, press the upload button in ABM as shown below:
- Wait for the process to finish
- Continue with step 11 {{% /alert %}}
Manually Configuring PlatformIO (for flashing via PIO)
- Download the latest Marlin firmware and unzip it.
- Install VSCode and its PlatformIO extension
- Open Marlin firmware's folder on VSCode
-
Grab Marlin configuration files and replace the files in the Marlin/Marlin folder with those new ones.
-
Edit the platformio.ini file to indicate which board you're uploading to. Update
default_envs
to readOpulo_Lumen_REV3
orOpulo_Lumen_REV4
depending on your motherboard. -
Attach the LumenPnP Mobo to your computer with the USB cable.
-
Boot your motherboard into DFU Mode
NOTE
If you have a hard time getting your board to enter DFU mode, instead try powering off the machine entirely, holding the 'BOOT' button, plugging in power, waiting 10 seconds, then release the BOOT
button.
-
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:
- Mac/Linux:
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.
Troubleshooting
If you aren't able to upload, you can check to see if your motherboard is booting into DFU mode correctly:
Also, reference the Marlin instructions for uploading.
Alternative Method (Not Recommended)
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.
- Compile (build) the project normally with PIO
- This generates a .bin-file that contains the firmware
- Connect your board to your ST-Link through the SWD header on board
- Start STM32CubeProgrammer
-
Click on Open file and navigate to the firmware.bin file in PROJECT_DIRECTORY/.pio/build/STM32F407VE_black
-
Click on Download. This will flash the SMT32F4 with the provided firmware
-
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.