Sloeber / arduino-eclipse-plugin

A plugin to make programming the arduino in eclipse easy
https://eclipse.baeyens.it/
420 stars 131 forks source link

String declaration for variables will freeze the code on the STM32 f103 #944

Closed ORGATHM closed 6 years ago

ORGATHM commented 6 years ago

Hello. I got a strange problem. I startet a project in the original Arduino IDE. It works great. After hundrets of rows coding and a dozend of functions, i feel annoyed about the bad arduino IDE. So i searched for a better IDE. After a couples of hours i found the great Sloeber Eclipse mod. So far so good, I inserted the board extension for STM32 (F103C8T8), STM32duino: http://dan.drown.org/stm32duino/package_STM32duino_index.json Some sample Scripts are running well. For example, the Analog Clock over SPI ILI9341 Display. Only my own Project freezes. The Debuglog shows a couple of yellow and one red bugs, but with this bugs the Analog Clock demo skripts works. That was not the real Problem. The real problem is not marked as a probem... if the programm comes to this lines onto the microcontroller, it freezes.

For better understanding and replicating the problem, i modded the "blink" skript. So everybody can check it by himself.

I used the String definition for Variables, a couple of times I used it to push static Text into my functions. Both will run with ardiono original IDE, but not with Sloeber.

`/* Blink by Scott Fitzgerald Modified by Roger Clark. www.rogerclark.net for Maple mini 25th April 2015 , where the LED is on PC13 Modified by DOMin8or for "String" type variables problem demonstration.

same freezing with function definition like void myFunction(String inputText) {;} */

include "Arduino.h"

// #include "header.h" // #include

void setup() { // initialize digital pin PC13 (internal led from STM32 F103) as an output. pinMode(PC13, OUTPUT); }

void loop() { // The 5 rounds loop will work for(byte xi=0;xi<5;xi++) { digitalWrite(PC13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(PC13, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }

String text="test"; // this is the bad boy, that freezes the code

                          // FREEZE!

for(byte xi=0;xi<10;xi++) // this code will NOT start. the LED is now ON { // this fast blink loop will not start. digitalWrite(PC13, HIGH); // (turn the LED on (HIGH is the voltage level) delay(200); // (wait for 200ms) digitalWrite(PC13, LOW); // (turn the LED off by making the voltage LOW) delay(200); // (wait for 200ms) }

} ` BlinkTest.ino.txt

I make some log files, after finding the verbose options in both IDE´s .

ORGATHM commented 6 years ago

Logfile with all verbose data on the original Arduino IDE 1.8,5 https://pastebin.com/ckrE5bGf

ORGATHM commented 6 years ago

i dont know where the verbose paramter is. i hope thats enough debug info. if not, please let me know how to set it in Sloeber. Sloeber Log (old) https://pastebin.com/i3yB5wbz

jantje commented 6 years ago

Very strange behaviour indeed. These are the build logs I requested. This is important because Sloeber and Arduino IDE use the exact same build commands. There are some differences because the files are at a different location and Arduino IDE, Sloeber and the tooling I use (CDT) have their own "specific behaviour". This is why the result you have now is strange ...

Unfortunately the Arduino IDE log only contains the compile of the .ino file but still there is a differences that may explain the different behaviour. The stm32F1 platform used is different between Arduino IDE and Sloeber 2018.2.26 versus 2018.3.18 Please see whether you have the same issue when using version 2018.3.18 in Arduino IDE. If not please provide the complete arduino IDE build log.

Best regards Jantje

As an independent open source project we value your submission, but we ask for support, either by helping us out coding (yeah, we do understand it does require time) or a Patreon contribution (starting from as low as 1$ a month): this allows us to support people who support us back! As a supporter you can drag our attention and prioritize your submission... please become a supporter! https://www.patreon.com/jantje

ORGATHM commented 6 years ago

Hello Jantje. I found an extra verbose option inside the Arduino Ide preferences.txt config file. So I installed Arduino IDE new, into the standard Path. And i installed a fresh Sloeber to C:/Sloeber, because you wrote about different pathes. I added my private hardwarepath and the .json file. And i switched to the 2018.2.26 in Sloeber. Unfortunely the Sting command will freeze the code on the microcontroller, exactly when the command is executed. Compiling is no problem at all. No warnings, no nothing. I send you the new Logfiles. I cant find any option in the Arduino IDE/preferences.ini to change the Platform Date.

Maybe you have 5 Minutes to check it with the STM32 F103 C8T8 board. (The C8T8 is introduced with 64kb, but in reallity they all have 128kb flash) If you are interested, i can send you 10$ and you order it on ebay. My test skript is fast uploaded, and the LED is onboard. The only thing you need is a FTDA Serial adapter connected to PA9+PA10+GND and a Microusb cable only for the 5V Power, or you can power it over the FTDI.

Thank you very much, and i am a new, small Jantje patreon supporter. :-) Best Regards, DOMin8or Next 2 postings, the new Logfiles

ORGATHM commented 6 years ago

Arduino LOG, extra verbose https://pastebin.com/TCauG4pw

jantje commented 6 years ago

Thanks for becoming a patron Unfortunately there is only 1 post.. which is the arduino compile. Waiting for the second post.

ORGATHM commented 6 years ago

okay. one moment. i think the debug is same, like before. only the path may changed. maybe you have an idea what i have to change. one simple thing i saw, but i dont know about the effect. the compile parameter is a little bit different. arm-none-eabi-g++" -c -g -Og ................ (sloeber) arm-none-eabi-g++" -c -g -Os ................. (arduino)

Sloeber log: https://pastebin.com/EEhCa611

jantje commented 6 years ago

Os versus Og can make a difference I'll look into why that difference exists

ORGATHM commented 6 years ago

maybe i change the path in soeber to the arduino IDE compiler? if we can not find any solution, did you think about my 10$ idea? i can send it to you by paypal or patreon. so you can order one of this microcontrollers on ebay, to check what wents wrong. now, i am on a point where i need the eclipse IDE. my source is now over 1000 lines and without the outline feature it is a torture... ;'-) i can copy the source fom eclipse to arduino ide, but this not as good as using your great plugin. :-)

jantje commented 6 years ago

Og is no optimisation and is when you select debug. OS is small optimisation and is used when selection one of the small options As to the board.. I do not object but I do not see how this will get us any further. I have no specific hardware to debug so I could only confirm (or disconfirm) your blinking led perception.

jantje commented 6 years ago

I see there are lots of S files. This might be a duplicate of #660

ORGATHM commented 6 years ago

I read threat #660, maybe it helps? is it possible to change the path from the sloeber compiler to the arduino compiler? make this sense?

ORGATHM commented 6 years ago

I cant find any .s or .asm files, like threat #660 No libraries included. i found a lot auf .c and .h files. WString,h + Wstring.cpp are looking interesting, but they include some other files

jantje commented 6 years ago

Maybe you have to many libraries. Can you delete all the libraries in the libraries folder? If they are needed they will reappear (some builds may be required)

ORGATHM commented 6 years ago

i see no libraries in the left tree. but a attention message, i cant understand. it seems to me as a wrong interpreted command?

Type 'String' could not be resolved What does it mean? I

image

ORGATHM commented 6 years ago

after pressing cleaning and rebuild index, its gone, now it show the class. but it freezes if it runs to the line.

indexrebuild

ORGATHM commented 6 years ago

i found an interesting thing... if i set a text string like this: const char* text = "this is my text"; it does work without freezing and does the same like: String text="this is my text";

Maybe this helps to find the failure. Maybe its inside the string class? I`ve tested it after an attention warning in the IDE comes up. Why the compiler wants to convert something?

Why the word CHAR is purple highlighted and BOLD, and the word STRING is green and not bold?? It must be purple and bold, too? Or both must be green, like in Arduino original IDE

this freezes: constchar

char_string_freeze_clock

this works: constchar2

char_const_star_clock

this works also: charstar

char_star_clock

without star, it makes erros in the rest of the source... char_no_star

jantje commented 6 years ago

The string is green here with me as well. But I do not get the warning. I would assume this warning to be an error and a explanation of the behaviour you see. I always go for 0 errors and 0 warnings :-) Are you sure you didn't change any of the core files? You should be able to tell based on the date/times on your file system.

ORGATHM commented 6 years ago

Hello Jantje, thanks for fast reply. Yesterday I was so frustrated, i deleted all eclipse stuff. But without eclipse it isn`t an option. So i thought i code inside eclipse and copy paste it to Arduino IDE... Just test the 32 Bit Version... Then i downloaded the 32 Bit version 4.2 from yor server. (Before I used the 64bit Version) (Nightly updates are not working for me. There is a .ini missing in the JNE folder, if i copy the nightly build over the existing files) Okay, On C:\ Sloeber will not start anymore. A black window appears and the Log said, all .JSON downloads not possible, "TIME OUT". Grande Catastrophe... Starting an starting over, fresh unzip copied to C:/, allways no Plugins download, "TIME OUT". I cant belive what is going on, so I startet an old installed version on Drive E:. It works perfekt. okay, everything back to start. New folder e:/sloeber createt, and inserted a clean 32 bit sloeber. inserted the stm boards .json link. waiting for download the addon stuff. my arduino ide (1.8.5) is now, fresh installed inside c:/Program Files (x86)\Arduino then i added the Private Library Path: C:\Users\dom_is_my_profile_name\Arduino\libraries and adding THE PRECONFIGURED PATH DOES NOT CONTAINS ANY ARDIUNO STUFF..... C:/Users/dom/Arduino/libraries AND IT WAS CONFIGURED WITH SLASHES , but if i use [NEW] button, and select a new path with the file explorer dialog, it creates a path with BACKSLASHES... (Seems confusing for me...) Then i deleted the preconfigured entry inside Private hardware path... to existing C:\Program Files(x86)\Arduino\hardware\avr inside this folder is: boards.txt, platform.txt, programmers.txt

libs

platform

ORGATHM commented 6 years ago

i`ve shorten this threat, by uploading all LOGs to pastebin. My Samsung Tablet has frozen, if i go inside this threat :-) I took a new LOG capture, with my new 32 bit sloeber on drive E:/, see next posting.

ORGATHM commented 6 years ago

new Sloeber freezing LOG at pastebin: https://pastebin.com/hjfhQhyb

e-freeze

new Sloeber freezing LOG at pastebin: https://pastebin.com/hjfhQhyb

jantje commented 6 years ago

Then i deleted the preconfigured entry inside Private hardware path... to existing C:\Program Files(x86)\Arduino\hardware\avr

Don't do this. ever!!

ORGATHM commented 6 years ago

okay, i got this from stm32duino site. mostly it works, only String command does not work... what path i have to locate? thanks for assistance :-) this?: E:\sloeber\arduinoPlugin\packages\stm32duino\hardware\STM32F1\2018.2.26 a guy wrote, that the boards.txt must inside the folder, is he right? and what about the jre inside Sloeber? must it declared in the windows path? or in the varaibles inside Sloeber eclipse?

ORGATHM commented 6 years ago

the path variable is red... what does it mean?

vars1

vars_red

jantje commented 6 years ago

If you refer to these http://wiki.stm32duino.com/index.php?title=Arduino_with_Eclipse installation instructions... the last update is from 2016!!!! And even then they were outdated. The bottom part states these are instructions fro V2 (not even V3) Talking about crappy documentation :-(

jantje commented 6 years ago

I'm not sure what you are doing but you miss Sloeber basics. It is all lots simpler than what you are doing. You do not need to set private hardware nor private libraries Just install the boards as you did in arduino IDE Maybe you should watch some of my video's to get the basics https://www.youtube.com/watch?v=zc2JLbtbI7Q&list=PLCSjf7QmP3TDPSjT_5UIp0DHXzKdhIQsF And please update the page to reflect V2 V3 at the top http://wiki.stm32duino.com/index.php?title=Arduino_with_Eclipse

ORGATHM commented 6 years ago

now i am more then 5 days installing sloeber, over and over and over. more then 30 times... i am so desperated, so i took all little hints & options and outdated infos from the internet.

now i installed a fresh windows into VM-Ware, installed arduino 1.8.5 to standart path, installed the board repo (.json) installed java (JavaSetup8u161.exe) unziped io.sloeber.product-4.2.0-20180116.154118-36-win32.win32.x86_64.tar.gz to c:/sloeber installed .json repo as 3d party created new arduino project, selected STM32 F103C board with date 28.2.. selected board and flash methode, nothing else configured. i think as simple is that, and thats the right way. it compiles and flashes, so i am not wrong.

and it does work....., like before. most skripts are running, only if the command: String myRandomVar ="text"; comes in the source it does freeze. it makes no difference if i use the 4.2 stable release or the nightly. and the nightly will not start on my master machine. there comes a not nice java error. (i have java deinstalled and fresh installed, but the error comes again and again.) in vm ware the nightly works well, but freezes at String, like all the time with the stable version. i think sloeber is great for noobs+pros, they want a better arduino ide. and for the most guys it is. but with my STM F103 C8T8 it freezes. i wont believe it and i give one try on another. 5 days & nights. but it does not work. i hoped it so much, but i can`t do even more, then use a fresh windows and install & testing it, over and over again.

now i have seen a lot of your movies and it teaches me a lot of deeply hidden features. its a master piece of software, you have done. now i am more interested then before to use Sloeber... :-) but i learned, that Sloeber is greatfully preconfigured and it does everything automaticly. so the failure can not be on my side :-) good to know, but i cant see the finishline and it makes me sad. i did know that eclipse is good and sloeber makes it much better, but what is it usefull for, if i cant use it with my microcontroller, spezially with my own code that contains the String command? i am one little step before, but without the String command it is absolutely not usable for me. i become gray hairs about it. :-) so near, and not close enough... i think i write into stm32 forums, where are active stm32 f103 users, they can proof the scenario. unfortunely i see no other way. thanks for the time you spent me and my problem. Sloeber rulez! :-))

jantje commented 6 years ago

now i installed a fresh windows into VM-Ware,

Not sure why you want to use a vm as sloeber runs on windows mac and linux

installed arduino 1.8.5 to standart path, installed the board repo (.json)

This is not needed

installed java (JavaSetup8u161.exe) :-) good Note that this is not necessary when you install a release. Sloeber releases come with a jre

unziped io.sloeber.product-4.2.0-20180116.154118-36-win32.win32.x86_64.tar.gz to c:/sloeber installed .json repo as 3d party created new arduino project, selected STM32 F103C board with date 28.2.. selected board and flash methode, nothing else configured. i think as simple is that, and thats the right way. it compiles and flashes, so i am not wrong.

This sounds like it should be.

i think i write into stm32 forums, where are active stm32 f103 users, they can proof the scenario. unfortunely i see no other way.

I think that is a good idea. As we have seen, Sloeber uses the same build commands as Arduino IDE so there must be a problem with "files that should not be part of the build" or linking problems. There should be more knowledge about that on the stm32 forums.

so the failure can not be on my side

I have been wrong before but at this point in time I agree with this. This is also why I think me having the same hardware will not help and why I think the stm32 forums is the place to ask questions. Please post the link so I can read/discuss along.

ORGATHM commented 6 years ago

thanks for reply. i tested with a fresh new windows inside the vm ware, to eleminate every possible missconfiguration on my machine. after 30 rounds of installing Sloeber and some other IDE`s , it seems my Java does not exactly what it has to to. I wrote you about the error.

if i unzip the nightly to C:/ on my master machine it does not start. SAME zip file in VM works properly.

nightly

After deleting c:/sloeber and unzip the stable 32bit bundle, no plugin download possible... new error.... stable-c

and the best thing is,..... Sloeber runs on drive E:/developement/sloeber without any problems. this was too chaotic for me, so i used a fresh, clean windows in VM-WARE. after 1 week testint Sloeber, atom + platformIO, Arduino Ide 1.8.5 + 1.9.0, System Workbench, and a lot more programs, something with my $path went wrong, or what ever is wrong. its catastrophic. the only thing i nees, is a better ardiuno IDE. nothing more. just an IDE... :-)

jantje commented 6 years ago

According to this stackoverflow post running natively doesn't work due to incompatible java runtime https://stackoverflow.com/questions/7352493/failed-to-load-the-jni-shared-library-jdk

After deleting c:/sloeber and unzip the stable 32bit bundle, no plugin download possible...

As all json downloads fail I assume you have told windows that the java runtime is not allowed to access the internet/ You could disable your firewall and start sloeber to see if that assumption is true.

Note that the stable contains a jre folder. This is the java runtime included with sloeber and when you have a jre subfolder that one gets used.

after 1 week testint Sloeber, atom + platformIO, Arduino Ide 1.8.5 + 1.9.0, System Workbench, and a lot more programs,

IMHO you have been trying to many things and missed some basic things. Add to that the "security features" of windows 10 and 32bit versus 64 bit; and the tool providers are off for "sitting with a blind man trying to describe yellow". Not a nice place for any of us ;-) Really no offence because I know that when I am in this situation; I start mixing stuff from different versions and tools. My advice: stick to one version (like sloeber V4.2 stable 64 bit on windows native) to get it running. Do standard things first (like compile and upload to blink to the uno) and gradually add to get to your target environment. Also stick to one source of information. There are many ways to skin a cat. Mixing ways is "advanced". IMHO you are not up to that yet.

ORGATHM commented 6 years ago

the java works, and here are no firewall restrictions. and i am not a noob :-) only with C...

i do not have experience with gcc and c, but i have more then 30 years expirence with 6510 assembler, basic, html, php, mysql, apache, ms dos+batch, win 3.1, win95, win 2000, win7, win8, win10, small linux, photoshop, and now i am learning c and microcontroller programming. its not my first rodeo. it is only a new language and enviroment. and my project works very well. it is coded from the ground without any copy pasted code. the only thing what brakes me out, is the search for a better UI/IDE.

"sitting with a blind man trying to describe yellow" hurts and insults me. i have no bookware about microcontrollers and gcc... that could be a problem. the intenet is full of information. but it is not as easy to find the right informations... :-)

"My advice: stick to one version (like sloeber V4.2 stable 64 bit on windows native) to get it running. " it is running, from the beginning. the problem is the String declaration. its not my fault.

shelf

ORGATHM commented 6 years ago

i found an other board definition package, copyright seems directly from stm for arduino. https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/master/STM32/package_stm_index.json the gcc call looks years newer... arm-none-eabi-gcc/6-2017-q2-update/bin/arm-none-eabi-g++ in my old logs i see: arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g+ maybe this could fix the problem, a newer gcc... i`ve tested it in the arduino ide and it works. now the device has the codename bluepill, thats great. buuuut.... after installing it into Sloeber, Sloeber cant cook any source code. i start new project, select the new device named bluepill, and selected everything right, an error occurs.

https://pastebin.com/2WgNJiMr

19:33:24 Build of configuration Release for project clock "E:\sloeber\arduinoPlugin\tools\make\make" all 'Building file: ..\sloeber.ino.cpp' 'Starting C++ compile' "E:\sloeber\/arduinoPlugin/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q2-update/bin/arm-none-eabi-g++" -mcpu=cortex-m3 -mthumb @C:\Users\dom\Documents\sloeber-workspace\clock/Release/sketch/build_opt.h -c -Os -Wall -Wextra -std=gnu++14 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-I" "-IE:\sloeber\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/cores/arduino/avr" "-IE:\sloeber\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/cores/arduino/stm32" "-IE:\sloeber\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Drivers/STM32F1xx_HAL_Driver/Inc/" "-IE:\sloeber\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Drivers/STM32F1xx_HAL_Driver/Src/" "-IE:\sloeber\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/STM32F1xx/" "-IE:\sloeber\arduinoPlugin\packages\STM32\hardware\stm32\1.2.0\variants\BLUEPILL_F103C8/usb" "-IE:\sloeber\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-IE:\sloeber\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -DSTM32F1xx -DARDUINO=10802 -DARDUINO_BLUEPILL_F103C8 -DARDUINO_ARCH_STM32 -DSTM32F103xB -DNO_HWSERIAL "-IE:\sloeber\/arduinoPlugin/packages/STM32/tools/CMSIS/5.3.0/CMSIS/Core/Include/" "-IE:\sloeber\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Drivers/CMSIS/Device/ST/STM32F1xx/Include/" "-IE:\sloeber\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/" -I"E:\sloeber\arduinoPlugin\packages\STM32\hardware\stm32\1.2.0\cores\arduino" -I"E:\sloeber\arduinoPlugin\packages\STM32\hardware\stm32\1.2.0\variants\BLUEPILL_F103C8" -I"E:\sloeber\arduinoPlugin\packages\stm32duino\hardware\STM32F1\2018.2.26\libraries\Adafruit_GFX_AS" -I"E:\sloeber\arduinoPlugin\packages\stm32duino\hardware\STM32F1\2018.2.26\libraries\Adafruit_ILI9341_STM" -I"E:\sloeber\arduinoPlugin\packages\STM32\hardware\stm32\1.2.0\libraries\SPI" -I"E:\sloeber\arduinoPlugin\packages\STM32\hardware\stm32\1.2.0\libraries\SPI\src" -MMD -MP -MF"sloeber.ino.cpp.d" -MT"sloeber.ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "..\sloeber.ino.cpp" -o "sloeber.ino.cpp.o" arm-none-eabi-g++: error: @C:\Users\dom\Documents\sloeber-workspace\clock/Release/sketch/build_opt.h: Invalid argument subdir.mk:31: recipe for target 'sloeber.ino.cpp.o' failed make: *** [sloeber.ino.cpp.o] Error 1

19:33:25 Build Finished (took 948ms)

Arduino working compile log, to compare: https://pastebin.com/VAUX5Urf

its very interesting, how much errors i can produce, with a full automatic tool. :-)) (btw. all plugins downloaded without problems...no firewall or problems like this) * HAPPY EASTER :-)

ORGATHM commented 6 years ago

after viewing the esp32 movie, and following all the steps, my ESP32 compiles well. and the best is.... the String declaration works without freeze on the ESP32... (this procedure was good for learning. and i can decide to move to esp32... lol)

then i decided to remove all my added arduino related .json files and i do it the .git way. https://github.com/stm32duino/Arduino_Core_STM32 so far so good, importing git works, the boards are selectable. but if i compile the the 3 standard commands, a path error shows up. before the /bin/...... the basepath is missing. i think its no bid deal, with a hint from you. the subdir.mk is red in row 24. @echo 'Building file: $<'

05:07:04 Build of configuration Release for project stmduinotest1 "E:\sloeber\arduinoPlugin\tools\make\make" all 'Building file: ..\sloeber.ino.cpp' 'Starting C++ compile' "/bin/arm-none-eabi-g++" -mcpu=cortex-m3 -mthumb @C:/Users/dom/Documents/sloeber-workspace/stmduinotest1/Release/sketch/build_opt.h -c -Os -Wall -Wextra -std=gnu++14 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-I" "-IE:\sloeber\/git-import/arduino_core_stm32/Arduino_Core_STM32/cores/arduino/avr" "-IE:\sloeber\/git-import/arduino_core_stm32/Arduino_Core_STM32/cores/arduino/stm32" "-IE:\sloeber\/git-import/arduino_core_stm32/Arduino_Core_STM32/system/Drivers/STM32F1xx_HAL_Driver/Inc/" "-IE:\sloeber\/git-import/arduino_core_stm32/Arduino_Core_STM32/system/Drivers/STM32F1xx_HAL_Driver/Src/" "-IE:\sloeber\/git-import/arduino_core_stm32/Arduino_Core_STM32/system/STM32F1xx/" "-IE:\sloeber\git-import\arduino_core_stm32\Arduino_Core_STM32\variants\BLUEPILL_F103C8/usb" "-IE:\sloeber\/git-import/arduino_core_stm32/Arduino_Core_STM32/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-IE:\sloeber\/git-import/arduino_core_stm32/Arduino_Core_STM32/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -DSTM32F1xx -DARDUINO=10802 -DARDUINO_BLUEPILL_F103C8 -DARDUINO_ARCH_ARDUINO_CORE_STM32 -DSTM32F103xB -DNO_HWSERIAL "-I/CMSIS/Core/Include/" "-IE:\sloeber\/git-import/arduino_core_stm32/Arduino_Core_STM32/system/Drivers/CMSIS/Device/ST/STM32F1xx/Include/" "-IE:\sloeber\/git-import/arduino_core_stm32/Arduino_Core_STM32/system/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/" -I"E:\sloeber\git-import\arduino_core_stm32\Arduino_Core_STM32\cores\arduino" -I"E:\sloeber\git-import\arduino_core_stm32\Arduino_Core_STM32\variants\BLUEPILL_F103C8" -MMD -MP -MF"sloeber.ino.cpp.d" -MT"sloeber.ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "..\sloeber.ino.cpp" -o "sloeber.ino.cpp.o" **Das System kann den angegebenen Pfad nicht finden. subdir.mk:24: recipe for target 'sloeber.ino.cpp.o' failed make: * [sloeber.ino.cpp.o] Error 1

05:07:05 Build Finished (took 983ms)

jantje commented 6 years ago

the bluepill thing is issue #927 Creating the file c:/Users/dom/Documents/sloeber-workspace/stmduinotest1/Release/sketch/build_opt.h may help but I fear on windows the @ causes issues as well

I'm not sure which repository you used for the esp32 (which has a json by now as well) but in the one I use in the video platform.txt contains following line runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32-elf yours seems to be missing this one (or something like it)

ORGATHM commented 6 years ago

hello Jantje, after having no success with all the bluepill stuff aka STM32 f103 (the mikrocontroller i am using), i need a little success. and to verify the String problem on an other platform, i connected my ESP32 and installed it the .git way. seen in your esp32 video. https://youtu.be/szRrvJPvQz4 ( https://github.com/espressif/arduino-esp32.git ) with this success, after your great but tricky manual, i feel better and hopeful, that the git methode will work for arduino-STM also. thats the reason why i deleted this two arduino stm .json imports. and imported/cloned this two arduino stm git repos. same same, but different, i hoped... lol https://github.com/stm32duino/Arduino_Core_STM32.git https://github.com/rogerclarkmelbourne/Arduino_STM32.git inside the Arduino_Core_STM32.git, is a 2017 gcc compiler, not the 2014. my hope is, maybe, this helps for my String declaration problem.

your hint with sketch/build_opt.h works. now it compiles the source. great. unbeleavable. for real, how could i imagine to insert a blank textfile into a not existing folder?

FINALY, IT WORKS! String declaration WORKS. YOU ARE THE BEST no more freezing. one little problem, i got. but i could fix it by my self. after compiling, it was not possible to flash the recipe. could not found path to stm tools. so i deflated the windows tools from E:\sloeber\arduinoPlugin\downloads\tools_win-2018.2.26.zip into: E:\sloeber\git-import\arduino_core_stm32\tools

in short: import https://github.com/stm32duino/Arduino_Core_STM32.git mkdir Project/Release/sketch/ touch Project/Release/sketch/build_opt.h unzip tools to the .github package.

but after compiling, the build_opt.h is gone... is it possible to fix that an other way? who calls build_opt.h? maybe i can kick this line? or insert a little skript, that creates the build_opt.h automaticly?

jantje commented 6 years ago

your hint with sketch/build_opt.h works. now it compiles the source. great. unbeleavable. for real, how could i imagine to insert a blank textfile into a not existing folder?

the command line states @c:/Users/dom/Documents/sloeber-workspace/stmduinotest1/Release/sketch/build_opt.h And the error states Das System kann den angegebenen Pfad nicht finden.

but after compiling, the build_opt.h is gone... is it possible to fix that an other way? who calls build_opt.h? maybe i can kick this line? or insert a little skript, that creates the build_opt.h automaticly?

Sloeber assumes everything in the release folder to be "created resources" as such these get deleted when Sloeber or CDT thinks it is necessary. I really do not know why the file build_opt.h is needed nor why it is in the gcc command with a @ and for sure not what the reasoning is to put this file in the build location. I do see in the platform.txt

compiler.extra_flags=-mcpu={build.mcu} -mthumb @{build.opt.path}
build.opt.path={build.path}/sketch/{build.opt.name}

Which explain the existence of this file in the gcc command. There is also recipe.hooks.prebuild.1.pattern.windows=cmd /c "if not exist {build.opt.sourcepath} mkdir {build.path}\sketch & type NUL > {build.opt.path}" In the platform.txt. I knew all this because I try to compile all boards in the third party boards. This board failed so I made the issue.

to work around this: add following command to project properties->C/C++build->settings->build steps->pre build steps->command cmd /c "if not exist sketch mkdir sketch & type NUL > sketch/build_opt.h

jantje commented 6 years ago

include // no import

include // no import

Automatic install and import in the project is only supported by for libraries that have a foldername = includename-.h Adafruit does not follow this convention so needs to be installed and imported manually install arduino->preferences import see http://eclipse.baeyens.it/how_to.shtml#/lib the V2 and V3 way

ORGATHM commented 6 years ago

thank you so much for your assitance. great. actually the adafruits importing, only the DHT makes a bit trouble, but i follow your manual.

ORGATHM commented 6 years ago

hello jantje. the, cmd /c "if not exist sketch mkdir sketch & type NUL > sketch/build_opt.h" does not work as precompile command. in the windows CMD, copy pasted, it works. its no big deal. i created a batch file. one click, and its done. but why does it not work as precompile command? tested wit 4.2 release and the nightly (not updated) from your download server.

my batch started from inside the project directory and works. its not the coolest, but a working way. cmd /c "if not exist .\Release\sketch md .\Release\sketch & type NUL > .\Release\sketch\build_opt.h"

actually i am fighting with the libs. the optimized STM32 libs, for using DMA GFX lib, calls something that is not inside the . tested with 3 different SPI.h libs ... later i search deeper inside the libs for the dependencies and calls. with arduino IDE it works well, without any configuring....... :-) its allways fun :-) the easiest way, would be to use the arduino IDE managed libraries :-)

best regards, DOM

jantje commented 6 years ago

the, cmd /c "if not exist sketch mkdir sketch & type NUL > sketch/build_opt.h" does not work as precompile command.

I tested it here and it did work for me. It is pure CDT functionality (nothing to do with Sloeber) heavily used by lots of users.

the easiest way, would be to use the arduino IDE managed libraries :-) you can not point to Arduino managed libraries because arduino IDE only extracts the zips when building. You can however turn on verbose in arduino IDE and see what libraries are being used. This story and the String issue look as if something is(not) linked in correctly.

ORGATHM commented 6 years ago

its unbeleavable, here it worked one time, too. i have nothing changed. after deleting the sketch file, and test again....

22:50:19 Build of configuration Release for project STM32coreTest1 "E:\SloeberX64n\arduinoPlugin\tools\make\make" all 'Building file: ..\sloeber.ino.cpp' 'Starting C++ compile' "E:\SloeberX64n\/arduinoPlugin/packages/STM32/tools/arm-none-eabi-gcc/6-2017-q2-update/bin/arm-none-eabi-g++" -mcpu=cortex-m3 -mthumb @E:\SloeberX64n\sloeber-workspace\STM32coreTest1/Release/sketch/build_opt.h -c -Os -Wall -Wextra -std=gnu++14 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-I" "-IE:\SloeberX64n\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/cores/arduino/avr" "-IE:\SloeberX64n\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/cores/arduino/stm32" "-IE:\SloeberX64n\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Drivers/STM32F1xx_HAL_Driver/Inc/" "-IE:\SloeberX64n\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Drivers/STM32F1xx_HAL_Driver/Src/" "-IE:\SloeberX64n\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/STM32F1xx/" "-IE:\SloeberX64n\arduinoPlugin\packages\STM32\hardware\stm32\1.2.0\variants\BLUEPILL_F103C8/usb" "-IE:\SloeberX64n\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-IE:\SloeberX64n\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src" -DSTM32F1xx -DARDUINO=10802 -DARDUINO_BLUEPILL_F103C8 -DARDUINO_ARCH_STM32 -DSTM32F103xB "-IE:\SloeberX64n\/arduinoPlugin/packages/STM32/tools/CMSIS/5.3.0/CMSIS/Core/Include/" "-IE:\SloeberX64n\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Drivers/CMSIS/Device/ST/STM32F1xx/Include/" "-IE:\SloeberX64n\/arduinoPlugin/packages/STM32/hardware/stm32/1.2.0/system/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/" -I"E:\SloeberX64n\arduinoPlugin\packages\STM32\hardware\stm32\1.2.0\cores\arduino" -I"E:\SloeberX64n\arduinoPlugin\packages\STM32\hardware\stm32\1.2.0\variants\BLUEPILL_F103C8" -I"E:\SloeberX64n\arduinoPlugin\packages\STM32\hardware\stm32\1.2.0\libraries\SPI\src" -MMD -MP -MF"sloeber.ino.cpp.d" -MT"sloeber.ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "..\sloeber.ino.cpp" -o "sloeber.ino.cpp.o" arm-none-eabi-g++: error: @E:\SloeberX64n\sloeber-workspace\STM32coreTest1/Release/sketch/build_opt.h: Invalid argument subdir.mk:31: recipe for target 'sloeber.ino.cpp.o' failed make: *** [sloeber.ino.cpp.o] Error 1

22:50:20 Build Finished (took 978ms)

its funny. i dont have to understand this. :-)

ORGATHM commented 6 years ago

apropos not linked in... at the end of installing the .json repo, a error occours.... ( i know, i am annoying... lol.)

ln-not-found

this is the .json link: https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json

jantje commented 6 years ago

I created issue #951 for the ln issue

jantje commented 6 years ago

It would be cool to see if the nightly fixes you String issue now 951 is fixed. you do need to delete the folder [eclipseinstall]/arduinoplugin/packages/STM32 and reinstall the package in Sloeber after the update for the fix to work.

ORGATHM commented 6 years ago

the problem is, i tried 3 different STM32duino projects... all has problems.

STM32 Arduino PROJECT 1

https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json located in: E:\SloeberX64n\arduinoPlugin\packages\STM32 this STM32 package does work with "String" declaration... all the time... it contains a different core (arduino) and a gcc from 2017, this makes trouble with hSPI, and DMA activated GFX libraries... it was only the error message at the end while installing, but it works. String declaration works here it seems, this package has a different core, and the gfx libraries will not work with the integrated SPI lib. selecting an other SPI is not possible, because it needs an other core, with MAPLE libs.

after reading your last posting, i reinstalled the .json, the error occours like before. OK OK OK Failed to install STM32 Cores Failed to extract tar.bz2.E:/SloeberX64n/arduinoPlugin/downloads/STM32Tools-1.0.2.tar.bz2 Cannot run program "ln": CreateProcess error=2, Das System kann die angegebene Datei nicht finden

(-)

STM32 Arduino PROJECT 2

there is one more arduino stm git... https://github.com/rogerclarkmelbourne/Arduino_STM32.git located in: E:\SloeberX64n\arduinoPlugin\packages\Arduino_STM32 importing is no problem, but whe i compile,.... 23:33:43 Build of configuration Release for project arduinoSTM32test3 "E:\SloeberX64n\arduinoPlugin\tools\make\make" all 'Building file: ..\sloeber.ino.cpp' 'Starting C++ compile' "/bin/arm-none-eabi-g++" -c -g -Os -Wall -Wextra -DDEBUG_LEVEL=DEBUG_ALL -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_generic_stm32f103c -DVECT_TAB_ADDR=0x8000000 -DERROR_LED_PORT=GPIOC -DERROR_LED_PIN=13 -mcpu=cortex-m3 -DF_CPU=72000000L -DARDUINO=10802 -DARDUINO_GENERIC_STM32F103C -DARDUINO_ARCH_STM32F1 -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG -DMCU_STM32F103CB -mthumb -march=armv7-m -DSTM32F1 -DMCU_STM32F103CB -mthumb -march=armv7-m -DSTM32F1 "-IE:\SloeberX64n\/arduinoPlugin/packages/Arduino_STM32/STM32F1/system/libmaple" "-IE:\SloeberX64n\/arduinoPlugin/packages/Arduino_STM32/STM32F1/system/libmaple/include" "-IE:\SloeberX64n\/arduinoPlugin/packages/Arduino_STM32/STM32F1/system/libmaple/stm32f1/include" "-IE:\SloeberX64n\/arduinoPlugin/packages/Arduino_STM32/STM32F1/system/libmaple/usb/stm32f1" "-IE:\SloeberX64n\/arduinoPlugin/packages/Arduino_STM32/STM32F1/system/libmaple/usb/usb_lib" -I"E:\SloeberX64n\arduinoPlugin\packages\Arduino_STM32\STM32F1\cores\maple" -I"E:\SloeberX64n\arduinoPlugin\packages\Arduino_STM32\STM32F1\variants\generic_stm32f103c" -MMD -MP -MF"sloeber.ino.cpp.d" -MT"sloeber.ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "..\sloeber.ino.cpp" -o "sloeber.ino.cpp.o" Das System kann den angegebenen Pfad nicht finden. subdir.mk:31: recipe for target 'sloeber.ino.cpp.o' failed make: [sloeber.ino.cpp.o] Error 1

23:33:43 Build Finished (took 559ms)

here it could not find the path of ......... ???? may this works, but i cant compile...


STM32 Arduino PROJECT 3 (THIS IS THE .JSON REPO I WOULD PREFER)

http://dan.drown.org/stm32duino/package_STM32duino_index.json located in: E:\SloeberX64n\arduinoPlugin\packages\stm32duino

with this stm32duino .json repo i startet on arduno ide, and it worked perfectly.

works with hSPI, DMA optimzed GFX llibs. but this project has the String declaration & freezing problem in sloeber. with arduino ide this repo works perfectly. btw. this project uses libmaple as core. maybe i make an issue threat at dan.drown,. its a bit tricky to find him. on the stm32duino site is only the -json link. but i found him with google. https://github.com/ddrown/Arduino_STM32/commits/master i am not shure it is the stm32duino.. the name of Arduino_STM32 and stm32duino it is not equal. horrible..

ORGATHM commented 6 years ago

i think i make a couple of days a break with the bluepill... i need blue pills for my headache. after nearly 2 weaks of frustrating, i need success. :-) i think i will check the next days the esp8266 and the esp32. they has got more flash disk, wifi, and so on. for cheap projects, the bluepill is a great and extremly cheap device, the hSPI works so fast with ILI9341. but i give up. its not in my nature, but i am completely done... :-)

jantje commented 6 years ago

Bleading edge feelings ;-)

ORGATHM commented 6 years ago

its a bit offtopic, sorry. i ported my project to esp32. works now with hardware spi and the ili9341 runs like a ferrari. i better changed two weeks ago to esp32... lol. the wifi and dualcore opens a lot of future features. but one thing looks strange to me, i cant find the option to deactivate this debug garbage. the bin file is extremly big, because of a lot debug infos? megabytes of debug infos, i dont need. on the stm the bin was ~50 kb, inclusive 7 fonts for the display. the fonts took the most of the 50kb...

'Building target: ESP32_myHumi' 'Printing size:' "E:\SloeberX64n\/arduinoPlugin/packages/arduino-esp32/tools/xtensa-esp32-elf/bin/xtensa-esp32-elf-size" -A "E:/SloeberX64n/sloeber-workspace/ESP32_myHumi/Release/ESP32_myHumi.elf" E:/SloeberX64n/sloeber-workspace/ESP32_myHumi/Release/ESP32_myHumi.elf : section size addr .rtc.text 0 1074528256 .iram0.vectors 1024 1074266112 .iram0.text 37096 1074267136 .dram0.data 8768 1073479680 .dram0.bss 2680 1073488448 .flash.rodata 34180 1061158944 .flash.text 114637 1074593816 .debug_frame 63008 0 .debug_info 1059781 0 .debug_abbrev 147175 0 .debug_loc 396858 0 .debug_aranges 25160 0 .debug_ranges 26512 0 .debug_macro 161095 0 .debug_line 540675 0 .debug_str 839290 0 .comment 419 0 .xtensa.info 56 0 .xt.lit._ZN16Adafruit_ILI9341D5Ev 0 0 .xt.prop._ZN16Adafruit_ILI9341D5Ev 0 0 .xt.prop._ZN16Adafruit_ILI9341D2Ev 36 0 .xt.prop._ZN16Adafruit_ILI9341D0Ev 36 0 .xt.prop._ZTV16Adafruit_ILI9341 12 0 .xt.prop._ZTV12Adafruit_GFX 12 0 .xt.lit._ZN14HardwareSerialD5Ev 0 0 .xt.prop._ZN14HardwareSerialD5Ev 0 0 .xt.prop._ZN14HardwareSerialD2Ev 36 0 .xt.prop._ZN14HardwareSerialD0Ev 36 0 .xt.prop._ZTV14HardwareSerial 12 0 .xt.lit._ZN9IPAddressD5Ev 0 0 .xt.prop._ZN9IPAddressD5Ev 0 0 .xt.prop._ZN9IPAddressD2Ev 36 0 .xt.prop._ZN9IPAddressD0Ev 36 0 .xt.prop._ZTV9IPAddress 12 0 .xt.lit._ZN5Print5writeEPKc 8 0 .xt.prop._ZN5Print5writeEPKc 60 0 .xt.prop._ZTISt9exception 12 0 .xt.prop._ZTISt9bad_alloc 12 0 .xt.prop._ZTVN10cxxabiv117class_type_infoE 12 0 .xt.lit._ZNK9gnu_cxx24__concurrence_lock_error4whatEv 8 0 .xt.lit._ZNK9gnu_cxx26concurrence_unlock_error4whatEv 8 0 .xt.lit._ZN9__gnu_cxx24concurrence_lock_errorD5Ev 8 0 .xt.lit._ZN9gnu_cxx26__concurrence_unlock_errorD5Ev 8 0 .xt.lit._ZN9gnu_cxx7mutex4lockEv 8 0 .xt.lit._ZN9__gnu_cxx13scoped_lockD5Ev 8 0 .xt.prop._ZNK9gnu_cxx24__concurrence_lock_error4whatEv 48 0 .xt.prop._ZNK9gnu_cxx26concurrence_unlock_error4whatEv 48 0 .xt.prop._ZN9__gnu_cxx24concurrence_lock_errorD5Ev 12 0 .xt.prop._ZN9gnu_cxx26__concurrence_unlock_errorD5Ev 12 0 .xt.prop._ZN9gnu_cxx7mutex4lockEv 60 0 .xt.prop._ZN9__gnu_cxx13scoped_lockD5Ev 12 0 .xt.prop._ZN9gnu_cxx24__concurrence_lock_errorD2Ev 36 0 .xt.prop._ZN9gnu_cxx26concurrence_unlock_errorD2Ev 36 0 .xt.prop._ZN9__gnu_cxx24concurrence_lock_errorD0Ev 36 0 .xt.prop._ZN9gnu_cxx26__concurrence_unlock_errorD0Ev 36 0 .xt.prop._ZN9gnu_cxx13scoped_lockD2Ev 72 0 .xt.prop._ZTIN9gnu_cxx24concurrence_lock_errorE 12 0 .xt.prop._ZTIN9__gnu_cxx26concurrence_unlock_errorE 12 0 .xt.prop._ZTVN9gnu_cxx24__concurrence_lock_errorE 12 0 .xt.prop._ZTVN9gnu_cxx26__concurrence_unlock_errorE 12 0 .xt.prop._ZTVSt9bad_alloc 12 0 .xt.prop._ZTVN10cxxabiv120si_class_type_infoE 12 0 Total 3459310

its compiled as a release build.

jantje commented 6 years ago

@ORGATHM As a user it is important to understand that Sloeber is responsible to translate the information provided by the json file in build commands. There are about 500 boards that work with sloeber out of the box. There is no way anyone can know all of these boards. If there is a problem you should try to find out whether it is a "translation" issue or a board issue. Board issue->go to the boards support translation issue->Sloeber Gui user issue->Sloeber (I'll see wether it is a CDT or sloeber issue)

As an independent open source project we value your submission, but we ask for support, either by helping us out coding (yeah, we do understand it does require time) or a Patreon contribution (starting from as low as 1$ a month): this allows us to support people who support us back! As a supporter you can drag our attention and prioritize your submission... please become a supporter! https://www.patreon.com/jantje

RickKimball commented 6 years ago

This issue has been fixed by #1005. * at least I tried the given Blink.ino.txt on a bluepill and it now works fine. I'm sure that the String object was using a malloc/_brk from the newlib instead of the variant wirish/syscalls.c