Skip to content
Draft
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: 3 additions & 3 deletions flake.lock

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

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
esp32s2-idf = import ./shells/esp32s2-idf.nix { inherit pkgs; };
esp32s2-idf-rust = import ./shells/esp32s2-idf-rust.nix { inherit pkgs; };
esp32s3-idf = import ./shells/esp32s3-idf.nix { inherit pkgs; };
esp32s3-idf-rust = import ./shells/esp32s3-idf-rust.nix { inherit pkgs; };
esp32c6-idf = import ./shells/esp32c6-idf.nix { inherit pkgs; };
esp32h2-idf = import ./shells/esp32h2-idf.nix { inherit pkgs; };
esp8266-rtos-sdk = import ./shells/esp8266-rtos-sdk.nix { inherit pkgs; };
Expand Down
6 changes: 3 additions & 3 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ rec {

esp-idf-esp32 = esp-idf-full.override {
toolsToInclude = [
"xtensa-esp32-elf"
"xtensa-esp-elf"
"esp32ulp-elf"
"openocd-esp32"
"xtensa-esp-elf-gdb"
Expand All @@ -23,7 +23,7 @@ rec {

esp-idf-esp32s2 = esp-idf-full.override {
toolsToInclude = [
"xtensa-esp32s2-elf"
"xtensa-esp-elf"
"esp32ulp-elf"
"openocd-esp32"
"xtensa-esp-elf-gdb"
Expand All @@ -32,7 +32,7 @@ rec {

esp-idf-esp32s3 = esp-idf-full.override {
toolsToInclude = [
"xtensa-esp32s3-elf"
"xtensa-esp-elf"
"esp32ulp-elf"
"openocd-esp32"
"xtensa-esp-elf-gdb"
Expand Down
11 changes: 5 additions & 6 deletions pkgs/esp-idf/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{ rev ? "v5.1.3"
, sha256 ? "sha256-0QsIFOcSx1N15t5po3TyOaNvpzBUfKaFdsRODOBoXCI="
{ rev ? "v5.3"
, sha256 ? "sha256-w+xyva4t21STVtfYZOXY2xw6sDc2XvJXBZSx+wd1N6Y="
, toolsToInclude ? [
"xtensa-esp-elf-gdb"
"riscv32-esp-elf-gdb"
"xtensa-esp32-elf"
"xtensa-esp32s2-elf"
"xtensa-esp32s3-elf"
"xtensa-esp-elf"
"esp-clang"
"riscv32-esp-elf"
"esp32ulp-elf"
Expand Down Expand Up @@ -73,7 +71,8 @@ let
esp-idf-monitor
esp-idf-size
esp-idf-panic-decoder

esp-idf-nvs-partition-gen
pyclang
freertos_gdb

# The esp idf vscode extension seems to want pip, too
Expand Down
41 changes: 39 additions & 2 deletions pkgs/esp-idf/python-packages.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Versions based on
# https://dl.espressif.com/dl/esp-idf/espidf.constraints.v5.1.txt
# on 2023-07-05.
# https://dl.espressif.com/dl/esp-idf/espidf.constraints.v5.2.txt
# on 2024-02-20.

{ stdenv
, lib
Expand Down Expand Up @@ -210,5 +210,42 @@ rec {
homepage = "https://github.com/espressif/esp-idf-panic-decoder";
};
};

esp-idf-nvs-partition-gen = buildPythonPackage rec {
pname = "esp-idf-nvs-partition-gen";
version = "0.1.2";

format = "pyproject";

src = fetchPypi {
pname = "esp_idf_nvs_partition_gen";
inherit version;

sha256 = "sha256-HjW5RCKfy83LQgAs0tOW/f9LPVoLwHY1pyb6ar+AxwY=";
};

propagatedBuildInputs = [
setuptools
cryptography
];

doCheck = false;

meta = {
homepage = "https://github.com/espressif/esp-idf-nvs-partition-gen";
};
};

pyclang = buildPythonPackage rec {
pname = "pyclang";
version = "0.4.2";

src = fetchPypi {
inherit pname version;
sha256 = "sha256-vuDZ5yEhyDpCmkXoC+Gr2X5vMK5B46HnktcvBONjxXM=";
};

doCheck = false;
};
}

10 changes: 5 additions & 5 deletions pkgs/esp-idf/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ let
toolFhsEnvTargetPackages = {
xtensa-esp-elf-gdb = pkgs: (with pkgs; [ ]);
riscv32-esp-elf-gdb = pkgs: (with pkgs; [ ]);
xtensa-esp32-elf = pkgs: (with pkgs; [ ]);
xtensa-esp32s2-elf = pkgs: (with pkgs; [ ]);
xtensa-esp32s3-elf = pkgs: (with pkgs; [ ]);
xtensa-esp-elf = pkgs: (with pkgs; [ ]);
esp-clang = pkgs: (with pkgs; [ zlib libxml2 ]);
riscv32-esp-elf = pkgs: (with pkgs; [ ]);
esp32ulp-elf = pkgs: (with pkgs; [ ]);
Expand Down Expand Up @@ -91,8 +89,10 @@ let
installPhase = let
wrapCmd = if system == "x86_64-linux" then
''
mv $FILE_PATH $FILE_PATH-unwrapped
makeWrapper ${fhsEnv}/bin/${pname}-env $FILE_PATH --add-flags "$FILE_PATH-unwrapped" ${lib.strings.concatStringsSep " " exportVarsWrapperArgsList}
[ ! -d $out/unwrapped_bin ] && mkdir $out/unwrapped_bin
WRAPPED_FILE_PATH="$out/unwrapped_bin/$(basename $FILE_PATH)"
mv $FILE_PATH $WRAPPED_FILE_PATH
makeWrapper ${fhsEnv}/bin/${pname}-env $FILE_PATH --add-flags $WRAPPED_FILE_PATH ${lib.strings.concatStringsSep " " exportVarsWrapperArgsList}
''
else
''wrapProgram $FILE_PATH ${lib.strings.concatStringsSep " " exportVarsWrapperArgsList}'';
Expand Down
2 changes: 1 addition & 1 deletion shells/esp32s2-idf-rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pkgs.mkShell {
shellHook = ''
# fixes libstdc++ issues and libgl.so issues
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ pkgs.libxml2 pkgs.zlib pkgs.stdenv.cc.cc.lib ]}
export ESP_IDF_VERSION=v4.4.1
export ESP_IDF_VERSION=v5.3
export LIBCLANG_PATH=${pkgs.llvm-xtensa-lib}/lib
export RUSTFLAGS="--cfg espidf_time64"
'';
Expand Down
42 changes: 42 additions & 0 deletions shells/esp32s3-idf-rust.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ pkgs ? import ../default.nix }:
pkgs.mkShell {
name = "esp-idf";

buildInputs = with pkgs; [
esp-idf-esp32s3

# Tools required to use ESP-IDF.
git
wget
gnumake

flex
bison
gperf
pkg-config
cargo-generate

cmake
ninja

ncurses5

llvm-xtensa
llvm-xtensa-lib
rust-xtensa

ldproxy
espflash

python3
python3Packages.pip
python3Packages.virtualenv
];
shellHook = ''
# fixes libstdc++ issues and libgl.so issues
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ pkgs.libxml2 pkgs.zlib pkgs.stdenv.cc.cc.lib ]}
export ESP_IDF_VERSION=v5.3
export LIBCLANG_PATH=${pkgs.llvm-xtensa-lib}/lib
export RUSTFLAGS="--cfg espidf_time64"
'';
}