Re: [Nix-dev] Cross development for STM32

2016-08-28 Thread Tim Barbour
On Sat, 27 Aug 2016 03:28:49 +1000, Alexey Shmalko wrote: > > I usually produce raw binary file first: > > $ arm-none-eabi-objcopy -O binary build/ch.elf ch.bin > > and then flash that with openocd: > > $ openocd -f openocd.cfg > poll > reset halt > flash probe 0 > flash write_image erase

Re: [Nix-dev] Cross development for STM32

2016-08-26 Thread Alexey Shmalko
I usually produce raw binary file first: $ arm-none-eabi-objcopy -O binary build/ch.elf ch.bin and then flash that with openocd: $ openocd -f openocd.cfg poll reset halt flash probe 0 flash write_image erase ch.bin 0x0800 reset Note this unlikely to work for you, as your device is probably

Re: [Nix-dev] Cross development for STM32

2016-08-26 Thread Alexey Shmalko
It's really simple and doesn't consume much resources by itself. I was able to shrink it down to 16Kb flash and 264 _bytes_ RAM. That's a simple command line interface, GPIO, LED-blinking, USART, timers. Most flash memory is used by Rust printing utilities and may be shrinked down by disabling

Re: [Nix-dev] Cross development for STM32

2016-08-26 Thread Tim Barbour
On Fri, 26 Aug 2016 22:23:46 +1000, Alexey Shmalko wrote: > [...] > Resources you may check out: > - my kernel for STM32F4Discovery which is 100% Rust > (https://github.com/rasendubi/bkernel). Interesting. How large is your kernel ? Would it fit in a small STM32 (128k flash, 20k RAM) ? Tim

Re: [Nix-dev] Cross development for STM32

2016-08-26 Thread Tim Barbour
Thank you Philip and Alexey. I have tried gcc-arm-embedded as you suggested, and had no trouble building the ChibiOS UART demo for a Maple Mini board (I did have to change GPIOC_LED to GPIOB_LED; presumably the demo was written for a board with more LEDs). $ file build/ch.elf build/ch.elf: ELF

Re: [Nix-dev] Cross development for STM32

2016-08-26 Thread stewart mackenzie
I'd really like to see a simple nix way to retarget derivations. So maybe `buildRustPackageForAndroid` or `buildRustPackageForSTM32`. or maybe buildRustPackage rec { name = "habitat-${version}"; version = "0.8.0"; target = "android"; ... } kr/sjm

Re: [Nix-dev] Cross development for STM32

2016-08-26 Thread Alexey Shmalko
To get Rust running on STM32 you need a cross-compiler first. Basically, rustc is backed by llvm, so you shouldn't rebuild it. However, you should build libcore for your target architecture. After that, you can compile your application. I've being doing bare-metal programming, so I haven't

Re: [Nix-dev] Cross development for STM32

2016-08-26 Thread Moritz Ulrich
Rust on STM32 mostly. I'm quite familar with Rust and Nix, but not with the STM32 yet. Alexey Shmalko writes: > [ Unknown signature status ] > What part you're interested in? Nix, STM32, Rust? > > On 08/25/2016 03:41 PM, Moritz Ulrich wrote: >> >> Alexey Shmalko

Re: [Nix-dev] Cross development for STM32

2016-08-25 Thread Alexey Shmalko
What part you're interested in? Nix, STM32, Rust? On 08/25/2016 03:41 PM, Moritz Ulrich wrote: > > Alexey Shmalko writes: > >> [ Unknown signature status ] >> Hi! >> >> I was also doing some STM32 development (but with Rust). > > I'm very interested in this. Can you

Re: [Nix-dev] Cross development for STM32

2016-08-25 Thread Moritz Ulrich
Alexey Shmalko writes: > [ Unknown signature status ] > Hi! > > I was also doing some STM32 development (but with Rust). I'm very interested in this. Can you share any resources (where to start, any guides, etc.)? ___ nix-dev

Re: [Nix-dev] Cross development for STM32

2016-08-25 Thread Alexey Shmalko
Hi! I was also doing some STM32 development (but with Rust). My shell.nix[1] file is similar: { system ? builtins.currentSystem }: let pkgs = import { inherit system; }; rust-nightly = pkgs.callPackage ./nix/rust-nightly { date = "2016-05-28"; hash =

Re: [Nix-dev] Cross development for STM32

2016-08-25 Thread Philip Potter
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

[Nix-dev] Cross development for STM32

2016-08-24 Thread Tim Barbour
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