2019-04-06 05:04:45 +08:00
|
|
|
{ stdenv, lib, openocd, makeWrapper }:
|
2019-03-08 01:24:21 +08:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "openocd-nucleo-f429zi";
|
|
|
|
buildInputs = [
|
|
|
|
openocd
|
2019-04-06 05:04:45 +08:00
|
|
|
makeWrapper
|
2019-03-08 01:24:21 +08:00
|
|
|
];
|
|
|
|
src = ./.;
|
|
|
|
noBuild = true;
|
2019-04-06 05:04:45 +08:00
|
|
|
installPhase =
|
|
|
|
let
|
|
|
|
openOcdFlags = [
|
|
|
|
"-f" "${openocd}/share/openocd/scripts/interface/stlink-v2-1.cfg"
|
|
|
|
"-f" "${openocd}/share/openocd/scripts/target/stm32f4x.cfg"
|
|
|
|
"-c" "init"
|
|
|
|
];
|
|
|
|
in ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
|
|
|
makeWrapper ${openocd}/bin/openocd $out/bin/openocd-nucleo-f429zi \
|
|
|
|
--add-flags "${lib.escapeShellArgs openOcdFlags}"
|
|
|
|
'';
|
2019-03-08 01:24:21 +08:00
|
|
|
}
|