Skip to content

About

Rust Peripheral Access Crates (PACs) for TI SimpleLink wireless connectivity microcontrollers

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Texas Instruments Logo

This repository contains TI's TI SimpleLink PACs Software Development Kit (SDK).

Summary | Setup Instructions | Build Instructions | Supported Devices | Licensing | Contributions | How It Works | Developer Resources

Summary

This repository contains Peripheral Access Crates (PACs) for TI's SimpleLink series of microcontrollers. These provide a register access layer to the device for use with the Rust programming language.

All these crates are automatically generated using svd2rust.

Supported Devices

Every device family within the chip series has its own PAC. A device family is how TI groups similar devices that share the same peripherals. In this naming scheme x is a wildcard.

To prevent lots of repetition in the crates, there is one PAC per device family, not per device.

The PACs are listed below:

PAC Supported Devices TI SDK Link target
cc23x0r5 CC2340R5 https://github.com/TexasInstruments/simplelink-lowpower-f3-sdk thumbv6m-none-eabi
cc27xxx10 CC2745R10-Q1 https://github.com/TexasInstruments/simplelink-lowpower-f3-sdk thumbv8m.main-none-eabihf

Setup Instructions

Installing Dependencies

In order to generate the PACs you will need some dependencies to be installed and on your PATH. Install them by running the following:

Install rustup (Rust's toolchain manager) from Rust's Install Webpage.

Install Rust (this version is compatible with our probe-rs version)

rustup install 1.86

Set 1.86 as default if you have multiple Rust toolchains installed:

rustup default 1.86

Install other Rust deps using Cargo:

cargo xtask install-deps

This will install svd2rust and form, which are used to generate the PACS.

Updating PACs

Note: This section is only needed if you want to regenerate the PAC and SVD file.

  1. Update the SVD files in the svds folder
  2. Update or add the xcfg info as needed in input folder
  3. Run cargo xtask generate

Build Instructions

To build a PAC:

cd pacs/cc23x0r5
cargo build --target thumbv6m-none-eabi
cd pacs/cc27xxx10
cargo build --target thumbv8m.main-none-eabihf

To build and run the blinky example:

cd tests/cc23x0r5
cargo build
cargo embed
cd tests/cc27xxx10
cargo build
cargo embed

To run the tests:

cd tests/cc23x0r5
cargo test

Licensing

See the License.

Contributions

This repository is not currently accepting community contributions.

How it works

This repo tries to automate as much as possible using svd2rust. This section seeks to describe how this repo is built.

To see how the code is organized, try running the command below

$ tree -L 2

This should give an output similar to below:

.
├── Cargo.lock
├── Cargo.toml
├── LICENSE.txt
├── README.md
├── input
│   └── devices
├── pacs
│   ├── cc23x0r5
│   └── cc27xxx10
├── svds
│   ├── cc23x0r5.svd
│   └── cc27xxx10.svd
├── tests
│   ├── cc23x0r5
│   └── cc27xxx10
├── tools
│   └── generate_pacs.py
└── xtask
    ├── Cargo.toml
    └── src

The creation of pacs from the input SVD files is automated using tools/generate_pacs.py.

Input files

The input directory contains Rust files that cannot be generated via svd2rust. In general, we try to automate as much as possible and use the SVD file as a single source of truth. However, certain things such as xCFG must be hand maintained. Anything handmaintained should be kept in input.


Developer Resources

TI E2E™ design support forums | Learn about software development at TI | Training Academies | TI Developer Zone

About

Rust Peripheral Access Crates (PACs) for TI SimpleLink wireless connectivity microcontrollers

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages