This tutorial was extracted from Erich Styger blog http://mcuoneclipse.wordpress.com with his agreement.
Freescale/Farnell/Element14 announced last week a new Freedom Board: the FRDM-K20D50MFRDM-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. In 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
FRDM-K20D50MFRDM-K20D50M is more expensive than FRDM-KL25ZFRDM-KL25Z
. Ok, I get an ARM Cortex-M4 instead of an ARM Cortex-M0+, but what else? Let’s see.
The Content
The board comes in the typical Freedom board, only that it the board is a red one:
FRDM-K20D50M Box and Content
The box includes a small bag with the 4 dual-row headers. Nice! That justifies at least some of the higher price.
Dual Row Arduino Headers
The Board
The front side of the board looks very familiar to the existing FRDM boards:
FRDM-K20D50M Front Side
Having a closer look, there are a few more add-ons:
- There are two crystals: one 32 kHz and one 8 MHz one.
- New analog Ambient Light Sensor with J12 jumper to isolate it
- New Temperature Sensor (U11) with jumper J13 to isolate it (Note: the user manual says that this sensor is *not* populated. However, it is present on my board
) - Two jumpers (J16 and J17) to disconnect the I2C lines to the accelerometer
- Jumper J14 to cut the reset line between OpenSDA and the target CPU
- Jumper J13 to isolate the BD1020HFV-TR temperature sensor
- Jumper J21 to enable USB Host support (unprotected), so my hack is not needed any more
Changes on board compared to FRDM-KL25Z
On the backside the battery holder is not populated (same as on earlier Freedom boards):
FRDM-K20D50M Backside
I noted that many pins on the dual row headers are marked as NC (Not Connected). So J9 could have been a single row header (which would be cheaper?).
Software
Freescale provides at this link an updated OpenSDA package plus bare-metal source code and examples. The source code package is not what I need in the first place as I already have a lot of drivers with Processor Expert, but always good to have such a package.
The Quick-Start Package (FRDM-K20D50M_QSP.zip) has an updated OpenSDA debug application and mass storage bootloader.
FRDM-K20D50M Quick Start
The board has the same OpenSDA on-board debug connection, so I had first to load the Debug Application (same procedure as for the FRDM-KL25Z: press the reset button on power-up, load the OpenSDA Debug App, re-power the board).
I loaded that new DEBUG-APP and I do not remember which one was factory installed. Anyway, that v106 worked for me and CodeWarrior for MCU10.3
First Project with CodeWarrior
Using CodeWarrior for MCU10.3, the MK20DX128VLH5MK20DX128VLH5 (mask 1N86B) is supported in the Wizard:
MK20DX128 in the CodeWarrior Wizard
The OpenSDA connection is not available in the connection page of the Wizard. But this does not matter, as the normal P&E Multilink connection works. I only have to change the Interface in the debugger settings from P&E Multilink to OpenSDA:
OpenSDA Debug Connection for FRDM-K20D50M
Do not forget to enable the ‘SWD’ debug option. I missed to set this option in the first place, and then the debugger reported “ERR: Can not enter background mode”
Running FreeRTOS
Running an emtpy bareboard application was just a matter of minutes. To use more of the board ressources, I added the FreeRTOS operating system, Shell over OpenSDA CDC and RGB LED support to it:
FreeRTOS and other components
All what I needed to do is to configure the RTOS and assign the proper pins for the LED and serial connection. With Processor Expert this took less than 10 minutes from start until I had a shiny toggling LED on my board
:
FreeRTOS running on the FRDM-K20D50M, with headers populated
The CodeWarrior project is available on GitHub here and will be extended over time.
Summary
That new Freedom board adds a Cortex-M4 to the existing FRDM-KL25Z and FRDM-KL05ZFRDM-KL05Z. It comes with the headers, plus temperature and ambient light sensor. While the M4 provides more horse-power, I wish it would have more than 16 KByte of RAM. Especially as STMicroelectronics has the STM32F3Discovery board with an ARM Cortex M4, 256 KByte of Flash and 48 KByte of RAM ? On the other side: there is no Processor Expert for the Discovery Board
. I think these days it is the software which makes the difference, not the silicon or the board. Silicon is only sand
I’m happy with what I was able to carry out with the board in a very short time. It is a great addition to my set of boards, especially as it can interface with Arduino (compatible) shields. And I want to run my Zumo with it so I have a little red+black robot
. That will be a lot of fun: I already have some ideas how to use the temperature and ambient light sensors.
PS: Yes, I had a beautiful and sunny week-end *outside*. Processor Expert enabled me to spend many hours outside with my family. Thank you! Despite the fact that I catched a light sun burn ![]()












