- Notifications
You must be signed in to change notification settings - Fork12
The LEGO® EV3 Downloader/UploaDER.
License
c4ev3/ev3duder
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The LEGO® EV3 Downloader/Uploader utility.
ev3duder is an implementation of the LEGO EV3's protocol over USB (HID), Bluetooth (RFCOMM) and WiFi (TCP). Runev3duder --help
for help.
Check the "Releases" tab for precompiled binaries.Building ev3duder on your own is quite easy too, though. It runs on Linux, Windows and OS X.
ev3duder requires a gnu99 compatible compiler, that is GCC 3.2 andabove or compatible compilers.Any recent version of gcc, clang or icc should be able to compile it.MS Visual C++ isn't supported, due to the use of C99 features and GNU extensions.Also required is GNU Make.
Get the source with git:
$ git clone --recursive https://github.com/c4ev3/ev3duder
If you haven't got git, you will have to download these seperately:https://github.com/c4ev3/ev3duder/archive/master.zipandhttps://github.com/signal11/hidapi/archive/master.zipthen unpack the hidapi archive into the hidapi directory of the ev3duder extraction path.
$ make
On Linux, you additionally need libudev-dev to be installed. On Ubuntu and other Debian-based system this can be done via
$ sudo apt-get install libudev-dev
If you used only a simplegit clone
earlier, you may also need to download some missing git modules:
$ git submodule update --init --recursive
Also to allow access to the ev3 over USB without requiring root, appropriate udev rules must be created. This can be easily done with
$ make install
The test/ directionry contains some sample projects that do stuff onthe EV3.perl flash.pl Test_Motors
uploads and executesthe Test_Motors project.
Generally, 2 files are needed:
- An ELF executable built for Linux on ARM. libc need not bedynamically linked (The standard firmware uses glibc).
stdlibc++ isnot provided by default and would need to beuploaded separately and dynamically loaded or linked statically (e.g. by specifying -static-libstdc++ during linking with GCC 4.5+).
- A launcher file, so the program can be started from the built-inmenu. This is not strictly required, as ev3duder can executeprograms too, but a menu entry is more convenient.
In order to compile C/C++ application you will need the arm-none-linux-gnueabi GCC or arm-linux-gnueabi GCC (Both are the same thing).Thesymlink_cross.sh
script can be used to symlink the latter to the former.
Easiest way is via the CodeSourcery Lite package which can be gotten here:https://sourcery.mentor.com/GNUToolchain/package4574/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi.exe
The easiest way on Linux systems is to also use the CodeSourcery toolchain, since it automatically provides the build environment:
$ wget -c http://www.codesourcery.com/sgpp/lite/arm/portal/package4571/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2$ mkdir ~/CodeSourcery$ tar -jxvf ~/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 -C ~/CodeSourcery/$ echo export PATH=~/CodeSourcery/arm-2009q1/bin/:$PATH >> ~/.bashrc && . ~/.bashrc
You can also use the toolchain that is found in the repositories, but keep in mind that you might have to do some additionalconfiguration with this toolchain.On Debian/Ubuntu the arm-linux toolchains can be installed using:
$ sudo apt install gcc-arm-linux-gnueabi
For C++:
$ sudo apt install g++-arm-linux-gnueabi
Carlson-Minot Inc. provides binary builds of CodeSourcery's GNU/ARM toolchain for OS X. It can be gotten here:http://www.carlson-minot.com/available-arm-gnu-linux-g-lite-builds-for-mac-os-x
Optimzing for size (-Os) is preferred. As ev3duder doesn'thandle remote debugging yet and AFAIK nothing else does,debug symbols should be skipped too (no need for -g).
Example commands to compile, upload and execute:
$ arm-linux-gnueabi-gcc main.c file.c -Os -o test$ ev3duder up test.elf ../prjs/BrkPrg_SAVE/test$ ev3duder mkrbf /home/a3f/lms2012/BrkPrg_SAVE/test test.rbf$ ev3duder up test.rbf ../prjs/BrkPrg_SAVE/test.rbf$ ev3duder run test.rbf
Alternatively, steps 4 and 5 can be omitted and the last step changed toev3duder exec test.rbf
; The downside of this is that no menuentry is generated. Another option is alsoinstalling theapplication, which will make it available with an optional icon inthe apps menu:
$ ev3duder up test.rbf ../apps/test.rbf
For uploading to a SD Card, the paths/media/card
or../prjs/SD_Card/
can be used instead. A connected USB stick would be available under/media/usb/
. Keep in mind that the Lego Menu doesn't show .rbf files at the root of the SD card, so it needs to be uploaded into a directory.ev3duder up
does create the paths by default.
As the commands ev3duder supports, mirror the functions internally used to implement them, the doxygen documentation of ["funcs.h"] should do as user manual. It's linked at the top or can be locally generated by runningdoxygen
and openning the index.html file in a webbrowser.
The utlity is written in GNU C99. The Makefile is GNU Make specific. The perl and shell scripts are complementary and not necessary.
About
The LEGO® EV3 Downloader/UploaDER.