Disabling EzPort on NXP Kinetis to Solve Power-On Issues


I’m using the NXP FRDM-K64F board in several projects: it is reasonably prices, has USB, Ethernet, micro SD card socket and connectors for Bluetooth classic and Nordic Semiconductor nRF24L01+ 2.4 GHz transceiver:

NXP FRDM-K64F Board

NXP FRDM-K64F Board

But one issue I have faced several times is that the board works fine while debugging and connected and powered by a host machine, but does not startup sometimes if powered by a battery or started without a debugger attached. I have found that the EzPort on the microcontroller is causing startup issues.

Continue reading

FreeRTOS Kernel Awareness with Ozone


In my first post about Segger Ozone (see “First Steps with Ozone and the Segger J-Link Trace Pro“) I missed the fact that it includes support for kernels like FreeRTOS. So here is how to show the FreeRTOS (or any other RTOS) threads with Ozone:

freertos-threads-in-ozone

freertos-threads-in-ozone

Continue reading

Tutorial: RFID Tags with the NXP NFC Controller PN7120 and Eclipse


Playing with RFID and NFC is definitely fun :-), and they are everywhere! For a research project I’m exploring different RFID tags and solutions. I several types around for a long time, but never found the time to actually work on it, so last nightI thought I give it a try, and I have it working with GNU ARM and Eclipse, powered by the NXP FRDM-K64F board 🙂

NXP NFC PN7120S

NXP NFC PN7120S with a FRDM-K64F Board

Continue reading

ARM Cortex-M, Interrupts and FreeRTOS: Part 2


In “ARM Cortex-M, Interrupts and FreeRTOS: Part 1”  I started with the ARM Cortex-M interrupt system. Because the ARM implementation cann be very confusing, I confused myself and had to fix and extend the description in Part 1 :-). Thank for all the feedback and comments!

Originally I wanted to cover FreeRTOS in Part 2. Based on the questions and discussions in Part 1 I thought it might be a good idea to provide visual examples.

NXP KV58F ARM Cortex-M7

NXP KV58F ARM Cortex-M7

Continue reading

Semihosting (again!) with NXP Kinetis SDK V2.0


I kind of hoped that after “Why I don’t like printf()” and all my other articles about printf and semihosting, that topic would be 200% handled and I won’t have to deal with any more. Well, I was wrong and underestimated how the Kinetis SDK is interfering with semihosting. And I underestimated how many of my readers are still using semihosting (even as there are other and better alternatives), so I keep getting questions and requests for help. That’s ok, and I hope I can help :-).

So here is yet again another post about how to turn on semihosting with Eclipse, GNU ARM Embedded and the Kinetis SDK v2.0. This time with the FRDM-K64F board:

FRDM-K64F Board with lwIP running

FRDM-K64F Board

Continue reading

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

NXP Pins Tool: Clock Gates and Controlling the Bits


With the NXP Pins Tool (see “Tutorial: Muxing with the New NXP Pins Tool“) I can configure and mux (multiplex) the microcontroller pins. What is really powerful and what might not be so obvious at the first sight is that it gives me deep control over every register bit and setting. For example I have below the PTB1 (Port B, pin 1) muxed as GPIO (General Purpose I/O):

PTB1 Muxed with Pins Tool

PTB1 Muxed with Pins Tool

But it only generates this:

void BOARD_InitPins(void) {
  CLOCK_EnableClock(kCLOCK_PortB);                           /* Port B Clock Gate Control: Clock enabled */

  PORT_SetPinMux(PORTB, PIN1_IDX, kPORT_MuxAsGpio);          /* PORTB1 (pin 54) is configured as PTB1 */
}

So what about all the other bits and pieces? Continue reading

How to Recover the OpenSDA V2.x Bootloader


More and more of my students are using Microsoft Windows 10 machines, and my computer has been upgraded to Windows 10 a couple of week ago too. From my work and experience, a new operating system causes always some challenges, and Windows 10 is no difference. And no, this is not about Microsoft vs. Apple vs. Linux, this post is about addressing a potential and painful problem which I have observed with Windows 10 machines, and to my understanding it could happen with any other operating system too. The problem is that somehow on several student machines the bootloader and OpenSDA application on their FRDM boards did not work any more.

FRDM-K64F (top) programming the OpenSDA Bootloader (bottom)

FRDM-K64F (top) programming the OpenSDA Bootloader (bottom)

Continue reading

Tutorial: Making Music with Floppy Disk Drives


3.5″ Diskette Drives are not widely used any more: CDs, DVDs, memory/thumb drives and downloads from the web are the usual distribution method these days for software. Back a few years ago, software was distributed on one or many 3.5″ diskettes, and even before that time on 5 1/4″ floppy disk drives. So what to do with all these not-used-anymore hardware? Play music with it 🙂

Floppy Music

Floppy Music

Continue reading

Dealing with Code Size in Kinetis SDK v2.x Projects


I’m exploring the Kinetis SDK v2.0 (see “First NXP Kinetis SDK Release: SDK V2.0 with Online On-Demand Package Builder“). For this, I’m using the ‘standard’ way: blinking the LED on the board 🙂

Blinky on FRDM-K64F Board

Blinky on FRDM-K64F Board

Continue reading

Tutorial: FreeRTOS Projects with Kinetis SDK V1.3 and the SDK Project Generator


This tutorial describes how to create a Kinetis SDK V1.3 project using the Freescale project generator in Kinetis Design Studio.

project generator

project generator

Continue reading

Tutorial: lwip with FreeRTOS and the Freescale FRDM-K64F Board


This tutorial is about how to create a lwIP project with FreeRTOS using the Kinetis SDK V1.3.0 with Kinetis Design Studio on the Freescale FRDM-K64F board.

FRDM-K64F Board with lwIP running

FRDM-K64F Board with lwIP running

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

Aligning S19 Records to 64-bit Boundaries


Many tool chains and linker are able to produce S19 files, such as with the GNU tools it is the ‘objcopy‘ which does this job (see “Binary (and S19) Files for the mbed Bootloader with Eclipse and GNU ARM Eclipse Plugins“). But these tools usually cannot handle the special cases. For example on the Freescale Kinetis K64F my serial bootloader (see “Serial Bootloader for the Freedom Board with Processor Expert“) had a problem with these lines in the S19 file:

Not aligned S19 file entries

Not aligned S19 file entries

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

Tutorial: Using GNU Profiling (gprof) with ARM Cortex-M


I have published a Sneak Preview how GNU gprof profiling looks for an embedded target ARM Cortex-M in an earlier post:

Freescale Kinetis Microcontroller Application Profiling

Freescale Kinetis Microcontroller Application Profiling

This tutorial explains how to profile an embedded application (no RTOS needed) on ARM Cortex-M devices with GNU gprof. Additionally I explain the inner workings to generate the data necessary for gprof.

Continue reading

Thanks to Erich and FRDM-K64F!! :)


It has been a long time since I wrote my last blog. I really want to apologize to you all for the delay, but I was busy with another project about the competitive analysis of Freescale with our competitors. I hope I can provide you guys later with some important findings from my research.

Well as far as my project for neopixels using FRDM-K64F is concerned, Erich wrote the wonderful tutorial for all of us to turn on the NeoMatrix. I tried my hands on that and I was indeed able to turn on the board but not in the way I wanted it to. 😦 So, it turns out that I got few LEDs turning blue or some turning green. I asked Erich about it and I got to know that it is because I screwed up with the timing signals. I was using an oscilloscope and not a logic analyzer but Erich’s recommendation was to use the Logic Analyzer. This was the result of my experiment following Erich’s tutorials.

https://mcuoneclipse.com/2015/08/01/tutorial-adafruit-ws2812b-neopixels-with-the-freescale-frdm-k64f-board-part-1-hardware/

IMG_1246

The Hardware

Continue reading

Sneak Preview: Profiling Bare Metal Microcontroller Applications with GNU gprof


I’m working on a conference paper and presentation, and tonight I had a break-through :-). So how cool is this: Profiling with GNU gprof a bare-metal embedded Cortex-M application (Freescale Kinetis K64F running the Freescale Kinetis SDK) in Eclipse:

Freescale Kinetis Microcontroller Application Profiling

Freescale Kinetis Microcontroller Application Profiling

Continue reading

Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 5: DMA


This is Part 5 of a Mini Series. In Part 4, I described how to set up the FTM (Kinetis Flex Timer Module) to generate the required waveforms used for DMA operations (see “Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 4: Timer“). In this post I describe how to use to trigger DMA (Direct To Memory) events. The goal is to drive Adafruit’s NeoPixel (WS2812B) with the Freescale FRDM-K64F board:

FRDM-K64F with Adafruit NeoPixel

FRDM-K64F with Adafruit NeoPixel

Continue reading

Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 4: Timer


This is Part 4 of a Mini Series. In Part 3, I described the software concepts (see “Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 3: Concepts“). In this post I describe how to set-up the timer to trigger later DMA operations. The goal is to drive Adafruit’s NeoPixel (WS2812B) with the Freescale FRDM-K64F board:

NeoPixels with FRDM-K64F

NeoPixels with FRDM-K64F

Continue reading