Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flake.nix #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ To run this script you need a Python interpreter, Linux and Mac users should be

Alternatively, Docker can be used to run this script as a one-liner without the need to install dependencies, see [git-developer/ti-cc-tool](https://github.com/git-developer/ti-cc-tool) for details.

Or if you [install Nix](https://github.com/DeterminateSystems/nix-installer) you can run it like this e.g.:

```
$ nix run github:JelmerT/cc2538-bsl -- --help
```

To communicate with the uart port of the SoC you need a usb to serial converter:
* If you use the SmartRF06 board with an Evaluation Module (EM) mounted on it you can use the on-board ftdi chip. Make sure the "Enable UART" jumper is set on the board. You can have a look [here][contiki cc2538dk] for more info on drivers for this chip on different operating systems.
* If you use a different platform, there are many cheap USB to UART converters available, but make sure you use one with 3.3v voltage levels.
Expand Down
63 changes: 63 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
description = "Script to upload firmware via the serial boot loader onto the CC13xx, CC2538 and CC26xx SoC.";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
debug = true;
imports = [];
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem = { self', config, pkgs, system, ... }: {
packages.default =
let
python = pkgs.python3.withPackages (p: [
p.intelhex
p.pyserial
p.python-magic
]);
cc2538-bsl_py = builtins.path {
name = "cc2538-bsl.py";
path = ./cc2538-bsl.py;
};
in
pkgs.writeShellScriptBin "cc2538-bsl.sh" ''
${python}/bin/python3 ${cc2538-bsl_py} "$@"
'';
};
};
}