In eclipse and CodeWarrior for MCU10 the usual thing I do is:
I have a project in my eclipse workspace
I compile and build it
I download and flash it to the target for debugging
If I need to program another board with the same binary, then I download it to that board too. Fine. But what if I want to skip point 1 and 2? What if I do not have or want a project? All what I have (and need) is a binary file, and I want is to flash that file to my boar. By pressing a button.
Sometimes my embedded application is not doing what I want it to do. I can solve many problems with normal ‘step/stop mode debugging‘: setting breakpoints, step, stop, inspect data, and so on. But not always. If a piece of code is changing a global variable unintentionally, I do not know where to set my breakpoint. Something is changing my variable, and I have no clue from where. It could be a dangling pointer, a stack overflow or something similar which I cannot track down with code breakpoints. What I need is a breakpoint on data: watchpoints!
In many cases I do a full erase-flash-debug cycle: I get my embedded microcontroller flash completely erased and then programmed with my application. Well, that does not work that way if I program with a bootloader. Yes, I can flash the bootloader and then load my target application with the bootloader, but that’s not the scenario I want to use in the development phase. I want to flash my application and keep the bootloader on the target. This means: I need to do erase and program a part of the memory. But how to do this?
Classic CodeWarrior used the concept of ‘Stationeries’ or ‘Project Templates’: If I have a project which you want to use as a starting point for ‘Create new project’, then I moved that project into the ‘Stationery’ sub-folder of my classic CodeWarrior. When I did a File > New Project…, it showed up in the project wizard:
My own stationery project in the classic new project wizard
This is very useful if I have my corporate template or using projects in a classroom environment. How can I do this in eclipse and CodeWarrior for MCU10.2?
One of the new features in CodeWarrior for MCU10.2 is the ability to build in parallel. Does not sound exciting? Well, when I tried this the first time in MCU10.2, I noticed immediately the reduction in build time: twice as fast compared to MCU10.1!!!. Wow! This improvement is based on using a make utility which can spawn multiple jobs on multicore host machines. CodeWarrior tries to use an optimized setting to make the build as fast as possible using parallel builds. The question is: is it really optimal?
It happens to me that I run into a really, really nasty problem. I spend hours (if not weeks) to get it resolved. Strong coffee and the problem keeps me up at long nights. I think every embedded system engineer knows what I’m talking about. Yeah, most of the time it is my fault or an oversight. But once in a while I’m convinced that I have found a real bug. Then I report it back to the vendor to fix it. I hope my report will prevent another engineers to run into the same problem. Or that I learn something else as a by-product. Oh yes….
Note: In general uninstalling an eclipse update is not possible. If you want to keep our original MCU10.2 on the side, then follow this trick: Copy your existing MCU10.2 installation folder and rename it (say to ‘MCU10.2_without_update’). Then apply the update to the normal MCU10.2. If you want to revert to the version without the update, simple delete the updated installation and rename the one without the update again. No need to reinstall things again. And you can use both the updated version and the normal version in parallel too: simply launch the eclipse\cwide you want
Time to read the release notes and dig into what has been changed and improved.
The FSL_USB_Stack Embedded Component presented in “USB CDC, reloaded” has been updated to V1.004 and is available here. I was running into issues if the USB CDC stack had to send out either 16 or 32 bytes of data in the App_Task() function. In that case the data is not sent until the next USB_Class_CDC_Interface_DIC_Send_Data() request.
I just ran into this problem: I know I have this file in my project, but still the linker complains that it cannot find the symbols: “Symbol X is undefined”? It must be something obvious, but somehow I cannot see it?
Yes, eclipse is a very visual and GUI oriented IDE. But this does not mean that everything is mouse oriented. While programming I have my hands on the keyboard. So I want to do as much as possible with shortcuts and the keyboard. The good news is that eclipse comes with a great set of helpers built-in. Here is my list of my favorite hotkeys and shortcuts…
(This is the first in an occasional series around the scripting in eclipse and CodeWarrior. Post a comment – let me know what you think!)
Writing code should be fun, and debugging it is just a necessity because I rarely get it right the first time. Eclipse with its GUI is a great thing, and so is a command line interface. Luckily the CodeWarrior eclipse engineers have added that kind of tool for the CodeWarrior debugger: the Debugger Shell as command line debugger using the TCL scripting language. This gives me a powerful way to deal with the embedded target board: from basic access to memory, to stepping and controlling the execution up to programming the flash memory.
Processor Expert is great: it generates initialization code and driver sources for me. This makes it a great knowledge and source base for non-Processor Expert projects too. Wondering how to initialize the SCI? What are again the register settings to use the CPU with a 6 MHz clock rate using an external crystal in low power mode? Lets generate a Processor Expert project to find out. Then copy-past the drivers or parts of it into my non-Processor Expert project. But How to do this?
With “Eclipse and PC-lint: Linticator” I have a plugin to lint my sources in a comfortable way. But I can do this as well without a plugin. For this I use a batch file with a build configuration, plus settings to get the PC-lint messages into the Problems view. Yes, this does not sound easy, but is very doable and straight forward once I have set it up. It gives me complete control on every little detail. Here is how I do it… Continue reading →
It is Easter time, and here is my Easter Gift in eclipse: Quick Access. If you are one of those developers who hate the mouse and want to do everything with your hands on the keyboard: this is definitely something for you. I admit that I had not noticed that feature, as it is buried behind menus. It is such a great functionality in eclipse (thanks for the hint, Teo!), but easily gets missed.