Skip to content

Instantly share code, notes, and snippets.

@akiatoji
Last active December 7, 2020 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akiatoji/3bf78aa3953bdc16bfc6e2a995b8eb95 to your computer and use it in GitHub Desktop.
Save akiatoji/3bf78aa3953bdc16bfc6e2a995b8eb95 to your computer and use it in GitHub Desktop.
Misc commands and notes for using Particle IoT devices on a Mac from command line

Particle Boron Setup Notes

Notes for using Particle.io Boron IoT via USB.

Flashing OTA has been a major paint for me as Boron 2G/3G can take forever before connecting to network. During development, it is best to use USB instead of Cell connection to Flash code.

Install Particle CLI

brew install dfu-util
bash <( curl -sL https://particle.io/install-cli )

Re-flash Boron with latest DeviceIO

Put device in DFU mode - Flashing Yellow (Mode+Reset, then release Reset, when flashing Yello, release reset)

particle update

Flash via USB

Put device in DFU mode, then flash

particle usb dfu
particle flash wombat_zombie --usb firmware.bin

Install gcc-arm-embedded

Developing, building then downloading compiled firmware in Particle Web IDE to flash via USB is the easiest.

Having said that, you can't automate any build using Particle Web IDE. So no CI/CD, you have to manually build, flash and test your code on a local test setup before flashing over the air to poptentially thousands of devices. That'd be a pain.

You can automate the build, but this gets involved. First, you need gcc-arm locally.

Homebrew has gcc-arm-embedded but Particle only recommends specific version (9-2019-q4-major for DeviceOS 2.0 at this time).
Need to download specific formula since the version we want is not tagged in homebrew.

wget https://raw.githubusercontent.com/Homebrew/homebrew-cask/24baf6c72920c409e6b5c6486b6664eb11d1343d/Casks/gcc-arm-embedded.rb
brew install gcc-arm-embedded.rb

Addtionally, gcc-arm-embedded is a cask and you can't pin it. So you'll have to re-run the above after every homebrew upgrade to stay on 9-2019-q4-major. I haven't tried the latest, but it just might work.

Info for building ARM binary locally is here:

https://support.particle.io/hc/en-us/articles/360039741273/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment