Migrating a AVR32 Studio project to Atmel Studio 6

Atmel has at least two IDEs that I know of:

Migrate AVR32 Studio project

I am studying migrating from AVR32 Studio to Atmel Studio 6. Luckily, migration is made painless in Atmel Studio 6, by providing an import option under the File menu. You can specify the location of your AVR32 Studio workspace, tell the import wizard to find/list projects under the workspace, and select all projects you want to migrate. The wizard does in-place migration, so backup your work before running the wizard. It didn’t mess-up anything, but you never know. The tool creates a solution file in the workspace folder, and a project file with the extension cproj under each project.

I had to eliminate the compiler option -march=ucr1 to proceed with the build. GCC compiler with the newer toolchain refuses to compile with message “Conflicting architectures implied by -mpart and -march.”

Missing linker flags after migration

I did find one minor issue after migration. My project uses a linker script to place code and data in flash and SRAM. The linker flag -T used to specify the linker script was missing. The same thing happened to the flag -Wl,-e, that is used specify the entry point. I had to add these manually to project settings, in the Linker flags text box under Toolchain, AVR32/GNU Linker, Miscellaneous. 

One last thing I had to do was exclude the linker script from compilation, otherwise the build fails.

Using older Toolchain

The biggest problem I faced was post build. The target board would reset on executing the code. GCC version that ships with Atmel Studio 6 is 4.4.3 (AVR_32_bit_GNU_Toolchain_3.4.0_332). Whereas, the GCC version that ships with AVR32 Studio 2.6 is 4.3.3 (AVR_Toolchain_3.0_124). Similarly, GNU ld is also newer. I confirmed toolchain was the culprit, by creating a Flavour Configuration (accessible from menu Tools –> Options…) that points to the toolchain provided with AVR32 Studio, and changing the project settings to that flavor (accessible from the Advanced tab). I still haven’t figure out what is wrong and how to fix it. I’ll update this post when I discover that. Till then, I’ll use the toolchain that ships with AVR32 Studio.

Atmel Studio 6 on Windows 8

I have been able to successfully install it on Windows 8. The only hassle being the following message a short while after launch: “Could not connect to the local debug agent. Make sure avrdbg.exe is started and not blocked by firewall or antivirus program.”

You’ll find instructions to get the debugger working again here. Atmel Studio 6.1 update works out of the box.

Going back to AVR32 Studio 2.6

Fairly straight forward, just fire it up. The only issue I found is that it fails to detect USB drivers for AVR debuggers, it shows the following message: “The USB drivers required for communicating with AVR debuggers such AVR ONE!, JTAGICE mkII and AVR Dragon do no appear to be installed.” The solution is to uninstall the updated driver and install the older one. This is not required after the Atmel Studio 6.1 update, both IDEs coexist well.

Piping information within the browser

Every time I download a big file using a mobile browser, say a book, to upload it to another site, say Dropbox, I wish I could do it without requiring to touch the file system. There are some book sellers who provide Dropbox integration, but the number of cloud storage services has skyrocketed, and I don’t think the sellers can integrate with each one of them. Some other, standard, mechanism is required.

If browsers provided a piping API, that allowed redirecting the download to just about any registered storage providers, file system being one of them, that would probably solve this issue. The provider configuration could be specified in the settings. It could also be requested at the time of download.

Any way, just a thought. I’ll think further on how this may be implemented without requiring any additional support from the browser.

Binary serialization for JavaScript objects

One particular mechanism I find lacking in JavaScript is an easy, reusable, way to parse binary data. I have leveraged custom attributes in the past with .NET. JavaScript does not provide custom attributes. One means of specifying the format of binary data is to use JSON. I tend to favor declarative mechanisms for writing reusable code.

I like it better when I can leverage open source code. Cross-pollination of ideas from other language communities can also provide interesting design ideas. I found the following that I may use, instead of writing my own parser/serializer:

If you are looking for something similar for Ruby, you can take a look at BinData. I’ll be updating this post as my work on this topic broadens. Check back.

A matter of opinion

A man is a wolf in sheep’s clothing, as long as he doesn’t speak, he is not discovered.

Few men are rational when asked to offer their opinion. The opinions are always laced with lots of self-interests, and with emotions resulting from deceptions suffered in the past.

I particularly, am considered the honest Indian. Asked for an opinion, I point out the way things are. I am an optimist, a realist, and cynical. To be realistic, cynical is a trait I have inherited from the rest of mankind, but I am optimistic that I can overcome that.

Like the zen master, the next time I am asked for an opinion, I’ll answer with a question, a completely useless phrase, or with silence. AUM!

Apple vs Samsung

Apple has won. Now what?

Both Apple and Samsung tried their best to show that the other’s products were based (/ inspired) by past innovations. Apple was better at doing it. The Jury bought that. Samsung needs to do better homework the next time. That said, the newer breed of Galaxy smartphones are way distinct from their first predecessors, the market is rewarding them handsomely. So, I think Samsung can just settle and go on.

In the end, the market decides the winners, not the courts. Look at Java, Sun won. Java is everywhere. But where is Sun really? Apple is protecting its turf. It’s all about market and survival. Bickering on patents and techniques is one way the system allows you to protect your interests.


Our most unique trait

All that science does is explain that which exists. All that is will not suddenly become different because of our understanding of it. What makes science interesting is that in understanding our universe we create.

If we are to quietly accept the scriptures, or become servants of existing knowledge, we cease to create. We cease to be useful to the universe. Our most fruitful purpose in existing is creation. It happens through our biological procreation, music, dance, art, prose, technology, and whatever else that makes our lives meaningful, even some of our religious rituals and ceremonies.

We are fighting for survival, even if it may not seem so at first. The odds are always stacked against us. We don’t know why we exist. Our existence, and our knowledge of the fact that we exist, is a conundrum that we stare at from the moment early childhood leaves us, and we begin to take our first bumbling steps towards adulthood.

In death we see a cruel certainty. We strive to do all that we may, live the most extraordinary experiences, before we die. I have found this desire strange, because once dead, it does not matter what we lived. Then I remember that this desire to explore, have new experiences, set off towards the unknown, are means to liberate our creative spirits.

We have made use of our scientific knowledge, so far, for creature comfort. A good majority of us have become complacent, dull. It is time to jolt ourselves out of our comfort zones. We have to ask hard questions and create innovative solutions. The study of evolution has shown us that very long periods of time pass before a dominant species is subjected to any stress. In a very brief period after that, it goes extinct. We have been subjecting countless species to that end.

It may just be that by eliminating every last biological enemy our survival will be ensured. We may arrive at grand, technological landscapes, that we conjure in our books and movies. These visions have made our lives more meaningful. There is however our biology to contend with, still very deeply entwined with nature.

We have created vast tracts of plantations, but we are far from converting sunlight to food. Our own still live in hungry misery. Our most useful medication is inspired by the very species that are going extinct. We don’t understand our biology enough, or possess the necessary technology, to make medicine from the known elements.

We have to liberate our creativity from the shackles of ignorance. We are collectively at fault. Let this be a manifesto and call for action.

Exchanging binary data in the absence of ArrayBuffer

You want to use jQuery to send binary data using jQuery.get() or jQuery.post(), and discover that it cannot send binary data without a patch. You use the patch and discover that your JavaScript implementation does not support ArrayBuffer for some strange reason.

Well then, here’s a hack that can work for small amounts of binary data, use an Array of numbers. For instance:

    var buf = new Array(10);
    buf[0] = 0;
    buf[1] = 1;
    buf[2] = 2;
    buf[3] = 3;
    buf[4] = 4;
    $.post(url, {buffer: buf});