[Nix-dev] Cross development for STM32

Alexey Shmalko rasen.dubi at gmail.com
Thu Aug 25 12:40:20 CEST 2016


Hi!

I was also doing some STM32 development (but with Rust).

My shell.nix[1] file is similar:

{ system ? builtins.currentSystem }:

let
  pkgs = import <nixpkgs> { inherit system; };

  rust-nightly = pkgs.callPackage ./nix/rust-nightly {
    date = "2016-05-28";
    hash = "0f9rx672v97f5bn6mnb1dgyczyf5f8vcjp55yvasflvln1w64krv";
  };

in with pkgs; {
  bkernelEnv = stdenv.mkDerivation {
    name = "bkernel";
    buildInputs = [
      gnumake
      git
      rust-nightly
      gcc-arm-embedded
      minicom
      openocd
      expect
    ];
  };
}

[1]: https://github.com/rasendubi/bkernel/blob/master/shell.nix

On 08/25/2016 11:01 AM, Philip Potter wrote:
> Hi Tim,
> 
> I've been compiling some stuff for STM32 recently -- in particular,
> the micropython fork for the STM32-based TiLDA-Mk3 board [1][2]. I
> just had to install the gcc-arm-embedded package and I was able to
> start compiling code.
> 
> My shell.nix (for setting up a nix-shell development environment) was
> not particularly complicated:
> 
> let pkgs = import <nixpkgs> {};
>   stdenv = pkgs.stdenv;
> in
> stdenv.mkDerivation {
>   name = "micropython-0.0.1";
>   buildInputs = with pkgs; [ git cmake python pythonPackages.pyusb
> pkgs.libusb1 gcc-arm-embedded ];
> }
> 
> With this, I was able to clone https://github.com/emfcamp/micropython
> and run `make -C stmhal BOARD=STM32L475_EMFBADGE` to build the .dfu
> file.
> 
> Phil
> 
> [1] https://badge.emfcamp.org/wiki/TiLDA_MK3
> [2] https://www.youtube.com/watch?v=sww4gJPse4o
> 
> On 25 August 2016 at 02:02, Tim Barbour <trb at categorical.net> wrote:
>> I have some STM32 boards (e.g. Maple Mini) to play with. I am not trying to
>> port Nixos to them, because they are not really powerful enough to run Linux;
>> instead I plan to run ChibiOS/RT on them.
>>
>> I would appreciate suggestions as to a good way to setup an STM32
>> cross-development environment on Nixos, so that I can write software that will
>> run on (link with) ChibiOS/RT on the STM32 board.
>>
>> Tim
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160825/7bcc7e5c/attachment.sig>


More information about the nix-dev mailing list