Skip to content

Commit

Permalink
Add flake.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
mausch committed Nov 9, 2024
1 parent 208cf7a commit 852371c
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
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} "$@"
'';
};
};
}

0 comments on commit 852371c

Please sign in to comment.