用于通过sam-ba在atmel的arm芯片上编写flash的python库。
pysamloader的Python项目详细描述
简介
pysamloader是一个python库,用于在atmel的arm芯片上编写flash 通过Sam-ba。最初写于几年前,当时atmel的标准工具是 在Linux上不可用或不可用,它已被调整为服务范围更窄,但 特定用例。
具体来说,pysamloader的目的是:
- Simple, particularly for an end-user
- Easily installable across platforms
- Usable from within larger python applications or scripts
目前,pysamloader在一小部分 支持的设备。
如果您碰巧使用pysamloader,或者希望使用它,请告诉我 对于任何反馈,您可能必须确保工具稳定、可靠,并且 多才多艺。设备支持很容易添加,我会 根据需要(更重要的是,在其他设备上进行测试的能力) 呈现自己。也欢迎拉取请求。
有关包含的设备支持模块,请参阅pysamloader/devices文件夹。 当前支持的设备有:
clearpage tableofcontents clearpage
功能
pysamloader当前支持以下操作:
- Write device flash
- Optionally verify flash after writing
- Optionally set the GPNVM bits to boot from flash after writing
- Read and parse ChipID
- Read Unique Identifier from Embedded Flash
- Read Flash Descriptor
要求和安装
注意!
你可能想看看 pysamloader-gui包装 也。它提供了一个简单的gui。如果你用的是二进制软件包, 它可以独立安装和使用。
pysamloader应该在任何支持python的平台上工作。它是 最好在Linux上测试,然后在Windows上测试(10和7)。
pysamloader同时支持Python2(2.7.x)和Python3(3.5)。Python2 支持很可能在不久的将来被移除。
一般来说,pysamloader应该是pip安装的。它可以是安全的 安装到Virtualenv中。只要你有一个运行正常的python 安装足够的版本,安装pysamloader很简单:
$ pip install pysamloader
如果您需要预先构建的二进制文件,它们可用于64位Linux和 窗户。但是,请注意这些二进制文件没有经过彻底的测试, 而且您的里程可能会根据您的特定操作系统和机器而有所不同 建筑。您还必须手动复制包含的devices 文件夹到正确的位置。(见下文)
如果你想开发,修改源代码,或者获取最新的 版本,可以从git存储库的克隆(或从 源包)如下:
$ git clone https://github.com/chintal/pysamloader.git $cd pysamloader $ pip install -e .
pysamloader/devices文件夹包含包含的设备支持 模块,每个模块都是一个python文件,有一个同名的类, 包含一个设备的特定于设备的信息。此文件夹可以是 复制到可以安全添加、删除或修改的单独位置 根据需要配置设备。这个步骤通常是可选的,但是 如果您使用的是二进制软件包,则此选项是必需的。位置是提供的 通过python user_config_dir的appdirs包,具体地说:
- Linux : ^{tt16}$
- Windows : ^{tt17}$
当前的pysamloaderwindows.msi安装程序将创建此文件夹并 作为安装过程的一部分填充它。
用法
使用pysamloader的主要入口点是作为控制台脚本。
对于那些匆匆忙忙的人,下面是一个如何使用 将app.bin刻录到其uart sam-ba接口的ATSAM3U4E的脚本 可在\dev\ttyUSB1:
上访问$ pysamloader --device ATSAM3U4E --port \dev\ttyUSB1 -g app.bin
这里列出了脚本用法和参数。此帮助列表还可以是 在命令行上用pysamloader --help获取。
链接和其他信息
已知问题
- Writing 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-BA ^{tt24}$ commands, which is about 20 times slower.
未来方向
- Add support for ^{tt25}$/^{tt26}$/^{tt27}$ based backend for cases where the device disables ^{tt28}$ for 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.
链接
文档的最新版本,包括安装、使用和 api/developer注释可以在 ReadTheDocs。
源的最新版本可以在 GitHub。请使用github的功能 报告错误、请求功能或提交拉/合并请求。
pysamloader的主要作者是chintalagiri shashank。作者可以 继续必要时通过 author’s github profile。查看作者文件 合作者和/或贡献作者的完整列表(如果有的话)。
pysamloader根据 GPLv3 license。 许可证文本的副本与源文件一起提供。