Yearly Archives: 2012

Solving the GUI framework cannot be initialized error in Miktex

Miktex 2.8 and 2.9 seem to suffer from a known issue with the package manager. Simply put, the package manager GUI will fail and then no packages can be fetched if the Yes or Ask options are selected for the package manager (contrary to some online information, selecting Yes doesn’t seem to work).
The solution isn’t too pretty: Open the mo (miktex options) GUI that’s in the bin folder of the miktex installation folder. For example in Windows 7 this is:
C:\Program Files (x86)\MiKTeX 2.9\miktex\bin>

Then just run mo.exe. IN the General screen, select the “No” option for whether packages should be downloaded automatically.

Here is the difficult part: you now will need to download the necessary packages manually. It’s a pain, but can be done quickly. Simply run miktex and see what package is missing from the error. Using the package manager (also available in mo.exe in the Packages tab), locate the packages and install them.

GIT it in your development

Over the last several years, I’ve played around and used several Source Control systems. Among the Perforce, GIT, Subversion and a few others. I have to say I’m very happy with GIT thus far. Despite the complaints of some, GIT is an excellent system and has saved me from source code hell a few times.
You can find more about git here:
http://git-scm.com/

The tutorials are quite good and can get you up and running quickly.

Once you’ve created the repository, go ahead and created an annotated tag with, for example the name v0.1.
After this, running the “git describe” command will provide you with incremental versioning, which is very much needed when you’re reporting bugs on a
particular commit. Just try giving your colleagues the SHA1 of the particular commits when they ask you the version in which the bug was found. I suspect they’ll be none too pleased, though you might get to figure out who knows what SHA1 is 😀

This automatic versioning is also useful when using a Continuous Integration server such as Hudson, Jenkins, etc.

Create debug first, software later

Have you ever found a software bug and then went back to add printf and other debugging capabilities later?
I think we’ve all done that. However, that approach is way too late. There is one true maxim in software:

Your software has bugs

Given this, the best approach is likely to add debugging capabilities first, then add the actual code later. There are plenty of advantages for this:
1) You’re much more likely to add the debugging prints if you have easy to use debugging functions
2) Issues will happen almost immediately once you start writing code. You will get to writing working code faster if you have a consistent debug method

In Windows/Linux, printf and similar functions are one way to go. Please note that using a good debugger in itself is critical, however, it’s sometimes easier to see
a chain of events happening when it prints. Make sure to use the line number Macros in C whenever possible since they’ll let you know immediately where the error is.

In embedded systems this becomes a bit more tricky. Embedded debuggers provide the ability to use printf across JTAG and this is quite good sometimes, but it might be better to use a separate UART connection. Another good option is that if your system has any kind of flash storage (such as SD card) then print the log information there. This is useful in the long term when you’re not paying attention and everything comes crashing down. You can then have a look and get a better idea of what is going on.

The blog over the last year

Over the last year, I’ve made little changes or additions to the blog due to being so busy with work and family. Some interesting trends developed while I was “away”.
My bandwidth requirements have spiked significantly. My MSP430 shows up as one of the top results in Google. I’ve never publicized it anywhere so I can only assume that users have been posting links to my blog. At 1MB a pop for the PDF, my BW gets quickly eaten up but I’m working to get more.
There have been many of you that have thanked me for the tutorial and I am very happy to know that you find it useful. I really make nothing out of it except knowing that some of
my knowledge about the MSP430 gets passed down.
There have been even more that have clamored for more material. I am happy to say that I’m working on just that. The MSP430 is a device with many features and peripherals, and on top of that I’m hoping to add some practical tutorials on debuggers, compilers, etc. Please feel free to e-mail me with material suggestions or corrections gustavo [at] glitovsky (dot) com

And as always, plenty of spammers have tried to craft intricate messages for me to approve in the Blog. I have to say it probably didn’t work 😀 Sorry!