Go Down

Topic: arduino-builder compiles into binary string not hex (Read 718 times) previous topic - next topic

32teeth

hi there,

i have been playing with the official official arduino-builder from arduino.cc

i have managed to successfully compile a sketch

Code: [Select]

void setup() {};\nvoid loop() {};


and the result is a JSON object
Code: [Select]

{
  "hex": "OjEwMDAwMDAwMEM5NDlCMDAwQz...[lots more omitted]",
  "id": "2a8fd66d-3cff-44d2-9e10-2f861dbab7bc",
  "stderr": "",
  "stdout": "arduino-builder\/arduino-builder -compile -core-api-version 10611 -build-path \/tmp\/410500705 -hardware arduino-builder\/hardware -hardware arduino-builder\/packages\/cores -tools arduino-builder\/tools -tools arduino-builder\/packages\/tools -built-in-libraries arduino-builder\/latest -libraries \/tmp\/386530442\/pinned -libraries \/tmp\/386530442\/custom -fqbn arduino:avr:leonardo -verbose=false \/tmp\/386530442\/empty\nWARNING: Category '' in library ArduinoUnit is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Parse Arduino SDK is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Pushetta is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library SparkFun MG2639 CellShield is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library StereoSID is not valid. Setting to 'Uncategorized'\n"
}


you can play this example here on create.arduino.cc

if you preview the developer console network tab you'll see the request params

Anyway, as you can see from the above JSON, the hex returned is a compiled binary

Code: [Select]

{
  "hex": "OjEwMDAwMDAwMEM5NDlCMDAwQz...[lots more omitted]",
  "id": "2a8fd66d-3cff-44d2-9e10-2f861dbab7bc",
  "stderr": "",
  "stdout": "arduino-builder\/arduino-builder -compile -core-api-version 10611 -build-path \/tmp\/410500705 -hardware arduino-builder\/hardware -hardware arduino-builder\/packages\/cores -tools arduino-builder\/tools -tools arduino-builder\/packages\/tools -built-in-libraries arduino-builder\/latest -libraries \/tmp\/386530442\/pinned -libraries \/tmp\/386530442\/custom -fqbn arduino:avr:leonardo -verbose=false \/tmp\/386530442\/empty\nWARNING: Category '' in library ArduinoUnit is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Parse Arduino SDK is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Pushetta is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library SparkFun MG2639 CellShield is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library StereoSID is not valid. Setting to 'Uncategorized'\n"
}



when in actuality i am expecting something like this

Code: [Select]

{
  "hex": "":100000000C942D010C9455010C9455010C94550140\r\n:...[lots more omitted]",
  "id": "2a8fd66d-3cff-44d2-9e10-2f861dbab7bc",
  "stderr": "",
  "stdout": "arduino-builder\/arduino-builder -compile -core-api-version 10611 -build-path \/tmp\/410500705 -hardware arduino-builder\/hardware -hardware arduino-builder\/packages\/cores -tools arduino-builder\/tools -tools arduino-builder\/packages\/tools -built-in-libraries arduino-builder\/latest -libraries \/tmp\/386530442\/pinned -libraries \/tmp\/386530442\/custom -fqbn arduino:avr:leonardo -verbose=false \/tmp\/386530442\/empty\nWARNING: Category '' in library ArduinoUnit is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Parse Arduino SDK is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library Pushetta is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library SparkFun MG2639 CellShield is not valid. Setting to 'Uncategorized'\nWARNING: Category '' in library StereoSID is not valid. Setting to 'Uncategorized'\n"
}


thoughts?

rpt007

I don't use the arduino-builder.
When I need a hex file of an Arduino sketch, the IDE is able to export the hex file.
You can find this feature under the "Sketch" menu.

Xloader will then upload the hex file to another Arduino. Dozen times done without any problem.
Before you ask:
Did you really read and understand How to use this forum ?
AND:
Do you have already some solution or is a part of the problem sitting in front of the screen?  :)

DrAzzy

The hex section looks like something base64 encoded. What do you get when you decode it as base64?
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up