User forums > Embedded development

C::B as IDE for Arduino, ESP8266 and similar

(1/5) > >>

g2003p:
Hi,

there is an awsome tool which does all the project managment and compiling for all the current boards from command line: http://platformio.org/

To use C::B as IDE I did this:
Add *.ino to Settings/Environment/File extensions handling.
Create PlatformIO project : platformio init --ide sublimetext --board uno
Add (example) source code file(s) .
Copy PlatformIO-Template.cbp into project folder.
Edit  PlatformIO-Template.cbp to reflect your environment!
Open  PlatformIO-Template.cbp, add source files, run.

Additional:
Open Project/target options, add C/C++ parser options:
.pioenvs/uno/FrameworkArduino,
add similar pathes from .pioenvs if libraries are used. Maybe there is a more comfortable way to enable parser / code completion? 






stahta01:
Edit: The OP attachment is a CB project that changes the custom CB makefile commands to do what the OP wants.

Instead of using "C:/Python27/Scripts" in your CB Project multiple times,
I would suggest a project user/custom variable set to either "C:/Python27/Scripts"  or "C:/Python27".
It is possible an CB Global variable would be a better choice than an project user/custom variable.

I do NOT use CC so, I have no help to give you on your code completion question.

http://wiki.codeblocks.org/index.php/Global_compiler_variables

Tim S.

 

ivan.kravets:
Dear @stahta01,

We have added Project Generator for CodeBlocks in the latest development branch. See https://github.com/platformio/platformio/issues/600

How to try it?
1. Install development version
2. Generate project for CodeBlocks:

--- Code: ---> platformio init --ide codeblocks --board uno
--- End code ---
3. Import generated project.

Does it work for you?

Regards, Ivan Kravets
The PlatformIO Team

g2003p:
Dear Ivan,

works perfect. Congratulation, thank you.

Regards,

Gottfried

AZ:
If i may to piggyback on this thread.
i installed the platformio.
created the project :

--- Code: ---[az@toshiba CB_Prj]$ mkdir ./CB_Prj
[az@toshiba CB_Prj]$ cd CB_Prj/
[az@toshiba CB_Prj]$ platformio init --ide codeblocks --board uno

--- End code ---

I can open the project in CB. But when i try to add an ino file - it won't open in the CB, but, at the same time i will NOT get any error messages.
Next if i proceed to compile, i'll get a compilation error ("fatal error: aprintf.h: No such file or directory") and the ino file will "appear" in the CB.
please advise.

Here is the debug from the CB:

--- Code: ---<skip initial messages>

Loading toolbar...
Initializing plugins...
KeyBinder failed UpdateById on[795][Target's default]
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
1 files loaded
Done loading project in 2ms
Project's base path: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ/
Project's common toplevel path: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ/
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/5.3.1
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/5.3.1/x86_64-redhat-linux
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/5.3.1/backward
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/local/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include
NativeParser::GetCompilerUsingStandardGCC(): Using language standard: -std=c++11
NativeParser::AddCompilerPredefinedMacrosGCC: Caching predefined macros for compiler '/usr/bin/g++':
#define __DBL_MIN_EXP__ (-1021)
#define __cpp_attributes 200809
<skip>
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_RELEASE 3

NativeParser::DoFullParsing(): Adding cpp/c files to batch-parser
ClassBrowser::UpdateClassBrowserView(): No active project available.
NativeParser::CreateParser(): Finish creating a new parser for project 'PlatformIO_PJ'
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
NativeParser::OnParserStart(): Starting batch parsing for project 'PlatformIO_PJ'...
NativeParser::OnParserEnd(): Project 'PlatformIO_PJ' parsing stage done!
Project 'PlatformIO_PJ' parsing stage done (1 total parsed files, 282 tokens in 0 minute(s), 0.009 seconds).
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/variants/standard/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/cores/arduino/ , 19
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Bridge/src/ , 11
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/EEPROM/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Esplora/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Ethernet/src/ , 9
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Firmata/ , 11
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/GSM/src/ , 35
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/HID/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Keyboard/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/LiquidCrystal/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Mouse/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/RobotIRremote/src/ , 3
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Robot_Control/src/ , 19
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Robot_Motor/src/ , 4
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/SD/src/ , 8
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/SPI/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Scheduler/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Servo/src/ , 4
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/SoftwareSerial/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/SpacebrewYun/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Stepper/src/ , 1
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/TFT/src/ , 4
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Temboo/src/ , 37
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/USBHost/src/ , 11
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/WiFi/src/ , 11
SystemHeadersThread: /home/az/.platformio/packages/framework-arduinoavr/libraries/Wire/src/ , 2
SystemHeadersThread: /home/az/.platformio/packages/toolchain-atmelavr/avr/include/ , 307
SystemHeadersThread: /home/az/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/4.8.1/include/ , 13
SystemHeadersThread: /home/az/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/4.8.1/include-fixed/ , 3
SystemHeadersThread: /usr/include/c++/5.3.1/ , 631
SystemHeadersThread: /usr/include/c++/5.3.1/x86_64-redhat-linux/ , 46
SystemHeadersThread: /usr/include/c++/5.3.1/backward/ , 8
SystemHeadersThread: /usr/lib/gcc/x86_64-redhat-linux/5.3.1/include/ , 99
SystemHeadersThread: /usr/local/include/ , 0
SystemHeadersThread: /usr/include/ , 1706
SystemHeadersThread: Total number of paths: 36
CWD for depslib was: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
CWD for depslib is: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
CWD for depslib is: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
-------------- Clean: Debug in PlatformIO_PJ (compiler: GNU GCC Compiler)---------------
Executing clean command: /bin/platformio -f -c codeblocks run -t clean
[Tue Jun 14 23:06:43 2016] Processing uno (platform: atmelavr, board: uno, framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------
======================================================== [SUCCESS] Took 1.52 seconds ========================================================
Cleaned "PlatformIO_PJ - Debug"
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
CWD for depslib is: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
CWD for depslib is: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
CWD for depslib is: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
CWD for depslib is: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
CWD for depslib is: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
Scanned 0 files for #includes, cache used 0, cache updated 0
CWD for depslib was: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
CWD for depslib is: /home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ.
-------------- Build: Debug in PlatformIO_PJ (compiler: GNU GCC Compiler)---------------
Scanned 0 files for #includes, cache used 0, cache updated 0
Checking if target is up-to-date: 1
Running command: /bin/platformio -f -c codeblocks run
[Tue Jun 14 23:06:47 2016] Processing uno (platform: atmelavr, board: uno, framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------
avr-g++ -o .pioenvs/uno/src/tmp_ino_to.o -c -fno-exceptions -fno-threadsafe-statics -std=gnu++11 -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DPLATFORMIO=021001 -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10608 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant -Isrc src/tmp_ino_to.cpp
avr-ar rcs .pioenvs/uno/libFrameworkArduinoVariant.a
avr-g++ -o .pioenvs/uno/FrameworkArduino/CDC.o -c -fno-exceptions -fno-threadsafe-statics -std=gnu++11 -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DPLATFORMIO=021001 -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10608 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/CDC.cpp
avr-ranlib .pioenvs/uno/libFrameworkArduinoVariant.a
avr-g++ -o .pioenvs/uno/FrameworkArduino/HardwareSerial.o -c -fno-exceptions -fno-threadsafe-statics -std=gnu++11 -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DPLATFORMIO=021001 -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10608 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant .pioenvs/uno/FrameworkArduino/HardwareSerial.cpp
/home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ/src/LED_turnonoff.ino:1:21: fatal error: aprintf.h: No such file or directory
#include "aprintf.h"
^
compilation terminated.
scons: *** [.pioenvs/uno/src/tmp_ino_to.o] Error 1
======================================================== [ ERROR ] Took 3.21 seconds ========================================================
Process terminated with status 1 (0 minute(s), 5 second(s))
1 error(s), 0 warning(s) (0 minute(s), 5 second(s))
Mozilla universal detection engine detected 'Pure *ASCII*'.
Final encoding detected: Unicode 8 bit (UTF-8) (ID: 41)
Editor Open
NativeParser::GetAllPathsByFilename(): Traversing '/home/az/Dropbox/work/Arduino/Sketches/Examples/PlatformIO_PJ/src' for: LED_turnonoff.*
NativeParser::GetAllPathsByFilename(): Found 0 files:
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.

--- End code ---

P.S. rename zip -> tgz

Navigation

[0] Message Index

[#] Next page

Go to full version