Flashin the Nano Every board with a Compiled Obj/Hex File,etc

I have a development laptop where i can compile my project and flash it to the board.

But, i have a scenario, where the board is in a lab where i cant take the above laptop w/o IT firewalls.

But i can use a IT firewalled laptop in the lab to flash the program to the board. Since, the laptop in the lab is IT firewalled, i cant compile the project in that laptop.

So is there a way to compile the project in the external laptop and carry an object or a hex file of the program and then flash it into the board with the IDE on the laptop w/ IT firewalls.(compiling a program is not possible but flashing is possible wIth the IDE on the firewalled laptop).

Any help greatly appreciated...

Compile the program, save thevHEX file, and use AVRDUDE to flash it.
Or use IDE 1.8.zxx to do it locally..

Hi Lastchancename, thanks for the hint,

Pls share a steps guide to save the HEX file in IDE 1.8.xxx for eg...i am unable to find such an option in the IDE

i am currently using the latest IDE and any steps to save hex file in this IDE also ok..

maybe a snapshot of the sequence to do in the IDE wud help.. thanks

Are you certain? The compilation process doesn't use the network, so it seems unlikely that the presence of a firewall would make it impossible to perform a compilation process.

Yes:

  1. Open the sketch in Arduino IDE.
  2. Select the target board from Arduino IDE's Tools > Board menu.
  3. Select Sketch > Export compiled Binary from the Arduino IDE menus.
    A sketch compilation will start.
  4. Wait for the compilation to finish successfully.
  5. Select Sketch > Show Sketch Folder from the Arduino IDE menus.
    The folder of the sketch will open in your file manager.

You will find the compiled .hex binary file in that folder.

No. It is not possible to use Arduino IDE to flash precompiled binaries.

However, you can do it by using the AVRDUDE uploader tool for the board directly from the command line.

You can learn the format of the command by performing an upload with verbose output enabled using Arduino IDE on the external laptop, then examining the command that was generated by Arduino IDE:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compile in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
    The "Preferences" dialog will close.
  5. Attempt an upload, as you did before.
  6. Wait for the upload to finish.
  7. Examine the contents of the black "Output" panel at the bottom of the Arduino IDE window. There you will see the avrdude command Arduino IDE executed to perform the upload.
    :exclamation: You might need to scroll up in the panel to see it.
    For example:
    "C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega4809 -cjtag2updi -PCOM3  -b115200 -e -D "-Uflash:w:C:\Users\per\AppData\Local\Temp\arduino\sketches\ED79B99528583AD0C18881A9CAAE83AD/sketch_may23a.ino.hex:i" "-Ufuse2:w:0x01:m" "-Ufuse5:w:0xC9:m" "-Ufuse8:w:0x00:m" {upload.extra_files}
    

You can then use that command as the model for the command you will need to run from the command line on the lab computer, making the following modifications:

  • Adjust the path to avrdude and avrdude.conf with the paths of the files on the lab computer.
  • Adjust the -P flag in the command for the serial port of the Nano Every board on the lab computer.
  • Adjust the path to the .hex file to the precompiled binary you brought.

There is a tricky thing about uploading via the command line to the Nano Every board. The board must be put into a special mode before starting the upload. If it isn't in that mode the upload will fail:

$ "C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega4809 -cjtag2updi -PCOM3  -b115200 -e -D "-Uflash:w:C:\Users\per\AppData\Local\Temp\arduino\sketches\ED79B99528583AD0C18881A9CAAE83AD/sketch_may23a.ino.hex:i" "-Ufuse2:w:0x01:m" "-Ufuse5:w:0xC9:m" "-Ufuse8:w:0x00:m" {upload.extra_files}

avrdude.exe: Version 6.3-20190619
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2014 Joerg Wunsch

             System wide configuration file is "C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

             Using Port                    : COM3
             Using Programmer              : jtag2updi
             Overriding Baud Rate          : 115200
avrdude.exe: jtagmkII_getsync(): sign-on command: status -1
avrdude.exe: jtagmkII_getsync(): sign-on command: status -1
avrdude.exe: jtagmkII_getsync(): sign-on command: status -1
avrdude.exe: jtagmkII_getsync(): sign-on command: status -1
avrdude.exe: jtagmkII_getsync(): sign-on command: status -1
avrdude.exe: jtagmkII_getsync(): sign-on command: status -1
avrdude.exe: jtagmkII_getsync(): sign-on command: status -1

Arduino IDE automatically puts the board into that mode. This is done by momentarily opening the serial port of the board with the port configured at 1200 baud. The board recognizes this as a signal to go into the upload mode.

Since you are already using Arduino IDE, it can be used for this purpose:

  1. Open Serial Monitor.
  2. Select "1200" from the baudrate menu in Serial Monitor.
  3. Close Serial Monitor.
  4. Run the upload command from the command line.

1st thanks ptillisch.

answer to compilation query, ur right no network needed. But, i use a Nano Every board and the libraries for this board are not available in the IDE by default .i.e. i have to install the library manually in the IDE and this uses the network and the IT firewall prevents network based lib installs. that is the root cause of my problem. If the IDE carried the Every board Lib by default i wud not face this problem.

thanks again, i will try the hex file saving method.

Then i will embark on the avrdude tool steps, seems daunting --- i am not a regular SW geek,,,but will try the steps and seek any help if i am stuck....Thanks in advance

OK, I see. Fortunately the "Arduino AVR Boards" platform of the UNO, Mega, Leonardo, etc. board also uses AVRDUDE as its upload tool. So if "Arduino AVR Boards" is installed on the lab computer then AVRDUDE will also be installed even though the "Arduino megaAVR Boards" platform of the Nano Every is not installed on that computer.

Hi Ptillisch,

i am soon embarking on the cmd sets from the command line journey with Arduino 1.8.19 IDE build and the NaNO Every Board.
The lab is 50 miles away and if something doesnt work i will have to do back and forth w/external laptop location. Hence, i wanted a short review of the cmd sets u gave me summarized below here again.(i will use 1.8.19 IDE build)

1st cmd set:

C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" - I will modify this cmd as below - as it depends on the location of the avrdude.exe file in my installation.

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" - pls confirm that this format is ok...the location of my avrdude.exe file is correct and i confirm that from my side

2nd Cmd Set

"-CC:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega4809 -cjtag2updi -PCOM3 -b115200 -e -D

i will mod the 2nd cmd to as below:
"-C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -v -V -patmega4809 -cjtag2updi -PCOMx
-b115200 -e -D
Ignore the PCOMx as i will replace the x with the port no on which the baord is connected on my laptop, pls confirm 2nd set cmd correctness

3rd Cmd

"-Uflash:w:C:\Users\per\AppData\Local\Temp\arduino\sketches\ED79B99528583AD0C18881A9CAAE83AD/sketch_may23a.ino.hex:i" "-Ufuse2:w:0x01:m" "-Ufuse5:w:0xC9:m" "-Ufuse8:w:0x00:m" {upload.extra_files}

i will modify this cmd as below:

"-Uflash:w:C:\Users\VijayMargret\OneDrive\Documents\Arduino\2WPUpgradeDemo\2WPUpgradeDemo.ino.nona4809.hex:i" "-Ufuse2:w:0x01:m" "-Ufuse5:w:0xC9:m" "-Ufuse8:w:0x00:m"

I have few questions for this command below

  1. the path to my sketches .hex file in the cmd is updated for my installation. Confirmed from my side
  2. i want to confirm that the 3 Ufuse settings ur using in this 3rd CMD will not fuse/burn any security fuse in the 4809 uC. bcos i need to use that board for multiple development projects and do not want to render the board permanently locked up for any future uploads onto the nano every board.

looking for ur expert review and confirmation of any mods or freeze on the 3 cmds set soon.
Then i will be ready to upload in the lab computer

i will follow the below instructions as per ur note above on the lab computer b4 issuing from cmd line

Arduino IDE automatically puts the board into that mode. This is done by momentarily opening the serial port of the board with the port configured at 1200 baud. The board recognizes this as a signal to go into the upload mode.

Since you are already using Arduino IDE, it can be used for this purpose:

  1. Open Serial Monitor.
  2. Select "1200" from the baudrate menu in Serial Monitor.
  3. Close Serial Monitor.
  4. Run the upload command from the command line.

Thanking You
Ben

i tried the cmds today , but , the lab computer - unless the megaavr board libraries are installed, it recognizes the board as Nano board and prevents me from uploading on the command line. Anywork around posible

no solution/work around possible, so far. Also tried with Arduino-CLI and with IDE, unless the libraries are installed on the PC, uploads for an unrecognized board will not happen.
only last option seems to be if i can manually install the LIB and can avoid the firewall... let me see

The only thing that you need is the driver and the upload tool (avrdude if I'm not mistaken). I'm not familiar with the use of Nano Every (I don't have one) so can't help further

That is unexpected. However, even if it truly is doing that, it wouldn't interfere in any way with your ability to use AVRDUDE to flash the binary to the board.

It will not be possible for us to help you with that problem based on such a vague description. Please provide a detailed description of what you mean by "prevents" in a reply on this forum thread, including:

  • What did you do?
  • What were the results you expected from doing that thing?
  • What were the results you observed that did not match your expectations?

Make sure to include the full and exact text of any error or warning messages you might have encountered.

Sure give me some time, i will retry once more and see how i can elaborate on when i reach the "prevents " stage...maybe i am doing it not so correctly...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.