Close

Minor Note - Uploading to SD Card via Arduino IDE

A project log for Monoprice Mini Marlin 2.0 Support

Getting Marlin to run on the Monoprice Mini/Malyan M200.

jc-nelsonJ.C. Nelson 10/22/2018 at 16:230 Comments

I'm still using PlatformIO as my editor for now (aka Atom, not VSCode yet). The M200 doesn't support ST-LINK upload or serial, and in fact, I want to use IAP so that users can move off of the Marlin 2.x build with no problems.

So that left me copying the binaries to the SD card by hand...until I decided to do better.

To do this, I added a copy to SD card method for uploading, set it as my board uploader.

In boards.txt:

# Upload menu
MALYANM200.menu.upload_method.CopyToSD=Copy To SD
MALYANM200.menu.upload_method.CopyToSD.upload.protocol=
MALYANM200.menu.upload_method.CopyToSD.upload.tool=copyToSD

In Platform.txt:

# Copy To SD for M200
tools.copyToSD.cmd.windows=copy
tools.copyToSD.cmd.macosx=cp
tools.copyToSD.upload.params.verbose=-batch
tools.copyToSD.upload.params.quiet=--batch-silent
tools.copyToSD.upload.pattern="{cmd}" "{build.path}/{build.project_name}.bin" /volumes/PRINTER/update.bin 

 This is in no way perfect. I'd like to call a script so I can output a "finished." It would also make sense to let the path be selectable and unmount the drive afterwards since I'm on OSX.

However, in terms of quality of life? This has been so very helpful. I insert my SD card adapter + SD card, choose upload, eject, and it's running.

I'll explore how to change this to call a script soon so it can echo that it's done (as well as figure out how to dismount a volume by name) but there you go. "custom" upload tool.

Discussions