Flashing Firmware Using Arduino IDE - tuanchris/dune-weaver GitHub Wiki
This guide provides instructions on how to flash firmware to your device using the Arduino IDE. Make sure to follow each step carefully to avoid issues.
Prerequisites
- Install Arduino IDE
- Connect your board (Arduino UNO or ESP32 Dev Module) to your computer via USB
Install the required library
- Open Arduino IDE.
- Go to Sketch > Include Library > Manage Libraries.
- Search for AccelStepper and install it.
Selecting the Right Board
Depending on your hardware, select the appropriate board in the Arduino IDE:
For Arduino UNO:
- Open Arduino IDE.
- Go to Tools > Board > Arduino AVR Boards and select Arduino UNO.
- Select the correct port under Tools > Port (e.g.,
COM3
on Windows,/dev/ttyUSB0
on Linux/Mac).
For ESP32 Dev Module:
- Install the ESP32 Board Support Package if not already installed. You can do this via Arduino IDE > Preferences and adding the following URL under Additional Board Manager URLs:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Go to Tools > Board > ESP32 Arduino and select ESP32 Dev Module.
- Select the correct port under Tools > Port (e.g.,
COM4
on Windows,/dev/ttyUSB1
on Linux/Mac). - Set the baud rate to 115200 under Tools > Upload Speed.
Flashing the Firmware
For Arduino UNO:
- Open the corresponding firmware file in firmware/arduino_code/ or firmware/arduino_code_TMC2209/.
- Click Verify (✔) to compile the code.
- Click Upload (→) to flash the firmware to the board.
For ESP32:
- Open the corresponding firmware file in firmware/esp32/ or firmware/esp32_TMC2209/.
- Click Verify (✔) to compile the code.
- Click Upload (→) to flash the firmware to the board.
Important Notes
- After testing the serial output in the Serial Monitor, close it. Leaving it open will prevent the frontend from connecting to the device.
- If you encounter issues with flashing the ESP32, try holding the BOOT button on the ESP32 while clicking the Upload button in the Arduino IDE.
- Ensure you are using a high-quality USB cable that supports data transfer.
Once the firmware has been successfully uploaded, your device is ready to use!