At last, the LEGO MINDSTORMS EV3 source code is now available for your perusal. It’s been uploaded to the Mindboards Github space: [LINK]. You can simply clone the repository. It would be really great if you could drop us a note to let us know what you’ve done with it! It would be nice if some of the programming effort was not duplicated or lost. You can simply send a tweet to @XanderSoldaat or drop a mail to ev3@botbench.com. I’d like to compile a list of all the different cloned repos out there and keep a copy of it on this blog.
Things you will need
- A Linux (virtual) installation. I used Ubuntu 13.04 on VMware Workstation, but I am sure other combinations also work.
- Eclipse. I used Helios Service Release 1, but I know more recent versions will also work.
- Java JRE (for Eclipse)
- Code Sourcery Lite for ARM version 2009q1-203. You can download here directly: [LINK].
- A USB to serial port dongle. You need to splice an NXT cable and hook up dig0 (pin 5) and dig1 (pin 6) to TX and RX, not 100% which way around. GND is pin 2 and 3, just pick one. The brick’s console is on port 1 and has a baud rate of 115200 8N1. I have a pre-made one with an NXT socket, it’s not actually as fancy as it sounds.
- An SD card to put your custom firmware on. It doesn’t use up a lot of space, but I’d stick with a simple 2GB one
- A pair of flat-nosed pliers. Why do you ask? The SD card can be a bit tricky to remove with your fingers, unless you have freakishly small fingers or nails that don’t snap off.
- A Netgear WNA1100 WiFi dongle. It is currently the only WiFi dongle that is supported by the EV3’s firmware. I am sure this will be remedied 2 hours after this release.
Getting started
Use Git to clone the ev3sources repo: git clone https://github.com/mindboards/ev3sources.git
The scripts in the EV3 sources expect the source code to live in a projects folder in your home directory. You will need to create a projects symlink to the ev3sources folder that was created when you cloned the Git repo.
I’ll publish some more elaborate HOWTOs in the next few days, for now, take a look at the scripts in ev3sources/lms2012/open_first. You can open the lms2012 folder in Eclipse to open all of the sub projects, including the kernel modules and shared libraries.
Have fun and stay tuned!
Nice to see you using GitHub for robotics stuff! People can fork the repository on GitHub, which allows them to have their own copy which they can modify as they choose.
Also, the Clone in Deskop button is the easiest way to get started with Git and GitHub.
Doesn’t the serial cable need a level adapter chip, max3232 or similar?
…and it seems that I have freakishly small fingers 😉
No, mine doesn’t have one 🙂
It’s 3v3 TTL UART, not RS232.
Great Blog! Can’t wait for your HOWTOs 🙂 Got a EV3 Education Kit but I need a little help to get started. Maybe a tutorial like on http://lejos-osek.sourceforge.net/ ?
Yeah, I am keen to get some proper docs up on the site. I’m actually working on a post at the moment that shows the various layers in the LEGO firmware and their functions.
[…] that hackers are chomping at the bit to tinker around under the hood. To that end, they’ve released the EV3 source code on […]
So I hooked up my EV3-Brick with a FT232 USB-UART Chip and everything works great. But if I try to stop the boot process as described in “bootsd.html” in the lms2012-docs it won’t work:
From terminal
[…]
ARM Clock : 300000000 Hz
DDR Clock : 132000000 Hz
Invalid MAC address read.
Hit ‘l’ to stop autoboot: 0
Card did not respond to voltage select!
[…]
How can I hit “l” ? I tried to send it via UART, but it just echos. Any ideas?
You need to press ‘i’ while powering it on. You can’t power it on and /then/ press ‘i’, it’s too fast 🙂
You can increase the boot timeout by setting the bootdelay variable. An easy way to do this is by putting it into a u-boot script in an SD card. I just uploaded a precompiled script to https://github.com/esteve/ev3-tools, copy the boot.scr file to an SD card, turn the brick on and it’ll set the bootdelay environment variable. Turn off the brick, remove the card and turn it on again, the brick should now wait 5 seconds before booting up Linux
Awesome, thank you for sharing this!
[…] 不過這消息竟然也不是在樂高官網公布,而是一個叫xanders的網站,是不想太高調嗎? […]
[…] http://botbench.com/blog/2013/07/31/lego-mindstorms-ev3-source-code-available/ […]
I quickly checked the kernel source code, and I have 2 questions:
1. In the default config file, CONFIG_ATH_COMMON is set, but it seems that there is no support for AR9271 based devices, as CONFIG_ATH9K_HTC is not set.
-> Should I set it manually or is the WNA1100 supported by another driver?
2. I wanted to enable support for the WNA1000M (way smaller than the WNA1100), which is based on a Realtek chip. The main problem is that the ‘rtl8192cu’ driver handling this chip was not part of the 2.6.33-rc4 kernel.
-> TI has an released and updated DaVinci SDK (3.22.00.02) that is based on a 3.3.0, that contains it. Can I rely on the ‘da850_omapl138_defconfig’ target to create an initial kernel config file, or is there something special to select for EV3 ? (maybe some patches too…)
Could you post this as two issues on https://github.com/mindboards/ev3sources? Thanks!
Is it possible to use the official mindstorms software to upload the firmware via USB to the brick instead of messing with a custom cable? I know that you can update the firmware and choose your own binary through that mechanism.
The custom cable is only for accessing the console, not for uploading.
[…] If you already own one of the Wi-Fi Dongles listed and decide to TRY it with your EV3, you will have to delve into the EV3′s Firmware Code. You will need to download the current Firmware Source. To start with you will have to change lines 82-85 of the c_wifi.c to suite the Wi-Fi Dongle you wish to use. Next you will have to recompile the LEGO Mindstorms EV3′s Firmware and download it to the EV3 Brick (See Xander Soldaat’s Instructions). […]
[…] Anschlüsse weiter zu erhöhen. Außerdem hat sich Lego zu Open-Source bekannt und den Quellcode des Lego Mindstorms veröffentlicht. Als Folge davon sind bereits zahlreiche Projekte entstanden, die eine Programmierung direkt auf […]
[…] improved processor and the fact that it actually runs Linux, not only that but Lego have shared the source code to the firmware as well! Bravo […]
For our USB-Serial Cable, only pin 3 worked as GND. If you are using pin 2 and are experiencing connection drops or other weird behaviour, try using the pin 3 before panicking 🙂
You are right, I have been meaning to fix the article but have not had a chance to make new photos.
Any news, guides, how-to’s etc on how actually use this source code with EV3-brick?
There are guides there on how to compile it, just check the Wiki. It tells you how to setup Eclipse with it. I also just released the HDK and SDK docs a few minutes ago. Check my blog 🙂
This is great, thanks.
May I ask where you got the code from originally? From the mindboards GitHub pages, it appears to be the official LEGO source, and certainly the code is “Copyright (C) 2010-2013 The LEGO Group”, but the mindboards.net site footer makes it clear it is “not affiliated with the LEGO Group”. If it was in response to a GPL request, is it the most recent available code?
I ask because I have found what seem to be some bugs in the code – and its comments – and would prefer to find either a more up-to-date source, or to suggest patches to the “one true source”.
Apologies if this is answered somewhere that I’ve missed, but I’ve looked everywhere that seems sensible. Perhaps a comment on “About this site” for http://mindboards.net would be useful?
Hi Ian,
This source code was given to me by TLG to put online. It is indeed the most recently available code with some additional community fixes.
As far as the Internet is concerned, this is the One True Source. I cannot guarantee that LEGO will do anything with the fixes we make, but that shouldn’t stop us from trying to make a better firmware. LEGO does not do its own development on this specific tree but when they release a new version of the source, it will make its way here. Our build process is a lot less clunky than LEGO’s own build process, which relies on a LOT of little scripts and very specific directory names.
If you have fixes, please create the pull-requests and I will review them and merge when appropriate.
Thanks in advance for your contributions!
I was a fan of LEGO mindstorms 20 years age. I had enjoyed with LegOS on NXT. I would enjoy again with EV3.
I cloned the repository, executed the builds (each one of the make steps) and then ran the make_image.sh command. Everything ran fine (some warnings here and there but that’s it). When I load the bin into the EV3 brick though, it doesn’t work. I am able to load the bin, but when starting the brick, it loads makes one of the actuators move and then shuts down again. I do not currently have the console cable done, so not sure what may be wrong, I had sort of hoped the build would work “out of the box”.
Anyway, any pointers as to what may be wrong would be much appreciated.
The only way you can debug this, is by getting a console cable. Anything else just futile.
Hi Xander,
I am a new guy for EV3. Unfortunately, I couldn’t reach the EV3 source code. In your comment, you mentioned too many software to download, I almost downloaded all of them, but I still don’t know how to get the source code. I searched too many sites but didn’t help me. I downloaded the Bricxcc but it’s an old software which doesn’t contain EV3.
Would you please just tell me in steps what to do after I downloaded Ubuntu of a VMware and how can I get the source code for the EV3.
I would be appreciated and most grateful for your kind efforts!
Please HELP!!!!
I am also confused because there are too many programming languages to use (C, C++, Java, LISP…) so what is the easiest way to reach the source code?
Source code in which language it is written??
The EV3 firmware is written in C and compiled with gcc. Getting started with the source code is not trivial and requires quite in-depth knowledge of Linux and embedded programming. What is it you’re trying to achieve and why do you think you need the source code of the firmware to do this?
Mr. Xander,
I am working on an EV3 project. They gonna ask me about the source code. I have a good knowledge in programming but I don’t know how to get EV3 source code.
I have been surfing the internet for two weeks. But still couldn’t reach there 🙁
Would you please tell me how to get there and I would be most grateful to you!
Thanks with regards,
[…] If you already own one of the Wi-Fi Dongles listed and decide to TRY it with your EV3, you will have to delve into the EV3’s Firmware Code. You will need to download the current Firmware Source. To start with you will have to change lines 82-85 of the c_wifi.c to suite the Wi-Fi Dongle you wish to use. Next you will have to recompile the LEGO Mindstorms EV3’s Firmware and download it to the EV3 Brick (See Xander Soldaat’s Instructions). […]
[…] Xander Soldaat publicó en 2013 un artículo en su blog botbench.com, dando a conocer que el código fuente del Lego Mindstorms EV3 está disponible para uso personal. Ver Enlace. […]