A lot of stuff learned!

I’ve been playing around a lot with the Stellaris Launchpad board, looking around the stuff I never noticed that the besides the fact of being licensed with a BSD style license, the Stellarisware SW provided by Texas Instruments has a closed license for the various examples.

The basic files needed to create a program for the board, and basically for all the ARM processors are the following with binutils and gcc:

  • The program you want contained in a .c file.
  • A linker script due to the fact you don’t have an operating system running.
  • A startup code file that zeroes the .bss segment variables, copies the .data segment to ram and setups the NVIC vector table.
  • A Makefile to build everything easily.

The program and the Makefile can be done with not much worries, but the linker script and the startup code are quite difficult, at least for me, to understand and set up properly.

So I ended up building from scratch the whole files needed and licensed them with a BSD license (Basically, do what you want with them, just give me credit I’m happy if someone find them useful, you can contribute, but don’t blame me if it doesn’t work lol)

You can find them in this Github repository

In the projects (eg: this) I’ve created in the past I just copied the 2 files from an existing example and modified them for my needs. That’s the lazy man (me) way! But after checking the license I was a little worried by this clause in particular:

# Texas Instruments (TI) is supplying this software for use solely and
# exclusively on TI’s microcontroller products. The software is owned by
# TI and/or its suppliers, and is protected under applicable copyright
# laws. You may not combine this software with “viral” open-source
# software in order to form a larger program.

So I decided to dig a bit deeper and figure out what makes typing “make” and enter on a shell prompt work.

After searching online I’ve found this 2 great pages:

Well, this provided a lot of help, giving me the basics of the ARM programming in GNU gcc and binutils. You should definitely check them out!

Also the manual pages for gcc and ld have been fundamental.

This have been a great learning experience for me, I’ve learned how to build a binary file from source code, how to use tools like objdump and nm, just following along the pages I’ve already posted before.

Well, if anyone wants to contribute it’s free to do it checking out my github repository for this project, cloning, editing and sending me bugs records and pull requests!

This is why I like open source, you can do everything you want with what others have shared with you. Isn’t this beautiful? 🙂

Advertisements

5 thoughts on “A lot of stuff learned!

  1. hi scompo,
    thanks for your posts. i acctually am teying to setup and develop stellaris on linux. i installed arm-none-eabi-gcc and lm4flash.
    But I only got the examples from the stellarisware working. I need to know how to compile acrual programs for stellariaware and also for freescale frdm-kl25z boards. can you guide me with some good references?

    1. Sorry about the delay, no clue about your freescale board. Now ti uses a software called tivaware for the ex stellaris parts. I will soon post something about that. 😀

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s