37 lines
800 B
Nix
37 lines
800 B
Nix
{ pkgs, ... }: {
|
|
packages = with pkgs; [
|
|
gnumake
|
|
cmake
|
|
pkgsCross.arm-embedded.buildPackages.gdb # ARM one is broken
|
|
gcc-arm-embedded
|
|
python3
|
|
picotool
|
|
openocd-rp2040
|
|
];
|
|
|
|
env = {
|
|
PICO_SDK_PATH = "${pkgs.pico-sdk}/lib/pico-sdk";
|
|
};
|
|
|
|
scripts = {
|
|
build.exec = ''
|
|
cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -D PICO_STDIO_SEMIHOSTING=1
|
|
cmake --build build --parallel
|
|
'';
|
|
build-rel.exec = ''
|
|
cmake -S . -B build-release -D CMAKE_BUILD_TYPE=Release
|
|
cmake --build build-release --parallel
|
|
'';
|
|
clean.exec = ''
|
|
rm -rf build/ build-release/
|
|
'';
|
|
|
|
ocd.exec = ''
|
|
openocd -f ${./tigard-swd.cfg} -f target/rp2040.cfg
|
|
'';
|
|
gdb.exec = ''
|
|
arm-none-eabi-gdb -x .gdbinit build/qclk.elf
|
|
'';
|
|
};
|
|
}
|