Live. Learn. Love.

The formal scratch pad of Shanjit Singh Jajmann.

April 7, 2013 at 9:24pm

0 notes

Microcontroller Software : Building Executables

Writing Software is easy, writing Software targeting a specific hardware can be pretty daunting. Daunting in terms of setting up your development environment, which compiler to use, what do the numerous compiler flags mean, how the linker comes around and its role in mitigating all those ‘undefined reference’ tags among other things.  

I had a very basic understanding of C and some practical experience on the Arduino. Starting off with ARM was no joke, i didn’t really sleep comfortably for too many nights in a row. For me understanding how the things fit in the big picture of having that LED blink is more important than that content feeling one gets after seeing the same. Flashing the code onto the board and seeing it run is easy, there is more than sufficient documentation online and follow any of those tutes and you’ll find your way through. I suggest you do that if you would like to right now, this post tries to put things in perspective for a Beginner in embedded software and in a way helps me put down everything on ‘paper’. Also, i am no embedded Software God. 

So, starting off with the aim of building the final hex/bin file. The first step is to choose a suitable toolchain for your use. Toolchains are basically a set of tool used to build a final bit of software (executable) which can be run on a machine. If the architecture of the machine you are targetting is different from the architecture of the machine you are using to build the code, then the toolchain is called a cross-toolchain. So, how do you choose which toolchain to use ? I will help you out here. Broadly, when you are building a executable file for a microcontroller what you can be targetting is one of two, building the hex/bin file to be run on the hardware directly or you could be targetting a layer above that (an .c capable executing hardware). The toolchain you’d be using for the former case is what would be called as a barebone toolchains. Here are some example of a barebone toolchains. I generally use the CodeSourcery Lite toolchain (barebone), it is a prebuilt set of tools put together and updated frequently by CodeSourcery (bought by Mentor Graphics). You can also build your own

Read More

March 25, 2013 at 2:21pm

0 notes
Almost an year’s work. Finally here! Thankful to a lot of people for this. :)

Almost an year’s work. Finally here! Thankful to a lot of people for this. :)

March 15, 2013 at 6:01pm

2 notes

Creating a Rails App from Scratch : Part 1


It was a couple of weekends back that i decided to finally make a web-app for my lab. The aim was to build a simple web-app which listed all the electronic components we used and also kept track of what we had in stock and what we didn’t. 

Knowing the destination i decided to sit down on a saturday night and code it up up through till Monday. So, since i graduate in about 80 days i decided to give back a simple good looking ‘easily editable’ web-app rather than a sucked-up HTML page. This is what i ultimately ended up making. (patience, free heroku accounts are slow). Here is how i did what i did, 

Front-end - Twitter Bootstrap 

Nothing can beat the ease with which this gets you into business. And all this at with that sexy-cum-clean look. Best for throwing in stuff for prototypes and quickies.

Back-end - Rails (yeah the Ruby one)

I did go over all the Ruby and Rails structure over my last winter vacations. Reason - Inquisitiveness. It was just that there was so much talk about it. I just had to get my hands dirty and find out what the mess was about. Post End Semesters and my Graduate Applications i had plenty of time on me, so i decided to learn a few tricks of the trade.

Rails works on a MVC (Model-View-Controller) Architecture. You’ll need to understand what goes into each folder and how databases, models and attributes are set and everything. Best to go look up some full tutorial on this. I will be making use of the Postgresql database as it most conveniently puts up with heroku

Step 1. 

Coding the front end was pretty straight forward. 

Read More