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

Live View for Variables and Memory

Debugging is usually a ‘stop-inspect-continue’ process. That does not work very well for watching a system which continuously changes its state. For this usually I toggle an LED, or write things to the console to watch with a human eye what is going on. But there is something very powerful in the CodeWarrior debugger too: to display variables and memory content while the target is running.

Variable Live View

Variable Live View

Continue reading

SWD Debugging with the FRDM-KL25Z Board

The OpenSDA on the FRDM-KL25Z board is a cool feature: I do not need any external debugging device to program and debug my board :-). But my KL25Z custom board will not have that OpenSDA on it: first because it would add additional costs, and I do not see a way how I could use it for my board. I better start using a SWD/JTAG debugger for my Freedom board to have everything in place.

What I need to add to the black Freedom board is the SWD header:

SWD J6 (populated) and J11 (unpopulated)

SWD J6 (populated) and J11 (unpopulated)

Continue reading

Unsecuring the KL25Z Freedom Board

In ‘Device is Secure‘ I had a case where this was a false alarm. But recently there has been a report in the Freescale Forum that this can be a real problem with the Freedom KL25Z board I’m using too. I was not able to reproduce this on my end, so a reader of this blog who sent me a binary file to reproduce it.

Well, I was really scared to try that ‘killer’ file on my board, but well, that board is not that expensive, and I have 5 pieces of silicon at hand from a sample order :-). So I took some risk, and programmed that binary using the simple flash programmer. And indeed, when I wanted to debug it again, I got that dialog with my black Freedom board:

Device is Secure. Erase to unsecure?

Device is Secure. Erase to unsecure?

Continue reading

Fixing the USB Drivers

USB has two sides: if it works, it is great :-). If it does not, it is really bad :-(. It took a while in the desktop and PC world until USB for common devices (mouse, keyboard, memory sticks, …) was working without issues. But ‘non-standard’ devices like a USB debugging probe/cable are not of that kind of category.

Occasionally I run into USB driver issues in my class. So this post is about identifying the different USB driver parts for the P&E OpenSDA, P&E OSBDM/OSJTAG and P&E Multilinks. And how to install the drivers manually if something is not going well.

Continue reading

OpenSDA on the Freedom KL25Z Board

P&E has released information and firmware instructions for using the OpenSDA, see pemicro.com/opensda. Future has posted a very useful article about using OpenSDA here. So time to upgrade OpenSDA bootloader and firmware v10.1. My FRDM-KL25Z board is a pre-production board, and I assume the production boards expected next week will have the new firmware on it. But it is always useful to know how to change/upgrade the firmware, as I expect there will be new versions of it in the future.

Continue reading

A Shell for the Freedom KL25Z Board

I’m a big fan of physical UART/RS-232 ports on boards. So I was somewhat disappointed not to see a serial 9pin connector on the Freedom KL25Z board. But it is perfectly understood that for this price costs are critical, and a serial header or connector is pushing the budget for that board very likely out of the water. Still, I want serial connectivity for my applications.

Freedom Board with RGB LED

Freedom Board with RGB LED

Continue reading

Virtual COM/USB CDC for OSBDM/OSJTAG

Many new notebooks do not have a serial port any more: everything is USB. This can lead to problems (see USB or not: CDC with Processor Expert) as many embedded targets  use normal RS-232. In my classes I’m using the Tower boards: some Tower boards have an on-board 2 pin RS-232 header, e.g. the Tower TWR-MCF52259. Others like the TWR-K60N512 use the added TWR-SER board. The Tower boards have as well a USB capable S08JM60 which is used for debugging (OSBDM/OSJTAG), so why not using the OSBDM microcontroller as Serial-to-USB gateway?

Continue reading

Device is secure?

It is one of these long weekends which allow to catch up on many things. One thing I finally completed was the move to FreeRTOS V7.1.1. With this I did some tests using the Tower boards, including the Kinetis one. So I have rebuild my Kinetis K60 application and was ready to flash the device. But then to my surprise I got this dialog:

Device is secure. Erase to unsecure?

Device is secure. Erase to unsecure?

Continue reading

Trimming S08 with P&E

Freescale S08 controllers have an internal clock generator (ICG) which allows the device to run without an external clock signal. But as devices differ, they need to be calibrated and trimmed. The microcontrollers are usually trimmed in the factory. How can I trim it myself if I need something better?

Continue reading