McuOnEclipse Components: 17-Oct-2015 Release

On SourceForge I have published an update of the McuOnEclipse software components, with following major changes:

  1. FreeRTOS updated to version V8.2.2 which comes with TLS (Thread Local Storage) support and GDB debug helpers.
  2. Percepio Trace updated to V3.0.2 with the release of Segger Real Time Terminal (RTT) for continuous trace streaming.
  3. FSL_USB_Stack with alternate USB initialization to deal with an issue in combination with the Kinetis SDK v1.3.0
  4. GenericI2C and GenericSWI2C have added support for custom I2C bus handling.

    McuOnEclipse SourceForge Release 2015-10-17

    McuOnEclipse SourceForge Release 2015-10-17

Updating the Components

Updating the components is simple: download the latest zip package from SourceForge (https://sourceforge.net/projects/mcuoneclipse/files/PEx%20Components/), unpack the archive and then import the components *.PEupd files into Processor Expert (see “McuOnEclipse Releases on SourceForge“).

FreeRTOS V8.2.2

FreeRTOS is now at version V8.2.2:

FreeRTOS V8.2.2

FreeRTOS V8.2.2

FreeRTOS from V8.2.1 includes a cool new feature: Tread Local Storage (TLS, see http://www.freertos.org/thread-local-storage-pointers.html). With TLS I can store data in the task control block and then access it from other tasks without the need for global variables which I then can access from other threads:

FreeRTOS Component

FreeRTOS Component

The number of thread local storage pointers can be specified in the properties:

thread local storage pointers

thread local storage pointers

As a cool extension for the ARM port, the component can add now GDB helper scripts to simplify thread debugging (see “FreeRTOS ARM Thread Debugging with Eclipse and GDB“):

GDB Debug Helpers

GDB Debug Helpers

Percepio Trace V3.0.2

Percepio Trace component has been upgraded to V3.0.2 version which includes the V3.0.2 version of the Segger RTT trace (see “FreeRTOS Continuous Trace Streaming“):

Percepio Trace V3.0.2

Percepio Trace V3.0.2

FSL_USB_Stack with Kinetis SDK V1.3.0

There seems to be a bug in/with the Kinetis SDK V1.3.0: With the Kinetis SDK V1.3.0 components installed, there can be issues that for inherited components the wrong or no components are found/assigned. The problem manifests that previously working projects fail with an error like

No inherited component assigned; Failed to create component/template: Init_USB_OTG_VAR0
Error inheritied component assigned

Error inherited component assigned

A workaround is to disable the Kinetis v1.3.0 components in the workspace preferences and then do a restart of Eclipse:

Kinetis SDK disabled

Kinetis SDK disabled

But this workaround prevents usage of the Kinetis SDK 1.3.0 components, so only works out nicely if not using Kinetis SDK components in the workspace.

The other workaround (recommended is) is to use an ‘outside’ component instead of the ‘inside’ inherited one. For this, add the Init_USB_OTG component from the Kinetis Repository to the project:

Init_USB_OTG

Init_USB_OTG

Make sure that the USB_Init component is using proper settings:

  1. Clock gate enabled
  2. Module Clock frequency: 48 MHz (choose proper clock source/prescalers from the available settings)
  3. External object declaration: extern uint8_t g_Mem[];
  4. Address: ((uint32_t)&g_Mem[0])
  5. USB Interrupt request: disabled
  6. USB ISR name: USB_ISR
  7. Call Init Method: yes
USB Init Configuration

USB Init Configuration

In the FSL_USB_Component have the ‘Inheritied USB Init’ disabled, and use instead the function name specified (default ‘USB0_Init’):

USB Init Function Name

USB Init Function Name

That way the FSL_USB_Stack Init() function will call the Init_USB_OTG Init function:

USB Initialization

USB Initialization

It’s not an ideal way, but until that problem with the Kinetis SDK V1.3 is solved (if ever?), I don’t have a better solution 😦

UPDATE: another solution instead to update the component and use the outside linking is to disable the ‘Init_USB_OTG_VAR0.dev’ template file. That file is present where the components have been installed:

Renamed Init_USB_OTG_VAR0.dev File

Renamed Init_USB_OTG_VAR0.dev File

UPDATE2: an even better way is to apply the following fix to the Init_USB_OTG_VAR0.dev file: https://github.com/ErichStyger/McuOnEclipse_PEx/commit/a1dec2d8d260bc5fc822e961316781a89f152db6

FSL_USB_CDC_Device with Standard I/O Functions

To simplify using the USB CDC with shell components it has now three additional standard I/O functions implemented:

USB CDC StdIO Handler functions

USB CDC StdIO Handler functions

GenericI2C and GenericSWI2C Custom Bus Handling

Sometimes it is necessary to control the I2C bus transaction on a lower level. For this, the GenericI2C and GenericSWI2C components have added functions and interfaces to deal with this:

ReadBlockGeneric in GenericI2C

ReadBlockGeneric in GenericI2C

RecvBlockCustom and SendAck

RecvBlockCustom and SendAck

Summary

The new update comes with a few larger and smaller extensions and updates. I hope that new release is useful for everyone. The release with the full release notes can be found on Sourceforge: https://sourceforge.net/projects/mcuoneclipse/files/PEx%20Components/

Happy Updating 🙂

Advertisements

10 thoughts on “McuOnEclipse Components: 17-Oct-2015 Release

  1. Hey thanks for the updates.
    I wonder do you think the FSL_USB_CDC_HOST would work for the twr-k65 (MK65F) – could you add it as a CPU option for USB particularly HOST_CDC/MSD (actually I’m using the MK26F – but its the same as the K65F except no Ethernet) thanks

    Like

    • I don’t have a K65F (nor a K26F) board :-(. So I can easily add that option, but will not able to verify it.
      Could it be that that the K64F will work out of the box for your K64F? Can you try this?

      Like

  2. Hmm – I tied it and it froze KDS3 on generating code. Twice :(.
    So when I include the FSL_USB_STACK it had problems below. I disabled the Init_USB – and did as you suggested above for seperate USB0:Init_USB_OTG. Also added FatFsMem_USB_MSD.

    LocalComponentRepository.findNonProcessorComponentByName() called for peripheral initialization component, name w/o family postfix “Init_USB_OTG”, from directory C:\Freescale\KDS_3.0.0\eclipse\ProcessorExpert\Repositories\Kinetis_Repository

    C:\Freescale\KDS_3.0.0\eclipse\ProcessorExpert\Repositories\KSDK120_Repository
    C:\Freescale\KDS_3.0.0\eclipse\ProcessorExpert\Repositories\KSDK130_Repository
    C:\Freescale\KDS_3.0.0\eclipse\ProcessorExpert\Repositories\Kinetis_Repository
    C:\Freescale\KDS_3.0.0\eclipse\ProcessorExpert\Repositories\KSDK120_Repository
    C:\Freescale\KDS_3.0.0\eclipse\ProcessorExpert\Repositories\KSDK130_Repository

    Like

      • Loaded latest 17.10.2015.PUepd and used FreeRTOS from that –
        Briefly my process was,new projected based on MK26F, KDS_1.3/PE
        Changed processor to MK26FN2M0VLQ18 – pin_mux err – accepted Switch Configuration,
        Selected clocks for 48Mhz, Added , FreeRTOS FSL_USB_STACK – selected device MSD Host CPU K64- unchecked Init_USB_OTG, Added component Init_USB_OTG and configured as per you great example here, added KinetisSDK.
        Compiled – missing fsl_os_abstraction_bm.h, Diskio.h – borrowed from SDK_1.30 tree
        HF1.h MSD1.c – problems with dword added – PE_Types.h in Event.h
        On linking couldn’t find EnterCritical/ExitCritical from host_ch9.c:USB_lock() – I ran out of cycles to deal with it.

        Like

  3. Hi Erich,

    Thanks a lot for this post!

    I have been trying to use your FSL_USB_Stack for CDC in Kinetis Design Studio, along with the SDK v1.3. I am following the fix of adding the SDK’s Init_USB_OTG separately, and testing on a Frdm-KL26Z board.

    After adding your FSL_USB_Stack, I get the following error when I build:
    ../Generated_Code/wdt_kinetis.c: In function ‘Watchdog_Reset’:
    ../Generated_Code/wdt_kinetis.c:42:2: error: assignment of read-only member ‘SRS0’

    I don’t really see how that relates to the usb stack, and the watchdog is disabled in the CPU component. But wdt_kinetis.c seems to be generated when I add the FSL_USB_Stack component.

    Do you know what might be going on?

    Thanks!
    Carlos

    Like

    • Hi Carlos,
      that stack has not designed to work with the Kinetis SDK (it had been created far before the Kinetis SDK), and I have not tried using it with the SDK. So what you see is probably a compiler error around the header files or includes with that SRS0 declaration?

      Like

      • Hi Erich,

        That is it. Yes, I had been using your library before the SDK, but I thought the workaround allowed to have some SDK components in the same project. My mistake. Thanks!

        Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.