I have used an arduino to create an ECU for a home built jet engine. I had to connect some fuel pumps to D4 and D13 to utilise the higher frequency PWM they provide. Unfortunately, the standard boot loader also “flashes” D13 pin on power up which injects a load of fuel into the engine whilst it’s not running which is very bad for my application. To get around this I am having to remove the fuel pump fuse every time I power on the ECU.
I would like to change the boot loader to remove the Led “flashes”. I tried to modify the standard stk500 one for many hours last summer to no success, and I am basically out of my depth.
I came across Optiboot but can’t compile it despite downloading various software such as winAVR and adding things to my system path. I go to cmd, navigate to the optiboot directory either within the arduino hardware folder, or the master one I downloaded from github, enter the command to make a hex file using the correct options, then get an error make (e=2) the system cannot find the file specified.
Would anyone be able to provide an optiboot bootloader hex file for mega2560 with no led flashes?
And assuming I can get one of those and program it via ISP, thereafter what changes do I need to make in arduino environment to download sketches - just change the hex file reference in boards.txt for the mega2560?
Wow A huge Thankyou for the files and assistance, that was fast!!
I was indeed trying to build it in windows command prompt, is that incorrect?
I considered downloading directly without bootloader, but the arduino sits upside down on a custom pcb (similar to a shield) and all of that is inside an enclosure in the bike, so the icsp headers are not accessible when fitted. I need to be able to make code changes “on the fly” when running the engine!
I tried inserting the optiboot hex from westfw, was able to program this using AVRDUDESS gui and a usbasp clone.
I modified the arduino boards.txt and added an option referencing the same optiboot hex. I tried to download a sketch from arduino IDE (equivalent to bare minimum, but just declaring pin 13 as output and writing it low) but it wouldn’t write and threw an error.
I tried downloading the same sketch using the megacore library in arduino ide and it worked… but pin13 (onboard led) still sits high for around a second upon booting - doesn’t flash twice though!
I repeated the above process using the stk500 hex file from missdrew for avrdudess, then download sketch in ide selecting the normal mega board and processor option. This downloads and does the same, around 1 sec high on pin13 with no flash.
Finally I setup a second arduino and used arduino as ISP, to download the sketch directly without a bootloader. This had just a very rapid flash of pin13 upon powering the arduino.
Looks like it’s not really possible to actually stop it altogether!!
I can assure you that with LED_START_FLASHES=0, the bootloader does not touch the onboard LED at all.
However, the pin will be set as an input by the reset hardware itself, and may "float" in one direction or another, depending on exactly what is connected to it. You may need a pull-down resistor to keep the pin reliably low during this time.