Serial Bootloader for the Freedom Board with Processor Expert

Bootloaders are a very useful thing: it allows programming an application file without a debugger. This makes it ideal for upgrading a system in the field.

Usually, there are application notes and examples from silicon vendors available. But typically they are for a certain microcontroller, and hard to change it to another system without a lot knowledge about its implementation. What I need for a project based on the FRDM-KL25Z is a bootloader which shall be small and portable. As I’m using Processor Expert to keep my applications portable across different microcontroller families: why not create a bootloader with Processor Expert components?  With the Processor Expert drivers available, things can get a lot simpler compared to the ‘traditional’ approach. With less than 10 KByte footprint?

Serial Bootloader made with Processor Expert

Serial Bootloader made with Processor Expert

Continue reading

Advertisements

USB CDC with the FRDM-K20D50M

Good news for everyone owning the FRDM-K20D50M board: I have extended the FSL_USB_Stack with USB CDC device class support for the K20D50M :-).

USB CDC Test Application with the FRDM-K20D50M

USB CDC Test Application with the FRDM-K20D50M

Continue reading

Debugging FRDM-KL05Z with USBDM

I mentioned in “Debug External Processors with USBDM and Freedom Board” post that I had a problem to debug the FRDM-KL05Z with USBDM. Well, after a long night with some sleep, with more thinking and searching, finally I have it resolved: I can debug my FRDM-KL05Z with USBDM 🙂

FRDM-KL05Z Debugging with USBDM

FRDM-KL05Z Debugging with USBDM

Continue reading

Debug External Processors with USBDM and Freedom Board

Teaching at a university means to work in a very special environment. What students love is ‘Open Source’: because it allows them to ‘see’ things and learn from the technology. The other thing is: students have a low budgets, so they appreciate if they can use inexpensive or low-cost hardware and software. The FRDM-KL25Z Freedom board for sure meets that low price, and no extra programming device needed.

Now they are building their own boards, and they wish to program and debug it. They can borrow the Segger J-Links and P&E Multilinks we have available at the university. But why not use the Freedom board as ‘hobby’ debug and programming solution? As explored in “Using the Freedom Board as SWD Programmer“, they can use the default factory installed OpenSDA to program another microcontroller of same type. But not to debug it.

While writing the “Using the Freedom Board as SWD Programmer” article, I was looking into USBDM. USBDM has added in January 2013 support for OpenSDA. But at that time, it was somehow not working for me, and I had not enough time to find out what the problem was. Time to get that fixed. Good news: With help and tips from the USBDM community, I have it finally working 🙂

USBDM Debugging another FRDM-KL25Z

USBDM Debugging another FRDM-KL25Z

Continue reading

Using the Freedom Board as SWD Programmer

I love the Freescale Freedom boards because they are low-cost, and I do not need a special debug device, as they have the on-board OpenSDA. It is using a small Kinetis-K20 which acts as JTAG SWD debugging probe. Why not using the Freedom board to program another board?

FRDM-KL25Z board programs another board

FRDM-KL25Z board programs another board

Continue reading

Red Suite 5: Eclipse Juno, Processor Expert and unlimited FRDM-KL25Z

❗ UPDATE: Code Red Technologies have been acquired May 1st 2013 by NXP, see this press release. According to this, they will not continue to support non-NXP architectures after May 2014. 😦

You probably know this already: I’m a fan of Eclipse, Processor Expert and the Freedom board. As for tool chains I use CodeWarrior for MCU10.x (Eclipse based, 64 KByte free limit) and IAR (32 KByte limit) with the Processor Expert Driver Suite.

And I have added a new Eclipse based solution: Red Suite 5 from Code Red Technologies. They released a new Red Suite 5 (v5.2.2 build 2108) which caught my attention when reading the release notes:

  1. Eclipse Juno SR2: New Eclipse Look & Feel 🙂
  2. Added integration for Processor Expert 🙂 🙂
  3. Non-expiring 128k (!!!) limit when used with the Freescale FRDM boards 🙂 🙂 🙂
Red Suite 5 Eclipse Startup

Red Suite 5 Eclipse Startup

Continue reading

printf() with the FRDM-KL25Z Board and without Processor Expert

In this tutorial I explored how to use printf(), and this tutorial is so generic that it works for any processor/microcontroller. That flexibility is because I’m using Processor Expert. In case Processor Expert shall not be used, then some tweaks are needed. Here I show what is needed to have printf() working with the FRDM-KL25Z board. I use the UART0 connected to OpenSDA USB CDC for this.

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

text, data and bss: Code and Data Size Explained

In “Code Size Information with gcc for ARM/Kinetis” I use an option in the ARM gcc tool chain for Eclipse to show me the code size:

   text       data        bss        dec        hex    filename
 0x1408       0x18      0x81c       7228       1c3c    size.elf

I have been asked by a reader of this blog what these item numbers really mean. Especially: what the heck is ‘bss’???? 🙂

Continue reading

Show it again! (How to re-enable hidden Dialogs in Eclipse)

Eclipse has a nice feature to ‘shut up’ dialogs: In many dialogs I can select an option so that dialog does not show up again:

'Dont' show Again' in Dialog

‘Dont’ show Again’ in Dialog

But what if I change my mind later on and what to have this dialog to show up again?

Continue reading

Extended Driver for the MMA8451Q Accelerometer

In “Tutorial: Accelerating the KL25Z Freedom Board” I used the MMA8451Q accelerometer on the FRDM-KL25Z board in a very primitive way: I’m reading directly some low-level registers from the device through an I2C low-level component. No calibrating, no special device feature setting, only raw values. Since then, things have been evolved: In “Tutorial: Creating a Processor Expert Component for an Accelerometer” I started to create a driver for this accelerometer, and since then a lot more functionality has been added.

Tracing Accelerometer Values to the Shell

Traced Accelerometer Values to the Shell

Continue reading

Stepping Backwards while Debugging: Move To Line

It happens to me many times: I’m stepping with the debugger through my code, and ups! I made one step too far!

Debugging, and made one step over too far

Debugging, and made one step over too far

What now? Restart the whole debugging session?

Actually, there is a way to go ‘backwards’ 🙂
Continue reading

First Steps with the P&E Tracelink

“As an engineer, you should ask for the best tools available. Spending money for better tools can make the difference between finding a problem quickly, or wasting days or weeks, and ultimately failing a project.” (unknown)

I had to learn it the hard way: some ‘hard-to-find-problems’ sometimes only can be found with some amount of luck, or with using a good trace solution. CodeWarrior already supports trace, such as using the MTB on the Cortex-M0+. But with this I’m limited to the on-chip trace buffer or on-chip RAM, which is better than nothing. But to solve the real hard problems, a bit of more power and memory is needed. And here where the P&E Tracelink comes into play: with 128 MByte trace buffer it would allow me to record a lot more trace data :-).

Continue reading

Restore Deleted Files in Eclipse with Local History

I’m using Version Control Systems like Git and SVN on a daily base. Because this gives me the opportunity to revert my changes and go back in time in my project. A VCS is incredible useful as well if I have deleted files or settings: restoring it is just a matter of a few mouse clicks.

But even without using a VCS, Eclipse has a built-in simple version control system: the Local History.

Eclipse History View

Eclipse History View

Continue reading

Decoding S19 Files

I’m recently dealing again with S19 (S-Record) files. I can easily generate S19 files from my ARM .elf files, but what I need is a simple decoder of the file format.

The good thing is: such a decoder is provided with CodeWarrior for MCU10.x 🙂

That capability is built into the Decoder.exe which is delivered with the Freescale S08 (or S12) tool chain, and is located inside the MCU\prog folder:

Decoder.exe inside MCU prog Folder

Decoder.exe inside MCU prog Folder

Continue reading