Skip to content

CLI Suggestion : Export compiled binary #6931

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

Closed
dimitre opened this issue Nov 15, 2017 · 12 comments
Closed

CLI Suggestion : Export compiled binary #6931

dimitre opened this issue Nov 15, 2017 · 12 comments
Labels
Component: CLI The Arduino IDE's command line interface feature request A request to make an enhancement (not a bug fix) Type: Wontfix Arduino has decided that it will not resolve the reported issue or implement the requested feature

Comments

@dimitre
Copy link

dimitre commented Nov 15, 2017

In Arduino command line interface
It would be great to have a parameter that compiles and export compiled binary only.

Example of usefulness: inside Arduino IDE the max baud rate I can upload a sketch to ESP8266 is 115200 and using esptool.py I can upload using baud 3000000.
Thank you

@matthijskooijman
Copy link
Collaborator

There is an "Export Compiled Binary" in the "Sketch" menu. Is that what you mean?

@dimitre
Copy link
Author

dimitre commented Nov 15, 2017

Sorry @matthijskooijman it is about CLI, command line arduino options. I'll edit my post for clarification

@per1234 per1234 added Component: CLI The Arduino IDE's command line interface feature request A request to make an enhancement (not a bug fix) labels Nov 16, 2017
@dimitre
Copy link
Author

dimitre commented Jul 28, 2018

Just as an usage example, one line to compile and export binary from a sketch

/Applications/Arduino.app/Contents/MacOS/Arduino --export ArduinoSketch.bin --board esp8266:esp8266:generic:CpuFrequency=80,FlashFreq=40,FlashMode=dio,UploadSpeed=230400,FlashSize=512K64,ResetMethod=ck,Debug=Disabled,DebugLevel=None____ ArduinoSketch.ino

@andrethomas
Copy link

Did you get this to work?

@dimitre
Copy link
Author

dimitre commented Aug 30, 2018

@andrethomas no. in fact I was meaning a new parameter in Arduino CLI to be able to export a binary compiled file via command line. This is an improvement suggestion.

@andrethomas
Copy link

Oh ok, I already do that with platformio but wanted to do it with arduino - somehow the linking scripts work different for the esp

@andrethomas
Copy link

~/arduino/arduino -v --board esp8266:esp8266:d1_mini:CpuFrequency=80,FlashSize=4M1M --verify sketch.ino --preserve-temp-files --pref build.path=/build/

Causes the .bin file to be in the /build/ folder specified so there's a way to do it I guess

@pkoevesdi
Copy link

pkoevesdi commented May 25, 2020

Thanks You for the solution.
Let me add this, since I stumbled upon it:

@matthijskooijman
Copy link
Collaborator

Thanks for the suggestion.

Since this issue was created, https://github.com/arduino/arduino-cli was created, which will be the backend for the java IDE as well in the future. Since that offers a much more complete CLI interface, I expect that the java IDE commandline interface will become deprecated at some point, and will likely not be developed any further. For that reason, I'm going to close this as wontfix.

As for this particular request, I suspect arduino-cli does not implement it yet, but the same approach as above would work: Run a compile with a fixed build path, and extract the binary from the buildpath afterwards. See also https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_compile/

@matthijskooijman matthijskooijman added the Type: Wontfix Arduino has decided that it will not resolve the reported issue or implement the requested feature label May 25, 2020
@cmaglie
Copy link
Member

cmaglie commented May 25, 2020

Actually it's the opposite: arduino-cli will always export the compiled binary inside the sketch folder.

To be precise until arduino-cli 0.10.0 the binary was exported in sketch/sketch.ino.board-id.hex where "board-id" is the board identifier.
We recently merged a patch that changes this behaviour and now the cli export in sketch/build/board-id/sketch.ino.hex that is muuuch more clean, this will be available in arduino-cli >=0.11.0 (not yet but soon to be released).

@pkoevesdi
Copy link

Thanks for pointing out.
Is andrethomas' (and my current) solution using the java IDE commandline interface? (I was not well aware of what's happening when calling arduino from command line.)

@HARIS4820

This comment was marked as off-topic.

@arduino arduino locked as resolved and limited conversation to collaborators Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: CLI The Arduino IDE's command line interface feature request A request to make an enhancement (not a bug fix) Type: Wontfix Arduino has decided that it will not resolve the reported issue or implement the requested feature
Projects
None yet
Development

No branches or pull requests

7 participants