0

On this page http://playground.arduino.cc/Bootloader/DueBootloaderExplained it mentions the sam-ba bootloader is permanently burned into the rom of the chip.

Does this mean even if I buy a new chip from Farnell, it will still have the bootloader in or is just ones that are specifically made for the arduino due?

That is different from say the mega328, with the mega328 I have to burn the bootloader on manually using isp programmer/ buy it preprogrammed.

1 Answer 1

2

Yes, for the Due, but No, for a Zero or Adafruit Feather M0.

The Due uses the Atmel SAM3X8E featuring:

16 Kbytes ROM with embedded bootloader routines

As a ROM the contents are fixed during manufacture, so would be there in a new chip.

However it is worth noting that many SAM devices including this one have the NVM bits that are much like the fuse bits on an ATmega. Here GPNVM bit 1 defaults to 0, enabling the bootloader, but if set to 1 the bootloader will be skipped. Hence it may well be possible to get one into a state where the bootloader is not available. They also have an "erase" pin which if driven high during startup will restore the default state (bootloader invoked) of this NVM bit (and erase whatever you put in flash).


In contrast, the Arduino Zero and the Adafruit Feather M0 also use Atmel "SAM" chips with "SAM-BA", however, they use the SAMD21, where the situation is a bit different:

Unlike existing SAM products, ROM monitor is not available in SAM D21 and SAM-BA will be loaded in Flash memory.

SAM-BA bootloader is not factory programmed on SAM D21 devices and has to be programmed using an external programmer.


Incidentally, congratulations on being willing to step beyond the ATmega DIP packages - more people need to learn that surface mounts part (or at least the TSSOP and LQFP varieties) are something that can be worked with by hand. If you do not have hot air tools, make sure to only solder one corner, check alignment, solder the opposite and recheck, etc. But hot air will save you so many headaches and a solder station with it is now in the $60-70 range.

Finally, while you do have the bootloader available in the SAM, to really take advantage of all of its capabilities you will want to get an SWD interface - in addition to programming without reliance on the bootloader, this exposes things like breakpoint debugging, which while almost never "necessary" can still be quite convenient and useful. Atmel used to offer a great deal on the PCB of the SAM-ICE pod less cables kit and housing, unfortunately there was a massive price increase after the Microchip acquisition.

SWD programming is effectively vendor-unique software operations performed on top of a standard signalling scheme, so you do have options for programmers from other sources - you can make a functional if quite slow CMSIS-DAP from an MBED board (or apparently an Arduino Pro Micro) that will work for debugging but be slow at flashing, you can probably use a Raspberry pi, or the more advanced FTDI devices with the MPSSE engine such as FT232H/FT2232H/FT4232H (but not the everyday FT232RL). With alternate programmers you will probably need to use something like openocd for the host software - Atmel Studio likely only supports their own and perhaps a few pricey alternatives.

1
  • 1
    Just out of curiosity what programmer would I need to program this chip if I wanted to use an external programmer. Say I wanted to change some fuses and update the firmware for example.
    – Ageis
    Jan 8, 2017 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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