# Sublime Text editor to develop ARM-based software

Until this moment I used Atmel Studio to develop software for AVR-based devices. Now I'd like to go to ARM Cortext M. Additionally I'd like to try codesign and version control (I still not experienced in those useful things yet).

I know that Atmel studio have the plugin to work with GitHub repositories. But I just acquired with Sublime Text 2 editor which is very nice to work with. It is also able to work with GitHub (as I have read in the Internet, I just not tried it myself) but I'm not sure that Sublime Text will be handy to compile GCC and ASM sources to HEX's.

Does anyone tried to use Sublime Text 2 as a source editing tool for such implementations? Or traditional IDE's will be much easier to work?

• Sublime text is a editor. It's scriptable, but if you want interactive debugging, you're going to be stuck at the command line. Just learn to write makefiles and build-scripts. Oct 13 '14 at 9:17
• Also, version control and atmel studio are not related. I use SVN for my atmel studio projects, there is no reason you can't store the files from atmel studio (or visual studio, on which it is based) in a VCS. Oct 13 '14 at 9:18
• Lastly, that is "codesign"? Do you mean code signing? That's largely irrelevant for the smaller ARM devices, unless you're writing your own bootloader that does the verification stuff. Oct 13 '14 at 9:19
• @ConnorWolf I didn't think about debugging issue. In this case traditional IDE will be a way better than any text editor. Thanks for that! Oct 13 '14 at 9:19
• SVN is "Subversion" - a version control system more akin to CVS than Git. Oct 13 '14 at 10:18

Yes, you can use SublimeText to edit source code, and not just for ARM, but for anything; and many people do. It's a very popular source code editor.

The tricky part comes when you want to do more than just edit. A traditional IDE provides far more than just editing facilities, so you would have to either implement, or find someone on the internet who has already implemented, the functions you require for working with ARM. Not least of those functions are:

• Compiling the source into target binary files (usually ELF files).

How you would do that is somewhat dependant on your host OS and what scripting tools you have available for doing the tasks. In general the compiler will be GCC, which is freely available for all the main operating systems, so if you know the correct flags to use when compiling source for your specific target then scripting the compilation shouldn't be too much of a problem.

When it comes to uploading the code, though, that all depends on how you do the uploading. Do you use a hardware programmer? Does your target chip have a bootloader installed? For either of those, what tools are available that are scripting friendly that you can use to add functionality to SublibeText?

So unless you can find a resource online where someone has actually done just what you want to do, for the same target chip or chip family as you are using, then it's going to be a lot of work to get going. You'd be better off starting with a traditional IDE and using that as a template (investigate how it compiles and uploads) and migrate it to SublimeText, or operate a hybrid environment where you do the editing in SublimeText but use the IDE to compile and upload the code.

• Thank you for such detailed answer! Great! Could you suggest IDE for my case? I know only Atmel Studio and I use only a little fraction of it's functionality. Oct 13 '14 at 11:18
• Also note that Sublime supports make as a build tool, so you can google around for a cool makefile for ARM compiling and uploading and use it. Oct 13 '14 at 11:44
• I don't use an IDE for most of my projects. Generally, it's some sort of editor (Kate or Sublime) and then I use make to run the toolchain. I run make and git from the command line, as they are command line programs. I have makefiles for AVR, ARM, and Xilinx FPGA projects. Oct 13 '14 at 18:23
• I use an IDE for my embedded projects, but that's mainly because I wrote the IDE myself :) For writing the IDE, or doing other PC development I use vi ;) Oct 13 '14 at 18:25

As others have said, Sublime is an editor (a very powerful one), not an IDE so using Sublime for debugging is cumbersome, though not impossible (see footnote at bottom).

I do a lot of embedded programming though, so describing my workflow may be helpful.

All of my coding is done in ST2 with a few key packages:

• Package Control: no description needed I hope
• SublimeTODO: for tracking TODOs in my projects
• BracketHighlighter: for aiding in visualizing scope in C
• SublimeClang: by far the most crucial package for me. This excellent plugin provides real-time syntax checking, code verification, and definition/implementation finding. In fact, I rely on this so heavily that since it is technically for ST2 only, it has prevented me from moving to ST3 until I can try to port this.

I also make use of custom snippets for code formatting. Once my coding is ready to be tested on the hardware, I'll use an IDE for debugging. Any code changes I need to make are still done in Sublime however. Some people may find that awkward, but I've grown used to that.

As for IDE's, many of the IC manufacturers provide there own IDEs (TI, Freescale, Microchip, etc.), however there are some good & free ARM-centric IDEs out there now. Em::Blocks is the one I've used the most. It's well maintained and a solid application. CooCox is also quite good.

Footnote: The same developer who created SublimeClang also created a GDB plugin (SublimeGDB), however for debugging I think a dedicated IDE with memory views, variable watches, and expressions is hard to beat.

• Thank you for sharing this! It's really useful! Do you use any VCS in you workflow? How do you compile your sources? GCC? Oct 13 '14 at 17:24
• Thanks. We use SVN & git at work, and I use git for my own projects. I never really integrated that within Sublime though. I know a lot of people do though, and there are good plugins to support both. I don't compile within Sublime -- just use the Clang plugin for syntax checking which gets me all the way up to linking. When actually compiling I use whatever IDE I'm using for the particular project. I could tie that into the Sublime 'build' command I suppose... Oct 14 '14 at 14:42

Since this question was posted, and it's been more than 2 years from now (Jun 2018), a new full-featured editor has appeared on the scene: https://atom.io/packages/language-arm

Atom, among other things, supports Git version control out-of-the-box.