Post navigation

LED’s for Kinetis, simplified

Sometimes it takes a while until things get better. Same thing applies to software: from time to time a refactoring and simplification makes sense. Especially if the underlying technology has been improved. With CodeWarrior for MCU10.3 available, it is time to refactor the LED component.

The ‘old’ way using GPIO_LDD

GPIO_LDD is rather complex to set up. Even more, it was not possible to use a single interface for my LED. I had to add a dual interface. The connection from the LED component to the GPIO_LDD was done with special settings in the LED component properties:

GPIO_LDD Connection

So for ARM/Kinetis, it was using a LDD interface, where it was using BitIO for every other architecture. BitIO is using BitIO_LDD

The new way: BitIO is using BitIO_LDD

With the availability of CodeWarrior for MCU10.3, things finally have been improved: it is possible to use BitIO_LDD:-). CodeWarrior for MCU10.3 supports now the earlier BitIO component, and interfaces it automatically with the BitIO_LDD sub-component. With this, it is possible that I get rid of my LDD interface :-). Which makes everything easier to use.

Migrating to the new component

Unfortunately I have not found a good way to make things backward compatible. This means if you use that new LED component V1.047 or later, you need to configure it for the LED used. To transform a project from the ‘old’ the new simplified way, following steps need to be performed:

Download the new LED component and install it in CodeWarrior/Processor Expert

Open in CodeWarrior the project. The LED’s will show errors as not configured properly yet.

Remove the GPIO_LDD’s used for the LEDs

For each LED, configure the LED pin according to the pin connection:

Configuring LED Pin

What happens is that for each LED, the BitIO sub-component will automatically add and configure a BitIO_LDD component:

BitIO_LDD Component

:idea: Creating new projects will automatically use the new LED interface, so no extra step is needed.

Summary

Although things are not backward compatible, the usage of the new LED component is now simpler with the usage of BitIO_LDD. The new LED component is available here. I have updated the Freedom Board example projects too.

Hello,
are you using the Wait component from the GitHub on https://github.com/ErichStyger/mcuoneclipse?
this one definitely supports ARM gcc.
And: can you verify that the compiler is set to Gcc in the Processor Expert CPU componen settings (build options tab)?

I am not actually using Code Warrior (because I don’t have its license). I am just using the stand alone processor expert software to generate code, convert that into a Keil Microvision project and compile/debug it there. I didn’t realize that by default the code is generated in Code Warrior syntax.

By the way, what other compilers do you support, other than the CW compiler and GNU compiler?

You do not need a CodeWarrior license: without a license, it is limited to 64 KByte code size for Kinetis-L which is a lot. Other CPUs have even a 128 KByte limit, so plenty of room to do development free of charge.
And I support right now IAR, CW and GCC compiler syntax. As long as it is ‘C’, no issue with other compilers. But of course the assembly language syntax is many times different for different compilers (like in the WAIT module).