Tutorial: Using the FRDM-KL25Z as Low Power Board

The FRDM-KL25Z is a great board: inexpensive (around US$15), small form factor, has easily accessible pins, and has a low power (capable, at least) microcontroller, and comes with an embedded debugging interface. So why not using this board right away ‘as is’ for a low power battery operated device? Great idea, you think? Yes, I thought too. Only to find out that the board needs 20 mA out of the box.

The good news is: It is possible on a week-end to get this 150 times better down to 132 μA, with an RTOS running all the time :-). I invite you to join a journey with board modifications, jumpers, schematics and many multi-meter pictures ;-)….

132 micro amps

132 micro amps!

Continue reading

Optimized FreeRTOS: Stack Check and SysTick for ARM Cortex Cores

The ARM Cortex specification includes the ‘SysTick’ (System Tick Timer): a dedicated system timer which is intended to be used as time base for an RTOS. While technically it would be possible to use any periodic interrupt timer, I’m using as well the SysTick for my FreeRTOS ARM ports. And because Processor Expert includes a nice timer interface, I’m using the TimerUnit_LDD:

TimerUnit LDD for SysTick

TimerUnit LDD for SysTick

While this is great for flexibility, it has its price in efficiency. That TimerUnit_LDD adds overhead. So I want to get rid of the TimerUnit_LDD and use a more efficient way.

Continue reading

DIY Free Toolchain for Kinetis: Part 5 – FreeRTOS Eclipse Kernel Awareness with GDB

So far I have covered in this tutorial series how to install ARM GNU gcc, adding Eclipse, followed by adding GNU GDB debugger, and then adding Processor Expert. I’m using FreeRTOS a lot in my projects, and luckily there is a Kernel Awareness Plugin available for FreeRTOS for GDB in Eclipse. This tutorial is about how to install and use it.

Queues and Tasks

Queues and Tasks

Continue reading

FreeRTOS V7.5.0 released

A week ago, the updated FreeRTOS V7.5.0 has been released on FreeRTOS.org. So time to have my Processor Expert FreeRTOS component updated as well :-).

FreeRTOS V7.5.0

FreeRTOS V7.5.0

Continue reading

Hacking the Heating System for Cooling – Geothermal Drilling with extra Benefits

Summer finally has arrived in Switzerland. Yes, I live in a moderate climate zone, but if the outside temperature goes above 28-30° Celsius as these days, then sleeping at night is not that comfortable as it should be in my view. Luckily, I’m in a good constructed house with good insulation, so it takes a few days until it heats up. But I love to keep the temperature below 25° Celsius, especially at night. I do have a heating system which combines geothermal and solar heating. The question is: how can I use it for cooling during hot summer days? The solution: some extra plumbing, a Freescale Tower system and the Freescale FRDM-KL25Z board 🙂

FRDM-KL25Z with Arduino Data Logger Shield

FRDM-KL25Z with Arduino Data Logger Shield controlling Heating/Cooling System

Continue reading

USB MSD Host for the FRDM-K20D50M Board

The Freedom boards FRDM-KL25Z RevE and FRDM-K20D50M make it easier to use it as USB Host device, as they come with a special jumper to provide 5V to the USB device, so my earlier ‘hack’ is not needed any more :-). After I had USB MSD Host working for the FRDM-KL25Z, it was much harder to get the USB stack working for the FRDM-K20D50M board, because somehow the example Freescale provided with their USB stack refused to work properly on my board. After debugging it for several nightly hours, I decided to take my working Processor Expert project for KL25Z and added support for the K20. And the good news is: since tonight this is working :-).

FRDM-K20D50M as USB MSD Host

FRDM-K20D50M as USB MSD Host

Continue reading

FreeRTOS Heap with Segmented Kinetis K SRAM

While working on a project for the FRDM-K20D50M, I faced a problem: I was running out of SRAM for my application. The GNU linker reports: “section `.bss’ will not fit in region `m_data'”: 😦

bss will not fit in region m_data

bss will not fit in region m_data

But my device has 16 KByte of SRAM, and I knew I use much less than 10 KByte. So what is the problem? Continue reading

Low Power with FreeRTOS: Tickless Idle Mode

It took me a while to find the time to upgrade to FreeRTOS V7.4.2, but finally it is done :-). What caused me to move from V7.2 to V7.4 is a low power application on the FRDM-KL25Z board. V7.4 comes with two major new features: Queue Sets and Tickles Idle Mode (see this article). The last one if of interest here.

FreeRTOS runs an IDLE task. This one runs when there is no other active task. That task calls an optional Idle task hook which is a perfect place to put the microcontroller into low power mode:

Task T1 Running

Task T1 Running

Continue reading

Freedom Track Robot with IEEE802.15.4/SMAC

My other robots based on the FRDM-KL25Z use Bluetooth as connectivity. This one is using a Freescale IEEE802.15.4/ZigBee/SMAC module:

Robot with SRB MC13213 Board

Robot with SRB MC13213 Board as Remote Controller

Continue reading

A new Freedom Board: FRDM-K20D50M with ARM Cortex M4

Freescale/Farnell/Element14 announced last week a new Freedom Board: the FRDM-K20D50M :-). As you can expect, I was not able to resist, and ordered one from my local Farnell store right away. So I did my first steps with it on this sunny and wonderful weekend (yes! we skipped Spring Time and entered Summer Time right away!).

I do not need to compare the board with the previous Freedom boards, as I have found an article here. I a nutshell: I get pretty much the same as with the FRDM-KL25Z, but instead of an ARM Cortex-M0+, it has an ARM Cortex-M4!

The new FRDM-K20D50M Board

The new FRDM-K20D50M Board

Continue reading