How to create read only project

So in my Arduino IDE the example projects are read-only. Is there a way to mark my own projects to behave in the same way?

Basically I am going to be having someone else flashing my sketch onto an Arduino... I have spent weeks trying to find a good way to let them just push a compiled sketch to the board to no avail and am just moving on and going to require they use the IDE. But I would like to make sure they dont mistakenly change the code.

I think you can give them the final hex file. There's a discussion from 2016/7 here that may still be relevant that discusses how to do this.

You can just upload a compiled hex file using avrdude .. I believe , never tried it , but that would do the job .

Note to self , type faster

Doesnt work. Im actually using an Adafruit board so they use a custom util for using to the board (adafruit-nrfutil). Ive followed the instructions on copying the command used by the IDE and then running it on the command line. It doesn't work, just errors out:
Opened serial port /dev/cu.usbmodem1101
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 165564
Sending DFU start packet
Timed out waiting for acknowledgement from device.

I'm just exhausted from fighting with this... it seems like it should be a total non-issue allowing a way for end users to perform updates on a device.

I’m confused

Sorry, So I am working on a project which is based on an Adafruit board which to my admittedly novice understanding is a kind of Arduino board.

So I have 2 issues that I need to solve which are basically the same:

  1. The person who will be doing assembly I want to make it easy to flash the initial software onto the device
  2. When this device is in the wild my end user may from time to time have to flash an update onto the board. My end users will be non-technical.

For #1 its possible to get an Arduino IDE set up and allow them to build/upload to the board... but I would like a way to protect my code from accidental change which is why I am asking about making a project read only.

Optimally I would have a simple way a non-technical user could push a hex file to the board which would solve both problems #1 and #2... However, I am so tired of fighting this I am considering just using the IDE and solving #1 and leaving #2 for future me to deal with.

Hopefully that clears up my question?

Specifically which Adafruit board are you using, so others can at least look at what is involved with the upload.

Have you asked Adafruit? If you go to their forum, you MAY find that someone has already done this, or their customer service may give you instructions.

If you tell us what board you have, someone here MAY write loader script for you, or at least give you the correct commands to use.

avrdude is the executable use by the Arduino IDE to program an Arduino board.

i used the following (bash) shell script to change the code running on a board (flashes LED). (assume a .bat could be written to do similar)

    set -x


    $Avr/bin/avrdude \
        -C$Avr/etc/avrdude.conf -v -V -patmega328p -carduino \
        -PCOM4 -b115200 -D -Uflash:w:$File:i

Looks like the OP is needing to use adafruit-nrfutil, so presumably the board is based on an nRF52 or something similar. Unlikely avrdude will work.

For the non-technical end user, there is probably going to be a need for this to be a self-contained Windows executable script that does not require any additional downloads, installations, setup, etc.

if he was able to use the Arduino IDE to flash the chip, shouldn't avrdude work with whatever chip he's using?

i've used the Arduino IDE to program eps32 boards

check File->Preferences->Show verbose output during -- upload and see what command is used to flash the chip

No! Other board setups use different programs to upload. AVRDude is primarely for AVR based boards.

Sorry had to go offline and do "Dad stuff".
Lot to reply to here so here goes:
gcjr: Not sure if avdude would work. When I do verbose output on the IDE its using the adafruit-nrfutil rather than avr
missdrew: Yes I have put the question on the adafruit forums but no response forthcoming. I have asked a few other questions both on their forums and discord around this issue and havent gotten anywhere.
david_2018: Its an Adafruit nRF52840. Also a self contained executable would be ideal. I would also be happy if I could create an installer like NSIS which did it. But before I can script anything like that I first need to get it to work in general.

They are read-only because the folder is read only: