ATMEGA328P-PU UART bootloader suggestion... - Page 1
Forum section: electronics / general

author: muthukural001
author_rank: Regular Contributor
timestamp: November 30, 2019, 09:05:22 am
content: Hi All,I have Arduino UNO R3 board. With the development board, I have demonstrated my project. Now, I want to design a custom board with ATMEGA328P-PU (MCU) and ATMEGA16U2MU-R which act as USB to UART converter in the Arduino board.Coming to the programming the microcontroller in the Arduino board, from the Arduino IDE, I will just dump the hex which will be received by ATMEGA16U2MU-R that does USB to UART protocol conversion and send it to the ATMEGA328P-PU microcontroller over UART. The microcontroller should have had UART bootloader to flash it's internal memory with the hex received over its UART.Here, my question is that if I am buying the ATMEGA328P-PU (MCU) from Microchip instead Arduino, the microcontroller will be having the UART bootloader code on the chip (Or) I have to write the UART bootloader code myself. In the case I am writing the bootloader code, Is there any reference code that will help me.Please suggest.Thanks and Regards,Muthu

author: jhpadjustable
author_rank: Frequent Contributor
timestamp: November 30, 2019, 09:15:47 am
content: MCUs are shipped blank. You can install the standard Arduino bootloader with another Arduino, among other ways. I googled "installing arduino bootloader" and found this:https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader

author: westfw
author_rank: Super Contributor
timestamp: November 30, 2019, 10:05:39 am
content: The Arduino bootloader is open source (GPL2), and you can install it in any ATmega328p based project that you want (many other types of AVR as well.) But it is not pre-installed on chips that you buy from Microchip/Digikey/Mouser/etc, so you'll need an actual device programmer to program the chips using the ISP protocols.Current Arduino Bootloader source is here:https://github.com/arduino/ArduinoCore-avr/tree/master/bootloaders/optibootAnda more recent version of the same Optiboot Bootloader (additional features, additional chips, significant documentation) is here:https://github.com/Optiboot/optiboot(Microchip and other vendors will provide you chips that are pre-programmed with ... whatever code you want. For a fee. I haven't actually done this, but it looks like it's pretty reasonably priced (~$0.25/chip from Microchip?))

author: muthukural001
author_rank: Regular Contributor
timestamp: November 30, 2019, 12:10:23 pm
content: Hi westfw,Since the optibootloader is GPL2, I don't need to worry much about licensing in the case of my product is going for commercial.Please let me know it is good to go with Optiboot for the commercial product and how much stable it is.Thanks

author: westfw
author_rank: Super Contributor
timestamp: November 30, 2019, 10:49:40 pm
content: QuoteCorrect. IMO, it is just a OK to use Optiboot for a commercial product as it is to use linux as the OS for commercial software. Since Optiboot is completely separate from the application code, it does not "infect" the product as a whole. If you end up making change to optiboot itself, you should be prepared to make the modified optiboot source available to customers as well (that's what GPL2 says), but it doesn't affect other parts of the product.If I had been the original author instead of just the maintainer, I wouldn't have used GPL (because I regard GPL as ambiguous for deeply embedded code.) But the original author attached that license and then disappeared, and changing licenses of abandoned software is ... at best, really tricky.Arduino itself is a commercial product that uses Optiboot, and I'm sure it doesn't have any special arrangements.Stability-wise: The Optiboot version running in the Uno has been essentially unchanged since 2011. The separate Optiboot repository has had more changes, but the "releases" are in pretty good shape (and are well-tracked, and used in the MCUdude and DrAzzy alternative AVR cores.)

author: IconicPCB
author_rank: Super Contributor
timestamp: November 30, 2019, 11:55:32 pm
content: Why do you need optiboot... why not simply burn the hex file directly with an ISP programer? reduce complexity of your board?