zephyrproject-rtos / eclipse-plugin

Zephyr Eclipse Plugin
Eclipse Public License 2.0
16 stars 18 forks source link

Problem after reopen Eclipse. #15

Closed rokobert closed 4 years ago

rokobert commented 4 years ago

Configuring project using Zephyr eclipse wizard works. But when I reopen Eclipse, I get next error.

Screenshot 2020-02-12 at 08 53 44

And I can not build anzmore. Also Folder in Project exloprer is empty. And If I want to click next error is shown.

Screenshot 2020-02-12 at 08 57 45

Any idea.

Regards, Robert

dcpleung commented 4 years ago

Which version of Eclipse are you using?

rokobert commented 4 years ago

Sorry for delayed ansver.

I'm using Eclipse 2019-09 R (4.13.0) with CDT.

dcpleung commented 4 years ago

I have not been able to reproduce it locally. Could you tell me how you created the project (e.g. board name, toolchain, etc.)?

rokobert commented 4 years ago

HI,

After last note I was resolve some problems, but not all.

Ok. I'm using MacOS 10.14.6(Mojave), Eclipse CDT 2019-09 and jdk1.8.0_241.

  1. I was try to install plugin over marketplace with no succes. Problem was, that I was using jdk1.8.0_45.
    Solved: Upgrade JDK to latest version. And say Eclipse to use this latest version in eclipse.ini file. This file is in Eclipse.app/Contents/Eclipse folder.

  2. Using project wizard was not problem. But build was. If you choose "GNU ARM embedded toolchain" then it was problem that envirovment variable ZEPHYR_TOOLCHAIN_VARIANT vas set to "gnuarmemb:gnuarmemb". I fix this problem with insert line "set(ZEPHYR_TOOLCHAIN_VARIANT "gnuarmemb")" before line 63 in "cmake/generic_toolchain.cmake" file. Please fix this problem in souce code of plugin.

  3. After this modification all was Ok. I can build newly created project. But if I close Eclipse and run again, build was not possible anymore. I get "Problem Occured" window mentioned in previus report. See attached eclipse log file. log.txt

Regards, Robert

rokobert commented 4 years ago

Hi Daniel,

Did you find something regarding my problem.

Regards, Robert

rokobert commented 4 years ago

I try to use Eclipse CDT 2019-03. And now it is work. Do no use newer version of Eclipse!!!

Problem with ZEPHYR_TOOLCHAIN_VARIANT on MacOs still exist.

From console output: CMake Error at /Users/Shared/Soft/CSR313/zephyrsrc/cmake/generic_toolchain.cmake:65 (include): include could not find load file: /Users/Shared/Soft/CSR313/zephyrsrc/cmake/toolchain/gnuarmemb:gnuarmemb/generic.cmake Call Stack (most recent call first): /Users/Shared/Soft/CSR313/zephyrsrc/cmake/app/boilerplate.cmake:459 (include) CMakeLists.txt:15 (include)

Regards, Robert

dcpleung commented 4 years ago

I was looking into it yesterday. The issue with those NPEs is due to some fundamental changes in Eclipse CDT, which break the plugin. By skimming through the CDT code, it looks like a partial rewrite of the plugin is required for it to work with R2019-12.

dcpleung commented 4 years ago

As for the gnuarmemb:gnuarmemb issue, I don't have a Mac. But I tried to reproduce it on a Linux machine without issue.

rokobert commented 4 years ago

Could you tell me where in plugin code is generated ZEPHYR_TOOLCHAIN_VARIANT variable.

I will try to fix this problem on Mac.

Regards, Robert

dcpleung commented 4 years ago

It is inside plugins/org.zephyrproject.ide.eclipse.core/src/org/zephyrproject/ide/eclipse/core/internal/ZephyrHelpers.java, function setupBuildCommandEnvironment(pStore, env), where the environment for CMake is being constructed. The value comes from the preference store, which is stored from plugins/org.zephyrproject.ide.eclipse.ui/src/org/zephyrproject/ide/eclipse/ui/wizards/internal/ZephyrApplicationToolchainWizardPage.java inside performFinish(), and plugins/org.zephyrproject.ide.eclipse.ui/src/org/zephyrproject/ide/eclipse/ui/property/ZephyrApplicationToolchainPropertyPage.java inside performApply().

rokobert commented 4 years ago

Thanks. I will check and replay if I find something.

dcpleung commented 4 years ago

@rokobert if you have time, could you try #23 and see if it fixes the NPE issues mentioned above. I still haven't been able to reproduce the issue with using GNU ARM Embedded toolchain.

KozhinovAlexander commented 4 years ago

I have almost same error on Mac OS Catalina 10.15.4:

An internal error occurred during: "Building Active Configuration". java.lang.NullPointerException

It happens after I reopened Eclipse.

How to reproduce:

  1. Provide all Zephyr Eclipse Plug-in install steps from here
  2. Build application and you should get one of java.lang.NullPointerException errors.

The error can be partially solved according to this Eclipse Bug on Mac OS X.

But then building of the project starts and ends with the following error:

----- Generating CMake files for board nucleo_h745zi_q_m7 in build_eclipse /usr/local/bin/cmake -DBOARD=nucleo_h745zi_q_m7 -G Ninja - DCMAKE_EXPORT_COMPILE_COMMANDS=ON /Users/nuke/eclipse-workspace/NUCLEO_H745ZI_Q__TestApp_M7 -- Application: /Users//eclipse-workspace/NUCLEO_H745ZI_Q__TestApp_M7 -- Zephyr version: 2.2.99 (/Users//Documents/DevProjects/zephyrproject/zephyr) -- Board: nucleo_h745zi_q_m7 -- Found west: /Applications/anaconda3/bin/west (found suitable version "0.7.2", minimum required is "0.7.1") -- Found dtc: /usr/local/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6") -- Found toolchain: gnuarmemb (/usr/local/bin) CMake Error at /Users//Documents/DevProjects/zephyrproject/zephyr/cmake/compiler/gcc/generic.cmake:8 (message): Zephyr was unable to find the toolchain. Is the environment misconfigured?

-- Configuring incomplete, errors occurred! User-configuration:

ZEPHYR_TOOLCHAIN_VARIANT: gnuarmemb

Internal variables:

CROSS_COMPILE: /usr/local/bin/bin/arm-none-eabi-

TOOLCHAIN_HOME: /usr/local/bin

Call Stack (most recent call first): /Users//Documents/DevProjects/zephyrproject/zephyr/cmake/generic_toolchain.cmake:70 > (include) /Users//Documents/DevProjects/zephyrproject/zephyr/cmake/app/boilerplate.cmake:502 > (include) CMakeLists.txt:3 (include)

----- Done generating CMake files for board nucleo_h745zi_q_m7 in build_eclipse

Restarting Eclipse either with usual way or from console leads to java.lang.NullPointerException and does not even provides the error from above.

Suggested solution: Can running zephyr-env.sh from ZEPHYR_BASE help?

dcpleung commented 4 years ago

We are in the process of updating the plugin in Marketplace through CI. Please wait for version 0.2.99 as it should fix the re-opening bug.

KozhinovAlexander commented 4 years ago

We are in the process of updating the plugin in Marketplace through CI. Please wait for version 0.2.99 as it should fix the re-opening bug.

When is it planned?

dcpleung commented 4 years ago

@nashif ^^^

dcpleung commented 4 years ago

A comment in #25 mentioned that the problem is fixed, so closing this one.