Is there a fast way build and flash your code to your Particle device


#1

There might already be a way. If so then can someone guide me. I feel like that compiling code, then putting device in dfu mode and then flashing takes too long. Is there a faster way to do this??


#2

write a script file? I compile locally (code size around 10,000 lines) compiles the full code in a minute (or so) on a macbook pro, dumping it into the device is another 15 - 20 seconds. All done by script file


#3

A script is definitely the way to go.

You can put a device into dfu mode by setting the baud rate to 14400.

What OS are you using?

The command to set the baud rate differs across Linux, Mac, and Windows.


#4

I am using a mac at work and windows at home. I have never written a script before though


#5

Get you device into dfu mode without pressing any buttons with:

stty -f /dev/cu.<your device> 14400

is usually something like cu.usbmodemXXXX with XXXX being a number.

So make that stty command your first line in the script


#6

Don’t do a separate compile and flash step. Instead, Start the flash, switch to another window and use Mode command to put into DFU, then wait for flash to complete.
(Windows use implied here…)