11

The answer needs to have multiple parts: Yes, in principle you can create a bootloader for any microcontroller, which acts like the Arduino's. Please be aware that there are different bootloaders, not just the common STK500 compatible one. Each of these bootloaders implements a certain protocol to transfer the binary code to the target system. ...


5

The Optiboot version 7 has a do_spm function which can be called from application. The Optiboot repository contains an example for the use of this function. SPM is the AVR CPU instruction to write to flash memory. The Optiboot wraps this in a function. A pointer to this function is put in a 'vector table' at the beginning of the bootloader. The first pointer ...


3

There is a solution with SD card and SD bootloader. You put a bin file on SD card, insert it into the SD adapter and power up the Arduino. The bootloader loads the bin file to flash memory. I use 'avr_boot' SD bootloader by Zevero. It reads a file named firmware.bin from SD card if present and loads it into flash. To generate a bin file for Arduino AVR ...


2

I can see you are on Linux so I won't give you instructions for using AVR Studio - but do know that if you have access to a Windows machine that is another option you could try. I can't tell you exactly why it is not working through the Arduino IDE - it could be that the settings are not set correctly or any number of reasons. What I can say is that it is ...


2

It seems that you are using a lm317 voltage regulator to power your atmega328p MCU but I think you forgot the part that lm317 needs feedback of 1.25v with voltage divider network to set its variable output voltage in the schematic you have connected adj pin of lm317 directly to GND. S0 check your output vtg from your regulator and another issue voltage ...


2

The Arduino builder creates for AVR boards not only hex file for the sketch, but it creates a combined hex with bootloader and sketch too. It is for example for Blink.hex a Blink_with_bootloader.hex. If you use in IDE the "Export compiled binary" command in Tools menu, the builder puts the hex files next to ino file in your sketch folder. If you want the ...


2

You cannot just load a sketch into any microcontroller, because every microcontroller has different memory layout, peripherals, ways of uploading, FLASH size etc. You can use the atMega (or any microcontroller) for production purposes though. Of course each MCU type has operation conditions (like min/max temperature), so in e.g. automotive or military ...


2

The bootloader is a 'program' that resides inside the Atmel IC and makes that IC an 'Arduino'. The bootloader takes care that a sketch can be retrieved by UART (via the USB) and stored inside the Arduino. The programmer is an external hardware device that can upload a sketch without using the bootloader. Another Arduino can also be used as programmer. In ...


2

NodeMCU and "Wemos D1 R2 and Mini" esp8266 (esp-12) pins and io overview Serial RX io3 RX0 TX io1 TX0 boot config pins with pullup or pulldown on board D3 io0 PULLUP (LOW for boot to flashing mode) D4 io2 TX1 PULLUP (Serial1 TX. no RX for Serial1) D8 io15 PULLDOWN (SS pin if esp8266 is SPI slave); TX if Serial.swap() untroubled GPIOs with optional ...


1

The source of Optiboot on Uno is here. I would prefer a simple watchdog reset with wdt_enable(WDTO_15MS); while (true); But I am not sure now if it runs sketch upload detection in bootloader. For direct jump to Optiboot on Uno (one flash page) this should work typedef void (*bootloader_jump_t)(); const bootloader_jump_t bootloader_jump = (...


1

The MCU on the Uno R3 comes with a specific bootloader (Optiboot) and fuse configuration (external clock, clock prescaler disabled, bootloader enabled...). You may find some ATmega328Ps on the market that have been specifically configured as drop-in replacements for the one on an Uno. Those should “just work”. If the ones you bought come with a different ...


1

This isn't the exact answer but it helps. Uploading without avrdude is complicated and generally slow. The best solution to not using the IDE is to open and close a port then use the avrdude command that the ide usually uses. from serial import Serial from time import sleep from subprocess import run while input('Press enter to upload ') == '': Serial('...


1

It sounds like you have a newer board than the version of Micronucleus in the Arduino package. As I discovered here you basically need to upgrade micronucleus in your Ardino installation, which you can download from here Download the zip file from Github and extract it. Then in a terminal (if you're not already in one) go to the directory you extracted. ...


1

Problem solved, i did put two capacitors way to big on the XTAL's pins, which was making the crystal unable to resonate. Thanks to @Wirewrap for finding the mistake


1

The Arduino 'device' is identified by the USB device code of the USB to TTL Serial on Arduino or by core code in case of MCU with native USB. The USB ids are written to the USB chip in factory or are part of the firmware/core and they are listed in boards.txt file so that the IDE then knows what Arduino is attached. If you use a common FTDI it doesn't have ...


1

Problem solved. The standalone CH340-based converter for whatever reason isn't man-enough to reliably pull down the RX0 line when connected to the Mega 2560 (also with a CH340 converter on board). I've seen suggestions posted in various places that this can be a problem with respect to DTR (though I don't have a problem with it). My solution is to insert a ...


1

The bootloader doesn't care about how many pins the device has. All it cares about is the UART pins, and they are the same. Internally the two chips are the same, it's just the packaging that is different. They take the same silicon chip and mount it on a different lead frame and encapsulate it in epoxy. Which is why the only pin differences are a couple of ...


1

There is no specific piece of hardware that does what you ask. There are various options though: Write a new bootloader that uses the USB Host Shield to load data from a USB MSD device then flash it to the internal flash of the MCU (hard to do if you don't know low-level programming) Use an embedded Linux computer (Raspberry Pi, etc) to run avrdude and ...


1

You can use a second Arduino as a standalone programmer for it, either to upload your sketch directly, or to upload a bootloader (after which you'd upload your sketch in the normal way). The example program, ArduinoISP, uploaded into the second Arduino is what can do this. Here is a link to a how-to article for doing just that. If you haven't already ...


1

It seems that you are using too high programming speed. SCK period al of 0.1 us renders 10 MHz, which is to fast if crystal is working at 8 MHz. Not sure where to change it in Arduino environment, but you should add this key to avrdude.exe run string: avrdude.exe -B 8 This will set programming speed to 125 kHz. Also I suggest you to buy a cheap USBasp ...


1

use Zadig 2.4 to change the driver for USBasp. USBasp works with 3 drivers but it seems the type of installed driver causes some problems in various software. khazama, progisp on one hand and Arduino on the other hand. despite all of them using avrdude. libusb-win32 : khazama works, Arduino does not WinUSB : khazama doesn't work, Arduino works ...


1

I managed to figure this out after hours of searching. I wanted to flash the new Nano bootloader to my Nano, but it would fail with the same error as you. For some reason, after Arduino 1.8.5, AVR boards with "Arduino as ISP" were changed so that they no longer work for me. The solution for me was to revert programmers.txt to what it was on 1.8.5, i.e. ...


1

I got this same error when my Arduino COM port was busy with other apps. I closed that app and upload Arduino sketch and error disappeared.


Only top voted, non community-wiki answers of a minimum length are eligible