Package: pysamloader
Introductionpysamloaderis a python library for writing flash on Atmel’s ARM chips
via SAM-BA. Originally written years ago when Atmel’s standard tools were
unavailable or unusable on Linux, it has been adapted to serve narrower but
specific use cases.Specifically,pysamloaderis intended to be :Simple, particularly for an end-userEasily installable across platformsUsable from within larger python applications or scriptsCurrently,pysamloaderseems to be reasonably stable on a tiny set of
supported devices.If you happen to usepysamloader, or wish to use it, let me know along
with any feedback you might have to ensure the tool is stable, reliable, and
sufficiently versatile. Device support is easy enough to add, and I will do
so as the need (and more importantly, the ability to test on other devices)
presents itself. Pull requests are also welcome.See thepysamloader/devicesfolder for included device support modules.
Currently supported devices are :clearpage
tableofcontents
clearpageFeaturespysamloadercurrently supports the following actions :Write device flashOptionally verify flash after writingOptionally set the GPNVM bits to boot from flash after writingRead and parse ChipIDRead Unique Identifier from Embedded FlashRead Flash DescriptorRequirements & InstallationAttention!You might want to take a look at thepysamloader-guipackage
as well. It provides a simple GUI. If you are using the binary packages,
it can be installed and used independent of this.pysamloadershould work on any platform which supportspython. It is
best tested on Linux followed by on Windows (10 and 7).pysamloadersupports both Python 2 (2.7.x) and Python 3 (>3.5). Python 2
support is likely to be removed in the near future.In general,pysamloaderis expected to be pip-installed. It can be safely
installed into a virtualenv. As long as you have a functioning python
installation of sufficient version, installingpysamloaderwould be simply :$pipinstallpysamloaderIf you require pre-built binaries, they are available for 64-bit Linux and
Windows. However, be aware that these binaries are not thoroughly tested,
and your mileage may vary based on your specific operating system and machine
architecture. You will also have to manually copy the includeddevicesfolder to the correct location. (See below)If you wish to develop, modify the sources, or otherwise get the latest
version, it can be installed from a clone of the git repository (or from a
source package) as follows :$gitclonehttps://github.com/chintal/pysamloader.git$cdpysamloader$pipinstall-e.Thepysamloader/devicesfolder contains the included device support
modules, each of which is a python file with a single class of the same name,
containing device specific information about one device. This folder can be
copied into a separate location where you can safely add, remove, or modify
device configuration as needed. This step is generally optional, but will be
required if you are using the binary packages. The location is that provided
byuser_config_dirof the pythonappdirspackage, specifically :Linux :~/.config/pysamloaderWindows :C:\Users\<username>\AppData\Roaming\QuazarTechnologies\pysamloaderThe currentpysamloaderwindows .msi installer will create this folder and
populate it as a part of the install process.UsageThe primary entry point for use ofpysamloaderis as a console script.For those in a hurry, the following is a quick example of how to use the
script to burnapp.binto anATSAM3U4Ewhose UART SAM-BA interface
is accessible on\dev\ttyUSB1:$pysamloader--deviceATSAM3U4E--port\dev\ttyUSB1-gapp.binScript usage and arguments are listed here. This help listing can also be
obtained on the command line withpysamloader--help.Links & Other InformationKnown IssuesWriting to multiple flash planes is not currently supported. This
application will always write to the first flash plane and will start at
the beginning.The use of xmodem send file to write flash doesn’t seem to work. Flash is
instead written using SAM-BAwrite_wordcommands, which is about 20
times slower.Future DirectionsAdd support forlibftdi/libd2xx/libusbbased backend for cases
where the device disablesftdi_siofor its normal operation.Add hooks for device auto-detection. Do not even bother to probe blindly
for SAM-BA - that is too dangerous. Instead rely on apriori knowledge of
signatures of device configuration, including VID, PID, Manufacturer,
Product, Serial Number, and USB endpoint descriptors.LinksThe latest version of the documentation, including installation, usage, and
API/developer notes can be found atReadTheDocs.The latest version of the sources can be found atGitHub. Please use GitHub’s features
to report bugs, request features, or submit pull/merge requests.The principle author forpysamloaderis Chintalagiri Shashank. The author can
be contacted if necessary via the information on theauthor’s github profile. See the AUTHORS file
for a full list of collaborators and/or contributing authors, if any.pysamloaderis distributed under the terms of theGPLv3 license.
A copy of the text of the license is included along with the sources.