EnterCritical() and ExitCritical(): Why Things are Failing Badly

I have carefully implemented my firmware. It works perfectly for hours, days, months, maybe for years. If there would not be this problem: the firmware crashes sporadically :-(. Yes, I’m using watchdogs to recover, but hey: it is a serious problem. And because it happens only under rare and special conditions, it is hard to track it down or to debug it.

Accessing shared data

Accessing shared data from the main application and from an interrupt

The thing is: these nightmares exist, and they are real and nasty. I’m pushing my students hard on this topic: It is about how to protect critical sections. And what could go wrong. And here is just yet another example: how it can go badly wrong if you are not careful. And it took me a while too to realize where the problem is. It was not a fun ride….

Continue reading

Tower Prototyping: PROTO Board, Breadboard on Ebay

The Freescale Tower boards are very versatile, and there are many different boards you can combine like lego bricks. When I tinker with my own hardware or need to try out something, then I use a special prototype board: the TWR-PROTO.

Tower Proto Board Frontside

Tower Proto Board Frontside

Continue reading

International Obfuscated C Code Contest Winners Announced

One of my favourite quotes about programming is this one:

“ Programming can be fun, so can cryptography; however they should not be combined. ” – Kreitzberg and Shneiderman

Well, there is truth behind this. But on contrary, there is a lot of fun with the combination of the two: the yearly IOCCC contest has posted the 2013 winners!

As in earlier years, it is amazing to see what can be done with creativity and a programming language like C ;-).

Continue reading

RNet Stack for 8bit MC9S08QE128 Microcontroller and MC13201 Transceiver

I admit: I have used ARM Cortex cores a lot in the recent months. Yes, I think with the ‘ARM domination of the world’ over time the ARM core will blast away probably all other cores, except for niche players? Still, there are reasons to use non-ARM cores, and even if it is just that I have a board at hand :-).

DEMOQE with MC9S08QE128 and MC13201 Transceiver Card

DEMOQE with MC9S08QE128 and MC13201 Transceiver Card

Continue reading

Tutorial: Replacing IAR EW with Eclipse IDE

Are you using IAR tools and you are jealous looking at what others can accomplish with Eclipse? You wish you could use your IAR build tools but taking advantage of Eclipse too?

I do not want to start a religious IDE war here ;-). At least for IAR, there is a way to bring both worlds together: having IAR build and debug tools integrated in Eclipse :mrgreen: :

Using IAR Tools In Eclipse

Using IAR Compiler and Debugger in Eclipse

Continue reading

Review: ThunderBench with the Freescale FRDM Board and Processor Expert

For the Eclipse and Processor Expert lovers of this world: there is another Eclipse based IDE you can use: ThunderBench made by Emprog:

ThunderBench for ARM Eclipse Startup Screen

ThunderBench for ARM Eclipse Startup Screen

They support a range of ARM based devices, including the Freescale ones I’m using. So I downloaded the v3.24 30 day trial from their download page last week. Finally I have found some time to try it out. Could this be an alternative to use my Freescale FRDM boards with Processor Expert?

Continue reading

Using the FRDM-KL25Z with CMSIS-DAP to program non-Freescale ARM Microcontrollers

Freescale might not have thought about this: how to use Freescale boards and silicon to develop for non-Freescale silicon? 😉

I tinkered around using the FRDM (e.g. FRDM-KL25Z) board as a general purpose programming or debugging device. See the links to the posts at the end of this article. I have used it to program and debug other Freescale ARM processors. It requires board changes and the usage of a different OpenSDA firmware which has its own limitations (no USB CDC serial bridge). But for about $15-20 I have a device to program my own external boards :-).

If you are using Keil tools, then the good news is: With CMSIS-DAP you can debug any other (even non-Freescale) ARM device as long it is supported by the IDE :mgreen:

FRDM-KL25Z debugging the nRF51422-DK (Source: Keith Wakeham)

FRDM-KL25Z debugging the nRF51422-DK (Source: Keith Wakeham)

Continue reading

How to Avoid Slow Processor Expert Projects

The Eclipse IDE is in my view the best IDE in the world :-). But it is not the fastest one: All the functionality and comfort has a price, and such a Java and highly flexible IDE requires its resources. The Eclipse community is continuously addressing that concern, and for example the Eclipse Juno 4.2 IDE in CodeWarrior for MCU10.5 shows this nicely: things are much smoother compared to the Eclipse Indigo 3.7 in MCU10.4. But if you feel that you do not want to use Processor Expert because it is too slow, then I have a trick how to improve performance by a factor of 10 :-).

Continue reading