Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added external programmer support #720

Merged
merged 14 commits into from
Jun 15, 2020
Merged

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented May 22, 2020

This PR add support for

  • list supported programmers for a board:
$ ./arduino-cli upload --fqbn arduino:avr:uno --programmer list
ID                     Programmer Name                Platform         
avrispmkii             AVRISP mkII                    arduino:[email protected]
jtag3                  Atmel JTAGICE3 (JTAG mode)     arduino:[email protected]
jtag3isp               Atmel JTAGICE3 (ISP mode)      arduino:[email protected]
arduinoisp             ArduinoISP                     arduino:[email protected]
usbGemma               Arduino Gemma                  arduino:[email protected]
avrisp                 AVR ISP                        arduino:[email protected]
parallel               Parallel Programmer            arduino:[email protected]
buspirate              BusPirate as ISP               arduino:[email protected]
arduinoasispatmega32u4 Arduino as ISP (ATmega32U4)    arduino:[email protected]
usbasp                 USBasp                         arduino:[email protected]
atmel_ice              Atmel-ICE (AVR)                arduino:[email protected]
usbtinyisp             USBtinyISP                     arduino:[email protected]
arduinoisporg          ArduinoISP.org                 arduino:[email protected]
stk500                 Atmel STK500 development board arduino:[email protected]
arduinoasisp           Arduino as ISP                 arduino:[email protected]
  • upload with external programmer using the command line:
    arduino-cli upload .... -P programmer-id

  • burn bootlader:
    arduino-cli upload --fqbn ... --burn-bootloader (changed as per @ubidefeo suggestion)
    arduino-cli burn-bootloader --fqbn ....

Another improvement of this PR is that it makes the --port parameter mandatory only when really needed in upload patterns.

Missing:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

@ubidefeo
Copy link

I would advice to keep the --burn-bootloader as its own command, hence burn-bootloader as a command to arduino-cli

example:
arduino-cli burn-bootloader --fqbn arduino:samd:nano_33_iot -p atmel_ice -v

upload, on the other hand, should be related to "uploading" or "programming" a firmware generated by the Arduino workflow

@cmaglie
Copy link
Member Author

cmaglie commented May 22, 2020

I would advice to keep the --burn-bootloader as its own command, hence burn-bootloader as a command to arduino-cli

Agreed, I'll fix this out.

@cmaglie cmaglie linked an issue May 28, 2020 that may be closed by this pull request
@cmaglie cmaglie added this to the 0.11.0 milestone Jun 12, 2020
@cmaglie cmaglie self-assigned this Jun 12, 2020
@cmaglie cmaglie requested review from rsora and ubidefeo June 12, 2020 16:15
Copy link
Contributor

@rsora rsora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@cmaglie cmaglie merged commit 5373961 into arduino:master Jun 15, 2020
@cmaglie cmaglie deleted the ext-programmer branch June 15, 2020 14:55
umbynos pushed a commit that referenced this pull request Jun 17, 2020
* Added scaffolding for external programmer support

* Added programmers extraction in arduino/cores module

* Implemented programmers list command

* Print upload command line in verbose mode

* Added programmer option to compile command

* External programmer implementation

* Factored function runTool in upload

This will turn out useful for burn-bootloader that requires to run
two actions in a row ("erase" and "bootloader").

* Implemented burn-bootloader

* Increased tracing log

* Test fix

* Added BurnBootloder action

* Make the upload port parameter mandatory only when really needed

* Fixed nil pointer exception when burning-bootloader

* Added sanity check on upload parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External Programmer Support
3 participants