Device is secure?

It is one of these long weekends which allow to catch up on many things. One thing I finally completed was the move to FreeRTOS V7.1.1. With this I did some tests using the Tower boards, including the Kinetis one. So I have rebuild my Kinetis K60 application and was ready to flash the device. But then to my surprise I got this dialog:

Device is secure. Erase to unsecure?

Device is secure. Erase to unsecure?

Continue reading

Bit Banging I2C

The Freescale ColdFire V2 (MCF52259) is a great communication device: an embedded Processor like a Swiss Army Knife: Great peripherals, USB and Ethernet interface, a lot of flash application space and up to 64 KByte of RAM. I’m using that core in many projects, and there is great community support for it with boards and software. Unfortunately Freescale somehow provides Processor Expert support only half way for it. Support for the I2C bus is missing :-(.

Continue reading

Fixing the Morpho Core Exception

After running the MQX batch installation file for MCU10.2 (see MQX Eclipse Working Sets) I had an error dialog when I inspected my debug/run configuration:

“Error loading data producer reader: com.freescale.morpho.core.CWException: The function “getServiceByContractID” returned an error condition (0x80040154)”

Error loading data producer reader

Error loading data producer reader

Continue reading

MQX Eclipse Working Sets

Working Sets are a very useful feature in the Eclipse Framework (see Working Sets Explained). But: with a standard Eclipse distribution it is not possible to import or export working sets. The good news is: the AnyEdit plugins (see 5 Best Eclipse plugins) provides that missing functionality. The other good news is: Buried in the Freescale MQX 3.8 distribution for Eclipse CodeWarrior, there is an even better implementation for the Eclipse Working Sets.

Continue reading

Trimming S08 with P&E

Freescale S08 controllers have an internal clock generator (ICG) which allows the device to run without an external clock signal. But as devices differ, they need to be calibrated and trimmed. The microcontrollers are usually trimmed in the factory. How can I trim it myself if I need something better?

Continue reading

CRC Calculation with MCU10

With USB goes medical I have a serial-to-USB (CDC) support for my TWR-S08MM128 board. What makes these devices targeted for medical applications interesting for other applications are features like bootloader support and a CRC (Cyclic Redundancy Check)  engine. But how can I generate the required CRC numbers with MCU10?

Continue reading

Dump my Device Memory

Maybe this situation is familiar to you: My embedded software stopped in the field. I am in front of it, hooked up with my laptop and debugger. And I see: indeed, it has a problem. Maybe just a one-time-thing? Maybe I do a reset and things will work as expected? Not really, according to Debugging Rules.

The thing is this: I’m in a situation which requires some deep investigation. But I do not have the time now. Or my boss, the boss-boss or the customer are standing behind me asking all the good questions for which I don’t have an answer. So in this situation it would be great if you could take a dump of the device memory, reset that board, move on and investigate what happened offline? Here are several ways how to do this…

Continue reading

Flashing with a Button (and a Magic Wand)

In eclipse and CodeWarrior for MCU10 the usual thing I do is:

  1. I have a project in my eclipse workspace
  2. I compile and build it
  3. I download and flash it to the target for debugging

If I need to program another board with the same binary, then I download it to that board too. Fine. But what if I want to skip point 1 and 2? What if I do not have or want a project? All what I have (and need) is a binary file, and I want is to flash that file to my boar. By pressing a button.

Continue reading

Watchpoints: Data Breakpoints

Sometimes my embedded application is not doing what I want it to do. I can solve many problems with normal ‘step/stop mode debugging‘: setting breakpoints, step, stop, inspect data, and so on. But not always. If a piece of code is changing a global variable unintentionally, I do not know where to set my breakpoint. Something is changing my variable, and I have no clue from where. It could be a dangling pointer, a stack overflow or something similar which I cannot track down with code breakpoints. What I need is a breakpoint on data: watchpoints!

Continue reading

Programming part of flash

In many cases I do a full erase-flash-debug cycle: I get my embedded microcontroller flash completely erased and then programmed with my application. Well, that does not work that way if I program with a bootloader. Yes, I can flash the bootloader and then load my target application with the bootloader, but that’s not the scenario I want to use in the development phase. I want to flash my application and keep the bootloader on the target. This means: I need to do erase and program a part of the memory. But how to do this?

Continue reading