Time is passing by so fast, and the year end is approache fast! I’m pleased to announce that a new release of the McuOnEclipse components is available in SourceForge:
- Percepio Trace V3.1 for FreeRTOS which includes both Segger RTT continuous streaming and snapshot tracing in a single API
- Generation of sources and drivers so they can be used without Processor Expert using McuLibConfig, removal of dependency to NXP Kinetis SDK: components use a generic API approach to have them working with other SDKs.
- New contributed ExceptionsHandler component
- Callback Setter and Getter in USB CDC stack for simpler option handling
- GenericTimeDate with flexible RTC support and added Unix Timestamp functions
- LongKey events in Key component
- FreeRTOS with optimized task selection on Cortex-M4/M7
- Many smaller bug fixes and enhancements
Percepio Tracealizer V3.1
Percepio has released a new Tracealizer for FreeRTOS with many improvements.
I have it now working and ported for all devices the McuOnEclipse library supports. On Cortex-M with Segger I can stream the data to the host while the target is running:
The new unified trace API supports both streaming and snapshot API combined:
The component settings including support in FreeRTOS has been updated to support the new version. The settings have been regrouped, plus there is now the option to place the files into folders:
With the new options I can collect streaming trace right from the startup:
The new library offers alternative streaming methods as USB CDC or Ethernet, but I have not explored these (yet).
The new library and host application has a powerful way to spot memory leaks.
Omar Isai Pinales Ayala has contributed the new component ‘ExceptionsHandler‘:
With that component a simple try/catch/throw exception handling can be used with C. I had not much time to try it out, but this concept is very promising.
GenericTimeDate with Unix Timestamp Functions
The GenericTimeDate component can now be used as software RTC or in combination with hardware RTC, both internally or externally. It can be used as internal or external RTC without internal software counters now. Additionally initialization and default values can be configured:
Additionally it the driver implements flexible Unix time stamp (seconds after 1970) conversions:
Long Key Debouncing Events
The Key component is used to debounce one or multiple push buttons. It features dedicated events for long key press and release events:
FreeRTOS Optimized Task Switching
In FreeRTOS, the configUSE_PORT_OPTIMISED_TASK_SELECTION setting is used for an optimized task selection by the kernel:
It is only implemented for ARM Cortex-M4/M7 and with configMAX_PRIORITIES less than 32 (which is not really a limitation in normal systems). With that enabled, task selection is using the ‘clz’ (count leading zeros) assembly instruction for the task selection.
The effect is a small but measurable decrease of Kernel time: in one of my robotics application the Scheduler time was reduced from an average of 1.30% to 1.18%:
To help a broader usage of the drivers and code, I have added a new component: McuLibConfig. It replaces the KinetisSDK component plus fixes several limitations introduced by the SDK. One issue is that both Processor Expert and the SDK depend on types like ‘bool’ or ‘uint8_t’: depending on the inclusion order of header files, this can result in ‘incompatible type’ errors produced by the compiler. The McuLibConfig component allows to specify which API (and from where the standard types are coming):
The McuLibConfig component creates a configuration header file which is used in all the other drivers. That way the proper API (SDK or Processor Expert) is selected:
#ifndef __McuLib_CONFIG_H #define __McuLib_CONFIG_H /* Identifiers used to identify the SDK */ #define McuLib_CONFIG_SDK_GENERIC 0 /* using a generic API/SDK */ #define McuLib_CONFIG_SDK_PROCESSOR_EXPERT 1 /* using Processor Expert SDK */ #define McuLib_CONFIG_SDK_KINETIS_1_3 2 /* using NXP Kinetis SDK V1.3 */ #define McuLib_CONFIG_SDK_KINETIS_2_0 3 /* using NXP Kinetis SDK V2.0 */ #define McuLib_CONFIG_SDK_MCUXPRESSO_2_0 4 /* same as Kinetis SDK v2.0 */ /* specify the SDK and API used */ #ifndef McuLib_CONFIG_SDK_VERSION_USED #define McuLib_CONFIG_SDK_VERSION_USED McuLib_CONFIG_SDK_PROCESSOR_EXPERT #endif /* special macro to identify a set of SDKs used */ #define McuLib_CONFIG_NXP_SDK_USED ( (McuLib_CONFIG_SDK_VERSION_USED==McuLib_CONFIG_SDK_KINETIS_1_3) \ || (McuLib_CONFIG_SDK_VERSION_USED==McuLib_CONFIG_SDK_KINETIS_2_0) \ || (McuLib_CONFIG_SDK_VERSION_USED==McuLib_CONFIG_SDK_MCUXPRESSO_2_0) \ ) /* 1: project is a NXP/Kinetis SDK project; 0: Normal Processor Expert project or generic project */ #endif /* __McuLib_CONFIG_H */
Each driver now will generate such a configuration file which is either configured by Processor Expert graphically through the component properties. Or you can use it without Processor Expert and simply edit that configuration file. Each configuration is guarded with a #ifndef so you can set the configuration through compiler switches too.
The other feature is that I can specify a folder name for configuration files:
With this, each generated driver creates a configuration header file <Driver>config.h which has the user configuration.
For example the XFormat component creates the following files:
- McuXFormat.h: driver interface
- McuXFormat.c: driver implementation
- McuXformatconfig.h: driver configuration header file
That way the configuration is separated from the driver. And best of all: the driver now can be used without Processor Expert :-). This is still work in progress, but if you would like to check out how this looks: I have pushed several driver files to GitHub here: https://github.com/ErichStyger/McuOnEclipseLibrary
The plan is to extend the set of drivers and level of configuration in the configuration header files. The goal is to offer a library you can pull from GitHub and configure it with the IDE and tool you want.
Migrating from KinetisSDK to McuLibConfig
Because the interface has been changed from using the KinetisSDK component to the McuLibConfig one, existing projects need to be updated. The easiest way is to
- Add the McuLibConfig component to the project
- Remove the Kinetis SDK component from the project
- Close the project (Project > Close)
- Reopen the project (Project > Open)
With these steps all components previously using the Kinetis SDK one are using the new McuLibConfig component.
There are now around 14’000 component downloads every year (thanks to you all!). The McuLibConfig component is a step towards an even broader usage of the software and libraries provided through the McuOnEclipse project.
The changes are documented on GitHub. The release is available on SourceForge: https://sourceforge.net/projects/mcuoneclipse/files/PEx%20Components/. See “McuOnEclipse Releases on SourceForge” how to install the update.
I hope you find the new release useful.
Happy Eclipsing 🙂
- Release on Sourceforge: https://sourceforge.net/projects/mcuoneclipse/files/PEx%20Components/
- Component installation instructions: McuOnEclipse Releases on SourceForge
- McuOnEclipse Library on GitHub: https://github.com/ErichStyger/McuOnEclipseLibrary
- Percepio Trace Streaming: FreeRTOS Continuous Trace Streaming