On SourceForge I have published an update of the McuOnEclipse software components, with following major changes:
- FreeRTOS updated to version V8.2.2 which comes with TLS (Thread Local Storage) support and GDB debug helpers.
- Percepio Trace updated to V3.0.2 with the release of Segger Real Time Terminal (RTT) for continuous trace streaming.
- FSL_USB_Stack with alternate USB initialization to deal with an issue in combination with the Kinetis SDK v1.3.0
- GenericI2C and GenericSWI2C have added support for custom I2C bus handling.
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 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:
The number of thread local storage pointers can be specified in the properties:
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“):
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“):
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
A workaround is to disable the Kinetis v1.3.0 components in the workspace preferences and then do a restart of Eclipse:
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:
Make sure that the USB_Init component is using proper settings:
- Clock gate enabled
- Module Clock frequency: 48 MHz (choose proper clock source/prescalers from the available settings)
- External object declaration: extern uint8_t g_Mem[];
- Address: ((uint32_t)&g_Mem[0])
- USB Interrupt request: disabled
- USB ISR name: USB_ISR
- Call Init Method: yes
In the FSL_USB_Component have the ‘Inheritied USB Init’ disabled, and use instead the function name specified (default ‘USB0_Init’):
That way the FSL_USB_Stack Init() function will call the Init_USB_OTG Init function:
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:
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:
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:
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 🙂
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
LikeLike
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?
LikeLike
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
LikeLike
Oops 3rd time lucky – it generated the code. Oh but not missing include files fsl_os_abstraction.h removed which were removed when adding FreeRTOS component.
LikeLike
Did you add the FreeRTOS component from the KSDK or the McuOnEclipse one?
LikeLike
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.
LikeLike
I see what you problem is: you have choosen to use the Kinetis SDK which is not compatible.
LikeLike
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
LikeLike
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?
LikeLike
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!
LikeLike