Can I Write Rust for my Lego Mindstorms NXT 2.0?

Does anybody know how to get Rust running on a Lego Mindstorms NXT 2.0?

Maybe I could try to port this project to Rust:

1 Like

As far as I cam make out the NXT 2.0 has an ATMEL AT91SAM7 micro-controller in it. Which is an ARM v7. So one of the Tier 2 aarmv7 Rust compilers should produce code for it:

It also has an ATMEL ATMEGA48 eight bit micro-controller. Amazingly there is a Rust compiler for that too. See 'avr' on the same page. Which is something I was about to look into as I have a pile of ATMEGA chips here.

Presumably if you hunt around you will find out how people have been flashing binaries into the Mindstorms.

nxos seems like a good way to find out to drive the ARM peripherals. Of course you will need the data sheet for the chip SAM7 micro, which you can download from ATMEL (Now Microchip).

1 Like

Thanks for the info @ZiCog. :slight_smile:

Now I guess this is probably specific to the hardware, but does anybody have any idea if there is a risk of irreversibly damaging my Mindstorms brick by trying to flash it.

I know you're supposed to always be able to flash it back to the original software, but maybe that's assuming it's not broken. Can you break it just by putting bad software on it or will you always just be able to flash it back?

Unless I'm mistaken, it is ARM7, but not armv7. The ARM7 chips use arm4t don't they?

@zicklag Found out you can compile for armv4t architecture. You'll have to create your own target file. Just copy the contents of the thumbv4t-none-eabi and change the llvm-target to armv4t-none-eabi and tell cargo to compile with this target.

1 Like