Support for ATSAMD21E18 (SAMD21E) and BOSSA for Arduino

820 views
Skip to first unread message

Alex Albino

unread,
Mar 24, 2015, 7:41:03 AM3/24/15
to devel...@arduino.cc
Hello folks!

I'd like to contribute to work between the SAM D21 line of chips and integration into the Arduino eco system. 

So far, I have an open source schematic, and a write up showing how to get the SAM-BA bootloader on to an ATSAMD21E18.

Additionally, I've also forked the BOSSA github repo, and added support for the ATSAMD21E line of chips. The ATSAMD21J18A, and the ATSAMD21G18A was already supported. Simply adding in flash and firmware details to the source code and recompiling did the trick (they all share similar settings).

You can see what I've been changing in the (now not as welcome?) settings for "Arduino 1.5.8.3" from the *other* Arduino site. Here's the related thread on the matter: https://github.com/femtoduino/femto-usb/issues/1

I'll keep working on this to (hopefully) have another board supported by the Arduino IDE. Next up is loading the 'Arduino Zero' bootloader to the ATSAMD21E18 and attempting to 'talk' with it using my forked version of BOSSA, then having the Arduino IDE use it too.


Cristian Maglie

unread,
Mar 24, 2015, 7:59:58 AM3/24/15
to devel...@arduino.cc
Hi Alex,

Il 20/03/2015 02:15, Alex Albino ha scritto:
> Additionally, I've also forked the BOSSA github repo, and added support
> for the ATSAMD21E line of chips. The ATSAMD21J18A, and the ATSAMD21G18A
> was already supported. Simply adding in flash and firmware details to
> the source code and recompiling did the trick (they all share similar
> settings).

I've another PR on bossac pending on my todo list, if you want to
contribute your patch for ATSAMD21E too so I can pick everything in one
go you're very welcome! :-)

> You can see what I've been changing in the (now not as welcome?)
> settings for "Arduino 1.5.8.3" from the *other* Arduino site. Here's the
> related thread on the
> matter: https://github.com/femtoduino/femto-usb/issues/1

I see the changes you posted on github, IMHO they can be easily imported
(with very small tweaking) to our Zero's core once released.

> I'll keep working on this to (hopefully) have another board supported by
> the Arduino IDE. Next up is loading the 'Arduino Zero' bootloader to the
> ATSAMD21E18 and attempting to 'talk' with it using my forked version of
> BOSSA, then having the Arduino IDE use it too.

BOSSA should work (almost) out-of-the-box with the stock sam-ba
bootloader provided by Atmel (even if it can be very slow to upload). We
are working on a modified version of the bootloader to improve upload
speed while keeping backward compatibility, but you must wait for the
release to see it.

C


--
Cristian Maglie <c.ma...@arduino.cc>

Alex Albino

unread,
Mar 25, 2015, 4:54:59 PM3/25/15
to devel...@arduino.cc
What fork and branch of BOSSA should I submit a merge request to? I have a fork of BOSSA, but I've merged the 'arduino' branch into my own 'master' branch, as the original 'master' branch was rather out dated.
At worse, I can just fork again, and re-add my simple changes.

 - Alex

Alex Albino

unread,
Mar 25, 2015, 5:12:28 PM3/25/15
to devel...@arduino.cc
Hi Cristian, I've submitted a merge request between 'shumatech:arduino' and 'zrecommerce:arduino'. See https://github.com/shumatech/BOSSA/pull/9

--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+...@arduino.cc.

Taylor Alexander

unread,
Mar 25, 2015, 8:28:25 PM3/25/15
to devel...@arduino.cc
Hello all!
I also have a change to BOSSA needed to support Flutter's SAM3S1A and SAM3S2A processors. It is a two-line change to add the flash ID, apparently similar to these other changes. I have only determined the FlashID for the SAM3S1A CPU for now but I should get some of the others and figure that out. Looks like I can just submit a pull request to shumatech, but I thought Arduino used a slightly different version of the BOSSA code? Should we submit to shumatech and then get Arduino to merge the changes?

Also, how does one compile BOSSA on Windows and Mac? Does anyone have a guide? Thanks!

Alex Albino

unread,
Mar 26, 2015, 12:41:47 AM3/26/15
to devel...@arduino.cc
Hi Taylor, perhaps we can work on refactoring the ID detection routine. As it currently stands, it's just a bunch of conditional logic. Perhaps we can refactor to use some kind of settings file (JSON? INI? XML?)
Where is your github fork of BOSSA? Perhaps we can collaborate.

Cristian Maglie

unread,
Mar 26, 2015, 5:50:22 AM3/26/15
to devel...@arduino.cc
Il 26/03/2015 01:28, Taylor Alexander ha scritto:
> Hello all!
> I also have a change to BOSSA needed to support Flutter's SAM3S1A and
> SAM3S2A processors. It is a two-line change to add the flash ID,
> apparently similar to these other changes. I have only determined the
> FlashID for the SAM3S1A CPU for now but I should get some of the others
> and figure that out. Looks like I can just submit a pull request to
> shumatech, but I thought Arduino used a slightly different version of
> the BOSSA code? Should we submit to shumatech and then get Arduino to
> merge the changes?

Hi,

it seems that bossa is gaining in popularity, so let me clarify a bit
how we get to the current situation.

Two years ago I used bossac with the SAM3X (for the Arduino Due), the
support for this CPU in bossac was implemented but not working. I asked
for tech support to the original author Scott Shumate and he was very
kind and quickly fixed the problem.

Unfortunately I discovered a lot of subtle stability issues while
testing bossac with linux and mac, in particular when I tried to upload
from the native USB port. I must say that these issues was caused by
bugs on sam-ba bootloader and I solved by adding a bunch of workarounds
in bossac. At the time the number of patches was large and very SAM3X
specific, so it looked like they won't make their way into the upstream
project, but Scott agreed to give me push access to the repository to
maintain an "arduino" branch that I keep synchronized with the "master"
branch.

Going back to now: the "arduino" branch has gained the support for the
SAMD21 and some more feature that are missing from the "master" branch.

On the other side, while the command line version of bossac is working
fine on the "arduino" branch, I cannot say the same for the GUI because
I haven't had the time to test it (the main functions should work but
probably there were some little tweaks to do).

Said that, Taylor, if you want to make a simple pull request on the
"arduino" branch, I'm happy to quickly merge it. Instead if there is a
wish to do a major refactoring of the project it may be the case to get
in touch with Scott again and see how we can coordinate to reduce the
number of different forks. In this case we should also move the
discussion away from this mailing list that is mainly focused on Arduino.

> Also, how does one compile BOSSA on Windows and Mac? Does anyone have a
> guide? Thanks!

There is a Makefile, to build the command line tool you can run:

make bin/bossac

or

make bin/bossac.exe

on windows (I'm using mingw32 to build).
If you want to build also the GUI you must install wxwidgets library
with headers and simply run "make".

C
> https://github.com/femtoduino/__femto-usb/issues/1
> <mailto:developers+...@arduino.cc>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Developers" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to developers+...@arduino.cc
> <mailto:developers+...@arduino.cc>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to developers+...@arduino.cc
> <mailto:developers+...@arduino.cc>.

Alex Albino

unread,
Mar 26, 2015, 11:38:36 AM3/26/15
to devel...@arduino.cc
Hi Christian,

Thank you for merging my changes to the arduino branch.

My main goal with this thread is to get *Arduino* working with the patched version of BOSSA (and not just patch BOSSA). It would be incredibly useful to upload sketches using the native USB port on the SAM D21 chips using the SAM-BA boot loader, since this would simplify people's introduction to ARM designs (and in particular ARM Designs with Arduino as the 'toolchain')

I hope this makes sense. I just want people to have an easy way of leaning to work with ARM chips using Arduino.

Alex Albino

unread,
Apr 2, 2015, 2:37:08 PM4/2/15
to devel...@arduino.cc
I've forked the Arduino (cc) github repo, should I base my work on any particular branch? (I may have missed a README instruction on this)
...If there's no particular workflow rules (or Arduino can't share the samd21 work yet), I can just make a 'dev-samd21' branch and save my work there.

Alex Albino

unread,
Apr 2, 2015, 4:21:00 PM4/2/15
to devel...@arduino.cc
...never mind, read the Arduino Forums guideline. Again, thank you. :-)

Martin Manduch

unread,
Jul 5, 2016, 11:50:26 AM7/5/16
to Developers
Hi All,

I'd like to use BOSSA to upload programs to SAMD21E16A. I've changed all parameters in the sources (bossa, arduino branch) on my computer. I don't know, how to set these two constants. 

ATSAMD21E16A_BUFFER_ADDR

ATSAMD21E16A_STACK_ADDR


Could you help me? What they actually mean?  My blind guesses 0x20001000ul,0x20002000ul  and then 0x20000500ul, 0x20001000ul ended with write error or verify error.



Dňa utorok, 24. marca 2015 12:41:03 UTC+1 Alex Albino napísal(-a):
Reply all
Reply to author
Forward
0 new messages