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.

Bare metal programming

Guys, sorry, this might be some questions you experts might be hearing from a long time and I am sorry, I am again asking this. 

I recently started working with embedded systems again, all I want to do is open cmd prompt, run some blinky.c on my board. I know the meaning of all the technical terms liek tool chains, build tools, cross compilers etc. 

just help me with how to compile blinky.c to blinky.elf so which i can flash in my TM4C123G with LMFLASH.

I have read so much of documentation but there are 100s of ways people across globe are using. I want it simple, at this time I dont want to use CCS or any other IDEs. 

Just simple windows commands. 

Any help is greatly appreciated.

  • Hello Aaditya

    Mostly IDE's come with compilers. Is there is a specific compiler you are looking at for compiling the source code?

    Regards
    Amit
  • Hi,

    I just want to use Windows/Linux command prompt. Once I understand the flow/what tools are involved and the extensions. I will start using eclipse and configure it to work.

    Thanks
    Aaditya
  • Hello Aaditya,

    You need a compiler and linker to be able to do so. Pretty complicated if you are setting it up outside of the IDE environment. Suggestion: Install an IDE

    Regards
    Amit
  • Hello Amit,

    I agree it is complicated but there should be some notes or references right? I want to know the methodology.

    Thanks
    Aaditya

    On Saturday, August 27, 2016, Amit Ashara <bounce-310847@mail.e2e.ti.com> wrote:

     

    A Message from the TI E2E™ Community
    Texas Instruments

     

    Amit Ashara replied to Bare metal programming.

    Hello Aaditya,

    You need a compiler and linker to be able to do so. Pretty complicated if you are setting it up outside of the IDE environment. Suggestion: Install an IDE

    Regards
    Amit

     

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

  • Why complicated Amit?

    I've done precisely that with IAR tools, it didn't take long or require much effort. I've previously done that with gcc which took longer since i first had to figure out how to build the compiler which is a step that is less likely to be required.

    And doing so beats trying to figure out the inanities of yet another IDE and getting it to accept any tools other than it's own. Or navigating the overwrought complexities of Eclipse (now that's the start of an editor war)

    Now maybe CCS doesn't have the proper documentation to call a build process from the command line but other tool chains doq. IAR's was straight forward enough although the GNU documentation can be intimidating in its detail. I have, in my limited interaction with CCS, noticed that it's documentation appears a bit scattered but that may be a reflection of my limited familiarity.

    I agree with the OP, this should be a straightforward task, especially for someone already experienced in the command line.

    Robert

    BTW, isn't CCS an Eclipse environment? My recollection is that the Eclipse heritage of CCS has caused me many problems installing the TI DSP compiler. Eclipse is dangerously close to collapsing under its own weight in my experience
  • Hello Robert,

    "all I want to do is open cmd prompt, run some blinky.c on my board."

    This does not suggest the poster experience...

    Yes, CCS is eclipse based...

    Regards
    Amit
  • By CMD, I meant cross compiler tools. I downloaded and installed ARM GCC tool chain, I was able to compile the code and make an object file with right flags but am having difficulty with assembling and linking, I don't have .s file for TM4C, I could use .ld file for linking provided in blinky example. I don't know how to create one .s file.

    And yes, I am just starting. 

    When it comes to complexity, it could be but there should be some procedure somewhere or someone might have already tried. 


    I am looking for some guidelines for this.

    Thanks
    Aaditya
    On Sunday, August 28, 2016, Amit Ashara <bounce-310847@mail.e2e.ti.com> wrote:

     

    A Message from the TI E2E™ Community
    Texas Instruments

     

    Amit Ashara replied to Bare metal programming.

    Hello Robert,

    "all I want to do is open cmd prompt, run some blinky.c on my board."

    This does not suggest the poster experience...

    Yes, CCS is eclipse based...

    Regards
    Amit

     

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

  • Hello Aaditya

    Aaditya Kandibanda said:
    all I want to do is open cmd promp

    I have not heard (and sorry for my lack of knowledge) but cmd prompt has never been associated as implying cross-compiler tools

    I have always used the .s file in CCS IDE running GCC tool chain, so never worried about getting one or debugging one. Check on CCS forum and you may get some examples.

    Regards

    Amit

  • Thanks Amit! My bad. I should have put the question in a better way! 

    What about the flags etc I need to use during assembly? Is there any place where I can find this info? 

    Also, from CCS, is there a way to know the commands CCS is running to build ?

    Thanks
    Aaditya 

    On Sunday, August 28, 2016, Amit Ashara <bounce-310847@mail.e2e.ti.com> wrote:

     

    A Message from the TI E2E™ Community
    Texas Instruments

     

    Amit Ashara replied to Bare metal programming.

    Hello Aaditya

    Aaditya Kandibanda
    all I want to do is open cmd promp

    I have not heard (and sorry for my lack of knowledge) but cmd prompt has never been associated as implying cross-compiler tools

    I have always used the .s file in CCS IDE running GCC tool chain, so never worried about getting one or debugging one. Check on CCS forum and you may get some examples.

    Regards

    Amit

     

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

  • Hello Aaditya

    CCS has a console log which shows all the commands, options and flags being used during a compile and link

    Regards
    Amit
  • Aaditya Kandibanda said:
    I just want to use Windows/Linux command prompt. Once I understand the flow/what tools are involved and the extensions.

    Found Tiva, Linux, CMake where someone describes how to compile a Tiva program using GCC from a command line using CMake, and debug using Open On-Chip Debugger and GDB from the command line.

  • Thanks Guys,

    I am in a better spot now than I was before asking this question.

    if you could explain me what does template do? and where does I find the startup.s file for Tiva launchpad?

    Thanks
    Aaditya
  • Hello Aaditya

    In CCS when you generate a new project within the IDE environment with GNU compiler the template and the startup file are auto-populated

    Regards
    Amit
  • Hi,

    Cortex-Mx micros do not need startup.s files. Actually only Keil uses that, the others, CCS, GCC uses startup_ccs.c/startup_gcc.c file, to be found in examples folder of each micro.

  • Thanks Petrei,

    Hen I using arm GCC, we can compile user C program to .obj, the startup GCC also has .c extension? Do we need to compile both to .obj? And how to use the arm-none-eabi-ld to link two above OBJ files and .LD file? 

    On Monday, August 29, 2016, Petrei <bounce-1462477@mail.e2e.ti.com> wrote:

     

    A Message from the TI E2E™ Community
    Texas Instruments

     

    Petrei replied to Bare metal programming.

    Hi,

    Cortex-Mx micros do not need startup.s files. Actually only Keil uses that, the others, CCS, GCC uses startup_ccs.c/startup_gcc.c file, to be found in examples folder of each micro.

     

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

  • Hi,

    Yes, the file startup_gcc.c must be compiled also and then both/all files should be linked to generate the application. To do compilation/link automatically, you need to write a Makefile and then use the make application on your computer (make.exe on Windows, known good version 3.81).

    I do not have an example at hand, must look into archives.

    But also, in Tiva folder there is a Makefile, you can open a cmd window, cd to Tiva and call make - note this will compile/link all examples in Tiva, takes too long to accomplish. However, the makefile is interesting, since it have all configurations/switches needed. (The Makefile writing is usually avoided by IDE programs like CCS. Also in IDE you may use parallel compiling for large programs, but this is another story).  

  • Point taken Amit

    Robert
  • Hello Robert

    Which one?

    Regards
    Amit
  • All of them of course Amit.

    But in this particular case the demonstrated experience level.

    Robert