☰
Current Page
Main Menu
Home
Home
Editing VIMAndIAR
Edit
Preview
H1
H2
H3
default
Set your preferred keybinding
default
vim
emacs
markdown
Set this page's format to
Markdown
Plain Text
Pod
RDoc
reStructuredText
Rendering unavailable for
AsciiDoc
BibTeX
Creole
MediaWiki
Org-mode
Textile
Help 1
Help 1
Help 1
Help 2
Help 3
Help 4
Help 5
Help 6
Help 7
Help 8
Autosaved text is available. Click the button to restore it.
Restore Text
--- title: VIMAndIAR --- VIM snippets for using the IAR ARM compiler (Embedded Workbench). * Various bits were tested either with IAR ARM or IAR MSP430 compilers ## Makefile * Call xmlstar from makefile to extract includes and sourcefile list * Alternatively, transform project file to makefile entirely ## Extract source files from IAR project * [xmlstarlet][2] * outputs list of all .c and .cpp files included in the project ### Bash version * Escaped for direct inclusion in BASH script. * $PROJECT_FILE is .ewp project file * IAR uses standard DOS path separator so use `tr '\\' '/' ` xml sel -t -m '/project/file|/project//group/file' -i "contains(name,'.c') or contains(name,'.cpp')" -v "concat(substring-after(name,'\$PROJ_DIR$\'),' ')" $PROJECT_FILE [[$[Get Code]]][3] ### DOS batch version * Escaped for direct inclusion in DOS batch file. * %PROJECT_FILE% is .ewp project file xml sel -t -m "/project/file|/project//group/file" -i "contains(name,'.c') or contains(name,'.cpp')" -v "concat(substring-after(name,'$PROJ_DIR$\'),' ')" %PROJECT_FILE% [[$[Get Code]]][4] ## Extract include directories from IAR project ### Environment Variables : * PROJ_DIR * TOOLKIT_DIR ### Extract with xmlstar * XPath: /project/configuration(Debug)/settings(ICC430)/option(CCStdIncludePaths|newCCIncludePaths)/state xml sel -t -m '/project/configuration' -i "contains(name,'Debug')" -m './settings' -i "contains(name,'ICC430')" -m "./data/option" -i "contains(name,'CCStdIncludePaths') or contains(name,'newCCIncludePaths')" -m "state" -v "concat('-I "',.,'" ')" $PROJECT_FILE [[$[Get Code]]][8] ## Extract defines from IAR project xml sel -t -m '/project/configuration' -i "contains(name,'Debug')" -m './settings' -i "contains(name,'ICC430')" -m "./data/option" -i "name='CCDefines'" -m "./state" -v "concat('-D',.,' ')" $PROJECT_FILE [[$[Get Code]]][9] ## VIM Compiler File * Install into .vimfiles/compiler/iar.vim " ---- Beginning of ${vimfiles}/compiler/iar.vim ---- " Compiler: IAR icc430 " Maintainer: Mark Ferry <vim_NOSPAM_AT_markferry_DOT_net> " Last Change: 2009 Jan 21 if exists("current_compiler") finish endif let current_compiler = "iar" " errorformat matches errors like: " ... " MyOneArgumentFunction(); " ^ ""MyFile.c",666 Error[Pe165]: too few arguments in function call " " ... " Warnings are matched similarly. " CompilerSet errorformat=%E%p^,%Z\"%f\"\\\,%l\ \ Error[Pe%n]:\ %m,%W%p^,%Z\"%f\"\\\,%l\ \ Warning[Pe%n]:\ %m " ---- End of Vim compiler file ---- ## Configure VIM Set your compiler `:compiler iar` vimrc project settings set path=.,,**,C:\Program\\\ Files\IAR\\\ Systems\Embedded\\\ Workbench\\\ 5.4\430\inc,C:\Program\\\ Files\IAR\\\ Systems\Embedded\\\ Workbench\\\ 5.4\430\inc\dlib ## ToDo * more compiler configuration - C99 etc. [2]: http://xmlstar.sourceforge.net/ [3]: VIMAndIAR?action=sourceblock&num=1 [4]: VIMAndIAR?action=sourceblock&num=2 [8]: VIMAndIAR?action=sourceblock&num=3 [9]: VIMAndIAR?action=sourceblock&num=4 <!-- vim: filetype=markdown -->
Uploading file...
Sidebar
# SideBar * [Home][1] * [Projects][2] * * * <!-- --> * [Code][3] * [Tech][4] * [Network][5] * [MediaCentre][6] * [UAV][7] * * * <!-- --> * [Travel][8] * [Music][9] * [Horse Riding][10] * [Study][11] * [Games][12] * [Other Activities][13] * * * <!-- --> * [Car][14] * [House][15] * [Watch][16] * [Clothing][17] * [Miscellany][18] * * * [1]: /Home [2]: /Projects [3]: /Code/Code [4]: /Tech/Tech [5]: /Network/Network [6]: /MediaCentre/MediaCentre [7]: /UAV/UAV [8]: /Travel/Travel [9]: /Music/Music [10]: /HorseRiding/HorseRiding [11]: /Study/Study [12]: /Games/Games [13]: /Do/Do [14]: /Car/Car [15]: /House/House [16]: /Watch/Watch [17]: /Clothing/Clothing [18]: /Miscellany/Miscellany <!-- vim: filetype=markdown -->
Edit message:
Cancel