Bricking and Recovering OpenSDA Boards in Windows 8 and 10


Getting a board from a distributor like Farnell/Element14/Mouser (add your own distributor) means that chances are high that the default firmware on it is written years from now because the inventory has not been updated, or because boards are still produced with that original firmware (because of testing?). So what happens if I use board with a firmware developed pre-Windows 8/10 area?

Freshly Unboxed NXP FRDM-KL25Z Board

Freshly Unboxed NXP FRDM-KL25Z Board

It might work, but chances are high that the bootloader and firmware is not ready for the ‘modern age’, and as a result the board might be bricked. If you still have a Windows 7 machine around (I do!), you are lucky. If not, then you need to read this article….

Continue reading

FatFS with Adafruit MicroSD Breakout Board and NXP FRDM-KL25Z


Breakout boards are great: they allow me to explore functions quickly, without to build my custom board: all what I need is some wires and ideally a bread board.

Adadfruit MicroSD Card Breakout Board

Adadfruit MicroSD Card Breakout Board

Continue reading

Tutorial: Bare-Metal Shell for Kinetis


I have been asked to provide a command line shell example for a bare-metal (no RTOS) application, so here we go!

Having a way to communicate to the firmware on a board is essential for most of my projects: it is simply, incredibly helpful and easy to do (see “A Shell for the Freedom KL25Z Board“). This tutorial shows how to add a simple command line shell to the NXP Freedom board which then can be extended as necessary.

Console Application

Console Application

Continue reading

openHAB RGB LED Light Cube with WS2812B and NXP Kinetis


From my earlier work to use the NXP Kinetis with openHAB (see “Controlling NXP Freedom Board RGB LED with openHAB and Raspberry Pi“) it was only a small step to control a 20x20x20 cm light cube with 256 Adafruit WS2812 NeoPixels:

Kinetis RGB Cube with openHAB

Kinetis RGB Cube with openHAB

Continue reading

First NXP Kinetis SDK Release: SDK V2.0 with Online On-Demand Package Builder


There are plenty of different software packages available for microcontroller these days from all the silicon vendors. Finding a good software package is one challenge, getting what I really need is another one. Freescale is now part of NXP since December 2015, so this is probably the first release of the former Freescale part now as NXP: The NXP Kinetis SDK Version 2.0.

It comes with an interesting distribution way: instead of downloading huge packages with all-and-everything in it, I can build it ‘on demand’ online and get what I need, on demand from a web-based front end:

NXP Kinetis Expert with Kinetis SDK

NXP Kinetis Expert with Kinetis SDK

Continue reading

Controlling NXP Freedom Board RGB LED with openHAB and Raspberry Pi


In “Blinky LED with openHAB on Raspberry Pi” I have used openHAB on a Raspberry Pi to control an LED attached to the Pi, and in “Controlling NXP Freedom Board RGB LED with openHAB and Raspberry Pi” I have explored how to connect a NXP Freedom Board over USB CDC to the Raspberry Pi. In this article I’m going to combine both: to control the LED on a NXP Freedom board remotely with openHAB on the Raspberry Pi.

ColorPicker with openHAB and FRDM-KL25Z

ColorPicker with openHAB and FRDM-KL25Z

Continue reading

Zumo Robots at Maker Faire in Rome (16. – 18. Oct. 2015)


I won’t be able to attend the Maker Faire in Rome (16. – 18. Oct. 2015). But five of the Sumo bots students from the previous semesters have built and programmed will be there.

Sumo Robots

Sumo Robots

Continue reading

Using FRDM-K64F Board to debug another Kinetis Board


Given all the posts I already have published on a similar topic, this one will be a short one: how to use the Freescale FRDM-K64F board with OpenSDAv2 to debug another board:

FRDM-K64F Board to Debug FRDM-KL25Z Board

FRDM-K64F Board to Debug FRDM-KL25Z Board

Continue reading

Programming Kinetis with CodeWarrior from the DOS Shell


In “CodeWarrior Flash Programming from a DOS Shell” I showed how to program a device from the DOS shell. Because that example was for ColdFire and CodeWarrior for MCU10.2, here is the same for a Kinetis (FRDM-KL25Z) and CodeWarrior for MCU10.6. In my workspace (c:\tmp\wsp_10.6) I have a project folder (FRDM-KL25Z).

I’m using the ‘Flash Programmer’ to sneak the needed commands:

Sneaking Commands from Flasher

Sneaking Commands from Flasher

Continue reading

Translating for the world …


English is not my first language, but I use it in this blog because that way I can reach a broader audience. If I would use Swiss German, only a few would be able to understand what I write about: “Wänn I würd schwiizerdütsch bruuche, dänn chönt wohl chuum öpper das hie läse” ;-).

Google Translate is not prefect, but still it does a fair job of translating web pages. I have added now a Google translate button to this blog side bar. Click on it and have the web page translated to the language of your choice. Try it out:

GoogleTranslate

💡 If you are speaking Portuguese and want to learn about the Freescale FRDM-KL25Z board, then check out https://hardwarizando.wordpress.com/2015/08/11/introducao-a-kl25z-codewarrior-processor-expert-e-interrupcoes-periodicas/

Happy Translating 🙂

PS: some of the translations by Google are sooooo funny 🙂

Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 1: Hardware


This is Part 1 of a Mini Series. Manya has challenged herself to use the Adafruit NeoPixels (WS2812B RBG LEDs) with the Freescale FRDM-K64F board and the Kinetis SDK (see “Let’s play with Freescale FRDM-K64F“). I did a while back that with the FRDM-KL25Z board (see “NeoShield: WS2812 RGB LED Shield with DMA and nRF24L01+“). I used Processor Expert in my project (without the Kinetis SDK), and with this setup it is very easy. However, Manya wanted to do this with the Kinetis SDK and without Processor Expert. No surprise to me, she has found out that this setup with the Kinetis SDK and without the usage of Processor Expert is much more challenging (see “Not done yet!!“). I promised to Manya to give her a helping hand, so here we go! 🙂

Adafruit 8x8 NeoPixel Shield with Freescale FRDM-K64F Board

Adafruit 8×8 NeoPixel Shield with Freescale FRDM-K64F Board

Continue reading

Unboxing the Freescale FRDM-KL43Z Board


I’m preparing for the next semester at the university starting in September this year. As part of that, I’m currently evaluating the Freescale Kinetis FRDM-KL43Z board:

FRDM-KL43Z Board Unpacked

FRDM-KL43Z Board Unpacked

Continue reading

FreeRTOS Continuous Trace Streaming


Key to successfully implementing embedded applications these days is to have detailed visibility into what is going on with the application on the board. For this, I’m using the FreeRTOS+Trace from Percepio to inspect the runtime behaviour. Stop-Mode debugging is very useful, but visibility into the runtime is even more important. FreeRTOS+Trace is a tool to accomplish this, but it requires to dump the data off the target to the host (see “Updated Percepio Tracealyzer and Trace Library to Version V2.7.0“). Usually, I’m using the GDB debugger for this, and that works for shorter trace sequences like a few seconds. Yes, I can combine them, but it painful to stop, dump and continue. So what if I could collect trace for several minutes or hours without the need to stop the application? Why not stream the data to the host directly?

So here is it: I’m now able to get almost unlimited trace streaming off the target, witout user intervention. I can trace my application for hours 🙂

Trace Recording

Trace Recording for almost one hour

Continue reading

Poor Man’s Trace: Free-of-Charge Function Entry/Exit Trace with GNU Tools


There are cases where my application runs find for days, weeks or even months, but then from time to time there is an application crash. Yes, the watchdog will recover it, but still it would be good to know what happened? One solution would be to hook up a trace probe (like the one I have described in this post: “First Steps with the P&E Tracelink“). But having such a trace probe attached all the time is first not cheap and second not always possible. So what if the application would leave ‘breadcrumbs’ behind which would tell me the flow of the program leading to the problem? I have found a functionality in the GNU tools which seems not be widely known or use, but is incredibly helpful in such cases.

So what if I could get a log like this telling me which functions get called by whom?

{ 00000E88->00000DA0 ???->DEMO_Init
} 00000E88<-00000DA0 ???<-DEMO_Init
{ 00000E8C->00000D40 ???->DEMO_Run
 { 00000D62->00000CE8  DEMO_Run:0x0022->decide
  { 00000D0E->00000C60  decide:0x0026->calcValue
  } 00000D0E<-00000C60  decide:0x0026<-calcValue
  { 00000D16->00000CA0  decide:0x002E->getValue
   { 00000CC6->00000C60  getValue:0x0026->calcValue
   } 00000CC6<-00000C60  getValue:0x0026<-calcValue
  } 00000D16<-00000CA0  decide:0x002E<-getValue
 } 00000D62<-00000CE8  DEMO_Run:0x0022<-decide
 { 00000D62->00000CE8  DEMO_Run:0x0022->decide

Continue reading

Using the DHT11/DHT22 Temperature/Humidity Sensor with a FRDM Board


For a home automation project I need to know the room temperature and humidity percentage of the room air. Adafruit has an inexpensive DHT11 sensor from http://www.aosong.com which I decided to use for that project.

Test Setup for DHT11 Sensor

Test Setup for DHT11 Sensor

Continue reading

Altium File for Freescale FRDM-K25Z Board


If you are designing your own board for the Freescale FRDM boards, then having the matching PCB design files is a good thing to have. I have posted this week an Altium contribution on GitHub for the FRDM headers (see “FRDM-KL25Z Arduino Headers with Altium“). And here there is yet another contribution I received from [Darren]: the FRDM-KL25Z board in Altium :-):

FRDM-KL25Z in Altium

FRDM-KL25Z in Altium

Continue reading

Command Line Programming and Debugging with GDB


Eclipse with GDB is great: it comes with a graphical front end for debugging. But sometimes it is all about to download a program. Is it really necessary to launch an IDE like Eclipse to program or quickly debug a board? With the GNU Debugger (GDB), the answer is ‘no’: GDB comes with a command line debugger which is designed exactly for this: providing a command line interface for programming/downloading and debugging, bypassing any GUI (Graphical User Interface).

Combination of GDB Debugging Probes and Boards

Combination of GDB Debugging Probes and Boards (P&E, Segger and FRDM-KL25Z)

Continue reading

OpenOCD/CMSIS-DAP Debugging with Eclipse and without an IDE


OpenOCD is an open source and free-of-charge debugging solution, which is a great option here at the University of Lucerne, as students do not need to buy an expensive debugging probe. Still, I recommend to buy professional probes like the P&E or Segger ones, as they are worth every (Euro) cent. But for a ‘zero’ budget, OpenOCD with CMSIS-DAP is something to consider. And with Kinetis Design Studio using the GNU ARM Eclipse Plugins, OpenOCD is not that hard to be used. And because both Freescale and GNU ARM Eclipse offer OpenOCD Windows binaries, that connection method is in the reach of Windows users too.

FRDM-KL25Z with OpenOCD Debug

FRDM-KL25Z with OpenOCD Debug

Continue reading