Skip to content

Indexer in V4.4.0 is Seriously Flakey with ESP32 Code #1491

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

Closed
gfvalvo opened this issue Jul 12, 2022 · 83 comments
Closed

Indexer in V4.4.0 is Seriously Flakey with ESP32 Code #1491

gfvalvo opened this issue Jul 12, 2022 · 83 comments

Comments

@gfvalvo
Copy link

gfvalvo commented Jul 12, 2022

With just about any ESP32 code, will usually get tons of fake “… unresolved” errors even though the code compiles totally error-free. I’ve played with all the check boxes under Window --> Preferences --> C/C++ --> Indexer. I’ve tried deleting the errors in the “Problems” tab, Clean Project, Recompile, Build All, Close Project, Close Sloeber, etc.

Then for no apparent reason, most of the fake errors might go away. Or, they may stay permanently.

Can’t find the right Kabuki Dance to make it work all the time.

@PerennialNovice
Copy link

PerennialNovice commented Jul 14, 2022

Had the same issue with AVR and STM32, so seems not to be platform specific.
This worked ONCE for me:

close sloeber, delete indexer settings in the projects .prefs file, restart sloeber, select project->Indexer->Rebuild Index
https://stackoverflow.com/questions/11357009/eclipse-indexing-not-working/41760020#41760020

@jantje
Copy link
Member

jantje commented Jul 14, 2022

please try the nightly to see if the problem still exists
https://github.com/Sloeber/arduino-eclipse-plugin/actions/runs/2651591737

@gfvalvo
Copy link
Author

gfvalvo commented Jul 14, 2022

please try the nightly to see if the problem still exists
https://github.com/Sloeber/arduino-eclipse-plugin/actions/runs/2651591737

Jantje, I will try. But, I'm not a tool chain guy and I don't know how to "build" anything. Do I just click on "windows" and download the .zip? Then, click on "sloeber-ide.exe"?

image

image

@jantje
Copy link
Member

jantje commented Jul 14, 2022

you will have to expand the zip file before opening sloeber-ide.exe. On windows best to expand as close to the root as possible to keep path lengths small.
all the other things seem ok to me

@gfvalvo
Copy link
Author

gfvalvo commented Jul 14, 2022

OK, thanks. That's how I install all versions of the Sloeber Product ... in their own directory right under root, each with their workspace directory (also right under root).

@PerennialNovice
Copy link

PerennialNovice commented Jul 15, 2022

With the latest nightly (from the update server 4.4.1.202207120021) there are still some hickups with unresolved references showing up every now and then
...
BUT
...
right-click on project -> index -> rebuild solved it every time up to now :)

This is really a great relief !
Thanks jantje & wim & whoever else helped

@PerennialNovice
Copy link

Sorry, but after a while now it is back to the original state where the indexer stopped working.
This is very clearly indicated by missing syntax coloring and "jump to declaration" not working again.
Rebuilding the index does not work, clicking the command does nothing at all.
Even the trick above (deleting some contents in .prefs does not remedy the situation...

@jantje
Copy link
Member

jantje commented Jul 18, 2022

I'm sorry to hear this.
Are there errors/warning in the log file?

@PerennialNovice
Copy link

hmmm, where would I find that logfile?
I found a build log deep inside the .metadata folder...

@jantje
Copy link
Member

jantje commented Jul 18, 2022

in the menu windows->show view->other->error log
Then you have the view inside eclipse

You can right click in the view and select export log

@PerennialNovice
Copy link

the log is VERY big (985kb)

but in a timeslot where I THINK that I tried the index rebuild, there are lots of the same errors:

image

I cleared the log and will have an eye on it when it occurs again

@PerennialNovice
Copy link

hmmm, that error appears also when the index is rebuilt properly :/

@jantje
Copy link
Member

jantje commented Jul 18, 2022

The no propertytester gnumcu is gui related. It should be fixed by CDT (as gnu mcu is now part of cdt and it is a plugin dependency error) I should work around that (but I don't know how).

But it surely is not related to indexing.
I think the ESP32 problem is related to discovery (which is run before indexing) and should identify as a command that can not be run.

@PerennialNovice
Copy link

now it happened again.
(I am on STM32, not ESP32. but I think it might not be platform specific)

sloeber was open, I closed and reopened the project (which closed all open files as well) and after reopening the project and a file, syntax coloring did not happen, call hierarchy, reference searching etc. don't work. Second file too. Rebuilding index did not start, F5 also with no effect.

But there is nothing in the error log, only the bespoke and unrelated property tester message.

@PerennialNovice
Copy link

found a menu option on sourcefile right-click -> index - create parser log

here's the output:
eclipse_parser_log.log

this is interesting:

Unresolved includes (from headers in index):
   file:/C:/Users/xXxXxXx/Documents/sloeber_projects/PowerSupply/Controller.h is not indexed
   file:/C:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/Arduino.h is not indexed
   file:/C:/Users/xXxXxXx/Documents/Arduino/libraries/SafeString/src/loopTimer.h is not indexed
   file:/C:/Users/xXxXxXx/Documents/Arduino/libraries/MemoryFree-master/MemoryFree.h is not indexed

nevertheless nothing happens when I try

  • rebuild index
  • update with modified files
  • freshen all files
  • re-resolve unresolved includes

@jantje
Copy link
Member

jantje commented Jul 19, 2022

Are you sure this is not a casing issue Arduino.h versus arduino.h or something like that?

@PerennialNovice
Copy link

nope, not sure!
... but as it builds and I am on Windows I'd guess casing is not the root evil here...

I will try in a xubuntu VM

@jantje
Copy link
Member

jantje commented Jul 19, 2022

... but as it builds and I am on Windows I'd guess casing is not the root evil here...

I can 100% sure guarantee that it can.
Eclipse is case sensitive so it requires correct casing.

@PerennialNovice
Copy link

PerennialNovice commented Jul 19, 2022

Thanks for clarifying this!

Any hint where I could start looking?
It builds because windows is case insensitive, but the discovery/indexer (don't know what is what and what it does) is and so there can be issues on this side but not on the compiler side.
Did I get this right?

@jantje
Copy link
Member

jantje commented Jul 19, 2022

yes and the list of unresolved headers is IMHO a complete list of possible issues.
You dumped the list in a previous post above here but you can also ask the indexer to show you the unresolved includes.
You can remove the include name and retype it. Autocomplete should give you the name in the required casing.
Note that I have had platforms/libraries where I had to modify the platform/library to get things to work because some names (like Arduino.h) have to be in a specific casing

@PerennialNovice
Copy link

just a thought on this: if it builds without problem on Linux, can I rule out a casing issue?

@jantje
Copy link
Member

jantje commented Jul 20, 2022

Yes

@gfvalvo
Copy link
Author

gfvalvo commented Aug 3, 2022

So, is there a solution? This bug really limits the usefulness of Sloeber when working with ESP32 code. The "Open Declaration" function is probably the feature I use most. As things are now, that fails often even though the code compiles totally error-free.

@jantje
Copy link
Member

jantje commented Aug 3, 2022

The root cause has still not been identified.

@PerennialNovice
Copy link

a clumsy and not always working workaround is to close and re-open sloeber...

@gfvalvo
Copy link
Author

gfvalvo commented Sep 2, 2022

a clumsy and not always working workaround is to close and re-open sloeber...

Even that rarely works.

@jantje
Copy link
Member

jantje commented Sep 2, 2022

Have you tried to trigger the discovery?
project properties->pre processor includes->providers->arduino compiler settings->Command to get compiler specs. change it (add a space)
Select Apply and close
As you are there also activate Allocate console in console view.
Next time it happens see whether the console provides some debugging info
afbeelding

@jantje
Copy link
Member

jantje commented Sep 16, 2022

Today I tried this with https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
Using version 2.0.4
I didn't see any problems.
afbeelding

@PerennialNovice
Copy link

Despite the title beeing for ESP32, I experience the same indexer misbehaviour for STM32.
I have Sloeber v 4.4.1.202207151257

Created a new project, add some very simple code (read inputs and write to serial)
(first hickup, that has nothing to do with this issue: SrcWrapper.h was not added automatically)
I saw that syntax-coloring was halfway done, but it wouldn't compile because of a missing semicolon. After correcting that and rebuilding (I always do a "build clean" before a build) Syntax coloring was completely gone.
Rebuilding the index, refreshing all files, re-resolving unresolved includes, nothing of these helped.

I then did the steps you wrote a few weeks back to trigger the discovery:

Have you tried to trigger the discovery? project properties->pre processor includes->providers->arduino compiler settings->Command to get compiler specs. change it (add a space) Select Apply and close As you are there also activate Allocate console in console view. Next time it happens see whether the console provides some debugging info afbeelding

And well, it worked!
This is a one-time experience for now, since I did not succeed in reproducing a state where the indexer misbehaves...

@jantje
Copy link
Member

jantje commented Oct 18, 2022

SrcWrapper.h was not added automatically

If there is an indexer issue SrcWrapper.h will not be added automatically.
It may also need a build before it gets added. Basically in Sloeber if the build fails: try again. If it still fails the second time you probably have a problem in the code/setup.

And well, it worked!

Great to see my assumption -that this problem is related to discovery failing- confirmed.

This is a one-time experience for now, since I did not succeed in reproducing a state where the indexer misbehaves...

Is there an error in the error log? And if this happens again and you have activated the console log. Can you provide the discovery console log and the error log here?
This may contain a clue where things go wrong.

@PerennialNovice
Copy link

PerennialNovice commented Dec 12, 2022

Hmm, strange that box is checked...
I triggered the discovery again and now it worked!

I had a correct index, changed some sloeber setting (in project properties -> sloeber -> Optimize from -O3 to -O0) and after that the index and syntax coloring was broken.

Here's what is in the console now:

12:23:54 **** Running scanner discovery: Arduino Compiler Settings ****
"C:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\tools\\xpack-arm-none-eabi-gcc\\10.3.1-2.3\\bin\\arm-none-eabi-g++" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_FULL_LL_DRIVER -mthumb "@C:\\Users\\xXxXxXx\\Documents\\Nucleo-Tests\\sloeberNucleo-Tests\\Test_L4R5\\Release/sketch/build.opt" -c -O0 -g -Wall -Wextra -std=gnu++17 -ffunction-sections -fdata-sections -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -MMD "-IC:\\Users\\xXxXxXx\\Documents\\Nucleo-Tests\\sloeberNucleo-Tests\\Test_L4R5" -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/avr -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32 -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/LL -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/OpenAMP -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb/hid -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb/cdc "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/Drivers/STM32L4xx_HAL_Driver/Inc" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/Drivers/STM32L4xx_HAL_Driver/Src" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/STM32L4xx" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/Middlewares/OpenAMP" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/Middlewares/OpenAMP/open-amp/lib/include" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/Middlewares/OpenAMP/libmetal/lib/include" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/Middlewares/OpenAMP/virtual_driver" -DSTM32L4xx -DARDUINO=10812 -DARDUINO_NUCLEO_L4R5ZI -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"NUCLEO_L4R5ZI\"" "-DVARIANT_H=\"variant_NUCLEO_L4R5ZI.h\"" -DSTM32L4R5xx -DUSBCON -DUSBD_VID=0 -DUSBD_PID=0 -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -DHAL_UART_MODULE_ENABLED "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\tools\\CMSIS\\5.7.0/CMSIS/Core/Include/" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0\\system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\tools\\CMSIS\\5.7.0/CMSIS/DSP/Include" "-IC:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\tools\\CMSIS\\5.7.0/CMSIS/DSP/PrivateInclude" -D__IN_ECLIPSE__=1 -E -P -v -dD -D__IN_ECLIPSE__ C:/Users/xXxXxXx/Documents/Nucleo-Tests/sloeberNucleo-Tests/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.cpp 
arm-none-eabi-g++: error: C:\Users\xXxXxXx\Documents\Nucleo-Tests\sloeber_Nucleo-Tests\Test_L4R5\Release/sketch/build.opt: No such file or directory
Using built-in specs.
COLLECT_GCC=C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\xpack-arm-none-eabi-gcc\10.3.1-2.3\bin\arm-none-eabi-g++
Target: arm-none-eabi
Configured with: /Host/home/ilg/Work/arm-none-eabi-gcc-10.3.1-2.3/win32-ia32/sources/gcc/configure --prefix=/Host/home/ilg/Work/arm-none-eabi-gcc-10.3.1-2.3/win32-ia32/install/arm-none-eabi-gcc --infodir=/Host/home/ilg/Work/arm-none-eabi-gcc-10.3.1-2.3/win32-ia32/install/arm-none-eabi-gcc/share/doc/info --mandir=/Host/home/ilg/Work/arm-none-eabi-gcc-10.3.1-2.3/win32-ia32/install/arm-none-eabi-gcc/share/doc/man --htmldir=/Host/home/ilg/Work/arm-none-eabi-gcc-10.3.1-2.3/win32-ia32/install/arm-none-eabi-gcc/share/doc/html --pdfdir=/Host/home/ilg/Work/arm-none-eabi-gcc-10.3.1-2.3/win32-ia32/install/arm-none-eabi-gcc/share/doc/pdf --build=i686-pc-linux-gnu --host=i686-w64-mingw32 --target=arm-none-eabi --with-pkgversion='xPack GNU Arm Embedded GCC i386' --enable-languages=c,c++ --enable-mingw-wildcard --enable-plugins --enable-lto --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/Host/home/ilg/Work/arm-none-eabi-gcc-10.3.1-2.3/win32-ia32/install/arm-none-eabi-gcc/arm-none-eabi --with-native-system-header-dir=/include --with-multilib-list=rmprofile --disable-build-format-warnings --with-system-zlib
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.3.1 20210824 (release) (xPack GNU Arm Embedded GCC i386) 
"C:/Sloeber/arduinoPlugin/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_FULL_LL_DRIVER -mthumb @C:\Users\xXxXxXx\Documents\Nucleo-Tests\sloeberNucleo-Tests\Test_L4R5\Release/sketch/build.opt -c -O0 -g -Wall -Wextra -std=gnu++17 -ffunction-sections -fdata-sections -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -MMD -IC:\Users\xXxXxXx\Documents\Nucleo-Tests\sloeberNucleo-Tests\Test_L4R5 -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/avr -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32 -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/LL -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/OpenAMP -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb/hid -IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb/cdc -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/STM32L4xx_HAL_Driver/Inc -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/STM32L4xx_HAL_Driver/Src -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/STM32L4xx -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/ST/STM32_USB_Device_Library/Core/Src -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/open-amp/lib/include -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/libmetal/lib/include -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/virtual_driver -DSTM32L4xx -DARDUINO=10812 -DARDUINO_NUCLEO_L4R5ZI -DARDUINO_ARCH_STM32 -DBOARD_NAME="NUCLEO_L4R5ZI" -DVARIANT_H="variant_NUCLEO_L4R5ZI.h" -DSTM32L4R5xx -DUSBCON -DUSBD_VID=0 -DUSBD_PID=0 -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -DHAL_UART_MODULE_ENABLED -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/Core/Include/ -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/ -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/ -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/DSP/Include -IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/DSP/PrivateInclude -D__IN_ECLIPSE__=1 -E -P -v -dD -D__IN_ECLIPSE__ C:/Users/xXxXxXx/Documents/Nucleo-Tests/sloeberNucleo-Tests/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.cpp" terminated with exit code 1. Build might be incomplete.

12:23:54 Build Finished. 0 errors, 0 warnings. (took 187ms)

@jantje
Copy link
Member

jantje commented Dec 12, 2022

Can you create the file
C:\Users\xXxXxXx\Documents\Nucleo-Tests\sloeber_Nucleo-Tests\Test_L4R5\Release/sketch/build.opt
and run the discovery again?

@PerennialNovice
Copy link

hmm, that file already exists (created 6 minutes after the above project settings change the corrupted the output)
Probably caused by some action I did to get back a working index/discovery

content of the file build.opt:



-fmacro-prefix-map=C:\\Sloeber\\arduinoPlugin\\packages\\STMicroelectronics\\hardware\\stm32\\2.3.0=.```

@jantje
Copy link
Member

jantje commented Dec 12, 2022

I think this makes sense
C:\Users\xXxXxXx\Documents\Nucleo-Tests\sloeber_Nucleo-Tests\Test_L4R5\Release/sketch/build.opt is probably created in the prebuild actions of the build
I assume that changing the compilation options deletes the folder C:\Users\xXxXxXx\Documents\Nucleo-Tests\sloeber_Nucleo-Tests\Test_L4R5\Release/
And then the discovery fails
After a build the file is back but no discovery is run anymore

@PerennialNovice
Copy link

I assume that changing the compilation options deletes the folder

yes, after clicking "apply & close" a lot happens in the GUI and among these happenings the release folder disappears.

I deleted the whole release folder and triggered discovery via the
above method

nothing happened, maybe some very quick actions that my eye didn't catch...

I then did a clean build, and triggered the discovery again.
Now the indexer runs for a longer time and after triggering the discovery index and syntax coloring is correct again.
But no output in the console from the discovery :/

as of yet I still have not found clearly what has to be done to recover the index... mostly a combination of a clean build and triggering the discovery works.
But sometimes it doesn't, I then restart sloeber and repeat the above steps in varying order until it eventually works again...

@jantje
Copy link
Member

jantje commented Dec 12, 2022

But no output in the console from the discovery :/

You have to jukebox the consoles. It is not really user friendly and error prone.

A fool proof full functionality supporting workaround won't be easy.
If you do not use the build.opt functionality I would comment out the line build.opt.path=${build.path}/sketch/${build.opt.name} in platform.txt (delete sloeber.txt; project properties->sloeber->apply close.

And this problem needs it's own issue as it is different form the original issue.

@PerennialNovice
Copy link

well, it seems that the STM32 implementation needs that specific line...
If I comment it out, the compiler complains a lot:

'Starting C++ compile'
"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\xpack-arm-none-eabi-gcc\10.3.1-2.3/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_FULL_LL_DRIVER -mthumb "@" -c -O3 -g -Wall -Wextra -std=gnu++17 -ffunction-sections -fdata-sections -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -MMD "-IC:\Users\ansay\Documents\_fs-Laser\sloeber_fs-Laser\Test_L4R5" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/avr" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/LL" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/OpenAMP" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb/hid" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb/cdc" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/STM32L4xx_HAL_Driver/Inc" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/STM32L4xx_HAL_Driver/Src" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/STM32L4xx" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/open-amp/lib/include" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/libmetal/lib/include" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/virtual_driver" -DSTM32L4xx -DARDUINO=10812 -DARDUINO_NUCLEO_L4R5ZI -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"NUCLEO_L4R5ZI\"" "-DVARIANT_H=\"variant_NUCLEO_L4R5ZI.h\""  -DSTM32L4R5xx -DUSBCON  -DUSBD_VID=0 -DUSBD_PID=0 -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -DHAL_UART_MODULE_ENABLED  "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/Core/Include/" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/DSP/Include" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/DSP/PrivateInclude" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\cores\arduino" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\variants\STM32L4xx\L4R5Z(G-I)T_L4R7ZIT_L4S5ZIT_L4S7ZIT" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\libraries\SPI\src" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\libraries\SrcWrapper\src" -MMD -MP -MF"Test_L4R5.cpp.d" -MT"Test_L4R5.cpp.o" -D__IN_ECLIPSE__=1 "..\Test_L4R5.cpp" -o "Test_L4R5.cpp.o"
'Starting C compile'
"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\xpack-arm-none-eabi-gcc\10.3.1-2.3/bin/arm-none-eabi-gcc" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_FULL_LL_DRIVER -mthumb "@" -c -O3 -g -Wall -Wextra -std=gnu11 -ffunction-sections -fdata-sections --param max-inline-insns-single=500 -MMD "-IC:\Users\ansay\Documents\_fs-Laser\sloeber_fs-Laser\Test_L4R5" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/avr" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/LL" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/OpenAMP" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb/hid" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb/cdc" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/STM32L4xx_HAL_Driver/Inc" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/STM32L4xx_HAL_Driver/Src" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/STM32L4xx" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/open-amp/lib/include" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/libmetal/lib/include" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/virtual_driver" -DSTM32L4xx -DARDUINO=10812 -DARDUINO_NUCLEO_L4R5ZI -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"NUCLEO_L4R5ZI\"" "-DVARIANT_H=\"variant_NUCLEO_L4R5ZI.h\""   -DSTM32L4R5xx -DUSBCON  -DUSBD_VID=0 -DUSBD_PID=0 -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -DHAL_UART_MODULE_ENABLED  "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/Core/Include/" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/DSP/Include" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/DSP/PrivateInclude" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\cores\arduino" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\variants\STM32L4xx\L4R5Z(G-I)T_L4R7ZIT_L4S5ZIT_L4S7ZIT" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\libraries\SPI\src" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\libraries\SrcWrapper\src" -MMD -MP -MF"libraries\SrcWrapper\src\stm32\PortNames.c.d" -MT"libraries\SrcWrapper\src\stm32\PortNames.c.o" -D__IN_ECLIPSE__=1 "C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\libraries\SrcWrapper\src\stm32\PortNames.c" -o "libraries\SrcWrapper\src\stm32\PortNames.c.o"
'Starting C++ compile'
"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\xpack-arm-none-eabi-gcc\10.3.1-2.3/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_FULL_LL_DRIVER -mthumb "@" -c -O3 -g -Wall -Wextra -std=gnu++17 -ffunction-sections -fdata-sections -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -MMD "-IC:\Users\ansay\Documents\_fs-Laser\sloeber_fs-Laser\Test_L4R5" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/avr" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/LL" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/OpenAMP" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb/hid" "-IC:/Sloeber/arduinoPlugin/packages/STMicroelectronics/hardware/stm32/2.3.0/cores/arduino/stm32/usb/cdc" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/STM32L4xx_HAL_Driver/Inc" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/STM32L4xx_HAL_Driver/Src" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/STM32L4xx" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/open-amp/lib/include" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/libmetal/lib/include" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Middlewares/OpenAMP/virtual_driver" -DSTM32L4xx -DARDUINO=10812 -DARDUINO_NUCLEO_L4R5ZI -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"NUCLEO_L4R5ZI\"" "-DVARIANT_H=\"variant_NUCLEO_L4R5ZI.h\""  -DSTM32L4R5xx -DUSBCON  -DUSBD_VID=0 -DUSBD_PID=0 -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -DHAL_UART_MODULE_ENABLED  "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/Core/Include/" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/DSP/Include" "-IC:\Sloeber\arduinoPlugin\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/DSP/PrivateInclude" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\cores\arduino" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\variants\STM32L4xx\L4R5Z(G-I)T_L4R7ZIT_L4S5ZIT_L4S7ZIT" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\libraries\SPI\src" -I"C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\libraries\SrcWrapper\src" -MMD -MP -MF"libraries\SrcWrapper\src\stm32\analog.cpp.d" -MT"libraries\SrcWrapper\src\stm32\analog.cpp.o" -D__IN_ECLIPSE__=1 "C:\Sloeber\arduinoPlugin\packages\STMicroelectronics\hardware\stm32\2.3.0\libraries\SrcWrapper\src\stm32\analog.cpp" -o "libraries\SrcWrapper\src\stm32\analog.cpp.o"
arm-none-eabi-g++: error: : No such file or directory
make[1]: *** [subdir.mk:20: Test_L4R5.cpp.o] Error 1
make[1]: *** Waiting for unfinished jobs....
arm-none-eabi-gcc: error: : No such file or directory
make[1]: *** [libraries\SrcWrapper\src\stm32\subdir.mk:63: libraries\SrcWrapper\src\stm32\PortNames.c.o] Error 1
arm-none-eabi-g++: error: : No such file or directory
make[1]: *** [libraries\SrcWrapper\src\stm32\subdir.mk:70: libraries\SrcWrapper\src\stm32\analog.cpp.o] Error 1
make: *** [makefile:106: all] Error 2
"C:/Sloeber/arduinoPlugin/tools/make/make -j8 all" terminated with exit code 2. Build might be incomplete.

14:16:44 Build Failed. 4 errors, 0 warnings. (took 6s.982ms)

Shall I open a new issue? If so, I need assistance in finding an appropriate title and description since I don't know enough about the specifics of what goes wrong here...

@jantje
Copy link
Member

jantje commented Dec 12, 2022

there is no file name in the error so this is probably caused by a double space :-(

@jantje
Copy link
Member

jantje commented Dec 12, 2022

sorry. That work around won't fly. I can't test here on this machine as this machine is a work in progress.
I'm making a new issue.

@PerennialNovice
Copy link

there is no file name in the error so this is probably caused by a double space :-(

Is it possible to tell in which command/file the double space could be? I can search for it, but due to lack of knowledge don't know where to start looking...

@jantje
Copy link
Member

jantje commented Dec 13, 2022

I provided a workaround in the issue #1534 which is about the opt file problem.
This issue is in regards the indexer being deactivated after a close open project

@gfvalvo
Copy link
Author

gfvalvo commented Jan 10, 2023

This issue is marked "fixed in the nightly". Yet it persists in Stable Product v4.4.1. Does this Stable version pre-date the "nightly" in which the fix was implemented?

Also the workaround of "project properties->pre processor includes->providers->arduino compiler settings->Command to get compiler specs. change it (add a space)
Select Apply and close" does not work as well with 4.4.1 as it did with 4.4.0. Once the project and Sloeber are closed, indexing never seems to work again.

@jantje
Copy link
Member

jantje commented Jan 10, 2023

Things marked fixed in nightly are not yet released.
You can download the "nightly" from the actions above. Scroll down for artifacts.
Here is a link to the latest nightly at the time of writing
https://github.com/Sloeber/arduino-eclipse-plugin/actions/runs/3659904477

@gfvalvo
Copy link
Author

gfvalvo commented Jan 17, 2023

Here is a link to the latest nightly at the time of writing
https://github.com/Sloeber/arduino-eclipse-plugin/actions/runs/3659904477

WOW, this works a lot better than previous versions. Thanks!!!!

I notice it also seems to fix This Problem

The only "Fake Errors" I'm still getting now are those associated with the data structures and functions in the file "esp_camera.h". The code compiles error-free but the Indexer simply doesn't "see" anything in that file. Perhaps it's because of the file's location? This is were it is in the installation directory:

D:\SloeberNightly230109\arduinoPlugin\packages\esp32\hardware\esp32\2.0.6\tools\sdk\esp32\include\esp32-camera\driver\include

Is it possible to also make the Indexer look there?

Thanks again.

@jantje
Copy link
Member

jantje commented Jan 17, 2023

I notice it also seems to fix #1364

Not sure why that would be fixed but I had to a add "completely ignore pre build errors" for esp8266 :-( ; maybe that is related.

If the build finds the esp_camera.h file the indexer should find it to. You can see what the discovery found in project properties->C/C++ General->Entries
afbeelding

As a workaround you could try to add the path to the include paths.
afbeelding

@Alex-Kent
Copy link
Contributor

Alex-Kent commented Aug 8, 2023

I'm seeing something similar with the latest nightly build (as of 2023-08-08) and the arduino-esp32 SDK. From the indexer's console output (as mentioned above) it appears that (for ESP32) the indexer is only looking at files provided by Arduino Compiler Settings while the broken includes I'm seeing are those provided by CDT Managed Build Settings Entries [ Shared ] (this is going by the list of provided files shown under Project properties → C/C++ General → Preprocessor Include Paths, Macros etc. → Entries → GNU C++). This only effects the indexer; builds work fine.


Edit: Deselecting Project properties → C/C++ General → Indexer → Index all header variants made the issue mostly go away (in both 4.4.1 and the latest nightly build) with library classes and methods now being indexed. In my test project it's a #define and a couple of typedefs that are still being marked as an error/not being indexed (these are defined is in a core header file driver/i2s.h that is being included from a library header file).

@PerennialNovice
Copy link

For whatever reason, this issue is back for me (existing project) with a 4.4.3 release and also the 5.0 nightly ...
None of the above mentioned workarounds helped

@jantje
Copy link
Member

jantje commented Aug 20, 2024

Strange.
It was reported that the discovery phase in V5 did not find all includes.
But for now V5 is still in gamma testing and esp32 seems to be the focus as it is not working as should -which is no surprise to me as esp32 is the hardest plat(form to get to work-.

Not sure why that would be fixed but I had to a add "completely ignore pre build errors" for esp8266 

I completely forgot about this one and it is for sure not in V5.0. I hope this is not needed in V5.0

@PerennialNovice
Copy link

well, after a fresh install of 4.4.3, indexing seems to be correct again !
issue on the user side I suspect ;)

will check for V5.0 tomorrow

@jantje
Copy link
Member

jantje commented Aug 20, 2024

Before checking V5 for esp32 wait for a fix for "exclude from build"
I hope to finish this today but it seems to be very invasive (due to configuration rename)

@PerennialNovice
Copy link

My issue is not related to ESP32, I am on STM32

@jantje
Copy link
Member

jantje commented Aug 21, 2024

STM32 in general behaves better than esp32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants