TruePERSPECTIVES_logo.png

Top reasons why the embedded industry standardize on ARM processors, the GNU compiler and the Eclipse IDE

Posted by Magnus Unemyr on Apr 14, 2015 3:05:00 PM

It is currently a very strong trend in the embedded industry to standardize on ARM Cortex devices, the GNU gcc compiler (with its accompanying gdb debugger), and the Eclipse IDE. I call the ARM, GNU and ECLIPSE combo “AGE”.

What are the driving factors for this strong trend? And what are the benefits for embedded developers to jump on the ARM Cortex, GNU gcc/gdb and Eclipse train? In my opinion, there are many benefits that provide embedded developers with great advantages.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, Embedded Software Development, Project migration

Are STM32 developers using FreeRTOS blind?

Posted by Magnus Unemyr on Apr 14, 2015 11:56:21 AM

One of the most popular real-time operating systems in recent years is FreeRTOS; and many STM32 developers use it successfully in their STM32 designs. FreeRTOS is a free-of-charge lightweight RTOS, offering threading capabilities on Cortex-M devices, including STM32.

While commercial RTOS’es may support more advanced capabilities, FreeRTOS is good enough for many; and hence its popularity considering its price. It is probably the most widely used RTOS for microcontrollers by now. Are you too using FreeRTOS on STM32? Great, but don’t be blind!

Read More

Topics: ARM Cortex, Debugging, Atollic TrueSTUDIO, RTOS

Parallel compilation: How the right STM32 tool can speed-up development with a mouse-click

Posted by Magnus Unemyr on Apr 14, 2015 8:40:00 AM

Computers today are fast, and I suspect yours is no exception. However, embedded projects tend to be larger and larger, now often comprising hundreds of C/C++ source code files. With the new STM32 F7 (the Cortex-M7 based STM32 family with 512KB or 1MB of Flash) for example, you have a lot of memory to fill with code. The same goes for the smaller STM32F3 and STM32F4 families too for that matter. And so, also with the most powerful PC’s, compilation time can be lengthy, which adds to development time if you develop incrementally with a lot of re-compilations of your application.

So, what should an STM32 developer do to reduce compilation times? I suggest you choose a great development tool for your STM32 project; and in this context that means a tool that can compile your source code files in parallel, rather than sequentially. Development tools supporting parallel compilation can vastly reduce your waiting time (and as a negative side, your coffee breaks too). This is how it works.

Read More

Topics: ARM Cortex, Atollic TrueSTUDIO, Embedded Software Development

11 techniques every Cortex-M developer should consider

Posted by Magnus Unemyr on Apr 13, 2015 1:31:27 PM

Are you a skilled Cortex-M developer, perhaps developing great software? Of course you are. No one would admit to being a lousy developer. However, it is useful to sometimes take a step back and see if there are new techniques or skills available that can help you improve. In this blog article, I have collected a number of techniques that can be deployed to help you develop Cortex-M software in a better way, releasing software more timely and of higher quality.

First of all, you obviously need to know C or C++ and possibly a tad bit of assembler as well. This is a must; if you don’t master this, order a book on Amazon.com immediately. You likely need to know your target device and its device driver libraries as well. Your semiconductor vendor will provide information on this. But when what? What are the “secret” techniques used by really skilled embedded developers?

Read More

Topics: ARM Cortex, Software quality, Debugging, Embedded Software Development

Optimizing code-size with the GNU gcc compiler for STM32 and other ARM Cortex-M targets

Posted by Magnus Unemyr on Apr 13, 2015 12:05:32 PM

The discussion of code size has been a never ending story in the embedded compiler industry for decades. During many years, the code size of compilers was the only real differentiator, and code size measurements were publicly used in magazine advertisements as well. Remember the times of the 8051? Embedded compiler vendors have even modified their tools to detect when official benchmark test suites were compiled and generated hand optimized machine code in those cases, to produce “incredible” numbers for marketing use in “competitor comparisons”. Go figure.

Luckily, most embedded compilers in use today are of very high quality, and produce code size of very small size difference in real-life projects (the GNU compiler is a good example of this). Still some compiler vendors use misleading figures in their marketing, but that is of little practical consequence in real life for most customers.

Read More

Topics: ARM Cortex, GNU tools (GCC/GDB), Atollic TrueSTUDIO

Is SEGGER J-Link the best debugger probe for ARM Cortex debugging?

Posted by Magnus Unemyr on Apr 10, 2015 1:37:00 PM

SEGGER J-Link’s are probably the most widely used line of debugger probes available today, at least within the world of ARM, and in particular for ARM Cortex-M devices like STM32 or Kinetis. SEGGER claims to have shipped over 250.000 JTAG probes over the years. I cannot verify if this is true or not, but most professional engineering teams I have met doing STM32 development are using the SEGGER J-Link for example, and so I see no reason to question that figure.

I have even heard the J-Link name been used synonymous to a debugger probe in general (from any vendor) multiple times. As such, SEGGER has almost succeeded in getting the J-Link name being the industry standard reference, much like Google have managed to get its company name being equal to do an internet search in general (“to google something”). So what about these SEGGER debugger probes anyway?

Read More

Topics: ARM Cortex, Debugging, Atollic TrueSTUDIO, SEGGER J-Link

Meet STM32F7 – The new Cortex-M7 based STM32 family

Posted by Magnus Unemyr on Apr 10, 2015 11:49:00 AM

The new ARM Cortex-M7 processor core is the most recent and highest performance of the different microcontroller cores in the ARM Cortex-M family. And as such, it outperforms for example the Cortex-M3 and Cortex-M4 on performance, while maintaining backwards compatibility.

Many semiconductor manufacturers have announced new Cortex-M7 devices, and one of the first out is STMicroelectronics, adding new Cortex-M7 devices to their STM32 family. The Cortex-M7 version of STM32 is called STM32F7, runs at 200MHz and initially coming with 512KB or 1MB of Flash memory and 320KB of RAM. And so, what can STM32 developers expect, when equipping their coming designs with the more powerful STM32F7?

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Atollic TrueSTUDIO, SEGGER J-Link, ST-LINK

Cortex-M debugging: Measure execution time using SWV/ITM

Posted by Magnus Unemyr on Apr 10, 2015 10:22:00 AM

By now, I have written a large number of blog articles highlighting the advanced debugger capabilities offered by the Serial Wire Viewer (SWV) real-time event- and data tracing, available in Cortex-M devices, such as STM32 from STMicroelectronics, Kinetis from Freescale, LPC from NXP, etc. In this blog article, I will mention how the Instrumentation Trace Macrocell (ITM), which is part of SWV, can be used to measure the execution time of any-sized and any-partitioned blocks of code.

For example, you may want to know what the execution time is of a while{} loop. Or how long it takes from the user press the “Heat” button until the oven reaches a certain temperature in the code (perhaps detected by an if{} statement code line), or how long time it takes to execute 15 sequential lines  of code in a function. All these time measurement use cases, and more, can easily be accommodated using SWV/ITM in Cortex-M based devices, such as the widely popular STM32 or Kinetis microcontroller families.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, SEGGER J-Link, ST-LINK

STM32 debugging using the ST-LINK debug probe from STMicroelectronics

Posted by Magnus Unemyr on Apr 9, 2015 9:40:00 AM

Many STM32 developers use ST-LINK as their JTAG/debug probe. In particular, it is soldered onto many STM32 starter kits and evaluation boards, including the STM32 Discovery Kits and Nucleo boards. But it is also offered as a low-cost stand-alone JTAG/debugger probe as well.

So what debugging capabilities can you expect when hooking up the C/C++ debugger in your IDE to your STM32 board using the ST-LINK JTAG/debug probe? Considering its price, it is a very useful and convenient debug solution, but it also doesn’t offer the performance or all of the more advanced capabilities of for example the SEGGER J-Link or J-Trace debug probes.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, ST-LINK

Using GNU gcc/gdb and ECLIPSE with ARM Cortex devices: Is free tools right for you?

Posted by Magnus Unemyr on Apr 8, 2015 11:59:00 AM

As the embedded industry now standardize on the GNU C/C++ tools (gcc compiler and gdb debugger) and the ECLIPSE IDE, more tool options have become available in the last year or two. In particular, free or low-cost Eclipse/GNU tools are widely available on the market for Cortex-M devices like STM32, Kinetis and LPC. Also available are high-end Eclipse/GNU tools like Atollic TrueSTUDIO, supporting the same devices with many commercial add-ons. And so, which one to choose?

A question is if the free tools really are free, and if they offer what you need? Factors to consider are out-of-the-box experience, quality and support options, as well as productivity and functionality, and managing project risks. Different development teams may well have different priorities and answer to these questions. Let’s see what factors there are to consider.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, SEGGER J-Link, RTOS, ST-LINK

Cortex-M debugging: Performance optimization using SWV statistical profiling

Posted by Magnus Unemyr on Apr 8, 2015 8:00:00 AM

So, where do you hang out? Or rather, where do you spend your time? While this question may appear a bit personal, it is a valid question in terms of embedded software. Knowing where your application spends most time executing is the first step in efficient speed optimizations. Profiling your application to understand where it spends most of the time, is the best way to optimize performance the most, with the least efforts.

Say for example that your application spends 95% of the time in 3 C-functions, and the remaining 5% in another 125 C-functions. Then it is quite obvious you should spend your optimization efforts in the 3 functions that use most of the CPU time. While this 95% in 3 functions/5% in 125 functions ratio may appear to be a rigged and fairly extreme example, it really isn’t that uncommon. Usually, only a few C-functions use most of the CPU cycles. By analyzing what C-functions steal most of the CPU cycles, you know where to optimize for best results.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, SEGGER J-Link, ST-LINK

What is the best tool for professional STM32 development?

Posted by Magnus Unemyr on Apr 7, 2015 12:58:00 PM

I often get questions on what tool to choose for embedded development; and after a number of years in this industry I have learnt that no tool fits all, and that many developers have very different opinions on what is important. Additionally, different developers have different needs and skill levels too.

Having said that, I have also seen a large number of development projects and learnt what is important for most embedded developers, and how to approach the tool selection process. Last week, I again got the question on what embedded tools are best from a company looking for STM32 development tools. That triggered me to take a step back and think about how to select the right tools (for STM32, or any other ARM Cortex device like Freescale Kinetis or NXP LPC for that matter) from a slightly more philosophical point of view.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Software quality, Debugging, RTOS, Embedded Software Development