Apaseo 3 Posted August 7, 2013 Share Posted August 7, 2013 Hello, I am trying to set up my computer so that I can compile my code with mspgcc using the command line. I downloaed mspgcc from: http://sourceforge.net/projects/mspgcc/files/Windows/mingw32/ Extracted it into mspgcc folder at C:/ Then I added to path. Now, when I tried to use it, it tells me (and I see) that there is no make.exe but there is msp430-gcc.exe, when I run this it tells me: msp430-gcc fatal error: no input files Does anyone have any idea or comments about this. All is welcomed. I prefer to work with the command line, Thanks Quote Link to post Share on other sites
simpleavr 399 Posted August 7, 2013 Share Posted August 7, 2013 Now, when I tried to use it, it tells me (and I see) that there is no make.exe but there is msp430-gcc.exe, when I run this it tells me: msp430-gcc fatal error: no input files How did you use it? Via a makefile? So it failed and you try just type "C:>msp430-gcc"? You do need parameters though. I would say if you are serious w/ doing command line, install cygwin and you will have all utilities available (make, binutils, etc). And the install just take 10 minutes. I think I am using the same mspgcc built, plus I had cygwin installed, plus I built mspdebug from source under cygwin. chrisc@5A:~ > which make /usr/bin/make chrisc@5A:~ > which msp430-gcc /cygdrive/c/mspgcc-20120406-p20120502/bin/msp430-gcc chrisc@5A:~ > which mspdebug /usr/local/bin/mspdebug chrisc@5A:~ > Apaseo 1 Quote Link to post Share on other sites
Apaseo 3 Posted August 7, 2013 Author Share Posted August 7, 2013 Im going to post what I have and how I have used it: I went to: http://sourceforge.net/apps/mediawiki/mspgcc/index.php?title=MSPGCC_Wiki And downloaded the latest windows version here:http://sourceforge.net/projects/mspgcc/files/Windows/mingw32/ After downloading I extracted to my C:/mspgcc After extracting I added the path: C:\mspgcc\bin to my paths now to test if I had the files working I opened a command window (cmd) and typed msp430-gcc :msp430-gcc: fatal error: no input files compilation terminated. -->This means that path and files are there Now to test if it would actually compile anything I downloaded this examples: hello_world.c from: http://sourceforge.net/apps/mediawiki/mspgcc/index.php?title=Example:hello_world and Makefile from: http://sourceforge.net/apps/mediawiki/mspgcc/index.php?title=Example:Makefile Put them on a folder and navigate to the folder on the console, then typed: msp430-gcc hello_world.c And got back: c:\test>msp430-gcc hello_world.c c:/mspgcc/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe: cannot open linker script file memory.x: No such file or directory collect2: ld returned 1 exit status And that is where I'm stuck. This is from cygwin: Mypc ~ $ which mymake /usr/bin/mymake Mypc ~ $ which msp430-gcc /cygdrive/c/mspgcc/bin/msp430-gcc I would like to get the command line compiling working, because I don't like CCS and would prefer to do my text editing on gVim or Sublime. Thanks Quote Link to post Share on other sites
simpleavr 399 Posted August 7, 2013 Share Posted August 7, 2013 You need to specify the target device via -mmcu, also you should add the -o to specify the output file name, or else you would get a.out (as in all gcc one liners) The memory model is different for each device and the linker need those information. msp430-gcc -mmcu=msp430g2553 hello.c -o hello.elf You can then use mspdebug or msp430flasher (from TI) to flash the firmware into your launchpad. Apaseo 1 Quote Link to post Share on other sites
Apaseo 3 Posted August 7, 2013 Author Share Posted August 7, 2013 You need to specify the target device via -mmcu, also you should add the -o to specify the output file name, or else you would get a.out (as in all gcc one liners) The memory model is different for each device and the linker need those information. msp430-gcc -mmcu=msp430g2553 hello.c -o hello.elf You can then use mspdebug or msp430flasher (from TI) to flash the firmware into your launchpad. I do think I got it. I was able to get a .elf file Now I will try the flasher stuff, I will report back when I get something. Thanks Quote Link to post Share on other sites
Apaseo 3 Posted August 8, 2013 Author Share Posted August 8, 2013 How did you use it? Via a makefile? So it failed and you try just type "C:>msp430-gcc"? You do need parameters though. I would say if you are serious w/ doing command line, install cygwin and you will have all utilities available (make, binutils, etc). And the install just take 10 minutes. I think I am using the same mspgcc built, plus I had cygwin installed, plus I built mspdebug from source under cygwin. chrisc@5A:~ > which make /usr/bin/make chrisc@5A:~ > which msp430-gcc /cygdrive/c/mspgcc-20120406-p20120502/bin/msp430-gcc chrisc@5A:~ > which mspdebug /usr/local/bin/mspdebug chrisc@5A:~ > Thanks for all the help. Now I seem to be having some problems with installing mspdebug . When I try to build it from source I get some errors. Just to make sure my cygwin is fine, do you have dev tools installed? Are there other packages that may be needed or some that you might recommend? And if you could please give me some tips or comments on how to build mspdebug from source. Thank You Quote Link to post Share on other sites
simpleavr 399 Posted August 8, 2013 Share Posted August 8, 2013 I don't remember the details, I always have c/c++ development installed w/ cygwin. You definitely need libusb, or libusb development. I just rebuild it and check the -l (libraries) that is needed, you should search for related packages that provides them. I.e. libusb, libreadline?, libws2_32? don't know what it was. I would usually look at compile / link errors and go from there. If you are stucked, show us the compile error here. gcc -s -o mspdebug.exe util/btree.o util/expr.o util/list.o util/sockets.o util/sport.o util/usbutil.o util/util.o util/vector.o util/output.o util/output_util.o util/opdb.o util/prog.o util/stab.o util/dis.o util/gdb_proto.o util/dynload.o drivers/device.o drivers/bsl.o drivers/fet.o drivers/fet_error.o drivers/fet_db.o drivers/flash_bsl.o drivers/gdbc.o drivers/olimex.o drivers/rf2500.o drivers/sim.o drivers/uif.o drivers/ti3410.o drivers/tilib.o drivers/olimex_iso.o formats/binfile.o formats/coff.o formats/elf32.o formats/ihex.o formats/symmap.o formats/srec.o formats/titext.o simio/simio.o simio/simio_tracer.o simio/simio_timer.o simio/simio_wdt.o simio/simio_hwmult.o simio/simio_gpio.o ui/gdb.o ui/rtools.o ui/sym.o ui/devcmd.o ui/reader.o ui/cmddb.o ui/stdcmd.o ui/aliasdb.o ui/main.o -lusb -lreadline -lws2_32 Apaseo 1 Quote Link to post Share on other sites
Apaseo 3 Posted August 8, 2013 Author Share Posted August 8, 2013 Just figured it out, I needed some libraries, and it compiled without errors, I was also able to test it. Thanks for the help. Quote Link to post Share on other sites
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.