Cycle Counting on ARM Cortex-M with DWT

Some ARM Cortex-M have a DWT (Data Watchpoint and Trace) unit implemented, and it has a nice feature in that unit which counts the execution cycles. The DWT is usually implemented on most Cortex-M3, M4 and M7 devices, including e.g. the NXP Kinetis or LPC devices.

Continue reading

Advertisements

McuOnEclipse Components: 28-Jan-2017 Release

I’m pleased to announce that a new release of the McuOnEclipse components is available in SourceForge, with the following main features and changes:

  • New Sharp Memory Display Driver supporting 96×96 and 128×128 pixel ultra low power display
  • PID_Int can be used without hardware
  • GenericTimeData has added functions to convert date/time into strings
  • HardFault can now disable write buffers on ARM Cortex to simplify debugging faults
  • Folder support for SEGGER SystemView and Percepio FreeRTOS+Trace
  • Component usage without Processor Expert
  • NXP MCUXpresso SDK support for FreeRTOS using tickless idle mode and low power timer
  • Many other smaller bug fixes and enhancements
SourceForge

SourceForge

Continue reading

Upgrading to Sharp 128×128 Pixel Memory Display

In “Low Power LCD: Adafruit Breakout Board with Sharp Memory Display” I used a 96×96 Sharp Display (LS013B4DN04) with the Adafruit breakout board, but because that one seems to be EOL (End Of Life), I searched for a replacement. I have found the 128×128 pixel version (Sharp LS013B7DH03), and best of all, it is pin compatible :-). With a small tweak of the driver, it works :-):

Sharp Memory Display 128x128

Sharp Memory Display 128×128

Continue reading

McuOnEclipse Components: 12-Dec-2016 Release

Time is passing by so fast, and the year end is approache fast! I’m pleased to announce that a new release of the McuOnEclipse components is available in SourceForge:

  • Percepio Trace V3.1 for FreeRTOS which includes both Segger RTT continuous streaming and snapshot tracing in a single API
  • Generation of sources and drivers so they can be used without Processor Expert using McuLibConfig, removal of dependency to NXP Kinetis SDK: components use a generic API approach to have them working with other SDKs.
  • New contributed ExceptionsHandler component
  • Callback Setter and Getter in USB CDC stack for simpler option handling
  • GenericTimeDate with flexible RTC support and added Unix Timestamp functions
  • LongKey events in Key component
  • FreeRTOS with optimized task selection on Cortex-M4/M7
  • Many smaller bug fixes and enhancements
SourceForge

SourceForge

Continue reading

Making-Of Sea Shell Sand Clock

The year is coming to an end, the Holiday season is approaching. In case you are looking for a nice present: I have completed my version of a sand clock: a clock writing the time into sand:

Sandclock

Sandclock

If you are interested to build your own version, I have documented the different steps with tips and tricks…

Continue reading

McuOnEclipse Components: 30-Oct-2016 Release

A new McuOnEclipse components release was long overdue, so I’m pleased to announce that a new drop is available with the following major changes:

  • Segger SystemView library with kernel time reporting
  • GenericTimeDate supports different hardware RTC devices
  • Utility with little endian packet handling functions
  • Shell Standard I/O handlers for USB CDC, Segger RTT and Bluetooth
  • FreeRTOS and stack size reporting
  • printf() support in Shell component
  • Various small bug fixes and improvements
SourceForge

SourceForge

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

Tutorial: Blinky with Kinetis SDK V1.3 and Processor Expert

This tutorial goes through the steps how to create a blinking LED application, using Kinetis SDK and Processor Expert, using the TWR-KL43Z48M board from Freescale (now NXP):

twr-kl43z48m

twr-kl43z48m

Continue reading

McuOnEclipse Components: 31-July-2016 Release

Time for a new major update of the McuOnEclipse components, with the fillowing main features and changes:

  • FatFS component updated to R0.12 with patch 3 and exFAT support
  • Extended support for Cortex-M7
  • Extended support for Kinetis SDK V2.0
  • USB component support for Kinetis SDK V1.3
  • Improved FreeRTOS for NXP FreeRTOS TAD plugin
  • Added C++ wrappers to multiple components
  • Many smaller fixes and improvements

    SourceForge

    SourceForge

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

McuOnEclipse Components: 25-June-2016 Release

SourceForge

SourceForge

A new release is available on SourceForge, with the following main changes:

  • Support for FreeRTOS and Cortex-M7
  • Segger SystemView updated to V2.38
  • Components for NXP Kinetis SDK V1.3
  • Fixed bug in Wait component (register handling for GCC and ARM)
  • FatFS supports FreeRTOS V9.0.0 with static memory allocation
  • FreeRTOS shell and task list with static memory allocation
  • Floating point conversion routines in Utility
  • FreeRTOS component shows NVIC mask bits

Continue reading

Switching the Microcontroller Package, Device and Family

One of the major benefits of Processor Expert is that I can easily switch the device or processor used in a project. For example I can do my concept with a larger device with more FLASH and RAM, and then at the end easily switch to a smaller or even completely different device very quickly. For example I have a project working with the 64KByte FLASH version of the KE02Z (KE02Z68VLH2):

MKE02Z64VLH2

MKE02Z64VLH2

Continue reading

First steps: ARM Cortex-M7 and FreeRTOS on NXP TWR-KV58F220M

For a university research project I need a fast microcontroller with lots of RAM and FLASH memory. I have ordered a TWR-KV58F220M board from NXP which arrived yesterday. The special thing is that it has on of these new ARM Cortex-M7F on it:

TWR-KV58F220M Box

TWR-KV58F220M Box

Continue reading

Swiss Army Knife of Terminal Program for Serial Bootloaders

A bootloader shall be small and concise. I very much like bootloaders which do not need a ‘special’ program on the host, so I prefer a simple terminal for this. While porting my serial bootloader to the NXP FRDM-K64F board, I have found RealTerm which offers a lot of cool features:

RealTerm

RealTerm

Continue reading

McuOnEclipse Components: 29-May-2016 Release

Major changes in this new release:

  • FreeRTOS V9.0.0 with static memory allocation.
  • Shell with single character I/O function.
  • FatFS File System with extra shell commands for memory dump and file creation.
  • Segger SystemViewer library updated to V2.36a
Segger SystemViewer V2.36a

Segger SystemViewer V2.36a

Continue reading

FreeRTOS V9.0.0 with Static Memory Allocation

I’m using FreeRTOS in most of my applications. There were only a few exceptions where an RTOS has to be used in safety critical systems: there usually it is not permitted to use any dynamic memory allocation because this adds the risk that a memory allocation could fail at runtime because of memory fragmentation or memory leak. And FreeRTOS uses a dynamic memory (heap) for the task stacks and the RTOS resources including semaphore, mutex and queues.

This is now a thing of the past. This week a new FreeRTOS Version 9 was released which does not need any dynamic memory allocation anymore: it is possible now to build completely statically allocated systems with FreeRTOS :-).

Dynamic and Static Memory Allocation in FreeRTOS V9.0.0

Dynamic and Static Memory Allocation in FreeRTOS V9.0.0

Continue reading

Tutorial: FreeRTOS with NXP Kinetis SDK V2.0 and Processor Expert

In “Tutorial: Blinky with NXP Kinetis SDK V2.0 and Processor Expert” I used Processor Expert components with the NXP Kinetis SDK to blink some LEDs. This tutorial extends the earlier project and adds FreeRTOS.

FreeRTOS running on a NXP FRDM-K22F Board

FreeRTOS running on a NXP FRDM-K22F Board

Continue reading

Tutorial: Blinky with NXP Kinetis SDK V2.0 and Processor Expert

In “Mother of Components: Processor Expert with NXP Kinetis SDK V2.0 Projects” I presented an approach how to use Processor Expert components with the NXP Kinetis SDK. This article is a tutorial how to create a blinking LED project with that approach, using McuOnEclipse Processor Expert components and the Kinetis SDK V2.0. As board the FRDM-K22F is used:

Blinky on a FRDM-K22F with SDK V2.0 and Processor Expert

Blinky on a FRDM-K22F with SDK V2.0 and Processor Expert

Continue reading

Mother of Components: Processor Expert with NXP Kinetis SDK V2.0 Projects

Unfortunately, now the NXP Kinetis SDK V2.0 does not include Processor Expert support (see “First NXP Kinetis SDK Release: SDK V2.0 with Online On-Demand Package Builder“). But at the Lucerne University we are using more than 150 different custom Processor Expert components we would like to use with that new SDK. So how to make them working with the Kinetis SDK V2.0? Using a Processor Expert as “the mother of all components”:

NXP Kinetis SDK V2.0 and Processor Expert Side-by-Side under Eclipse

NXP Kinetis SDK V2.0 and Processor Expert Side-by-Side under Eclipse

Continue reading

McuOnEclipse Components: 8-May-2016 Release

Time is passing fast, and many components have been updated to make the compatible with the NXP Kinetis SDK V2.0. As a highlight, besides of FreeRTOS the following components are now usable with the NXP Kinetis SDK:

Components compatible with Kinetis SDK

Components compatible with Kinetis SDK

Continue reading