Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.1 instead.
Reason given by maintainers: Wheels lack the BSD-3-Clause notice for the bundled bossac binary. Use 0.1.1 or later.

bossac-wrapper

A thin Python wrapper for bossac by ShumaTech - a flash programmer for Atmel SAM microcontrollers with a SAM-BA bootloader, such as the Arduino Due, Arduino Zero and MKR boards.

Installation

pip install bossac-wrapper

This will install bossac-wrapper along with the necessary bossac binary for your system.

bossac-wrapper requires Python 3.10 or later. Supported platforms are:

  • Linux (x86_64, arm64)
  • macOS (Intel, Apple Silicon)
  • Windows (x86_64)

Examples

Uploading a firmware file

To upload a firmware file to a device, use the upload() function. Both Intel HEX files (.hex) and raw binaries (.bin) are supported.

import bossac
import logging

logging.basicConfig(level=logging.INFO)
bossac.upload('blink.hex', port='/dev/ttyACM0')

By default, the device is first put into its bootloader with a 1200 baud touch. Its flash is then erased, written and verified, and the device is reset to start the new firmware. The progress will be logged:

INFO:bossac:Erase flash
INFO:bossac:Done in 0.887 seconds
INFO:bossac:Write 10288 bytes to flash (161 pages)
INFO:bossac:Done in 0.067 seconds
INFO:bossac:Verify 10288 bytes of flash
INFO:bossac:Verify successful
INFO:bossac:Done in 0.276 seconds
INFO:bossac:Set boot flash true

An Intel HEX file carries its addresses, so it is flashed at the right offset on any board. A binary file doesn't, so its offset has to be given - it depends on the board's bootloader, e.g. 0x2000 on SAMD21 boards with an Arduino-style bootloader, or 0 on the Arduino Due, whose bootloader is in ROM. On a board whose bootloader is in flash, an offset of 0 would overwrite it.

bossac.upload('blink.bin', port='/dev/ttyACM0', offset=0x2000)  # SAMD21

When uploading via a USB-to-serial bridge, such as the programming port of the Arduino Due, pass usb=False:

bossac.upload('blink.bin', port='/dev/ttyACM0', offset=0, usb=False)

Getting device information

To get the details of a device, use the info() function. The device must be in its bootloader, e.g. after double-tapping its reset button. touch=True puts it there, too - but that usually destroys the firmware, which then has to be uploaded again: the Arduino Due erases its flash, and SAMD boards running Arduino firmware erase its first flash row.

import bossac

bossac.info(port='/dev/ttyACM0')

For a SparkFun SAMD21 Mini, this returns:

{
    'device': 'ATSAMD21x18',
    'version': 'v1.1 [Arduino:XYZ] Feb 20 2019 10:43:51',
    'address': 0,
    'pages': 4096,
    'page_size': 64,
    'total_size': 262144,
    'planes': 1,
    'lock_regions': 16,
    'locked': [],
    'security': False,
    'boot_flash': None,
    'brownout_detection': True,
    'brownout_reset': True,
}

Full Documentation

The full API documentation is available here.

License Coverage CI PyPI

Metadata

Release files for bossac-wrapper 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bossac-wrapper 0.1.0
File Size Uploaded Provenance Actions
bossac_wrapper-0.1.0.tar.gz 49.7 kB Without provenance Details for bossac_wrapper-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for bossac-wrapper 0.1.0
File Actions
bossac_wrapper-0.1.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for bossac_wrapper-0.1.0-py3-none-win_amd64.whl
bossac_wrapper-0.1.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for bossac_wrapper-0.1.0-py3-none-manylinux_2_28_x86_64.whl
bossac_wrapper-0.1.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for bossac_wrapper-0.1.0-py3-none-manylinux_2_28_aarch64.whl
bossac_wrapper-0.1.0-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for bossac_wrapper-0.1.0-py3-none-macosx_11_0_x86_64.whl
bossac_wrapper-0.1.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for bossac_wrapper-0.1.0-py3-none-macosx_11_0_arm64.whl

Total release size: 1.1 MB

Release files / bossac_wrapper-0.1.0.tar.gz

Download URL bossac_wrapper-0.1.0.tar.gz
Size 49.7 kB
Tags Source
SHA-256 checksum
How to use checksums
eecf2e2780520b5851f32f18b412ee683cb739149bbffd424bdf7334b4f0cb0b
BLAKE2b-256 checksum
How to use checksums
7c1975a380bc936ad52c27107de2a45a881d5ffdb31776d921b0c45cd3bac62c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bossac_wrapper-0.1.0-py3-none-win_amd64.whl

Download URL bossac_wrapper-0.1.0-py3-none-win_amd64.whl
Size 135.3 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
884d124ad39d8e7a84f2890edfe7c1c822a5b632032c3c1e7a7ed1db0fb109e3
BLAKE2b-256 checksum
How to use checksums
d38ab090c6f6302f7d6c93e512740a801b04535226893e5d4b0a1d498a15f19b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bossac_wrapper-0.1.0-py3-none-manylinux_2_28_x86_64.whl

Download URL bossac_wrapper-0.1.0-py3-none-manylinux_2_28_x86_64.whl
Size 421.5 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
936f384756e9ff0c5266ebd5358bf8ebcd0716881126731e3db3d456cb7e83dc
BLAKE2b-256 checksum
How to use checksums
1d6bb8462224113948320c3f097b9d9484aefbca8789bd20a0967fec7bb11566
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bossac_wrapper-0.1.0-py3-none-manylinux_2_28_aarch64.whl

Download URL bossac_wrapper-0.1.0-py3-none-manylinux_2_28_aarch64.whl
Size 403.6 kB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
285a29ac5c13d7c907c4e5c2dcd2d3240eedfab2c886fb320c9e55b0e36ec820
BLAKE2b-256 checksum
How to use checksums
cc3bced35c4088d76b30dd3c29fbf01494e4e52a00897aaa700a1ff121ddf77d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bossac_wrapper-0.1.0-py3-none-macosx_11_0_x86_64.whl

Download URL bossac_wrapper-0.1.0-py3-none-macosx_11_0_x86_64.whl
Size 51.0 kB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
dce2b58c0992dc6d357ae2b1bd1ba4637d454107aeb8eac46d07fdc3aea55e27
BLAKE2b-256 checksum
How to use checksums
9bd2969bae837ec27a45b3c14af4afde8152756a429962221cca9dc68ced6bca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bossac_wrapper-0.1.0-py3-none-macosx_11_0_arm64.whl

Download URL bossac_wrapper-0.1.0-py3-none-macosx_11_0_arm64.whl
Size 87.9 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b230eedd458012448e767425074030cd355f260b648d148473826d3c1f790482
BLAKE2b-256 checksum
How to use checksums
2809e53bc44b2969cec3661b435a3403fc3927ae384fb871851eaf68dd32c3fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for bossac-wrapper 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

6 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page