2

As far as I understand it checks for a valid serial connection (new program incoming) and then either writes it to flash or starts executing the existing program.

Can't the 32u4 or EDBG fill the role of an ISP and program the MCU instead of the MCU self-programming? I know the EDBG is accessed via OpenOCD to write the bootloader to the SAMD21 on Arduino Zero boards so why is the bootloader even required?

2

The bootloader is there for convenience.

Yes, you understand what the bootloader does and how it operates. However, you have missed out one benefit, and that is evident when you're not using the bootloader. That is, when you're not using the bootloader the same connection can be used for a serial connection to the PC. If the 32U4 were directly programming the main MCU then it would be talking to the SPI pins not the UART pins, so you would need a second connection, or both a connection to the UART and the SPI pins, and much more complex firmware on the 32U4, in order to get a serial connection to the PC.

So the simplest option is just to have a dumb pass-through interface from the USB to the UART pins and have the main MCU self program with a bootloader.

It also means that you don't need any special programming hardware when making your own board - just something (another arduino maybe) to get the bootloader on there in the first place (or buy the MCU pre-programmed) and then use any TTL serial interface to program it with your main program.

  • Surely the 32U4 firmware wouldn't be that much more complex to have it switch between SPI and UART depending on the serial connection speed? (iirc it's 1200 baud to program.) – Ashlyn Black Dec 11 '15 at 16:15
  • @AshlynBlack But it's complexity that isn't needed, and would mean you need a special programmer to do anything with your own breadboard Arduino. It is far more convenient for most people to use a UART bootloader. Those that don't want a bootloader use a hardware programmer anyway, so it's a non-argument. – Majenko Dec 11 '15 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.