Author Topic: Update the ARM project template  (Read 22425 times)

Offline tridentsx

  • Single posting newcomer
  • *
  • Posts: 9
Update the ARM project template
« on: January 19, 2011, 05:26:09 pm »


I started looking at codeblocks recently, for arm embedded development. The template for ARM development is not suitable for me.
It doesn't have arm-none-eabi tool chain option. I allredy know I can add it by reconfiguring in the compiler options, however I would
like it to be avialable as a drop down in the project wizard.

What do you think ?

Regards /// Carl

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12125
    • Travis build status
Re: Update the ARM project template
« Reply #1 on: January 19, 2011, 05:33:44 pm »
Right click on the template -> edit script -> modify the code as you wish and submit a patch :)
(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 scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Update the ARM project template
« Reply #2 on: January 19, 2011, 05:49:12 pm »
Regarding the AVR template I modified, do I have to submit it as a patch? If so, I know nothing about creating a patch, how can I get help about this?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12125
    • Travis build status
Re: Update the ARM project template
« Reply #3 on: January 19, 2011, 07:10:03 pm »
svn diff > my.patch in the top level dir of C::B
If you need to know more about it svn help diff or read the manual.
(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 tridentsx

  • Single posting newcomer
  • *
  • Posts: 9
Re: Update the ARM project template
« Reply #4 on: January 19, 2011, 08:01:19 pm »

I tried right click and edit script, however it doesnt work. The script opens up in the editor but its read only. I can't edit anything in
the editor pane it doesn't accept keyboard input.

This was with the latest build as of yesterday on an ubuntu 10.10 machine. For fun I tried the same build on a windows box at work,
and on windows the pane does accept editing.  Dont' know whats going on here.

I also think that the new arm-none-eabi toolchain needs to be added to the compiler plugins?

Regards /// Carl
« Last Edit: January 19, 2011, 08:13:22 pm by tridentsx »

Offline tridentsx

  • Single posting newcomer
  • *
  • Posts: 9
Re: Update the ARM project template
« Reply #5 on: January 19, 2011, 08:02:39 pm »


One more thing how can i debug those scripts ? Is there someway to follow the exection flow ?

Thanks /// Carl

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12125
    • Travis build status
Re: Update the ARM project template
« Reply #6 on: January 20, 2011, 12:52:27 am »
You can use the Log function, also see the view -> script console

On linux you're running as simple user, but the scripts are inside /usr/something where only root can write.
Move the file to .codeblocks/share/scritps (or something like that).
Probably you'll have to rename the file...
(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 tridentsx

  • Single posting newcomer
  • *
  • Posts: 9
Re: Update the ARM project template
« Reply #7 on: January 20, 2011, 06:31:13 am »


I am trying to use the log function but I am not successful.  I am adding this to the script

Log(_T("Running STM32 setup script"));

Where should I see the output? I don't get it in the codeblocks-debug.log and I cant see it in the Log & Others ?

Thanks for your help.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: Update the ARM project template
« Reply #8 on: January 20, 2011, 07:15:59 am »
Where should I see the output? I don't get it in the codeblocks-debug.log and I cant see it in the Log & Others ?
To enable the debug log you must pass it as an option to C::B like on start-up like:
./codeblocks --debug-log
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline tridentsx

  • Single posting newcomer
  • *
  • Posts: 9
Re: Update the ARM project template
« Reply #9 on: January 20, 2011, 08:04:15 am »
Thanks for your kind help.  I tried your suggestion however it didnt seem to work.

Below is the content of the log file. It doesn't contain the debug Log entry that I have added to the ARM
script before starting codeblocks.

I did execute the right script I know that because I could see other changes in the welcome screen that I
did at same time as I added the  Log(_T("Running STM32 setup script")).

Is that the right syntax to add something to a wizard script?

Regards /// Carl
Code: [Select]
Initialize EditColourSet .....
Initialize EditColourSet: done.
Loading toolbar...
EnvVars: loaded
ClassWizard: loaded
FilesExtensionHandler: loaded
CodeStat: loaded
ProjectsImporter: loaded
wxSmith: loaded
wxSmithMime: loaded
ToDoList: loaded
ThreadSearch: loaded
HeaderFixup: loaded
Compiler: loaded
RegExTestbed: loaded
wxSmithContribItems: loaded
SymTab: loaded
MouseSap: loaded
CB_Koders: loaded
DoxyBlocks: loaded
Abbreviations: loaded
Exporter: loaded
Cscope: loaded
BYOGames: loaded
Valgrind: loaded
CppCheck: loaded
EditorTweaks: loaded
wxSmithAui: loaded
OpenFilesList: loaded
lib_finder: loaded
Profiler: loaded
HexEditor: loaded
CodeCompletion: loaded
Cccc: loaded
AutoVersioning: loaded
IncrementalSearch: loaded
BrowseTracker: loaded
ScriptedWizard: loaded
Autosave: loaded
NassiShneidermanPlugin: loaded
AStylePlugin: loaded
Debugger: loaded
copystrings: loaded
CodeSnippets: loaded
cbDragScroll: loaded
ReopenEditor: loaded
cbKeyBinder: loaded
Environment variables plugin activated
Class wizard plugin activated
Files extension handler plugin activated
Code statistics plugin activated
Foreign projects importer plugin activated
wxSmith plugin activated
wxSmith - MIME plugin plugin activated
Todo List plugin activated
ThreadSearch plugin activated
Header Fixup plugin activated
Added compiler "GNU GCC Compiler"
Added compiler "Intel C/C++ Compiler"
Added compiler "SDCC Compiler"
Added compiler "Tiny C Compiler"
Added compiler "GDC D Compiler"
Added compiler "LLVM D Compiler"
Added compiler "Digital Mars D Compiler"
Added compiler "GNU ARM GCC Compiler"
Added compiler "GNU ARM GCC eabi Compiler"
Added compiler "GNU AVR GCC Compiler"
Added compiler "GNU GCC Compiler for PowerPC"
Added compiler "GNU GCC Compiler for TriCore"
Compiler plugin activated
Regular expressions testbed plugin activated
wxSmith - Contrib Items plugin activated
Symbol Table Plugin plugin activated
MouseSap plugin activated
Koders query plugin activated
DoxyBlocks plugin activated
Abbreviations plugin activated
Source Exporter plugin activated
Cscope plugin activated
BYO Games plugin activated
Valgrind plugin activated
CppCheck plugin activated
Editor Tweaks plugin: Building menu
Editor Tweaks plugin: making the menu 14
EditorTweaks plugin activated
wxSmith - Aui plugin activated
Open files list plugin activated
Library finder plugin activated
Code profiler plugin activated
HexEditor plugin activated
Code completion plugin activated
Cccc plugin activated
AutoVersioning plugin activated
IncrementalSearch plugin activated
BrowseTracker plugin activated
Project wizard added for 'Empty project'
Project wizard added for 'Fortran application'
Project wizard added for 'Fortran library'
Project wizard added for 'Fortran DLL'
Project wizard added for 'Console application'
Project wizard added for 'D application'
Project wizard added for 'FLTK project'
Project wizard added for 'GLFW project'
Project wizard added for 'GLUT project'
Project wizard added for 'GTK+ project'
Project wizard added for 'Irrlicht project'
Project wizard added for 'Lightfeather project'
Project wizard added for 'OpenGL project'
Project wizard added for 'Ogre project'
Project wizard added for 'Code::Blocks plugin'
Project wizard added for 'QT4 project'
Project wizard added for 'SDL project'
Project wizard added for 'SFML project'
Project wizard added for 'Static library'
Project wizard added for 'Shared library'
Project wizard added for 'wxWidgets project'
Build-target wizard added for 'Console'
Build-target wizard added for 'Static library'
Build-target wizard added for 'wxWidgets'
Project wizard added for 'ARM Project'
Project wizard added for 'AVR Project'
Project wizard added for 'TriCore Project'
Project wizard added for 'PowerPC Project'
File(s) wizard added for 'Empty file'
File(s) wizard added for 'C/C++ source'
File(s) wizard added for 'C/C++ header'
File(s) wizard added for 'Fortran source'
Scripted wizard plugin activated
Autosave plugin activated
NassiShneidermanPlugin plugin activated
Source code formatter (AStyle) plugin activated
Debugger plugin activated
« Last Edit: January 21, 2011, 01:42:59 am by tridentsx »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12125
    • Travis build status
Re: Update the ARM project template
« Reply #10 on: January 20, 2011, 08:52:31 am »
Execute "Log(_T("Running STM32 setup script"))" in the script console and you'll see that it goes to the "Log & Others".
Probably your script is not executed.

p.s. please use code tags for long pastes.
(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 tridentsx

  • Single posting newcomer
  • *
  • Posts: 9
Re: Update the ARM project template
« Reply #11 on: January 20, 2011, 10:46:35 pm »

Thanks for the help, I dont know what I did wrong but its working now. :D
When I am done I will submitt a patch for review.

Thanks // Carl

Offline tridentsx

  • Single posting newcomer
  • *
  • Posts: 9
Re: Update the ARM project template
« Reply #12 on: January 21, 2011, 01:48:27 am »

I have successfully added the new compiler, but when I create a new project the template .c .h and .ld files are not added.
 
I get the following in the debug log.

Create new parser for project 'TestProject'
The Parser is still parsing files...
The Parser is still parsing files...
The Parser is still parsing files...
The Parser is still parsing files...
The Parser is still parsing files...
The Parser is still parsing files...
The Parser is still parsing files...
The Parser is still parsing files...
The Parser is still parsing files...

The tempate files under usr/localshare/codeblocks/templates/arm has the right permissions.
 Is it the codeblocks default search paths that are pointing somewhere else ?

Offline tridentsx

  • Single posting newcomer
  • *
  • Posts: 9
Re: Update the ARM project template
« Reply #13 on: January 21, 2011, 04:35:04 am »
 :?
I don't understand how codeblocks knows where to pickup the script wizard files.

I got two terminals with the same path settings, the same shell, same user and same environment that starts codeblocks.

The code blocks started from one of the shells can successfully complete the ARM wizard including copying files every single time.

Code: [Select]
Keyboard shortcuts plugin activated
Initializing plugins...
KeyBinder failed UpdateById on[1562][Man pages viewer]
KeyBinder failed UpdateById on[2584][Closed file list]
KeyBinder failed UpdateById on[2771][Help plugin...]
Can't find compiler executable in your search path (GNU ARM GCC Elf Compiler)...
Can't find compiler executable in your search path (GNU ARM GCC Elf Compiler)...
Project's base path: /home/tridentsx/source/test13/
Project's common toplevel path: /home/tridentsx/source/test13/
Passing list of files to batch-parser.
Add batch-parsing 3 file(s) for project 'test13'...
Create new parser for project 'test13'
Starting batch parsing for project 'test13'...
Project 'test13' parsing stage done (3 total parsed files, 517 tokens in 0 minute(s), 0.028 seconds).
Updating class browser...
Class browser updated.

The codeblocks started from my other shell always fails. It is executing my script because it gives a choice of compilers which the other doesn't
Code: [Select]
Keyboard shortcuts plugin activated
Initializing plugins...
KeyBinder failed UpdateById on[841][Nassi Shneiderman diagram]
Can't find compiler executable in your search path (GNU ARM GCC Elf Compiler)...
Can't find compiler executable in your search path (GNU ARM GCC Elf Compiler)...
srcdir[armfilesolimex-lpc213x]
File[armfilesolimex-lpc213x] is copied to [/home/tridentsx/source/test12/]
Passing list of files to batch-parser.
Create new parser for project 'test12'
Removed test12 from all deps
Delete parser for project 'test12'!
Deinitializing plugins...

This has to be something silly. Any ideas please? :?: :?: :?:

Offline tridentsx

  • Single posting newcomer
  • *
  • Posts: 9
Re: Update the ARM project template
« Reply #14 on: January 21, 2011, 05:27:57 am »

Ok I figured out whats happening, I just don't understand why if the paths, and environments in the shells are the same.

The working codeblocks outputs
Scanning for plugins in /usr/local/lib/codeblocks/plugins

The failing codeblocks outputs
Scanning for plugins in /home/tridentsx/.codeblocks/share/codeblocks/plugins
Loaded 0 plugins
Scanning for plugins in /usr/lib/codeblocks/plugins
SDK version mismatch for HelpPlugin (1.11.12). Expecting 1.11.13