QBAS Posted March 28, 2006 Report Share Posted March 28, 2006 Hi all.Can someone tell me: how to compile asm and also C projects for PIC18f452 on Linux?Thanx a lot Quote Link to comment Share on other sites More sharing options...
Synapsys Posted March 28, 2006 Report Share Posted March 28, 2006 Hi QBAS,Check out this link http://sdcc.sourceforge.net/You can download the SDCC 'C' compiler and the gputils from this site. This compiler and utils provide support for the PIC chips. There are a couple of alternate methods for installing it on Linux depending on the flavor of Linux you have. The documentation with SDCC and gputils is fairly good. Although I don't use Linux that often, this is the same compiler that is used on Windows so building applications on Linux should be fairly easy.Hope this is what you are looking for :)Regards,Synapsys Quote Link to comment Share on other sites More sharing options...
moebius Posted March 28, 2006 Report Share Posted March 28, 2006 Hi.I'm no expert, but I'll try to answer your questions:For asm - for your own projects: gputils from http://gputils.sourceforge.net should work. But I think this isn't useful for existing projects because Microchip assembler has different syntax. MPASM under Wine will work.For C - I'd guess SDCC 2.5.0 (from http://sdcc.sourceforge.net/) will work. The instructions on http://www.ucapps.de/mios_c.html page are referring to install in WIN32 environment, but if you understand the general requirements to make it work You can make it also in Linux.Moebius Quote Link to comment Share on other sites More sharing options...
QBAS Posted March 28, 2006 Author Report Share Posted March 28, 2006 Thank you very much.Ok - this is what I need.I will check gputils & SDCC 'C' compiler.Previously I was trying install MPASM under Wine on FC4, but it never runs.Maybe on another distro will be ok.For asm - for your own projects: gputils from http://gputils.sourceforge.net should work. But I think this isn't useful for existing projects because Microchip assembler has different syntax. MPASM under Wine will work.So - if I use program Skeleton or modificate midibox64e under gputils program will not working?(sorry for too much questions)QBAS Quote Link to comment Share on other sites More sharing options...
moebius Posted March 28, 2006 Report Share Posted March 28, 2006 Hi.Previously I was trying install MPASM under Wine on FC4, but it never runs.Hmm.. IF you have MPLAB IDE installed somewhere (on Win32), you could try only copying MPASMWIN.EXE and try using it under the wine.So - if I use program Skeleton or modificate midibox64e under gputils program will not working?That is what I've understood. GPASM will not compile sources made for MPASM but will give you bunch of errors because of the differences in the syntax.Does anybody have better knowledge about this or am I wrong?Moebius Quote Link to comment Share on other sites More sharing options...
QBAS Posted March 28, 2006 Author Report Share Posted March 28, 2006 hello MoebiusIF you have MPLAB IDE installed somewhere (on Win32), you could try only copying MPASMWIN.EXE and try using it under the wine.Unfortunately not :( I was not backuped an installed programs.Maybe I will find somebody with Win32 for install and copy to my computer.Ok I will try again, but thank you for many informations.QBAS Quote Link to comment Share on other sites More sharing options...
Synapsys Posted March 28, 2006 Report Share Posted March 28, 2006 Hi,That is what I've understood. GPASM will not compile sources made for MPASM but will give you bunch of errors because of the differences in the syntax.There are a few differences between MPASM and GPASM but they are somewhat insignificant. The original difficulty with MIDIbox code (MIOS and applications) with respect to GPASM was the macros that TK wrote. He used a feature in some macros that is not available in GPASM (e.g. passing an instruction to a macro as a parameter). I certainly don't blame TK for this, as the feature is quite powerful. In and of itself, this is not a big problem since the macros can be expanded manually in the source code. This is a lot of work however and prone to errors. In the meantime, I believe that TK has modified the code to make it compatible with GPASM. (I am not certain about this so TK’s input is needed to be sure).As an exercise in absurdity ???, I wrote a Windows application last year that scanned every source module in MIOS and expanded all the macros into another set of source modules. Once I had done this I was able to build MIOS using GPASM. I don’t recommend this since you end up with a non-standard unsupported set of code. Like I said, an exercise in absurdity :P.Regards,Synapsys Quote Link to comment Share on other sites More sharing options...
QBAS Posted March 29, 2006 Author Report Share Posted March 29, 2006 Hi all!IF you have MPLAB IDE installed somewhere (on Win32), you could try only copying MPASMWIN.EXE and try using it under the wine.Today my friend send me installed MPLAB, so now I can run it without installing!Thank you guys from all my heart.QBAS Quote Link to comment Share on other sites More sharing options...
svens Posted March 31, 2006 Report Share Posted March 31, 2006 Since i faced the same problem this week, i wrote some small sed script that replaces the problematic MACROs in the source code:replace-macros.sed-------------------------------------------------------8<------------------------------------------------------------1i;hey emacs, this is -*- asm -*-/^[ \t]*;/b #skip commented line/^\s*\w*\s*MACRO/b #skip macro definitionss/\<BIFSET\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\([^,]*\)\s*,\s*\(.*\)/btfsc \1, \2, \3\n\t\4/gs/\<BIFCLR\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\([^,]*\)\s*,\s*\(.*\)/btfss \1, \2, \3\n\t\4/gs/\<IFSET\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/btfsc \1, \2\n\t\3/gs/\<IFCLR\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/btfss \1, \2\n\t\3/gs/\<IFNEQ\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/cpfseq \1, \2\n\t\3/gs/\<IFLEQ\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/cpfsgt \1, \2\n\t\3/gs/\<IFGEQ\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/cpfslt \1, \2\n\t\3/g-------------------------------------------------------8<------------------------------------------------------------fix-gpasm.sh:-------------------------------------------------------8<------------------------------------------------------------#!/bin/shfor i in src/*.inc src/*.asm src/*.h;do tr -d '\r' < $i|sed -f replace-macros.sed >${i}_ && mv ${i}_ $idone-------------------------------------------------------8<------------------------------------------------------------Now i just have to copy the new src/ directory if there is a new version, run fix-gpasm.sh and can compile the source native on linux with gpasm :)Greetings,Sven. Quote Link to comment Share on other sites More sharing options...
stryd_one Posted March 31, 2006 Report Share Posted March 31, 2006 Nice work!! I think this would be good on the wiki, would you mind if it was there? Many unix users could benefit from your skills. Quote Link to comment Share on other sites More sharing options...
moebius Posted March 31, 2006 Report Share Posted March 31, 2006 Sven - Excellent Work!As stryd_one already suggested this should be in the wiki.Do You mind asking a favour: Could you write a little article to the wiki about compiling on linux with gpasm ect. with your code included. We could use Your expertise here.You can log to http://wiki.midibox.org by using forum login/password combination.Moebius Quote Link to comment Share on other sites More sharing options...
svens Posted March 31, 2006 Report Share Posted March 31, 2006 Good idea, i'll add that to the wiki over the weekend. I think the sed script could also be improved, thats only "the-first-version-that-works-for-me".Greetings,Sven. Quote Link to comment Share on other sites More sharing options...
pilo Posted April 1, 2006 Report Share Posted April 1, 2006 This sed script is fantastic!! I try to make one with perl sometimes ago, because this is too boring to not be able to compile mios stuff with gpasm!Thank you svens!! Quote Link to comment Share on other sites More sharing options...
svens Posted April 1, 2006 Report Share Posted April 1, 2006 i've created http://www.midibox.org/dokuwiki/doku.php?id=compiling_the_midibox_source_on_linux a few minutes ago, comments/improvements/suggestions are of course welcome 8) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 1, 2006 Report Share Posted April 1, 2006 Good on you mate! Thanks! :D Quote Link to comment Share on other sites More sharing options...
QBAS Posted April 7, 2006 Author Report Share Posted April 7, 2006 Hisorry but I`m not understood :PIs this link useful for C projects too? http://www.midibox.org/dokuwiki/doku.php?id=compiling_the_midibox_source_on_linuxProbably not. As it was said SDCC 'C' compiler is need.But how to use it??? Quote Link to comment Share on other sites More sharing options...
drin Posted April 7, 2006 Report Share Posted April 7, 2006 But how to use it?Have people suddenly lost the ability to read? See the menu on the left, where it says 'C Interface'? All the instructions are there.<sigh>-drin Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 8, 2006 Report Share Posted April 8, 2006 I guess that drin views the forums in a frame... he means here: http://www.ucapps.de/mios_c.html Quote Link to comment Share on other sites More sharing options...
QBAS Posted April 8, 2006 Author Report Share Posted April 8, 2006 Thank you, thank you, thank youYou have opened my eyes, now I looking for infos with bigger focus. :o Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 8, 2006 Report Share Posted April 8, 2006 No worries. You should always read ucapps.de, the forum, the wiki, the portal, and google for these things, many times you will find the answer there first, or at least something that will give you specific questions to ask here :) Quote Link to comment Share on other sites More sharing options...
QBAS Posted April 8, 2006 Author Report Share Posted April 8, 2006 Thank you once againYes - everything works great :) :) :) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 8, 2006 Report Share Posted April 8, 2006 Excellent :) now on to greater things...velocity sensitive matrix things... ;D Quote Link to comment Share on other sites More sharing options...
chriss Posted December 11, 2006 Report Share Posted December 11, 2006 hi allthis weekend i wanted to compile the Midibox SEQ application the first time under osx. usually i do this on an old PC , but always had trouble finding the right files and because its much more affort than having one maschine for all that. So first i tried to read the forum and stumbeld over Xcode2. Then i realized i don´t need that, but need gputils-0.13.4, managed to install everthing to recognize that i get a lot of error messages. looked in the forum again and found this thread... and of course the wiki. http://www.midibox.org/dokuwiki/doku.php?id=compiling_the_midibox_source_on_linuxnow since i am not a linux expert and much more not a command line expert i have problems to get this sed file running.from the wiki To use this script, copy the following files in your mios_v_1_x_src dir:does this mean i need to copy both into txt files and save one as "replace-macros.sed" and the other as "fix-gpasm.sh" in the dir of the MB SEQ. because if i do so it does not work. terminal gives me following messages after sh fix-gpasm.sh back:fix-gpasm.sh: line 4: src/*.inc: No such file or directoryfix-gpasm.sh: line 4: src/*.inc_: No such file or directoryfix-gpasm.sh: line 4: src/*.asm: No such file or directoryfix-gpasm.sh: line 4: src/*.asm_: No such file or directoryfix-gpasm.sh: line 4: src/*.h: No such file or directoryfix-gpasm.sh: line 4: src/*.h_: No such file or directoryam i only in the wrong direction or do i need to do something else.thanks for the helpchriss Quote Link to comment Share on other sites More sharing options...
audiocommander Posted December 11, 2006 Report Share Posted December 11, 2006 Hi chriss,you're in the wrong direction, because the link you found refers to MIOS, the OS itself and not to MIOS-applications like the SEQ!But you are also in the right direction, because you just need GPASM indeed, but currently there seems to be an unsolved issue: http://www.midibox.org/forum/index.php?topic=2870.msg54888#msg54888Anyway, maybe you're interesed in these links for OSX (that's a linux topic btw ;) ) though they are targeted on C:http://www.midibox.org/dokuwiki/doku.php?id=application_developmenthttp://www.midibox.org/dokuwiki/doku.php?id=installing_gputils_and_sdcc_on_osxhttp://www.midibox.org/dokuwiki/doku.php?id=how_to_use_xcode2_as_ide_on_a_macBest regards,Michael Quote Link to comment Share on other sites More sharing options...
chriss Posted December 12, 2006 Report Share Posted December 12, 2006 okthank you for the info. didn´t thought about that.But that means i can not compile MB applications whith gpasm right at the moment. (either v.0.13.3 nor v.0.13.4) or is it possible to write a sed file which does the same as it does with MIOS files?And thanks for the links, although i knew them it´s always nice to get replies like that.thanks againchriss Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.