Author Topic: CB and Arduino 1.6.x  (Read 48709 times)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #15 on: June 18, 2016, 10:36:28 pm »
Now to get the project to build on CB i used the https://github.com/sudar/Arduino-Makefile project.

I just updated the Linux portion of the documentation( the documentation was good already btw), so hopefully, it will be an easy 10 minutes setup and integration with the CB. BTW the integration is described in detail and worked right away for me.

What i did to get Arduino-Makefile to work with CB is i created an _empty_ project and then followed the documentation in the https://github.com/sudar/Arduino-Makefile readme.

Looks like we have 3 options to use CB with Arduino 1.5.x+:
1. https://github.com/sudar/Arduino-Makefile
2. platformio
3. (and hopefully) https://github.com/obfuscated/cb_arduino_template
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #16 on: June 19, 2016, 12:59:29 am »
Tim, does this run on Arduino 1.5+ ? 
looks pretty cool.

I used Debian testing version "2:1.0.5+dfsg2-4".

Is version "2:1.5.6.2+sdfsg2-3" in Debian experimental likely to be easy for me to build on Debian Testing?
(I have only built code from "Sid" in the past and it took some time and just a slight effort to do.)

Because, I think it is NOT worth anymore effort on my part; till you fail to get it to work using what I posted.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #17 on: June 19, 2016, 01:06:19 am »
Now to get the project to build on CB i used the https://github.com/sudar/Arduino-Makefile project.

I just updated the Linux portion of the documentation( the documentation was good already btw), so hopefully, it will be an easy 10 minutes setup and integration with the CB. BTW the integration is described in detail and worked right away for me.

What i did to get Arduino-Makefile to work with CB is i created an _empty_ project and then followed the documentation in the https://github.com/sudar/Arduino-Makefile readme.

Looks like we have 3 options to use CB with Arduino 1.5.x+:
1. https://github.com/sudar/Arduino-Makefile
2. platformio
3. (and hopefully) https://github.com/obfuscated/cb_arduino_template

Items 1 and 3 are NOT compatible!!!!

I have given up on helping you; you seem to need too much help for me to spend the time.
It is obvious to me that you also need someone with more experience with Arduino to help you.

FYI: If you plan to continue on the CB custom makefile path, STOP wasting time using the Code::Blocks wizards!!!

Tim S.

« Last Edit: June 19, 2016, 01:07:59 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #18 on: June 19, 2016, 01:26:05 am »
I have decided to build package for version "2:1.5.6.2+sdfsg2-3" in Debian experimental for on Debian Testing and see if the obfuscated/cb_arduino_template works.
(Currently the package does NOT build using the normal steps I use; will try building again when the package is next updated.)

But, I still have given up on helping you; we are too much of the blind leading the blind.

Tim S.
« Last Edit: June 19, 2016, 01:44:59 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #19 on: June 19, 2016, 05:15:33 am »
Tim, does this run on Arduino 1.5+ ? 
looks pretty cool.

I used Debian testing version "2:1.0.5+dfsg2-4".

Is version "2:1.5.6.2+sdfsg2-3" in Debian experimental likely to be easy for me to build on Debian Testing?
(I have only built code from "Sid" in the past and it took some time and just a slight effort to do.)

Because, I think it is NOT worth anymore effort on my part; till you fail to get it to work using what I posted.

Tim S.

Tim,
 please correct me if i'm mistaken, but it looks like the  2:1.5.6.2+sdfsg2-3 version is for Arduino 1.0.5 (https://launchpad.net/ubuntu/+source/arduino/2:1.0.5+dfsg2-4). 

I started this thread to specifically address the Arduino 1.5+ problem.

The CB's wizard and https://github.com/obfuscated/cb_arduino_template are said to work with Arduino 1.0.x, but not so with 1.5.+

> FYI: If you plan to continue on the CB custom makefile path, STOP wasting time using the Code::Blocks wizards!!!
Obfusicated, the owner of the b_arduino_template said that he will try to update the template to work with arduino 1.5/1.6 versions. It is my understanding that until that happens, there is no other way (but platforio) to use CB, but with the custom makefiles.

Am i mistaken, Tim?
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #20 on: June 19, 2016, 06:02:53 am »
Now a new issue - there is no autocompletion.
CB log:
Code
Scanning for lexers in /usr/share/codeblocks/lexers/...
Found 56 lexers
Loading lexer_ada
Loading lexer_d
Loading lexer_A68k
Loading lexer_xml
Loading lexer_java
Loading lexer_srec
Loading lexer_html
Loading lexer_OgreMaterial
Loading lexer_python
Loading lexer_f77
Loading lexer_pascal
Loading lexer_smalltalk
Loading lexer_bash
Loading lexer_perl
Loading lexer_latex
Loading lexer_cu
Loading lexer_cpp
Loading lexer_css
Loading lexer_angelscript
Loading lexer_hitasm
Loading lexer_lua
Loading lexer_masm
Loading lexer_postscript
Loading lexer_registry
Loading lexer_haskell
Loading lexer_vhdl
Loading lexer_inno
Loading lexer_squirrel
Loading lexer_ihex
Loading lexer_cmake
Loading lexer_properties
Loading lexer_verilog
Loading lexer_matlab
Loading lexer_proto
Loading lexer_autotools
Loading lexer_caml
Loading lexer_nsis
Loading lexer_make
Loading lexer_prg
Loading lexer_glsl
Loading lexer_batch
Loading lexer_vbscript
Loading lexer_gm
Loading lexer_OgreCompositor
Loading lexer_bibtex
Loading lexer_tehex
Loading lexer_cg
Loading lexer_ruby
Loading lexer_javascript
Loading lexer_coffee
Loading lexer_sql
Loading lexer_lisp
Loading lexer_rc
Loading lexer_fortran
Loading lexer_diff
Loading lexer_objc
Configured 0 tools
Scanning for plugins in /home/az/.local/share/codeblocks/plugins
Loaded 0 plugins
Scanning for plugins in /usr/lib64/codeblocks/plugins
Tools Plus Plugin: Registering shell type Piped Process Control
Loaded 57 plugins
Loading:
ProjectOptionsManipulator
ToolsPlus
IncrementalSearch
Debugger
ReopenEditor
HelpPlugin
HeaderFixup
CodeStat
FilesExtensionHandler
ScriptedWizard
Profiler
MouseSap
cbKeyBinder
SmartIndentXML
SmartIndentCpp
Abbreviations
FileManager
lib_finder
copystrings
Exporter
CppCheck
HexEditor
RegExTestbed
ClassWizard
Valgrind
Compiler
ProjectsImporter
EnvVars
CodeCompletion
EditorConfig
ThreadSearch
BrowseTracker
SpellChecker
SpellChecker: Thesaurus files '/usr/share/mythes/th_en_US.idx' not found!
SpellChecker: Loading '/usr/share/mythes/th_en_US_v2.idx' instead...
EditorTweaks
CB_Koders
AStylePlugin
SmartIndentPython
AutoVersioning
Cscope
OpenFilesList
Cccc
CodeSnippets
Autosave
cbDragScroll
OccurrencesHighlighting
ToDoList
SymTab
Running startup script
Script plugin registered: Find Broken Files plugin
Script/function 'edit_startup_script.script' registered under menu '&Settings/-Edit startup script'
Opening /home/az/Dropbox/work//Arduino/Sketches/Examples/CB_PRJ_TEST/Makeprj/Makeprj.cbp
Done.
Current compiler 'GNU GCC Compiler for AVR' doesn't have correctly defined debugger!
NativeParser::CreateParser(): Finish creating a new parser for project 'Makeprj'
NativeParser::OnParserEnd(): Project 'Makeprj' parsing stage done!

log from project loading:
Code
OccurrencesHighlighting plugin activated
Todo List plugin activated
Symbol Table Plugin plugin activated
Loading toolbar...
Initializing plugins...
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
1 files loaded
Done loading project in 1ms
Project's base path: /home/az/Dropbox/work/Arduino/Sketches/Examples/CB_PRJ_TEST/Makeprj/
Project's common toplevel path: /home/az/Dropbox/work/Arduino/Sketches/Examples/CB_PRJ_TEST/Makeprj/
Mozilla universal detection engine detected 'Pure *ASCII*'.
Final encoding detected: Unicode 8 bit (UTF-8) (ID: 41)
Editor Open
Project data set for /home/az/Dropbox/work/Arduino/Sketches/Examples/CB_PRJ_TEST/Makeprj/master_reader.cpp
Top Editor: /home/az/Dropbox/work/Arduino/Sketches/Examples/CB_PRJ_TEST/Makeprj/master_reader.cpp
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /home/az/bin/arduino-1.6.5-r5/hardware/tools/avr/lib/gcc/avr/4.8.1/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /home/az/bin/arduino-1.6.5-r5/hardware/tools/avr/lib/gcc/avr/4.8.1/include-fixed
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /home/az/bin/arduino-1.6.5-r5/hardware/tools/avr/avr/include
NativeParser::AddCompilerPredefinedMacrosGCC: Caching predefined macros for compiler '/home/az/bin/arduino-1.6.5-r5/hardware/tools/avr/bin/avr-g++':
#define __DBL_MIN_EXP__ (-125)
<skip>

NativeParser::DoFullParsing(): AddProjectDefinedMacros failed!
NativeParser::DoFullParsing(): Adding cpp/c files to batch-parser
NativeParser::DoFullParsing(): Added 1 source file(s) for project 'Makeprj' to batch-parser...
ClassBrowser::UpdateClassBrowserView(): No active project available.
NativeParser::GetAllPathsByFilename(): Traversing '/home/az/Dropbox/work/Arduino/Sketches/Examples/CB_PRJ_TEST/Makeprj' for: master_reader.*
NativeParser::GetAllPathsByFilename(): Found 1 files:
- /home/az/Dropbox/work/Arduino/Sketches/Examples/CB_PRJ_TEST/Makeprj/master_reader.cpp
NativeParser::CreateParser(): Finish creating a new parser for project 'Makeprj'
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
NativeParser::OnParserStart(): Starting batch parsing for project 'Makeprj'...
NativeParser::OnParserEnd(): Project 'Makeprj' parsing stage done!
Project 'Makeprj' parsing stage done (2 total parsed files, 425 tokens in 0 minute(s), 0.005 seconds).
NativeParser::GetAllPathsByFilename(): Traversing '/home/az/Dropbox/work/Arduino/Sketches/Examples/CB_PRJ_TEST/Makeprj' for: master_reader.*
NativeParser::GetAllPathsByFilename(): Traversing ' - /home/az/Dropbox/work/Arduino/Sketches/Examples/CB_PRJ_TEST/Makeprj/' for: master_reader.*
NativeParser::GetAllPathsByFilename(): Found 1 files:
- /home/az/Dropbox/work/Arduino/Sketches/Examples/CB_PRJ_TEST/Makeprj/master_reader.cpp
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
SystemHeadersThread: /home/az/bin/arduino-1.6.5-r5/hardware/tools/ , 179
SystemHeadersThread: /home/az/bin/arduino-1.6.5-r5/hardware/tools/avr/lib/gcc/avr/4.8.1/include/ , 13
SystemHeadersThread: /home/az/bin/arduino-1.6.5-r5/hardware/tools/avr/lib/gcc/avr/4.8.1/include-fixed/ , 3
SystemHeadersThread: /home/az/bin/arduino-1.6.5-r5/hardware/tools/avr/avr/include/ , 307
SystemHeadersThread: Total number of paths: 4

CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #21 on: June 20, 2016, 03:15:31 am »
Auto-completion is sort of working with Search Directories -> Compiler set to:
/home/az/bin/arduino-1.6.5-r5/libraries
/home/az/bin/arduino-1.6.5-r5/hardware/arduino/avr/cores/arduino
/home/az/bin/arduino-1.6.5-r5/hardware/arduino/avr/libraries

So if i take :
Code
// Wire Master Reader
// by Nicholas Zambetti <http://www.zambetti.com>

// Demonstrates use of the Wire library
// Reads data from an I2C/TWI slave device
// Refer to the "Wire Slave Sender" example for use with this

// Created 29 March 2006

// This example code is in the public domain.

#include <Arduino.h>
#include <Wire.h>

void setup()
{

  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output


}

void loop()
{
  Wire.requestFrom(2, 6);    // request 6 bytes from slave device #2

  while(Wire.available())    // slave may send less than requested
  {
    char c = Wire.read(); // receive a byte as character
    Serial.print(c);         // print the character
  }

  delay(500);
}


and type #include < there will be a list of h files, but there will be no "wire.h". There will be Wire/Wire.h though. Once i add wire.h and  wire. will expend after the first symbol.
At the same time "Serial." would not expend at all.
File compiles fine.
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #22 on: June 22, 2016, 10:57:57 pm »
One thing that i already do NOT like about using make file approach is that i have to manually adjust a cbp file for every new project. That is obvious ( that this hs to be done), but considering that i'm burning thru a few arduino examples a day - really annoying.
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB and Arduino 1.6.x
« Reply #23 on: June 26, 2016, 12:49:52 am »
https://github.com/obfuscated/cb_arduino_template now supports Arduino 1.6.9. Please test and report if there are any problems with the wizard.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #24 on: June 26, 2016, 02:04:06 am »
https://github.com/obfuscated/cb_arduino_template now supports Arduino 1.6.9. Please test and report if there are any problems with the wizard.

The two Simulator Targets and the last three hardware targets did NOT build for me on Windows 7.
"Arduino Mega 8", "Microduino Core+ (644P)", and "Freematics OBD-II Adapter".
The others all built for me; but, I have no Arduino hardware to see it the code works.

But, the Arduino 1.6.9 I have on my Computer does NOT support those last three hardware targets.
So, likely no problem exists; I have not tried to figure out how to setup the two Simulator Targets.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB and Arduino 1.6.x
« Reply #25 on: June 26, 2016, 10:30:32 am »
But, the Arduino 1.6.9 I have on my Computer does NOT support those last three hardware targets.
So, likely no problem exists; I have not tried to figure out how to setup the two Simulator Targets.
Same here. Probably I'll just remove them.
I've not tried a simulator setup, too.

Can you provide a patch for README.md with the steps needed to setup the wizard on windows?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #26 on: June 26, 2016, 03:25:41 pm »
But, the Arduino 1.6.9 I have on my Computer does NOT support those last three hardware targets.
So, likely no problem exists; I have not tried to figure out how to setup the two Simulator Targets.
Same here. Probably I'll just remove them.
I've not tried a simulator setup, too.

Can you provide a patch for README.md with the steps needed to setup the wizard on windows?

I will see what I need to do; I will have to do a fresh CB Install and other stuff.

Overall outline of sections that I remember.

1. Copy Wizard Files
2. Edit wizard config script
3. Edit AVR Toolchain settings (I think that doing a patch to create Arduino Compiler Toolchain is a good Idea for someone to do)
4A. Install Arduino 1.6.9 (I plan to use zip download instead of installer download)
4B. Set CB Global Var "Arduino" to point to Arduino 1.6.9 folder.


It will take a while for me to get the time to do it.
One of the hard things for me to document on Windows is how to edit the "wizard config script".
Do you know of any other places that document how to edit "wizard config script" on Windows?

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #27 on: June 26, 2016, 03:36:57 pm »
FYI: A problem on Windows that I have been ignoring is I get this message below.

Code
Arduino Project has failed to load XRC resource...

I have been thinking I need to test with wxWidgets 3.0 to see if the message goes away.
But, I have NOT yet had time to do any testing.

Have you tested on any Linux that uses wxWidgets 2.8?

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #28 on: June 26, 2016, 06:34:53 pm »
https://github.com/obfuscated/cb_arduino_template now supports Arduino 1.6.9. Please test and report if there are any problems with the wizard.
awesome news! let me try on Fedora 22. I'll update the thread  in next 2 days

UPDATE:
cb start:
Code
[az@toshiba ~]$ codeblocks 
Warning: Mismatch between the program and library build versions detected.
The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1008,wx containers,compatible with 2.4,compatible with 2.6),
and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 1009,wx containers,compatible with 2.4,compatible with 2.6).
Starting Code::Blocks svn build  rev 10868 Jun 14 2016, 05:59:11 - wx2.8.12 (Linux, unicode) - 64 bit
Initialize EditColourSet .....
Initialize EditColourSet: done.
.....


And the error message is attached as a snapshot:
Code
Filename: /home/az/.local/share/codeblocks/templates/wizard//config.script
Error: the index 'RegisterWizard' does not exist
Details:
AN ERROR HAS OCCURED [the index 'RegisterWizard' does not exist]

CALLSTACK
*FUNCTION [main()] /home/az/.local/share/codeblocks/templates/wizard//config.script line [1]

LOCALS
[this] TABLE

Also in the log i see:
Code
....
Help plugin plugin activated
Header Fixup plugin activated
Code statistics plugin activated
Files extension handler plugin activated

(codeblocks:2314): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 18 and height -16


Similiar error was posted here (forums.codeblocks.org/index.php?action=post;msg=145176;topic=21252.15) with the resolution :
Code
This doesn't work because wxArrayString::Item is missing from the squirrel bindings your version of c::b.
The first fixed version is rev10400. So you need to install a recent night build or the latest stable build 16.01.

wxWidgets are:
Code
 rpm -qa | grep wx
wxGTK-2.8.12-16.fc22.x86_64
wxBase-2.8.12-16.fc22.x86_64


tried all versions until codeblocks.x86_64 16.01.svn.10827-1.fc22 with no positive results.
« Last Edit: June 26, 2016, 08:00:56 pm by AZ »
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #29 on: June 26, 2016, 09:23:13 pm »
Code
Error: the index 'RegisterWizard' does not exist

The above happens if you do NOT have the scriptedWizard plugin installed and enabled.

Edit: All your other issues; are NOT related to the CB Wizard change.

Tim S.
« Last Edit: June 26, 2016, 09:25:12 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org