Using breakpoints is central part of debugging. I’m usually debugging my applications in flash memory. Because nearly all the microcontrollers I use have on-chip flash memory, and have more flash than RAM. With debugging in flash I limited by the number of hardware breakpoints. And here is the advantage with debugging code in RAM: availability of ‘unlimited’ software breakpoints. But how does this all works, and how to make efficient usage of hardware breakpoints?
Tag Archives: Debugging
Watching Static Variables
Debugging static variables, especially ‘static locals’ is sometimes challenging. Especially ‘static local’ debugging depends on the compiler capability how they are encoded in to the object file. I have found out that at least with CodeWarrior for MCU and ARM/Kinetis this works straight forward. Only ‘Watch Expressions’ need special attention.
FreeRTOS with GCC, Cortex-M0+ and Kinetis KL25Z Freedom Board
Yesterday was my ‘lucky day’: My Kinetis-L Freedom board arrived :-). This board is really nice and features the KL25Z from the recently announced Kinetis L Family. And guess what is the first thing I want to flash on that processor? Yep: some FreeRTOS tasks. But to get there, a few important things have to be sorted out:
There is an ARM to Trace
When I added ‘support for ARM/Kinetis‘ to my bucket list in my Percepio+Trace post, I knew it will not be straight forward. But it was a lot harder than I thought. I had to burn many week-end hours. But finally I have Percepio Trace with FreeRTOS up and running for Kinetis and ARM Cortex-M4 with CodeWarrior for MCU10.2 :-).
Breakpoints with Special Effects
As promised back in Percepio, I want to have it ported and working with the Freescale Cortex-M4/Kinetis in CodeWarrior. That’s what I’m working on now, deep into the night. While doing this, I had to generate a lot of trace data, and I used the script I presented in that earlier post: Setting a breakpoint in the trace buffer wrapper event and then export the data. But there has to be an even better way, and indeed there is one: Breakpoints with Special Effects!
Debugging Global Variables
If I’m debugging my application in Eclipse or CodeWarrior, it shows in the Variables view the local and global variables of the current Thread and stack frame only:
This makes sense as this is usually where my focus is. And this is good from a performance point of view: The debugger does not need to read a lot of other variables from the target which I’m not interested in. But the question is: how to show the variables which are in other files if I really need to look at them?
Stop on startup
Occasionally I run into this kind of problem: I have downloaded my application, and it immediately crashes or looses the connection:
What is the problem? It is helpful to understand what happens if I press ‘debug’ in CodeWarrior or any other debugger:
Percepio FreeRTOS+Trace V2.2.2 released
Percepio has released a new V2.2.2 library of FreeRTOS+Trace (see Tracing with FreeRTOS+Trace from Percepio). The new release comes with many improvements. The trace recording is optimized for more efficient recording and longer trace with the same amount of memory.
Note: Because the trace data structure is changed and optimized, I need the latest tool on the PC/host from http://www.percepio.com.
I have updated the Percepio Processor Expert component to generate and use the new trace library V2.2.2. This includes the new settings in the component properties as shown below:
Continue reading
Debug vs. Release?
When I create a project with CodeWarrior for MCU using Processor Expert and S08GB60, I’m asked if I want to have a Debug and/or Release configuration:
Debug or Release? For an embedded microcontroller? Does this make any sense?
Killing Me Softly: Zombies and Debugger Engines
I’m stressing the CodeWarrior debugger a lot: having multiple boards attached, debugging things in parallel, switching and unplugging boards all the time. I have my eclipse IDE running for several days and nights (up to a week or more), with constantly suspending and resuming and switching networks. And sometimes it is my fault (see Device is Secure?). But well, sometimes the CodeWarrior debugger has a problem too. Luckily, a simple trick gets things back on track.


