Sl-Alex home lab

Em::Blocks - IDE for ARM Cortex.

Views: 9630Comments: 0
Notes

Translation: RU
Em::Blocks - IDE for ARM Cortex.

Once upon a time, when I was completely tired with slow CooCox and other Eclipse based IDEs, I've tried to search for a good alternative. Some of my projects are open-source, and it means that anyone, who have downloaded my project, should be able to build it without any license fees. Abilities of "light" versions of commercial IDEs were lower than I expected, so my search was limited only to free alternatives. Accidentally I found Em::Blocks.

Em::Blocks screenshot;

Figure 1: Em::Blocks screenshot

Who knows - will understand, which IDE was a basis for this one. For the rest I'll tell: it based on Code::Blocks, which is open-source, fast and flexible IDE. You can use Code::Blocks to write programs with С/С++ and other languages. Moreover, Code::Blocks is cross-platfoms, so it works under Linux, Windows and (people say) even under Max OS X. Some time ago, when I used to write a lot of programs for AVR, I used Code::Blocks. Don't ask me about debugging - I used serial port, LED or LCD to output debug messages, so debugging AVRs was not my choice. The same functionality I was expected from Em::Blocks. And I found it even better than my expectations.

Let's start from the very beginning - from the project wizard. If you try to create a new project, you have to select vendor, device, and then configure project and debug settings. At the moment of publication following vendors/device families are supported:

  • Atmel ARM (SAMD20, SAM3, SAM4, SAM7)
  • EnergyMicro ARM (EFM32x)
  • NXP ARM (EM77x, LPC1x)
  • PIC18
  • PIC32
  • dsPIC
  • STmicro (Cortex M0, M3, M4)
  • Texas Instruments MSP430

ST-Link and J-Link are supported "out of the box". Nevertheless, any other debug adapters, which support GDB, should work. Personally I prefer ST-Link, because STM32 are my favourite MCU.

The only withdraw of this IDE is the absence of Linux version. But, as it seems from the official project forum, it is just a matter of time, so we just have to wait a bit. For impatient users I can report, that Em::Blocks works under Wine, but does not remember settings.

After wizard has finished its work, we have ready-to-start project with all CMSIS and peripheral libraries connected. Peripheral libraries have actual version, at least for STM32. One additional moment: in case if wizard does not connect necessary peripheral libraries to project for your favourite processor - good news: you can change this behaviour manually. You can take STM32 wizard as an example:

$installation folder$/share/EmBlocks/templates/wizard/arm/st

By the way, in these folders you can find such interesting thing as scripts. It is interesting because you can write your own script and modify default Em::Blocks menu and add your own shortcuts. For example, you can make package for distribution. Ready to use example is here:

$installation folder$/share/EmBlocks/scripts

You can easily add it to the menu: just select "Settings/Edit startup script", and add the following line:

Include(_T("make_dist.script"));

Restart Em::Blocks and you will see that in menu "Project" new item "Create package for distribution" is available.

OK, we have finished with some possibilities, let's talk about building and debugging. I think you should not have any difficulties here. People, which used to work with Keil, will notice that interface is very similar, even key mapping is almost the same, but there is an additional thing, which can make your life easier. I talk about SVD (System View Description) files.

These files contain detailed information about processor registers and even about bit definitions for each register. It means that you should not search through processor documentation for each register and calculate its content manually. You can connect these files to the project in two ways: via online repository or manually (if you already have such file). In first case all you need is to select "Debug/Plugins/SVD repository..." and select your favourite processor, and file will be added to your debug configuration automatically. In the second case you have to specify this file in "Debug/Interfaces" on the "Target settings" tab.

Well, it seems that it's time to finish our short introduction. I think I've described some moments, which are good to know right from the start. The rest is pretty intuitive and you will not get a headache. In this short description I didn't say anything about other positive sides of this IDE: about good syntax highlighting, about auto-completion, about TODO-plugin (very useful thing, by the way), integrated doxygen and about many others. IDE is well maintained, some bugs are fixed earlier than I found them :). On the project website you can found bug tracker and a forum, where you can ask your question. So, I did my choice. Do yours.