This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Programming and compiling using mspgcc

Other Parts Discussed in Thread: MSP430F5529

I don' want to depend on softwares like CCS or IAR to program my MSP, because I won't have them laying around everywhere I go.

Instead, I would like to use versatile editors like CodeBlocks, dev, or even windows' notepad...

I've downloaded the officially supported mspgcc from texas' website

How to use it ?

 

Very important observation: I don't want to integrate this mspgcc thing to the editors !

I know it is possible to do it this way ("portable" mspgcc). My professor can make a microcontroller rain with a .c file, a makefile, and a windows' console window

But he can't help me. This texas' mspgcc is completely different to him.

I can't find any tutorial for this matter

MSP430F5529

  • To compile, just call the compiler with the correct options:

    msp430-elf-gcc -mmcu=msp430f5529 -o blink.elf blink.c

    (You might want more options. This can be written in a makefile, and should be if you're using more than one source file.)

    To program the chip, I happen to use mspdebug:

    mspdebug tilib "prog blink.elf"

  • Thank you very much for this answer. And sorry for the delay. Rough month.

    But I would appreciate much more basic information, like:

    - Where is that msp430-elf-gcc file (Reminding that I've downloaded Texas' MSPGCC) ?
    - What does it do ?
    - If it depends on other files, what do they do ?
    - What is "call the compiler" ? Something like opening a command prompt ?
    - Where (location) must the .c files stay in relation to these compiler files ?
    - After compiled, will it stick the .elf inside the microcontroller ?


    There are no tutorials anywhere
    You are a beacon of light on these matters. The only on the internet.

  • Didn't you install it?

    Read the Quick Start Guide.

    It is assumed that you already know how to use a command-line compiler. You might want to start with a compiler for Windows programs.

  • Thanks

    Apparently, I didn't have it installed

    I had some "toolchain" batch, not the gcc-full-windows-installer

    Now I have, but I'm still stuck.

    Following your document, page 3, after running the XDS GDB agent with UI, it tells me to enter the command make debug, which returns me an error stating that this make is not a recognized internal or external command(...)

    And it's true. There is no "make.exe" on the bin directory, or anywhere else. "make" also does not seem to be a parameter of msp-elf-gcc.exe

    Would you tell me what this "make" is ?


  • make (Wikipedia)

    If you have a Microsoft compiler installed, you should have its clone "nmake.exe".
    Otherwise, you can get the Windows port of GNU make, or install the make package with Cygwin.


    I would not recommend to try to use a command-line compiler if you don't know what you're doing.

  • I had nothing installed previously

    - I've download the make binary for windows (make-3.81-bin.zip, located on your first link)
    - Downloaded its dependencies and pasted the DLLs to windows folder (Noticed myself after a few attempts that it was necessary)
    - Also set an environment variable named make to point to the bin folder of the make folder

    Still getting my rear kicked.

    I've followed your document, section 2.2: Building manually with gcc

    The instructions lead to the creation of a blink.o, next to the blink.c example file
    So far, so good.


    Then I went to 2.3: Debugging, in order to flash the program to the microcontroller
    Section 2.3.1.1 runs fine using the program with gui, but on the very first step of 2.3.2.1 I get

    make: *** No rule to make target `debug'.  Stop.


    I'm really on the dark here. Too much loose information, or no information...

    Important:
    On all the steps, the dir I work on is the one where the C file is located.
    From there, I can call msp430-elf-gcc or make, and they will run, because they have an environment variable entry

**Attention** This is a public forum