Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload from eclipse #14

Closed
hayama600 opened this issue May 12, 2018 · 14 comments
Closed

Upload from eclipse #14

hayama600 opened this issue May 12, 2018 · 14 comments

Comments

@hayama600
Copy link

I have question about compiled file.
When i compile file on ev3 exists .elf file, but ev3 can't start that file and I see that file only when connect ev3 with computer.
Does anyone know how to solve this problem?

@a3f
Copy link
Member

a3f commented May 12, 2018

The eclipse plugin should upload a *.rbf file as well. This rbf file is what's displayed by the LEGO menu. Under the hood it just executes the .elf file.

@hayama600
Copy link
Author

Yes, eclipse generates two files .rbf and .elf.
But I can't find them on ev4..
When creating project I've selected Upload path: Internal Brick storage instead of SD card.
Can that be a problem ?

@a3f
Copy link
Member

a3f commented May 12, 2018

Can that be a problem ?

Yes, we had reports that uploading to brick memory didn't work as it is supposed to. Could you try again with SD card?

@hayama600
Copy link
Author

At monday i can buy sd card :)
I've tried with usb stick formated in fat32 but that didn't work.
Is there a way to use usb stick instead of sd card?

@a3f
Copy link
Member

a3f commented May 12, 2018

The project creation wizard has a USB option, but I don't think I ever used it. Sorry, no idea.

@hayama600
Copy link
Author

I've tried but it didn't work.
I will buy sd card.
Thanks for your help!

@hayama600
Copy link
Author

Hello, i've tried with sd card and now i can see Hello world program on ev3 but now I have new problem.
When I click on ev3 my program I see only program name for few seconds but program is never started.
Do you have idea what went wrong?

@hayama600 hayama600 reopened this May 15, 2018
@a3f
Copy link
Member

a3f commented May 15, 2018

The Hello World Example on Eclipse? What compiler do you use? Do you compile as C or C++?

@hayama600
Copy link
Author

I am using Cross ARM C++ Compiler.

image

image

image

image

After that I run Build Project and then Upload and run.

This is log
`20:19:39 **** Build of configuration Debug for project Hello ****
cs-make all
'Building file: ../src/Hello.cpp'
'Invoking: Cross ARM C++ Compiler'
arm-none-linux-gnueabi-g++ -mcpu=arm9 -marm -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -IC:/ev3/API -MMD -MP -MF"src/Hello.d" -MT"src/Hello.o" -c -o "src/Hello.o" "../src/Hello.cpp"
'Finished building: ../src/Hello.cpp'
' '
'Building target: Hello.elf'
'Invoking: Cross ARM C++ Linker'
arm-none-linux-gnueabi-g++ -mcpu=arm9 -marm -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -Xlinker --gc-sections -s -LC:/ev3/API -Wl,-Map,"Hello.map" -static-libstdc++ -o "Hello.elf" ./src/Hello.o -lev3api -lm
arm-none-linux-gnueabi-g++: unrecognized option '-static-libstdc++'
'Finished building target: Hello.elf'
' '
'Invoking: Cross ARM GNU Create Flash Image'
arm-none-linux-gnueabi-objcopy -O ihex "Hello.elf" "Hello.hex"
'Finished building: Hello.hex'
' '
'Invoking: Cross ARM GNU Print Size'
arm-none-linux-gnueabi-size --format=berkeley "Hello.elf"
text data bss dec hex filename
27574 10004 11064 48642 be02 Hello.elf
'Finished building: Hello.siz'
' '

20:19:42 Build Finished (took 2s.869ms)`

@a3f
Copy link
Member

a3f commented May 15, 2018

arm-none-linux-gnueabi-g++: unrecognized option '-static-libstdc++'

That's the problem... Sorry about that, I didn't find a precompiled Windows toolchain that's old enough to work on the EV3, but recent enough to support -static-libstdc++.

libstdc++ is the C++ standard library, which doesn't exist on the EV3. The easiest way around that is to statically link it into every application with -static-libstdc++, but the GCC you use is too old to support this option...

I will look into building a more recent toolchain. Till then you could either use C or use the toolchain for macOS or Linux (both are a bit more recent and support -static-libstdc++).

@hayama600
Copy link
Author

Thanks for your answer, I will try with linux.

@a3f
Copy link
Member

a3f commented May 15, 2018

I will leave the issue open for a while, while I look into building a newer toolchain.

@a3f a3f reopened this May 15, 2018
@JakubVanek
Copy link
Contributor

JakubVanek commented May 18, 2018

Hi,

I've tried to build a musl toolchain for EV3 using crosstool-ng some time ago, but I had some problems with uploading the generated ELFs. I don't know if the binaries work either.

statically-linked toolchain config
dynamically-linked toolchain config

A manually-built toolchain using glibc is probably going to be better, though.

Regards,

Jakub Vaněk

@a3f
Copy link
Member

a3f commented May 19, 2018

I've built x86-{macOS, Linux, Windows} → EV3 Toolchains, but they are in need of testing.
They include the most recent GCC (8.1.0 with Binutils 2.30) and target Linux 2.6.33-rc4 with glibc 2.8 (Firmware 1.09D).

A user in the Gitter channel was kind enough to verify the macOS one works, but it would be nice if the others can be tested as well. If you have issue using them, please open bug reports at https://github.com/c4ev3/toolchain/issues. I am closing this issue.

@JakubVanek I tried crosstool-ng as well, but the recent version doesn't support Linux v2.6.*, so I did the build steps manually. Thanks for the configs though, might be useful to others.

had some problems with uploading the generated ELFs

ev3duder issues? If so, could you open a bug report over there?

@a3f a3f closed this as completed May 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants