Page 1 of 1

Problem programming in Eclipse in VM

Posted: Sun Oct 15, 2017 1:36 pm
by NickCong
Hi

I am using Eclipse to programming by first time.when i wanted to see the code in the .c file in src/drives/src in crazyflie-firmware ,for example when i click to enter the led_f405.c and i2c_drv.c ,i get a lot problem messages.(Symbol 'GPIOD' could no be resolved .
Symbol 'GPIOD_Pin_0' could no be resolved
.....
and so on)
However, when I build the project, everything seems to work fine.
How can i solve these error. I guess the problem is the ARM environment not set up,it is true?

thank you for your time and support

Re: Problem programming in Eclipse in VM

Posted: Mon Oct 16, 2017 12:29 pm
by tobias
As you figured out it is a problem of eclipse not finding all symbols and such for the code analysis. I tried to fix it a while ago but never managed to and gave up. Must admit I did not put much time into it. If you manage to fix it please let us know how! If not you can turn it off in "Preferences->C/C++->Code Analysis"

Re: Problem programming in Eclipse in VM

Posted: Tue Oct 17, 2017 3:38 am
by linlin2017
Hi tobias,
I have encountered the same problems. According what you answered, I have turn off Code Analysis, however, there are several problems left, such as "Unresolved inclusion:<stdbool.h>","Unresolved inclusion:<string.h>",and so on.
Are these problems fatal errors that affect our program development?
If it is, how to fix it?
Thank you! :)

Re: Problem programming in Eclipse in VM

Posted: Tue Oct 17, 2017 9:16 am
by arnaud
These problems are not affecting the development in the sense that this is only static analysis aimed at helping the developer, the compiler is already well configured and compiles the code well.

Can you compile the Crazyflie firmware without problems?

Re: Problem programming in Eclipse in VM

Posted: Tue Oct 17, 2017 12:40 pm
by linlin2017
Thanks arnaud!
There is no problem when compiling the Crazyflie firmware. Then I still have a question: Generally when I hold down 'control ' key, and click on a variable, the variable definition can be presented. However, several variables' definitions can't be presented, for example 'true', 'false', 'int16_t', and so on. When clicking, a hint that "could not find symbol '~' in index" is presented in the lower left corner. Meanwhile several variables, for instance 'INT16_MAX', have many definitions. when clicking, I have to select one definition from a presented window.
I want to know the reason for the two cases above. Thank you. :)

Re: Problem programming in Eclipse in VM

Posted: Tue Oct 17, 2017 3:53 pm
by NickCong
tobias wrote: Mon Oct 16, 2017 12:29 pm As you figured out it is a problem of eclipse not finding all symbols and such for the code analysis. I tried to fix it a while ago but never managed to and gave up. Must admit I did not put much time into it. If you manage to fix it please let us know how! If not you can turn it off in "Preferences->C/C++->Code Analysis"
thank you very much!! :D

Re: Problem programming in Eclipse in VM

Posted: Wed Oct 18, 2017 10:13 am
by linlin2017
arnaud wrote: Tue Oct 17, 2017 9:16 am These problems are not affecting the development in the sense that this is only static analysis aimed at helping the developer, the compiler is already well configured and compiles the code well.

Can you compile the Crazyflie firmware without problems?
Thanks arnaud!
There is no problem when compiling the Crazyflie firmware. Then I still have a question: Generally when I hold down 'control ' key, and click on a variable, the variable definition can be presented. However, several variables' definitions can't be presented, for example 'true', 'false', 'int16_t', and so on. When clicking, a hint that "could not find symbol '~' in index" is presented in the lower left corner. Meanwhile several variables, for instance 'INT16_MAX', have many definitions. when clicking, I have to select one definition from a presented window.
I want to know the reason for the two cases above. Thank you. :)

Re: Problem programming in Eclipse in VM

Posted: Wed Oct 18, 2017 11:25 am
by arnaud
The reason is most likely that eclipse does not know the path the the libc headers. In the VM arm-none-eabi-gcc is installed in the home folder so you can find the include folder there that contains stdio.h and all other libc headers. Though the symbol you are talking about are standard and already well documented on the internet so you should not have much use for them.

Re: Problem programming in Eclipse in VM

Posted: Wed Oct 18, 2017 3:05 pm
by linlin2017
arnaud wrote: Wed Oct 18, 2017 11:25 am The reason is most likely that eclipse does not know the path the the libc headers. In the VM arm-none-eabi-gcc is installed in the home folder so you can find the include folder there that contains stdio.h and all other libc headers. Though the symbol you are talking about are standard and already well documented on the internet so you should not have much use for them.
Thank you. I have found the include folder. And I found the setting path: 'project' ->'properties' ->'c/c++ general' ->'preprocessor include path, macros etc.' ->'entries'->'setting entries' ->'CDT user setting entries' . I add the path 'home/bitcraze/arm-none-eabi/include'. Then I found some symbols work, for example 'int16_t', however, there are some symbols don't work, such as 'true' and 'false'.
I want to know how to configure eclipse to solve the problem. Thank you.

Re: Problem programming in Eclipse in VM

Posted: Thu Oct 19, 2017 7:35 am
by arnaud
This is as much as I know about, lets hope someone that knows more about eclipse CDT passes by this forum.

If you ever solve the problem please share is with us :-).