Skip to content

RP2040: Compiling

Paciente8159 edited this page Oct 3, 2024 · 5 revisions

µCNC for RP2040 can be built this way

Notes on building µCNC for RP2040

At the time of release of vesion v1.6.0 that supports RP2040, the Arduino Pico framework has several issues that might cause problems while trying to compile the code. These are some tips on how to be able to do it.

On Windows, PlatformIO seems to have some trouble downloading and installing the framework and tools needed to perform the task. After alot of digging, I found and issue that reports the problem and the solution that is related to issues with long names in Windows.

  • To fix this issue you have to insure long path names are enabled in windows
  • Also enable long path names in git. Install git, add it to your PATH environment variable and run the following command: git config --system core.longpaths true

Other issues seem to arrise when trying to compile with either Pico or Pico W.

  • For Pico W I recommend using framework version 3.1.1 or newer (Bluetooth support was added with version 3).
  • For Pico I recomment using previous version 2.7.3 since there seems to be an issue with filtering used libraries resulting in compilation errors.

For Pico W using Arduino IDE and enabling Bluetooth don't forget to select the appropriate IP/Bluetooth stack option

Method one - PlatformIO (recommended)

WARNING: If you have issues read the notes above.

  1. Get Visual Studio Code and install it.
  2. Install the PlatformIO extension.
  3. Open uCNC folder in VSCode.
  4. Edit cnc_config.h file and cnc_hal_config.h file to fit your needs and board.
  5. If needed edit the platformio.ini file environment for your board. Compile the sketch and upload it to your board.

Method two - Arduino IDE

WARNING: If you have issues read the notes above.

  1. Get Arduino IDE and install it. In this case I recommend using version 2 of the IDE.
  2. If you don't have, install RP2040 with Arduino board manager has explained here
  3. Go to uCNC folder and open uCNC.ino sketch.
  4. Edit cnc_config.h file and cnc_hal_config.h file to fit your needs and board.
  5. Use these settings:

image

  1. Compile the sketch and upload it to your board (via UF2).