Michel's blog

17 consecutive years...

MVP award

WEC7 December 2019 update woes...

UPDATE:: On 26 March 2020, Microsoft uploaded a fixed version of the WEC7 December 2019 update to their DPC site. Direct link (you'll only be able to access this if you have an account with "Indirect Embedded / IoT OEM" permissions).

Somebody at the Microsoft update team uploaded the WEC7 December 2019 update in the wrong format. If you try to update using WEDU it will fail, and if you download the file from the Device Partner Center site you will see it is in the .zip file format (instead of the normal .img ISO format). Note that you need to register and request "Indirect Embedded / IoT OEM" permissions to see all Embedded updates on the DPC site.

If you unpack the X22-25842.zip file you get these files:


X22-25842.zip
    ├───Layer0
    │       CONTROL.DAT
    │       DDPID
    │       IMAGE.DAT
    │       MANIFEST.xml
    │
    └───Layer1
            CONTROL.DAT
            DDPID
            IMAGE.DAT
            MANIFEST.xml

That doesn't look like a normal update at all but in fact it is, just a little bit in disguise... It's in DDP (Disc Descriptor Protocol) format, a format used to describe a replication master. Looks like Microsoft just simply forgot to convert this into a normal .img ISO file.

The .img ISO file can be recreated by simply concatenating the two IMAGE.DAT files from the Layer0 and Layer1 folder. On a command prompt, type the following command:

copy /b Layer0\IMAGE.DAT+Layer1\IMAGE.DAT X22-25842.img

You can now mount the .img file as you normally do (we use the excellent Elorabytes Virtual CloneDrive freeware to easily mount .img files).

Now you can install the WEC7 December 2019 update. It should complete without any errors. If the concatenation didn't go well (or if you just mount the IMAGE.DAT file from the Layer0 folder) you will get errors like this:


Note that the WEC2013 December 2019 update is in the right (.img) format and can be installed as normal.

The issues have been reported to Microsoft, so hopefully it gets fixed soon.

GuruCE iMX6 BSP release 2391

iMX6
After many weeks of deep testing, GuruCE iMX6 BSP release 2391 is ready! This release adds some great new features, like High Assurance Boot and 100% flicker-free transition from bootloader splash to the CE desktop or your application, new drivers for displays, touch controllers, and RTCs, and many code improvements and fixes.

The release notes contain the full list of changes.

A picture is worth a million words, so imagine what a video can do...

For this release we have created a video showing how easy it is to work with our BSP and just how much functionality is included out-of-the-box:

Video table of contents

00:18 - SetWINCERoot
00:52 - BSP installation
01:12 - BSP structure
02:10 - OS Design Build Configurations
03:30 - BSP Catalog
06:30 - Change board and make catalog selections
07:58 - Board specific header file
09:28 - Reducing size of kernel image
11:27 - Processor specific catalog items
11:48 - Configuring hive-based registry and TexFAT
12:05 - Enabling & configuring High Assurance Boot
12:20 - Generating HAB certificates and keys
14:15 - Building the OS Design to generate HAB signed bootloader and kernel images
14:32 - Building a bootloader for the NXP Manufacturing Tool
15:00 - Configuring the NXP Manufacturing Tool
16:25 - Flashing the bootloader to SPI NOR Flash using Visual Studio
16:57 - Stopping Windows Mobile Device Connectivity services to allow download and debug over USB Serial
17:30 - Using CEWriter to flash bootloader, kernel and splash images to an SD card
18:58 - Configuring the bootloader
19:13 ---- Setting up the primary display
19:23 ---- Setting up the secondary display
19:29 ---- Setting up mirroring of the primary display on the secondary display
19:35 ---- Configuring Ethernet
19:48 - Checking HAB and burning fuses
21:31 - Booting to the CE desktop on a Nitrogen6X board
22:08 - Pocket CMD over UART (CLI, Command Line Interface)
22:15 - Included utilities
23:18 - CE Remote Desktop
23:52 - Switching between WEC7 and WEC2013
24:28 - Tiny OS Design (small headless configuration)
24:45 - Production Quality TEMPLATE driver, SDK and application code
25:50 - Configure the bootloader for download and KITL debug over USB Serial
26:56 - Setting breakpoints in driver source
27:12 - Preparing Visual Studio for driver debug and development
27:48 - Inspecting variable at runtime
28:18 - Unloading, modifying, rebuilding and loading drivers at runtime, without having to rebuild and download the entire kernel image

Our promise

We will keep improving our iMX6 BSP, adding new features and we will be supporting our customers for many years to come, at the very least until the end of Microsoft's extended support end date of 10 October 2023.

Even though the GuruCE i.MX6 BSP is already the best performing, 100% OAL stable and most feature-rich i.MX6 BSP on the market today, there are always things to improve or fix and new features to implement.

As always; if you want us to add some particular functionality, need any customization, driver or application development: contact us and we'll make it happen.

Don't forget to check our Testimonials page to see what some of our customers have to say about the GuruCE i.MX6 BSP.

Don't believe the hype? Try it yourself!

We've got free downloadable evaluation kernels for the Element14 RIoTboard, the Boundary Devices SABRE-Lite, Nitrogen6X and Nitrogen6_VM, the Device Solutions Opal6 (all variants), the Digi ConnectCore6, the NXP SDP (DualLite & Quad), the SDB-QP (QuadPlus), the NXP MCIMX6ULL EVK (ULL), the Toradex Colibri and the Variscite VAR-SOM_MX6 (Dual/Quad) Starter Kit.and more.

GuruCE website: https://guruce.com
iMX6 landing page: https://guruce.com/imx6
Latest iMX6 BSP release: https://guruce.com/imx6/latest

CE Platform Abstraction Layer (CEPAL) for Windows 10 IoT

Since Microsoft Windows Embedded Compact is now officially out of its support life-cycle, many of our customers are looking to see what they can replace CE with. The choice is often between Linux/Android and Windows 10 IoT.

The main problem when moving to a new OS is the, often massive, code-base that needs to be ported to the new OS. In the case of Linux/Android this is more of a complete rewrite than a port and this was no different for Windows 10 IoT Core, until Microsoft announced the CE Platform Abstraction Layer (CEPAL) for Windows 10 IoT:


Microsoft has provided platforms and operating systems for embedded devices for decades. As new offerings such as Windows 10 IoT have become available, our customers and partners are increasingly interested in the advanced security, platform, and cloud connectivity features that these OS provide. Customers moving from most earlier editions of Windows, like Windows XP and Windows 7, can do so with little effort because of binary compatible applications. Other operating systems, like Windows CE, require device builders to modify source code. Porting applications like this can be challenging.

To help these customers move to Windows 10 IoT and harness the full power of the intelligent edge including artificial intelligence and machine learning, Microsoft is developing technology that will allow most customers to run their existing, unmodified Windows CE applications on Windows 10 IoT while they continue to invest in updating their applications. You can learn more about how this technology works in the recent IoT Show episode Modernizing Windows CE Devices.

Source:https://microsoft-ce-pal.com

Microsoft is gauging how much interest there is for this feature, and based on that interest will assign resources and even add more functionality to Windows 10 IoT Core to make it even easier for CE applications to run on Windows 10 IoT Core.

So, if you are interested in moving your CE application to Windows 10 IoT Core, please let Microsoft know. The more people that fill out the form, the easier it will get to move to Windows 10 IoT Core.

Now that we can run CE application binaries on Windows 10 IoT Core, without the need to port or even recompile code, choosing between Linux/Android or Windows 10 IoT Core as your next OS becomes a no-brainer.

Of course the experts of GuruCE are ready to help you move to Windows 10 IoT Core; contact us for more information.

Watch the Channel9 video:

TLS 1.2 support and fix for RTOS bug released for WEC2013

Microsoft has published the Wave 4 October 2018 update for WEC2013. This update adds support for TLS 1.2 in WEC2013 (WEC7 already had support added for TLS 1.2 in an earlier update) and fixes the kernel handle table locking mechanism bug (as described in this blog post):

Kernel Handle Table Locking Mechanism Bugfix

181031_KB4466833 - Implemented Kernel Fast-Lock sync optimization for Windows Embedded Compact 2013.

Note that you have to set a FIXUPVAR to enable the fix. Add the following line to your config.bib file (MEMORY section) to include the fix for WEC2013:

kernel.dll:dwSyncFastLock 0 0x0001 FIXUPVAR

Unfortunately, the fix for this bug hasn't been released for WEC7. We're hoping Microsoft will publish an update containing the fix for WEC7 in the near future (the GuruCE i.MX6 BSP of course contains the fix for WEC7 as well).

Transport Layer Security

181031_KB4467918 - Transport Layer Security (TLS) 1.1 and TLS 1.2 support added to Windows Embedded Compact 2013.

TLS 1.1

The following subkey controls the use of TLS 1.1:

[HKEY_LOCAL_MACHINE\Comm\SecurityProviders\SCHANNEL\Protocols\TLS 1.1]

To disable the TLS 1.1 protocol, you must create the Enabled DWORD entry in the appropriate subkey, and then change the DWORD value to 0. To re-enable the protocol, change the DWORD value to 1. By default, this entry does not exist in the registry.

Note To enable and negotiate TLS 1.1, you must create the DisabledByDefault DWORD entry in the appropriate subkey (Client, Server), and then change the DWORD value to 0.

TLS 1.2

The following subkey controls the use of TLS 1.2:

[HKEY_LOCAL_MACHINE\Comm\SecurityProviders\SCHANNEL\Protocols\TLS 1.2]

To disable the TLS 1.2 protocol, you must create the Enabled DWORD entry in the appropriate subkey, and then change the DWORD value to 0. To re-enable the protocol, change the DWORD value to 1. By default, this entry does not exist in the registry.

Note To enable and negotiate TLS 1.2, you must create the DisabledByDefault DWORD entry in the appropriate subkey (Client, Server), and then change the DWORD value to 0.

Warning The DisabledByDefault value in the registry keys under the Protocols key does not take precedence over the grbitEnabledProtocols value that is defined in the SCHANNEL_CRED structure that contains the data for an Schannel credential.

Note: Per the Request for Comments (RFC), the design implementation does not allow SSL2 and TLS 1.2 to be enabled at the same time.

Download locations

If you have access to DPC (device partner center) with the right "Embedded" permissions then you can download the Wave 4 update for WEC2013 here: https://devicepartner.microsoft.com/en-us/assets/detail/x21-98917-img.

If you don't have access to DPC, get the Wave 4 update for WEC2013 here: https://www.microsoft.com/en-us/download/details.aspx?id=42027

Windows Embedded Compact / Windows CE Documentation

In their infinite wisdom, some team at Microsoft decided to move all the Windows Embedded Compact / Windows CE documentation to docs.microsoft.com. That's fine, but unfortunately they also decided this content is not allowed to be indexed by search engines anymore. The result is that searching for an API in Google or Bing does not return any link to the correct API documentation page anymore. We could live with that if the site itself would allow us to search, but unfortunately that functionality is broken now too. This makes finding Windows CE API documentation extremely difficult...

To make your life a bit easier, here are some links that should help you find what you are looking for a bit easier:

All CE documentation can be found here: https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ee504814(v=winembedded.70)

Try to search for "CeSetThreadQuantum" using the search box on the top right to see that this functionality is broken now.
UPDATE: Microsoft has fixed the search functionality, hooray!

Without the search function working we have to manually click through the tree structure on the left to find what we need. Here are some handy links:

Kernel reference: https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ee482973(v%3dwinembedded.80)

Kernel APIs: https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ee482951(v%3dwinembedded.80)

Unfortunately, when you click on any API link on the above page, you will be redirected to the old Windows CE 6.0 documentation (and not to the expected WEC2013 documentation for the function you clicked).

To remedy this, manually change "winembedded.60" to "winembedded.80".

For example, clicking on the AllocPhysMem link will direct you here. Changing "60" to "80" will direct you to the expected page.
UPDATE: Microsoft has fixed the links to stay within the correct version, hooray!

Most other API documentation can be found here: https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ee488372(v%3dwinembedded.80)

Use the tree on the left to find your function.

To find documentation for Windows CE 6.0, change "80" in the urls above to "60". To find docs for Windows Embedded Compact 7, change "80" to "70".

For some reason parts of the CE 5.0, CE.NET 4.2 and CE 3.0 documentation pages are still on MSDN and haven't been moved to docs.microsoft.com. Probably somebody forgot to move these... The result is that searching for just the API in Google or Bing returns links to the CE 3.0 documentation. Surely not the intended result by the team that made the decision to move all documentation to a new place on the Microsoft servers...

We've of course reported these issues to Microsoft. We'll update this blog post if the situation changes...

Windows Embedded Compact is NOT an RTOS!

Introduction

There’s a bad bug in the Windows Embedded Compact scheduler code on WEC7 and WEC2013 (and possibly earlier versions as well) that causes the OS to become non-deterministic. This means WEC7 and WEC2013 can NOT be called a Real-Time Operating System as long as this bug is present.

We have reported this bug to Microsoft, together with the fix, but unfortunately Microsoft has responded with:

“This would impact the kernel and the risks to taking this on far outweigh the good that would come of it so in the interest of not destabilizing the product we have opted to forgo fixing this issue at this time.”

The fix we provided has been thoroughly tested by us and has shown the kernel works absolutely fine with it in place. The fix is inside PRIVATE code so it is really Microsoft who would need to update this code and provide updated binaries, if only to prevent a maintenance nightmare.

The bug

The CE kernel keeps a table containing all handles. Access to this kernel table is controlled by a locking mechanism. If a thread requests a handle the kernel would need to alter the handle table (to add the handle). In this case, the thread requesting a handle becomes a “writer” of the handle table.

If a thread is merely requesting an existing handle from the handle table without any need to alter the handle table, the thread requesting the existing handle becomes a “reader”.

“Writers” to the handle table acquire an exclusive lock whereas “readers” just increase the lock count.

If a “reader” tries to increase the lock count but the handle table is already owned and exclusively locked by a “writer”, the “reader” blocks until the “writer” releases the exclusive lock. In this case priority inversion should occur, so that the lower priority “writer” thread gets scheduled and will release the exclusive lock as soon as possible so that the higher priority “reader” thread can continue as soon as possible.

Due to a bug in the CE kernel handle table locking code, this priority inversion sometimes does not occur resulting in high priority threads to have to wait until many lower priority threads run their thread quantum.

This absolutely and completely breaks the real-time scheduling mechanism of Windows Embedded Compact.

The code acquiring the handle table lock requires two steps:

  1. Acquire the lock
  2. Set the owner of the lock

The problem is that the Microsoft kernel code does not make this an atomic operation, meaning that a low priority “writer” thread can be pre-empted by a high priority “reader” thread in between step 1 and 2. The resulting situation of that pre-emption is that the handle table is locked, but the scheduler has no record of which thread owns the lock, and thus cannot apply priority inversion. The higher priority “reader” thread now has to wait for the lower priority “writer” thread to be scheduled at its original low priority. If there are any other threads active in the system at equal or higher priority than the priority of the “writer” thread, it means the high priority “reader” thread will have to wait for all these lower priority threads to run before it is allowed to continue.

It is important to note that the handle table contains ALL handles and the lock is a table-wide lock, meaning that ANY handle access can cause this situation. One thread can be using a file system handle, while another thread uses a completely unrelated device driver handle. There is no need for both threads to try to access the same handle.

The bug commonly shows itself in real-world scenarios, but so far hasn’t been diagnosed properly. The reason is that the bug is caused by a locking mechanism completely hidden from the user and it is therefore extremely difficult to find the root cause of this bug. Application code will look completely correct and connecting the issue with another, apparently completely unrelated, active thread in the system that together are causing this issue to arise, is extremely difficult.

The proof

We have created example code that quickly and reliably shows that this bug occurs on all systems running the WEC7 or WEC2013 OS. We have not tried CE6 yet, but it is very likely this bug exists in that version of the OS as well, and likely also in earlier versions of the OS.

The example code consists of a very simple stream interface device driver and a test application that creates:

  • One low priority “writer” thread that gets, uses and releases a handle to the 1st instance of the device driver in a tight loop without yielding (so no sleep). This thread runs at priority 255 (idle).
  • One low priority “busy” thread per core, simply executing a tight loop for 100 ms without yielding (so no sleep and no use of any handle). These threads run at priority 255 (so the “writer” thread gets scheduled in round-robin fashion together with these “busy” threads).
  • One high priority “reader” thread that uses a handle to the 2nd instance of the device driver in a loop, sleeping for 1 ms before using the thread handle again. This thread runs at priority 0 (hard real-time).

The “reader” and “writer” threads call a function inside the device driver instance that stalls (runs a tight loop without yielding) for 100 us.

The busy threads are there to make sure all cores are busy all the time and the low priority “writer” thread gets scheduled in round-robin fashion together with these busy threads.

The high priority “reader” thread will pre-empt all of these low priority threads every 1 ms.

The high priority thread tracks how long the DeviceIoControl call to the device driver takes, and breaks out if it detects the bug situation. Below is the output of the test run on a Nitrogen6X iMX6 Quad with only a single core active. We only activated a single core to show that many other threads can be scheduled in succession before our high priority thread can be scheduled again. This is explained in more detail later. It is important to note that the bug also occurs when enabling all 4 cores (and we have a busy thread on each core).


\> rttapp
Handle table lock mechanism bug test started at 12:06:10 on 2018/08/15
Low priority writer thread 1 started on processor 1
Low priority busy thread 1 started on processor 1
High priority reader thread 0 stall of 100 us took maximum 120 us.
Low priority busy thread 2 started on processor 1
High priority reader thread 0 stall of 100 us took maximum 149 us.
Low priority busy thread 3 started on processor 1
High priority reader thread 0 stall of 100 us took maximum 241 us.
Low priority busy thread 4 started on processor 1
High priority reader thread 0 stall of 100 us took maximum 242 us.
High priority reader thread 0 stall of 100 us took maximum 252 us.
High priority reader thread 0 stall of 100 us took maximum 253 us.
High priority reader thread 0 stall of 100 us took maximum 254 us.
High priority reader thread 0 stall of 100 us took maximum 306 us.
High priority reader thread 0 stall of 100 us took maximum 399156 us.
Could not copy OSCapture.clg to \Release, error 3
ERROR: High priority reader thread 0 stall of 100 us took 399156 us!
Handle table lock mechanism bug test ended at 12:07:18 on 2018/08/15
\>

It’s only a matter of time before the high priority “reader” thread pre-empts the low priority “writer” thread in between it acquiring the lock and setting itself as the owner of the lock. As you can see in the above example it took a little over a minute to show the bug, and the result is that our priority 0 real-time thread had to wait almost 400 ms before being scheduled again!

If the test application code detects the bug, it calls “OSCapture” with parameter “-c” so that OSCapture writes the CELog RAM buffer to a file in the root called “OSCapture.clg”. It will then try to copy this file to the \Release folder, which is only available in a KITL enabled kernel. We ran the above test on a Shipbuild kernel (so without KITL enabled), hence the copy to \Release failed. We used FTP to copy the OSCapture.clg file to our Shipbuild’s _FLATRELEASEDIR and opened the file from there with Kernel Tracker:

The above Kernel Tracker screenshot shows a “good” situation. As you can see, the low priority “writer” thread is running when it gets pre-empted by our high priority “reader” thread. In the good situation, the high priority “reader” thread tries to get the handle table lock, but the table is locked by the low priority “writer” thread and the owner thread is properly set. The kernel now inverts the priorities of the high priority “reader” thread and the low priority “writer” thread. Now the low priority “writer” thread runs at priority 0 and thus gets scheduled immediately so it can finish its work asap and release the handle table lock. As soon as it has released the handle table lock, the priorities are inverted again and our high priority “reader” gets the handle table lock and gets scheduled immediately. It now continues execution; real-time deterministic behaviour is guaranteed.

Theoretical total time it would take for the high priority “reader” thread to finish is:

(Execution time of high priority thread) + (Remaining execution time of low priority thread) + some overhead.

In a “bad” situation, the high priority “reader” thread preempts the low priority “writer” thread in between it getting the handle lock and setting itself as the owner of the lock:

The above Kernel Tracker screenshot shows a “bad” situation. As you can see, the low priority “writer” thread is running when it gets pre-empted by our high priority “reader” thread. In the bad situation, the pre-emption of the low priority “writer” thread happens in between it locking the table (step 1) and setting itself as the lock owner (step 2). Now the high priority “reader” thread wants to lock the handle table, but the table is locked by the low priority “writer” thread without the owner thread properly set. The kernel now has no idea which thread owns the lock and thus cannot invert priorities. The scheduler now simply schedules the next thread that is ready to run. This thread runs for an entire thread quantum as well as any other thread ready to run after that. In our case there are 4 busy threads that all run an entire thread quantum before our low priority “writer” thread gets scheduled again:

As soon as the low priority “writer” thread gets scheduled again, it resumes at step 2 and sets itself as owner of the handle table lock so now the scheduler knows which thread to invert the priority of. Immediately the low priority “writer” thread gets scheduled again so it can finish its work asap and release the lock. When that happens, the priorities are inverted again and our high priority “reader” thread can finally run, but only after having had to wait for all these other low priority threads to have run through their thread quantum.

As you can see; deterministic behaviour is completely broken and thus we cannot say Windows Embedded Compact is a real-time operating system with this bug in place.

Luckily, the kernel code containing the bug is available when you install the shared source. It is possible to clone, modify and build this kernel code so that locking the table and setting the owner becomes an atomic operation. With this fix in place, real-time deterministic behaviour is restored and Windows Embedded Compact can be labelled as an RTOS again.

Note: the GuruCE iMX6 BSP will include this fix in our upcoming release. Current customers can request this fix right away.

We are still hopeful Microsoft will change its opinion and release an update for WEC7 and WEC2013 to fix this issue. If that happens, we will update this article to reflect that.

The example code showing the kernel handle table locking bug and a pdf version of this article are available here.

UPDATE: Microsoft fixed this bug in WEC2013 (but unfortunately not in WEC7), see this blogpost.

Finally, the new GuruCE iMX6 BSP release is out!

iMX6
Let's call this the mystical release! It's taken much longer than planned to get this BSP release out due to a number of factors. Our last release was almost exactly 1.5 years ago, so what does 1.5 years of development bring?

Some highlights:

  • Support for UL & ULL
  • Display clone
  • CE Updater (update firmware from within CE)
  • Multi-touch
  • Super fast and reliable USB RNDIS and USB Serial for KITL
  • Simplified use of hive-based registry (no need to pre-format disks anymore)
  • Completely verified clock tree code
  • Gigabit Ethernet (on selected boards and with limitations due to NDIS)
  • Easy switch USB function
  • Copy/update firmware from SD to eMMC
  • Keep track of reason of last reset (power-on reset, software reset, watchdog reset, etc)
  • Many improvements to our BSP catalog to make working with our BSP even easier
  • And many more improvements, fixes and new features!

Further details in the release notes.

DVFS

We'd like to hear if you are interested in DVFS functionality (including full suspend-resume). Please contact us if you want this so we can gauge interest and prioritize this work accordingly.

TLS 1.2

Microsoft has recently added TLS 1.2 functionality to WEC7. When we asked Microsoft when this functionality would be added to WEC2013 the answer was that this was not planned at all. After a bit more push from our side, Microsoft is now willing to consider bringing TLS 1.2 also to WEC2013 and they have asked us to gauge interest and gather company names and contacts for them so they can justify the investment. Please contact us if you want TLS 1.2 on WEC2013 now or you think you may need it in the future.

UPDATE: Microsoft has now added support for TLS 1.2 to WEC2013, see this blogpost.

Our promise

We will keep improving our iMX6 BSP, adding new features and we will be supporting our customers for many years to come, at the very least until the end of Microsoft's extended support end date of 10 October 2023.

Even though the GuruCE i.MX6 BSP is already the best performing, 100% OAL stable and most feature-rich i.MX6 BSP on the market today, there are always things to improve or fix and new features to implement.

Here's our wishlist:

  • Bring hardware accelerated H.264 video codecs to WEC2013 (not just WEC7)
  • Improve Gigabit network performance
  • Animated GIF bootsplash support
  • Create a solid solution for multi-display touch

As always; if you have anything you want us to add to the list or you want us to prioritize an item on the list: contact us and we'll make it happen.

Don't forget to check our Testimonials page to see what some of our customers have to say about the GuruCE i.MX6 BSP.

Don't believe the hype? Try it yourself!

We've got free downloadable evaluation kernels for the Element14 RIoTboard, the Boundary Devices SABRE-Lite, Nitrogen6X and Nitrogen6_VM, the Device Solutions Opal6 (all variants), the Digi ConnectCore6, the NXP SDP (DualLite & Quad), the SDB-QP (QuadPlus), the NXP MCIMX6ULL EVK (ULL), the Toradex Colibri and the Variscite VAR-SOM_MX6 (Dual/Quad) Starter Kit.

GuruCE website: https://guruce.com
iMX6 landing page: https://guruce.com/imx6
Latest iMX6 BSP release: https://guruce.com/imx6/latest

Meltdown and Spectre on Windows CE / Embedded Compact

Meltdown
Spectre
Meltdown and Spectre have hit the world by storm and of course the Windows CE / Embedded Compact OS is also affected by these processor bugs.

See this ARM bulletin: https://developer.arm.com/support/security-update
And this PDF: https://developer.arm.com/support/security-update/download-the-whitepaper

At GuruCE we of course want to release patches to prevent malicious attacks through these attack vectors, but unfortunately the required code changes are all in places we do not have source code for or that we can't compile:

Variant 1 (Spectre) needs an update of the ARM compiler in CE/EC: https://developer.arm.com/support/security-update/compiler-support-for-mitigations
Variant 2 (Spectre) needs updates to the COREOS code (scheduler / vm code)
Variant 3 (Meltdown) does not apply to the Cortex-A9 (so does not apply to our iMX6 BSP)

We have therefore asked Microsoft for their plans on releasing patches for Windows CE/EC, and today (January 16, 2018) we received an answer:

"Since the desktop fixes were just released we are just beginning our investigation of the backports for CE7 and Compact 2013. Since CE6 and Handheld were based on XP it is unlikely that we will see a fix unless there is a fix released for XP desktop client."

Please note the above comment is not an "official Microsoft" statement. The comment was received by us in an email from a Microsoft support manager.

So, that is at least some good news. There are still a lot of devices around that run Windows CE 6.0, so in that respect not fixing that OS version is bad, but at least both WEC7 and WEC2013 are now being investigated to see what it takes to be patched by Microsoft.

No timeline yet, but we will keep pushing MS and keep you updated on progress.

The official information pages from Microsoft are here:

https://support.microsoft.com/en-us/help/4073757/protect-your-devices-against-spectre-meltdown
https://cloudblogs.microsoft.com/microsoftsecure/2018/01/09/understanding-the-performance-impact-of-spectre-and-meltdown-mitigations-on-windows-systems

There is no official info about Windows CE/EC on those pages yet, but hopefully CE/EC info will be added soon to the official pages, together with a timeline of when to expect the patches for CE/EC.

msvsmon.exe exceptions when debugging CE applications in VS explained

If you have ever done any application development for Windows Embedded Compact (aka "CE" or "WEC") devices then you no doubt have seen this ugly exception coming out of the serial port of the device:

Exception 'Raised Exception' (0x80010108): Thread-Id=050f001e(pth=ae493688), Proc-Id=044a001e(pprc=ae48a4a0) 'msvsmon.exe', VM-active=044a001e(pprc=ae48a4a0) 'msvsmon.exe'

It has been a long standing issue that so far nobody has really taken the time to investigate or explain, so let's change that!

Today I loaded up a WEC2013 debug kernel, started conmanclient and created a default "ConsoleApplication" targeting my device. I pressed F10 and waited for PB to break because of the exception. The callstack at the time of the exception is:

COREDLL!xxx_RaiseException(unsigned long 0x406d1388, unsigned long 0x00000000, unsigned long 0x00000004, const unsigned long * 0x009ffd48)  line 1347
VSDEBUGENG.IMPL!43e2da82()
KERNEL!APICall + 142 bytes
COREDLL!TlsSetValue(unsigned long 0x00000001, void * 0x00000001)  line 260 + 6 bytes
COREDLL!ThreadBaseFunc(unsigned long (void *) 0x00000000, void * 0x00000000)  line 1269 + 6 bytes

So, msvsmon.exe (VSDEBUGENG.IMPL) is actually raising the exception! But why?

Setting a breakpoint on the call to RaiseException allowed me to step in and see the arguments passed to RaiseException:

    dwExceptionCode     0x406d1388
    dwExceptionFlags    0x00000000
    nNumberOfArguments  0x00000004
-    lpArguments,4      0x009ffd48
    [0]    0x00001000
    [1]    0x43e8794c
    [2]    0x0526001a
    [3]    0x00000000

A quick google search on "Exception 0x406d1388" turned up this little gem of information: "How to: Set a Thread Name in Native Code".

So, what this RaiseException call actually does is simply setting the thread name by sending the VS debugger the event name through this exception. The reason it does this is so it is easier for you (the developer) to identify which thread you are debugging. This could be very useful when debugging multi-threaded applications; open the Threads window (CTRL-ALT-H) to see the thread names.

Knowing what we know now, we can see that the above 4 arguments are indeed matching what is listed on the MSDN page:

-    lpArguments,4      0x009ffd48
    [0]    0x00001000    dwType: Must be 0x1000.
    [1]    0x43e8794c    szName: Pointer to name (in user addr space).
    [2]    0x0526001a    dwThreadID: Thread ID (-1=caller thread).
    [3]    0x00000000    dwFlags: Reserved for future use, must be zero.

Long story short; I don't think there is any way to avoid this exception (even if MS would be interested in 'fixing' this). It's an annoyance, but not more than that. The exception can be safely ignored. It should not have any (or at least not have a big) impact on your debugging experience.

Visual Studio and Platform Builder problems on high DPI 4K displays

Working with Visual Studio 2015 in combination with Platform Builder on a 4K monitor is very frustrating. The Attach Device window always opens half outside the display area on the bottom right, the Callstack window has such tiny letters that you need to use a magnifier to be able to read it, and Visual Studio 2008 is completely unworkable because the entire IDE reverts to tiny letters as soon as you download your kernel.

I tried the compatibility wizard to no avail and had given up hope, until one of our experts found the solution!

Start regedit, browse to [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers] and add a new string value with the path to devenv.exe, then set the value to "~ DPIUNAWARE" and Visual Studio and all your Platform Builder specific windows will work as they do on a normal, non-4K monitor!

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"="~ DPIUNAWARE"
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe"="~ DPIUNAWARE"

Thanks Doug!

GuruCE releases another major update of their i.MX6 BSP

iMX6
We have finalized testing and have now published official release 1375 of the GuruCE i.MX6 BSP. This release again adds a lot of great new features and improvements all of our customers will be very happy to see.

Some highlights:

  • Updated GPU driver to v5.0.15
  • Improved load, flash and boot times by up to 50%
  • Added support for LZ4 compressed kernel binaries to the bootloader.
  • Optimized bootloader cache settings (L1/L2) to shorten boot time.
  • Bootloader boot delay can now be set to 0 to shorten boot time.
  • Now setting ARM CPU frequency according to speed grade in the bootloader.
  • Made many improvements in the BSP catalog to make it even easier to use.
  • Added support for storage profiles per USDHC instance. This means that SD cards always get mounted using the same folder name, no matter in what order they are inserted, and we can now specify exactly which USDHC port to store the hive-based registry on or exactly which USDHC port to mount as root.
  • Added support for NXP SDB-QP (QuadPlus) board.
  • Added support for Device Solutions Opal6-QP (QuadPlus) board.
  • USB OTG Client/Host auto-detection now working correctly on all boards.
  • Added TinyBoot bootloader. This is an SPI bootloader that just resets the i.MX6 and directs it to boot from the medium selected in the catalog.
  • And many more improvements, fixes and new features!

Further details in the release notes.

Pictures say more than a thousand words, so here are some highlights of this release captured on video:

Even though the GuruCE i.MX6 BSP is already the best performing, 100% OAL stable and most feature-rich i.MX6 BSP on the market today, there are always things to improve or fix and new features to implement.

Here's our wishlist:

  • Bring hardware accelerated H.264 video codecs to WEC2013 (not just WEC7)
  • Improve Gigabit network performance
  • Animated GIF bootsplash support
  • Create a solid solution for multi-display touch

As always; if you have anything you want us to add to the list or you want us to prioritize an item on the list: contact us and we'll make it happen.

Don't forget to check our Testimonials page to see what some of our customers have to say about the GuruCE i.MX6 BSP.

Don't believe the hype? Try it yourself!

We've got free downloadable evaluation kernels for the Element14 RIoTboard, the Boundary Devices SABRE-Lite, Nitrogen6X and Nitrogen6_VM, the Device Solutions Opal6 (all variants), the Digi ConnectCore6, the Congatec Conga-QMX6, the NXP SDP (DualLite & Quad) and now also for the SDB-QP (QuadPlus), the Technologic Systems TS-4900 (Solo & Quad) and the Toradex Colibri.

GuruCE website: https://guruce.com
iMX6 landing page: https://guruce.com/imx6
Latest iMX6 BSP release: https://guruce.com/imx6/latest

Using STL (C++) in Platform Builder subprojects

Sometimes it is nice or necessary to be able to use STL or other C++ features in Platform Builder subprojects. This blog post explains what you need to do to make this work:

In your subprojects sources file, add the following path to _ISVINCPATH:

$(_WINCEROOT)\public\common\sdk\crt\include\stl;

And add the following lines to TARGETLIBS:

    $(SG_OUTPUT_ROOT)\sdk\crt\lib\ARM\libcpmt.lib  \
    $(SG_OUTPUT_ROOT)\sdk\crt\lib\ARM\msvcrt.lib  \

You can use libcpmtd.lib and msvcrtd.lib for debug builds.

And finally add:

CDEFINES=/EHsc

The required libraries are documented here.

After the above changes, the subprojects build the same as standalone SDK projects.

Thanks to Rajiv for figuring this out!

GuruCE releases feature update of their i.MX6 BSP

iMX6
We have finalized testing and have now published official release 1100 of the GuruCE i.MX6 BSP. This release adds a lot of great new features most of our customers will be very happy to see.

Some highlights:

  • Updated Vivante GPU driver to v5.0.11.p8.3
  • Multi-monitor functionality now working properly for all resolutions on i.MX6 Solo and DualLite processors.
  • Boot splash images can now be stored in the system partition (next to the bootloader and kernel images). No need to have a FAT12/16/32 formatted partition anymore.
  • Background color of boot splash screen now determined by color of bottom right pixel of the boot splash image.
  • Updated CEWriter tool to support flashing boot splash images.
  • Added support for external drives (like SATA connected through USB) to CEWriter.
  • Fixed flickering mouse cursor and bad performance when drawing under the mouse cursor.
  • OpenGL XAML render plugin now working properly.
  • Added support for NAND to bootloader and kernel.
  • Added support for external RTCs (Real Time Clock chips). Currently supported (and runtime auto-detected) chips are ISL1208, ISL2020, M41T0, M41T8x and RV4162.
  • Added PCIe core reset code so PCIe driver works on DualPlus/QuadPlus
  • Changed condition for enabling L2 cache double line fill feature to depend on L2C-310 revision. The i.MX6Solo/DualLite and DualPlus/QuadPlus now all have r3p2, so for those processors the double line fill feature is now enabled, resulting in much better cache behaviour (and better realtime performance on those processors).
  • Added bootshell option for directing clocks to CKO1/2 pads
  • Improved clocking code to now properly control reference counts of static divider root clocks
  • Moved clocking code to more logical place in the BSP tree.
  • Further cleaned up and refactor of large parts of the interrupt code.
  • Further clean-up and re-structure of BSP code and tree.
  • And many more improvements, fixes and new features!

Further details in the release notes.

Even though the GuruCE i.MX6 BSP is already the best performing, 100% stable and most feature-rich i.MX6 BSP on the market today, there are always things to improve or fix and new features to implement.

Here's our wishlist:

  • Reduce power consumption and enable super low power modes (DVFS/suspend)
  • Bring hardware accelerated H.264 video codecs to WEC2013 (not just WEC7)
  • Improve Gigabit network performance
  • Animated GIF bootsplash support
  • Create a solid solution for multi-display touch

As always; if you have anything you want us to add to the list or you want us to prioritize an item on the list: contact us and we'll make it happen.

Don't believe the hype? Try it yourself!

We've got free downloadable evaluation kernels for the Element14 RIoTboard, the Boundary Devices SABRE-Lite, Nitrogen6X and Nitrogen6_VM, the Device Solutions Opal6 (DualLite & Quad), the Digi ConnectCore6, the Congatec Conga-QMX6, the NXP SDP (DualLite & Quad) and now also for the Technologic Systems TS-4900 (Solo & Quad) and the Toradex Colibri.

GuruCE website: https://guruce.com
iMX6 landing page: https://guruce.com/imx6
Latest iMX6 BSP release: https://guruce.com/imx6/latest

QT 5.6.0 official release on the GuruCE iMX6 BSP

Official release Qt 5.6.0 builds and works fine with our GuruCE iMX6 BSP and SDKs!

Download Qt 5.6.0 official source here: https://download.qt.io/official_releases/qt/5.6/5.6.0/single/

We still need to make three patches: download the patches.

The complete guide to building Qt to work with the GuruCE iMX6 BSP and SDK can still be found here: https://guruce.com/blogpost/wec2013-and-qt.

There are no changes in the build steps apart from using the links above for Qt source and the required patches.

GuruCE releases major new version of their iMX6 BSP

iMX6
We have finalized testing and have now published official release 954 of the GuruCE iMX6 BSP. This release adds a couple of great new features many of our customers have been wanting to see supported in our BSP.

Some highlights:

  • Added true multi-monitor support: extended desktop with GDI, OpenGL-ES & OpenVG on all active displays
  • Added support for multi-display boot splash screens, with virtually flicker-free transition to the Windows Embedded Compact desktop
  • Multi-display configuration can be dynamically configured in the bootloader with immediate activation of (and display of bootsplash on) the selected displays
  • Latest Vivante GPU driver (5.0.11.p8.0 + 2G)
  • Introducing CEWriter; a Windows utility that can write a bootsplash, bootloader & kernel image directly to a SATA drive or SD card from your PC
  • Added support for iMX6 Dual+ and Quad+ processors
  • Added support for PCIe enumeration over bridges and switches
  • Added support for Command Line Interface (cmd.exe) over UART
  • Added support for VMINI network adapter while debugging over KITL
  • Added support for very large SATA disks
  • Added support for SD/eMMC 8-bit mode
  • Added support for eMMC 4.4 DDR mode
  • Added support for the Technologic Systems TS-4900 Solo & Quad board
  • Added support for the Device Solutions Opal6 Quad board
  • Added support for the Toradex Colibri DualLite board
  • And many more improvements, fixes and new features!

Further details in the release notes.

Even though the GuruCE iMX6 BSP is already the best performing, stable and feature-rich iMX6 BSP on the market today, there are always things to improve or fix and new features to implement.

Here's our wishlist:

  • Allow storing bootsplash image in system partition (instead of file partition as it is now)
  • Support bootsplash image to be stored in exFAT formatted file partitions
  • Animated GIF bootsplash support
  • Bring hardware accelerated H.264 video codecs to WEC2013 (not just WEC7)
  • Improve Gigabit network performance
  • Create a solid solution for multi-display touch
  • Reduce power consumption and enable super low power modes (DVFS/suspend)

As always; if you have anything you want us to add to the list or you want us to prioritize an item on the list: contact us and we'll make it happen.

In case you did not see it yet, the video below highlights some of the features of our previous BSP release. We'll create a new video highlighting the new release features (like bootsplash and multi-monitor) soon.

Don't believe the hype? Try it yourself!

We've got free downloadable evaluation kernels for the Element14 RIoTboard, the Boundary Devices SABRE-Lite, Nitrogen6X and Nitrogen6_VM, the Device Solutions Opal6, the Digi ConnectCore6, the Congatec Conga-QMX6, the Freescale/NXP SDP and now also for the Technologic Systems TS-4900 and the Toradex Colibri.

GuruCE website: https://guruce.com
iMX6 landing page: https://guruce.com/imx6
Latest iMX6 BSP release: https://guruce.com/imx6/latest

Meet us at the NXP FTF 2016 TECHNOLOGY FORUM from 16 to 19 May 2016, in Austin, Texas.

New GuruCE iMX6 BSP release 550 adds support for Freescale SABRE Smart Device Platform (SDP)

GuruCE Logo

To celebrate GuruCE becoming an official Freescale Proven Partner we added support for the Freescale SABRE Platform for Smart Devices Reference Design (DualLite & Quad) to our iMX6 BSP.

Free downloadable WEC7 and WEC2013 evaluation kernels for the Freescale SDP-DL and SDP-Q, as well as a myriad of other supported boards can be found here.

Some highlights of release 550:

  • Support for the Freescale SDP-DL and SDP-Q
  • Support for the new Boundary Devices Nitrogen6_VM
  • Further cache optimizations to improve real-time performance
  • Full support for Qt 5.5 on WEC7 and WEC2013
  • Better RS485 support
  • Added temperature monitor driver
  • Improved performance of FTP server code
  • Many more improvements, see the Release Notes for all the details

Download our demo kernel images now and see for yourself why no other iMX6 BSP on the market today can compete with the quality, performance and stability of the GuruCE iMX6 BSP!

It’s Time For Windows 10 IoT

This is a guest blog post by Ken Marlin

Windows 10 is coming! Quickly in fact. It’ll be here July 29th, 2015 and that leaves very little time to get ready. You may have seen an article or two on the 6 versions of Windows 10 but I’m going to cover all 10 editions. In the past 8 months, I’ve attended a ton trainings on Windows 10 and visited the Redmond Campus 6 times. Microsoft has been upfront about Windows 10 and they have provided information on a monthly basis, but the time has come – it’s here and it “IS” the O/S you will want moving forward!


10 VERSIONS OF WINDOWS 10

The news recently covered 6 or 7 versions of Windows 10 but most articles were leaving out the embedded (now called IoT) family of products. If you include the OEM Embedded versions, you jump to the wonderful count of 10 different flavors of Windows 10. See the Full list below.

Windows 10 Home – Non Domain for Home Users focused on Consumers

Windows 10 Pro – Domain connected for Business and Expert users.

Windows 10 Enterprise – A Volume upgraded edition that adds Corporate Security and other Features

Windows 10 Education – A Volume edition via Academic licensing for Schools/Faculty/Students

Windows 10 Mobile – Avail Direct Only for Smartphones and Small Tablets (Win Phone Replacement)

Windows 10 Mobile Enterprise – Volume Upgrade adds Enterprise Security/Features to Mobile Devices

Note Microsoft has renamed “Embedded” to “IoT” for Internet Of Things. Here are the new Embedded flavors of Windows now named using the “IoT” tag.

Windows 10 IoT Enterprise – Embedded Industry Edition with Embedded Lockdown Features

Windows 10 IoT Mobile – Embedded Direct Only option for Smartphones/Small Tablets

Windows 10 IoT Core – Free of Charge for small x86 and ARM devices – no Shell provided.

.Net Micro Framework – Free and Open Source with support for very low-end ARM devices.


THE PRICE

Free! Well not for every version and for a limited time but let me explain: Consumer and OEM System Builder versions will be a free “Upgrade” from Windows 7 and Windows 8.1 editions where you have a legal license.

What about the Embedded (IoT) family of Windows 7 and Windows 8.1 products – do they qualify for the upgrade? It depends. The FES family known as the For Embedded Systems products because they are 100% bit for bit identical to the full Windows products, will be eligible for the free upgrade. As long as those FES devices are connected to the internet and have Windows Updates enabled, they will get the free upgrade notification allowing them to be upgraded for free to Windows 10 Pro. However the WES and POS/Industry family would not qualify for this limited time free upgrade.

What about the Enterprise Volume license space for Win7 and Win 8.1? At this time the answer is no. Many customers who use the Enterprise Volume license typically have Software Assurance and if you have activate SA then you would in fact be getting the rights to Windows 10 Enterprise but only if your SA is active.


ELEVATOR PITCH – What’s it get me if I upgrade?

Most importantly it gets you a familiar user experience that your users will already be comfortable in using. Secondly it gets you the ability to run not only all your Win32/Win7/Win8 applications but it also adds a new Universal Application platform that allows the Apps written to work on all Windows 10 devices across device sizes including Xbox One, Windows Phone, Tablets, Desktops and even the new Surface Hub – 80” Display. It has improved security with the new “Hello” biometrics and face recognition capability as well as new DirectX12 graphic performance enhancements. They’ve also added a new Modern Browser called “Edge” that will compete with top Browsers on the market while keeping the IE11 version for backwards compatibility. Lastly, for a period of one year the product is free for consumer home use so I suggest you download it today or reserve you free copy via Windows Update.


EMBEDDED IoT OEM’s – What’s in it for me?

To start with a very simplified roadmap and a product family that has a unified toolset which gets you the ability to write applications once then run them across the entire Windows 10 family of devices. If you are building a small x86 or Arm device with low specifications you can use the Windows 10 IoT for Core devices which is now a free license. If you are building a device that requires more horsepower and would already have the Windows shell then you have the simplified choice of Windows 10 IoT for Enterprise/Industry devices. One part number and family to work with and one toolkit to work with.


HOW TO GET IT TODAY

Signup for the Tech Preview and look within your MSDN Subscription as the latest build is available via the MSDN download site. Lastly, watch for the Windows 10 reserve your copy balloon notification if you have a Windows 7 Pro/Ult or Windows 8.1 Pro system with the latest updates. It arrives July 29th. Get the Preview today from here: http://windows.microsoft.com/en-us/windows/preview-iso


THE EMBEDDED IOT CONCERN

If you built your OEM appliance using the For Embedded System versions of Windows 7 Pro/Ult or Windows 8.1 Pro and the device is connected to the internet with updates enabled you need to beware that the Windows 10 Free upgrade notifications have officially started. It means your device could very well be displaying a notification to users to reserve the Windows 10 upgrade which will go live July 29th. Most OEMs probably do not want this notification to be displayed on their appliance nor would they want the end-user to upgrade the device to Windows 10 because the application would not have been tested on Windows 10 and could break the appliance.

The latest information provided to our Embedded OEMs help set a registry key that will block any O/S upgrades. You can use group policy (which sets a registry key) or you can use the key directly. The group policy already exists on any PC which installed these KBs: Windows 7 SP1 – KB3050265 or Windows 8.1 Update – KB3050267.

Customers or OEMs should look for the Group Policy at this path:

Computer Configuration / Administrative Templates / Windows Components / Windows Update

It is called “Turn off the upgrade” to the latest version of Windows through Windows Update. If the group policy is set, then an OS Upgrade will never be detected, downloaded, or installed on that PC. The OS Upgrade applicability will look at the Policy registry key that’s set when you enable that policy:

HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate

DWORD: DisableOSUpgrade == 1 when that policy is set

These two KB articles will be updated with the following note:

https://support.microsoft.com/en-us/kb/3050265

https://support.microsoft.com/en-us/kb/3050267

IMPORTANT:

This update also installs a new group policy that allows you to block upgrades to the latest version of Windows through Windows Update. Computers with this policy applied will never detect, download or install an upgrade to the latest version of Windows.

Policy Path: Computer Configuration / Administrative Templates / Windows Components / Windows Update

Policy setting: Turn off the upgrade to the latest version of Windows through Windows Update (enabled, disabled)


IOT ACTIVATION

Embedded OEMs love WES7 because it had by-pass activation built into the product. If you have a device that you did not want to connect to the internet then WES7 was a great choice. Flash forward to Windows 10 and now with the Windows 10 IoT Enterprise edition you will receive a single PID/Key and your device will run without any activation notifications as long as it is not connected to the internet. If you do connect it to the internet then it will attempt to activate and will do so in the background without Windows 10 IoTany notifications. It’s a quiet type method of activation.


SINGLE TOOLKIT FOR ALL EDITIONS – WICD

Windows Image Configuration Designer – pronounced “Wicked” is the new tool that has been heavily simplified and covers all editions. Download it today and start practicing with the new tool.

I’ll close by suggesting again that you go download the latest Tech Preview and start testing. I’ve been running the Tech Preview since last November and it is proving to be the edition where Microsoft listened to the users and developers. It’s the edition to move your projects toward.


NINJA CAT

The Ninja Cat meme has been embraced by Windows Insiders everywhere as well as Microsoft. To learn more and download a copy of a Ninja Cat image for your device check out this article.



About the Author
Based in Phoenix, Ariz., Ken Marlin is a Microsoft MVP and Microsoft Champion at Avnet Embedded. He has over 25 years of Microsoft experience supporting all Microsoft products and programs with specialties in Microsoft OEM Embedded appliances as well as OEM System Builder and Volume programs. Ken is very passionate about technology in general and is also a Game Master for the annual Avnet Tech Games Competition. He is a first time contributor to the GuruCE blog. More about Ken here.

GuruCE and Boundary Devices announce official partnership

Boundary Devices LogoGuruCE Logo


PRESS RELEASE:
Chandler AZ, USA, and Ohiwa, New Zealand, 27 July 2015

Boundary Devices, a leading global supplier of ARM-based single board computers and System-on-Modules for the general embedded market, and GuruCE, well-known manufacturer of high quality Microsoft Windows Embedded Compact BSPs, today announced their official partnership.

GuruCE fully supports Boundary Devices' iMX6 based single board computers and SOMs in their very popular iMX6 BSP for Windows Embedded Compact 7 and 2013.

“GuruCE has put together an impressive CE7 and CE2013 BSP for i.MX6. The performance enhancements, features, and stability are ideal for embedded customers who are looking to use Windows Embedded Compact in their product. The GuruCE team has demonstrated a high-level of expertise with Windows Embedded Compact and is a great software partner that we highly recommend”

Pejman Kalkhoran, Partner at Boundary Devices.

“Boundary Devices popular and high quality SBCs and SOMs are a valuable addition to our GuruCE iMX6 BSP range of supported boards”

Michel Verhagen, CEO of GuruCE.

About GuruCE
GuruCE offers deep technical knowledge of Windows Embedded Operating Systems. The consultants of GuruCE are among the best in Windows Embedded BSP & driver development, training and consulting. They help customers overcome the steep learning curve and greatly reduce the time-to-market for their products. GuruCE operates as an umbrella for the top 5% of talented Windows Embedded consultants and employs local experts in Europe (Netherlands), USA and New Zealand. For more information please visit https://guruce.com

About Boundary Devices
Boundary Devices is a leading global supplier of ARM-based single board computers and System-on-Modules for the general embedded market. Founded in 2003 and headquartered in Chandler, AZ, Boundary Devices is a Freescale Proven Partner and have completed numerous successful projects with the I.MX family of processors. All boards are manufactured in the USA by specialists service providers in accordance with modern quality standards. All hardware is designed and tested in our Chandler, AZ facility. Software is always a barrier in embedded designs. With a significant amount of software partners as well as high-level internal expertise, Boundary Devices is well-positioned to provide the right software solution for your embedded design. For more information visit http://boundarydevices.com/

Old rev 1.0 iMX6 CPUs not supported

We've received reports of problems with our demo kernels on boards with a rev 1.0 iMX6 CPU. If you encounter problems, please first check the CPU revision of the iMX6 on your board.

You can do this by breaking into the bootloader menu, type 'B' to get to the bootloader shell, then type 'i' followed by ENTER and check the number after 'Revision'. If this number is smaller than 1.1 you will not be able to successfully run our demo kernels on your board. Press 'x' or 'q' followed by ENTER to exit the bootloader shell.

The reason we do not support revision 1.0 iMX6 CPUs is simply because we do not have any board with a rev 1.0 CPU on-board, and thus have not been able to test our BSP with rev 1.0 CPUs. If you have an old board and want us to add support for rev 1.0 CPUs, please contact us.

------------------
System Information
------------------
Processor                          = iMX6 Quad (4 cores)
Speed grade                        = 996 MHz
Temperature grade                  = Automotive -40 to 125C
Revision                           = 1.2
Silicon revision                   = 1.0
SOC version                        = 1.0
Fuse MAC                           = 00:00:00:00:00:00
USB VID/PID                        = 0000/0000
GP1                                = 0x00000000
GP2                                = 0x00000000
64 bit UID                         = XXXXXXXXXXXXXXXXX
256 bit SRK                        = 0000000000000000000000000000000000000000000000000000000000000000
SRC Reset Status Register          = 0x00000001

GuruCE iMX6 BSP video

We've just uploaded a little video showcasing our latest BSP release, have a look:

Major new release of the GuruCE iMX6 BSP!

iMX6
We have just released the latest version of our iMX6 BSP!

We made some major improvements in performance and have added quite a lot of functionality.

The highlights:

  • 4.75x faster than our previous release
  • This is >6x (!) faster than our competitor's BSP...

  • Added full HDMI support, including display auto-detection, hot-plug and dynamic resolution changes in CE
  • This means you can plug in a 1360x768 monitor and have the CE desktop shown in that resolution, then unplug the monitor and plug in a 1920x1080 monitor and CE will dynamically change resolution and show the desktop in 1920x1080 resolution, all this of course without the purple line on the left (a long standing problem in all the other iMX6 BSPs available).

  • HDMI, LVDS and LCD display output is now configurable in the bootloader
  • This means we have one kernel image for all. Just go into the bootloader menu and select which display you are using at which resolution and launch the kernel. Simple as that!

  • Added support for DMA on all UARTs
  • Full RX & TX DMA support on UART1, 2, 3, 4 and 5.

  • Upgraded to the latest Vivante GPU GALCORE driver v5.0.11 (25762)
  • And we added all the tutorials and test code as well. Together with the amazing performance increase of this release you can now enjoy 110+ fps in full screen 1920x1080 (and 350+ fps windowed) for OpenGL-ES 1.1/2.0! The OpenVG spinning tiger sample is now so fast you only see a blur, and we fully support OpenCL on Dual and Quad of course.

  • Now asynchronously loading drivers for faster boot
  • Added free downloadable demo kernel for Congatec-QMX6 (Dual/Quad, 1 GB module) on a QKIT-ARM
  • Maximum CPU temperature at rest: 45°C / 113°F
  • Maximum CPU temperature while running OpenGL-ES 2.0 reflecting ball: 65°C / 149°F
  • This is not nearly as low as we would like, but it's a lot better already. Our next release will focus on power-consumption and heat generation reductions.

  • Improved network performance
  • The performance improvements also make Ethernet throughput a lot better. We're only halfway to reaching the theoretical maximum possible on the iMX6 of ~45 MByte/s (it's on our list of things to fix), but at least Ethernet speeds are out of the KByte range now (tested using NETIO on WEC7 & WEC2013):

    NETIO - Network Throughput Benchmark, Version 1.32
    (C) 1997-2012 Kai Uwe Rommel

    TCP connection established.
    Packet size 1k bytes: 19.11 MByte/s Tx, 19.22 MByte/s Rx.
    Packet size 2k bytes: 21.22 MByte/s Tx, 20.38 MByte/s Rx.
    Packet size 4k bytes: 22.44 MByte/s Tx, 20.85 MByte/s Rx.
    Packet size 8k bytes: 23.06 MByte/s Tx, 22.43 MByte/s Rx.
    Packet size 16k bytes: 20.67 MByte/s Tx, 19.38 MByte/s Rx.
    Packet size 32k bytes: 20.79 MByte/s Tx, 20.58 MByte/s Rx.
    Done.

    UDP connection established.
    Packet size 1k bytes: 13.84 MByte/s (0%) Tx, 13.76 MByte/s (0%) Rx.
    Packet size 2k bytes: 15.97 MByte/s (0%) Tx, 15.97 MByte/s (0%) Rx.
    Packet size 4k bytes: 20.25 MByte/s (0%) Tx, 19.83 MByte/s (0%) Rx.
    Packet size 8k bytes: 22.39 MByte/s (0%) Tx, 22.49 MByte/s (0%) Rx.
    Packet size 16k bytes: 19.34 MByte/s (0%) Tx, 17.95 MByte/s (0%) Rx.
    Packet size 32k bytes: 21.78 MByte/s (0%) Tx, 21.17 MByte/s (0%) Rx.
    Done.

Full details in the release notes.

Don't believe the hype? Try it yourself!

We've got free downloadable demo kernels for the RIoTboard, the SABRE-Lite, the Nitrogen6X, the Opal6, the ConnectCore6 and now also the Conga-QMX6.

Error while compiling a native application

If you have installed an SDK generated from a WEC2013 OS Design built on a system that has the April 2015 update installed, you will most probably encounter this error when trying to compile a native code project targeting the SDK:

Microsoft.CppCommon.targets(242,5): error MSB6006: "CL.exe" exited with code -1073741515.

Further analysis shows that -1073741515 in unsigned hex is 0xC0000135 and that value is defined as error STATUS_DLL_NOT_FOUND in Windows:

#define STATUS_DLL_NOT_FOUND             ((NTSTATUS)0xC0000135L)    // winnt

So, something is missing a DLL somewhere...

A compare with an SDK installation generated prior to the installation of the April 2015 WEC update showed that the folder C:\Program Files (x86)\Windows CE Tools\SDKs\[SDK Name]\Sdk\Bin\i386\Arm was missing the file mspdb110.dll. Copying this file manually to the aforementioned folder fixes the problem and you can successfully build the project again.

If you are still getting errors (like for instance "Fatal Error C1902") after having copied mspdb110.dll, then copy all files from the folder "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE" to the SDK's i386\Arm folder as per above instructions.

This seems to be a problem with the SDK roller introduced in the April 2015 WEC2013 update.

Microsoft is aware of the bug and will most likely fix this issue in the next update of WEC2013.

GuruCE iMX6 BSP now supporting Boundary Devices Nitrogen6X board!

iMX6
Our new iMX6 BSP release (r406) now adds initial support for the Boundary Devices Nitrogen6X SBC!

We also did some work on the bootloader (now you can disable the watchdog in the CE kernel from the bootloader, you can test memory and you can inspect some technical info about image defines, clock gates & frequencies and the iMX6 itself). The problem we had with Ethernet on some Sabre-Lite boards has been fixed and UART DMA is now working properly as well, as is ILTiming. While we were at it, we also slightly improved the real-time performance of the kernel and we fixed some dependencies in the catalog.

All in all another great release from the experts at GuruCE! Go ahead and download a WEC7 or WEC2013 evaluation kernel for one of the many supported off-the-shelf development kits and SBCs.

GuruCE and Lauterbach announce their official partnership

Lauterbach LogoGuruCE Logo

PRESS RELEASE:
Hoehenkirchen-Siegertsbrunn, Germany, and Ohiwa, New Zealand, June 2015

Lauterbach, leading manufacturer of microprocessor development tools, and GuruCE, well-known manufacturer of high quality Microsoft Windows Embedded Compact BSPs, announced a deepening of their relationship in the form of an official partnership between GuruCE and Lauterbach. The experts at GuruCE and Lauterbach already have a long working relationship that is now brought to an even higher level of cooperation.

Lauterbach's debugging expertise combined with GuruCE's Windows Embedded expertise has been critical in creating a highly reliable and extremely well performing iMX6 BSP for Windows Embedded Compact 7 and 2013.

GuruCE now ships easy-to-use Lauterbach JTAG scripts with their iMX6 BSP so that GuruCE's customers can, if needed, dive deep with the help of the best JTAG solutions for Windows Embedded Compact by Lauterbach.

“We at Lauterbach very much enjoy the cooperation with GuruCE. Close contacts between the developers and managers of both companies ensure a fast time-to-market of new solutions, as well as a rapid response to customer support issues”, said Rudi Dienstbeck at Lauterbach.

“The expertise of Lauterbach has been invaluable in tracking down some very complex issues with L1 and L2 cache coherency in the multi-core iMX6 processors. Without the excellent support & tools of Lauterbach it would have taken us much longer to create a fully multi-core cache-coherent BSP for the iMX6”, said Michel Verhagen at GuruCE.

About GuruCE
GuruCE offers deep technical knowledge of Windows Embedded Operating Systems. The consultants of GuruCE are among the best in Windows Embedded BSP & driver development, training and consulting. They help customers overcome the steep learning curve and greatly reduce the time-to-market for their products. GuruCE operates as an umbrella for the top 5% of talented Windows Embedded consultants. Most of the experts working with us are Microsoft MVPs. GuruCE employs local experts in Europe (Netherlands), USA and New Zealand. For more information please visit https://guruce.com

About LAUTERBACH
Lauterbach is the leading manufacturer of complete, modular and upgradeable microprocessor development tools worldwide with experience in the field of embedded designs since 1979. It is an international, well-established company with blue chip customers in every corner of the globe and has a close working relationship with all semiconductor manufacturers. At the headquarters in Höhenkirchen, near Munich, the engineering team develops and produces highly proficient and specialized Development Tools, which are utilized all over the world under the brand TRACE32®. Own branch offices exists in United Kingdom, Italy, France, Tunisia, on the East and West coasts of the United States, Japan and China. Highly qualified sales and support engineers are also available in many other countries. For more information visit http://www.lauterbach.com/

iMX6 BSP now supporting PCIe!

We have just released a new version of our iMX6 BSP.

In this release (r363) we have added:

  • PCIe support
  • Digi ConnectCore6 support
  • Device Solutions Opal6 support
  • Many more supported devices like PMIC, touch, displays, etc. and many improvements

Download our demo kernel images now and see for yourself why the GuruCE iMX6 BSP is the best on the market today!

Michel Verhagen 2015 MVP

MVP Logo
Michel Verhagen has been honoured with the Microsoft MVP Award again this year!


Congratulations! We are pleased to present you with the 2015 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Windows Embedded technical communities during the past year.

According to my profile this is now the 12th consecutive year but I think that must be at least 13 (2001 or maybe 2002 was the first if I remember correctly). So long time MVP I can't even remember, but: Very happy to be recognized in the field again!

Both Michel Verhagen and Erwin Zwart of GuruCE are Microsoft Embedded Most Valuable Professionals; a recognition of their expertise and community involvement in the field of Windows Embedded Compact.

GuruCE High Quality iMX6 WEC7/2013 BSP supporting iMX6 Solo, Dual Lite, Dual and Quad NOW RELEASED!

iMX6
After working for more than a year on our iMX6 BSP we are finally ready to put our quality stamp on it and release our iMX6 BSP to our customers!

Here are the main benefits of our iMX6 BSP compared to the other iMX6 BSP offerings on the market today:

  • Stability
  • Our initial iMX6 BSP release is all about stability. We have done extensive testing to make sure the entire BSP is stable, in multi-core and single-core configurations, with or without caching, at stress and at rest. We have completely rewritten all of the low-level initialization code, all the timing code (CCM, system & performance counters), all of the cache code, all of the SMP (symmetric multiprocessing/multi-core) code and most of the interrupt handling code.

  • Performance
  • We have implemented all the cache optimizations possible for the iMX6 Cortex-A9 in combination with the PL310 L2 Cache Controller and we have configured DDR3 per board at the most optimal, fully stress tested, settings.
    iMX6 Catalog - BSP Options

  • No more data corruption!
  • We have done extensive testing to make sure there are no more data corruption problems when copying large files (on SATA, USB Storage or USDHC) or when sending large amounts of data over the network.

  • One BSP for all iMX6 variants
  • Our BSP supports the iMX6 Solo, Dual Lite, Dual and Quad processor range, so you can scale your HW design up or down without any software development investment!

  • One BSP supporting WEC7 and WEC2013
  • Full drop-in support for WEC7 and WEC2013. Not a single code change required in the BSP.

  • Super easy BSP configuration
  • Very easy configuration of board, bootloader, CPU, cache and page table BSP options through the catalog (see image on the right).

  • Production Quality Code
  • All hardware definitions name-synchronized with the iMX6 Reference Manuals and IOMUX tool. A large amount of Freescale code re-factored, cleaned up & bug fixed, and all redundant code removed and restructured. No more searching for driver code distributed throughout the BSP in different folders. Now the BSP is easily maintainable, well-structured & production ready. If you have worked with BSPs from Freescale or some of our competitors before you know what this means and why this is so important. Code quality and BSP structure is everything!

  • Full source
  • Including all Cortex-A9 cache routines, SMP, drivers, etc.
    We just don't believe in binary. Luke would never have gotten so far if he had to "use the binary"... ;-)

  • Very easy to add support for your custom board
  • All board specific settings in one folder and board file generator included. All you need to support your custom board is an IOMux design file (created with Freescale's IOMux tool for iMX6) and our board file generator that will create a header file with all your board specific settings.

  • SPI Flash/SD/MMC Bootloader
  • Our iMX6 bootloader offers many more configuration options and features, like selecting the serial debug port to use, blowing fuses, configuring the Ethernet settings to be used in Windows Embedded Compact and starting the kernel with a clean registry hive. It also fully supports booting from SPI Flash, SD and MMC, and has full support for formatting and partitioning SD and MMC and erasing/writing SPI Flash.

  • Full support for LCD8000-97C 1024x768 LVDS + capacitive touch screen
  • The BSP includes full support for this display, including touch driver support.

  • Hive based registry support
  • Destination fully configurable through the catalog. No registry modifications required.
    iMX6 Catalog - Storage

  • GPIO driver + SDK library
  • Control any (free) GPIO pin from your application.

  • FlexCAN driver + SDK library
  • Fully configurable FlexCAN driver. Access and control 2 separate CAN buses from your application with full configuration and timing control. Our High Performance FlexCAN driver for real busy CAN buses is available for iMX6 as well.

  • ECSPI driver + SDK library
  • Fully configurable, DMA enabled, Enhanced Configurable SPI driver. All functionality offered by the iMX6 is supported and configurable in our driver. Unfortunately the iMX6 still contains the same silicon bug as on the iMX53, but at least our driver warns you when you hit this condition.

  • GPT driver
  • Use the General Purpose Timer from within your application. Full control over counters, interrupts, etc.

  • USB Camera driver
  • Configured and ready for iMX6.

  • Memory Access Utility driver, SDK and application
  • For easy debugging and direct hardware access from within CE. Similar functionality as memtool in Linux.

  • SATA
  • Fully functional SATA driver with much faster drive detection algorithm.

  • Complete bootloader independence
  • The low-level kernel initialization code takes care of everything needed by Windows Embedded Compact. It does not depend on any configuration done by the bootloader. This means you can choose whatever bootloader you fancy. You can use our included and feature-rich eboot, or any other bootloader you like better.

  • Fully tested DDR3 setup code
  • Per board DDR3 stress testing done (FSL DDR3 Stress Test Tool) and DDR3 configured with optimal settings.

  • Included JTAG scripts for Lauterbach TRACE32
  • Just in case you need it.

The above is of course on top of the standard functionality:

  • UARTs (5)
  • Audio (SGTL5000)
  • Camera (CMOS)
  • I2C
  • Ethernet
  • USB (Host, Client & OTG)
  • USDHC/SDIO ports (4)
  • Display:
    • Opal6 DevKit
    • HDMI
    • LVDS (including Touch)
    • GPU (HW GFX acceleration)
    • VPU (HW Video acceleration)
    • Silverlight (OpenGL & DDraw)

Supporting various boards:

  • Supporting the Opal6 module and development board by Device Solutions (iMX6 Dual Lite)
  • Supporting the open source RIoTboard design by Element14 (iMX6 Solo)
  • Supporting the conga-QMX6 modules and development boards by Congatec (iMX6 Solo, Dual Lite, Dual and Quad)
  • Supporting the SABRE Lite board by Element14 (iMX6 Quad)
  • Supporting the BD-SL-iMX6 (formerly known as SABRE-Lite) board by Boundary Devices (iMX6 Quad)

Our business model
Our business model is all about delivering a high quality BSP that we fully support and stand behind. We want our customers to be able to get to market quicker, without having to spend an enormous amount of time and money on finding and fixing bugs. We sell & support a high quality, tested BSP and if needed our customers can work with GuruCE to add additional functionality or modify functionality specific to the customers needs.

MVP Logo
Dedicated & responsive support from real experts!
You connect directly to the highest level support engineers that will respond to your query within 48 hours with a high quality answer that will help you, not frustrate you.

Is it perfect?
Perfection is something we strive to achieve, but we will not pretend our BSP is perfect. There's always something to improve or functionality to add. This initial release was completely focused on stability and performance. Our next update will add some functionality (PCIe) and focus mostly on power management.

Below are the things we will work on next, ordered by priority:

  1. PCIe
  2. Develop a flexible, high performance PCIe bus driver and example client driver.

  3. Power Management
  4. Get the cores to the lowest possible power state when in idle to further reduce power dissipation and CPU heat. The first step is to reduce power dissipation in the low power WAIT mode, the next step will be to implement STOP mode, the step after will be to add DVFS support, and the final step will be to make sure the entire system can suspend and resume correctly.

  5. Add support for more boards
  6. Add support for Nitrogen6X, Freescale SDP, Digi CC6, Variscite iMX6 SOMs and possibly more iMX6 boards and modules available from various board and module manufacturers.

  7. Rewrite entire ENET driver
  8. So we fully support NDIS6 and can increase performance.

  9. Rewrite I2C driver
  10. Currently functional, but we would love to add more functionality and create high quality, maintainable code.

  11. Rewrite IPU driver
  12. Currently functional, but we would love to add more functionality so we can support true multi-monitor, dynamic resolution, dynamic switching of output, etc.

The above list and order can change depending on customer requests.

Freescale iMX53 and iMX6 ECSPI silicon bug

Update: We have repeated our tests on iMX6 and unfortunately the same silicon bug is also present on the iMX6, so everything you read here can be applied to the iMX6 as well...

We recently did a full rewrite of the Freescale ECSPI driver for our Opal i.MX53 BSP (now fully supporting all ECSPI features; master/slave mode, DMA, etc) and during testing we discovered a rather big problem with the ECSPI module inside the i.MX53...

For future reference and to prevent others from having to go through the same time-consuming research and analysis we decided to publish our findings through this blog post.

Problem Analysis

The ECSPI module shows unexpected behaviour when the bitcount is set to [(32 * n) + 1], where [n > 0].

As an example, let's walk through sending 1 x 33 bits.

In this case, we have to load the TXIFO with 2 UINT32s. The first UINT32 value contains 1 LSB and the 2nd UINT32 contains the remaining 32 bits.

For this transaction you'd have to configure the ECSPI registers as follows (33 bits, master mode, SS1, DRCTL don't care, loopback enable, no DMA, enable TC interrupt):

CONREG BURSTLENGTH      = 32
CONREG CHANNELSELECT    = 1
CONREG DRCTL            = 0
CONREG PREDIVIDER       = 0
CONREG POSTDIVIDER      = 0
CONREG CHANNELMODE      = 2
CONREG SMC              = 0
CONREG XCH              = 0
CONREG HT               = 0
CONREG EN               = 1

CONFIGREG HTLENGTH      = 0
CONFIGREG SCLKCTL       = 0
CONFIGREG DATACTL       = 0
CONFIGREG SSPOL         = 2
CONFIGREG SSCTL         = 2
CONFIGREG SCLKPOL       = 2
CONFIGREG SCLKPHA       = 0

INTREG TCEN             = 1
INTREG ROEN             = 0
INTREG RFEN             = 0
INTREG RDREN            = 0
INTREG RREN             = 0
INTREG TFEN             = 0
INTREG TDREN            = 0
INTREG TEEN             = 0

DMAREG RXTDEN           = 0
DMAREG RXDMALENGTH      = 0
DMAREG RXDEN            = 0
DMAREG RXTHRESHOLD      = 0
DMAREG TEDEN            = 0
DMAREG TXTHRESHOLD      = 0

STATREG TC              = 0
STATREG RO              = 0
STATREG RF              = 0
STATREG RDR             = 0
STATREG RR              = 0
STATREG TF              = 0
STATREG TDR             = 1
STATREG TE              = 1

PERIODREG CSDCTL        = 0
PERIODREG CSRC          = 0
PERIODREG SAMPLEPERIOD  = 0

TESTREG LBC             = 1
TESTREG RXCNT           = 0
TESTREG TXCNT           = 0

Load the TXFIFO with 2 UINTs as follows:

[0] 0x00000001
[1] 0xAAAAAAAA

The STAT & TEST registers reflect this:

STATREG TC              = 0
STATREG RO              = 0
STATREG RF              = 0
STATREG RDR             = 0
STATREG RR              = 0
STATREG TF              = 0
STATREG TDR             = 0
STATREG TE              = 0

TESTREG LBC             = 1
TESTREG RXCNT           = 0
TESTREG TXCNT           = 2

At this moment start the transfer by setting the XCH bit in the CONREG. This is when strange things start to happen:

CONREG BURSTLENGTH      = 32
CONREG CHANNELSELECT    = 1
CONREG DRCTL            = 0
CONREG PREDIVIDER       = 0
CONREG POSTDIVIDER      = 0
CONREG CHANNELMODE      = 2
CONREG SMC              = 0
CONREG XCH              = 0
CONREG HT               = 0
CONREG EN               = 1

CONFIGREG HTLENGTH      = 0
CONFIGREG SCLKCTL       = 0
CONFIGREG DATACTL       = 0
CONFIGREG SSPOL         = 2
CONFIGREG SSCTL         = 2
CONFIGREG SCLKPOL       = 2
CONFIGREG SCLKPHA       = 0

INTREG TCEN             = 1
INTREG ROEN             = 0
INTREG RFEN             = 0
INTREG RDREN            = 0
INTREG RREN             = 0
INTREG TFEN             = 0
INTREG TDREN            = 0
INTREG TEEN             = 0

DMAREG RXTDEN           = 0
DMAREG RXDMALENGTH      = 0
DMAREG RXDEN            = 0
DMAREG RXTHRESHOLD      = 0
DMAREG TEDEN            = 0
DMAREG TXTHRESHOLD      = 0

STATREG TC              = 1
STATREG RO              = 0
STATREG RF              = 0
STATREG RDR             = 1
STATREG RR              = 1
STATREG TF              = 0
STATREG TDR             = 1
STATREG TE              = 1

PERIODREG CSDCTL        = 0
PERIODREG CSRC          = 0
PERIODREG SAMPLEPERIOD  = 0

TESTREG LBC             = 1
TESTREG RXCNT           = 4
TESTREG TXCNT           = 0

As you can see from the above, the XCH bit is clear (good!), the TC interrupt fired (good!), but the RXFIFO contains not 2, but 4 UINT32s!

At this moment RXFIFO contains:

[0] 0x00000001
[1] 0x00000001
[2] 0x00000001
[3] 0xAAAAAAAA

As you can see, the first UINT32 from the TXFIFO is duplicated twice at the beginning of the RXFIFO.

The situation is slightly different with the 65 bit case. In that case the TC interrupt never fires:

We load the TXFIFO with 65 bits as follows:

[0] 0x00000001
[1] 0xAAAAAAAA
[2] 0x55555555
CONREG BURSTLENGTH      = 64

TESTREG LBC             = 1
TESTREG RXCNT           = 0
TESTREG TXCNT           = 3

All other registers are the same as per above.

Now we start the transfer by setting the XCH bit in the CONREG. This is when more strange things start to happen:

CONREG BURSTLENGTH      = 64
CONREG CHANNELSELECT    = 1
CONREG DRCTL            = 0
CONREG PREDIVIDER       = 0
CONREG POSTDIVIDER      = 0
CONREG CHANNELMODE      = 2
CONREG SMC              = 0
CONREG XCH              = 1
CONREG HT               = 0
CONREG EN               = 1

CONFIGREG HTLENGTH      = 0
CONFIGREG SCLKCTL       = 0
CONFIGREG DATACTL       = 0
CONFIGREG SSPOL         = 2
CONFIGREG SSCTL         = 2
CONFIGREG SCLKPOL       = 2
CONFIGREG SCLKPHA       = 0

INTREG TCEN             = 1
INTREG ROEN             = 0
INTREG RFEN             = 0
INTREG RDREN            = 0
INTREG RREN             = 0
INTREG TFEN             = 0
INTREG TDREN            = 0
INTREG TEEN             = 0

DMAREG RXTDEN           = 0
DMAREG RXDMALENGTH      = 0
DMAREG RXDEN            = 0
DMAREG RXTHRESHOLD      = 0
DMAREG TEDEN            = 0
DMAREG TXTHRESHOLD      = 0

STATREG TC              = 0
STATREG RO              = 0
STATREG RF              = 0
STATREG RDR             = 1
STATREG RR              = 1
STATREG TF              = 0
STATREG TDR             = 1
STATREG TE              = 1

PERIODREG CSDCTL        = 0
PERIODREG CSRC          = 0
PERIODREG SAMPLEPERIOD  = 0

TESTREG LBC             = 1
TESTREG RXCNT           = 5
TESTREG TXCNT           = 0

As you can see from the above, XCH stays set, the TC interrupt never fires and the TESTREG shows there are 5 UINT32s received in the RXFIFO (note that loopback is enabled!).

The contents of the RXFIFO are:

[0] 0x00000001
[1] 0x00000001
[2] 0xAAAAAAAA
[3] 0x00000001
[4] 0x55555555

As you can see, the 1st UINT32 from the TXFIFO is duplicated in the RXFIFO at position 0, 1 and 3.

The behavior is slightly different when doing the same but with SSCTL set to 0, but it's still not doing the right thing.

When doing a transfer of 33 bits with SSCTL set to 0, only 32 bits are sent:

Load TXFIFO with:

[0] 0x00000001
[1] 0xAAAAAAAA

Set XCH, wait for TC, result:

TXFIFO still contains:

[0] 0xAAAAAAAA

RXFIFO contains:

[0] 0x00000001
[1] 0x00000001

Note that SSCTL=0 works correct for bitcounts that are not [(32*n)+1] where [n>0].

Here are the scope captures of 32, 33, 34 and 35 bits, showing the i.MX53's bad behavior when transferring 33 bits:


yellow = chip select
blue = clock
purple = data

Freescale's response

We of course asked Freescale to verify this bug and they have. This is their response:

We are able to reproduce it. Unfortunately, there's no workaround for this error.

Other i.MX CPUs affected by this silicon bug?

We have verified the i.MX25 is NOT affected by this bug (but the i.MX25 contains an older version of the SPI block).
We have not been able to try our tests on the i.MX6 yet, but since the i.MX6 contains the exact same ECSPI block as the i.MX53, we suspect this issue will also be present on the i.MX6 series CPUs.
The issue is also present on the iMX6.

We have asked Freescale to update the errata sheets for the affected processor(s), but so far the erratas are silent about this issue.

More ECSPI silicon bugs?

Unfortunately; yes. Also the RX DMA TAIL mechanism (allowing non 32-word aligned DMA transfers to complete) does not work correctly. Here is the official response from Freescale:

We have confirmed this with the SDMA script owner. The script does not support the 32bytes unaligned DMA transfer.
This is a documentation bug. This will be corrected on documentation on next release.

Interesting way to solve silicon bugs... ;)

Conclusion

The ECSPI module inside the iMX53 CAN NOT BE USED for SPI transfers on 32 bit edges + 1.

When BURSTLENGTH is set to [(32 * n) + 1], the following happens:

For n = 0 (bitcount 1): All works fine!
For n = 1 (bitcount 33): TC interrupt fires, XCH bit clears, but more data than expected in RXFIFO (first UINT32 from TXFIFO duplicated).
For n > 1 (bitcount 65, 97, 129, etc): TC interrupt DOES NOT fire, XCH bit stays set, and also more data than expected in RXFIFO (first UINT32 from TXFIFO duplicated).

GuruCE to release a High Quality iMX6 BSP supporting iMX6 Solo, Dual Lite, Dual and Quad

iMX6
GuruCE has been working on a high quality iMX6 BSP for WEC2013 since the beginning of 2014, and will be releasing this BSP early 2015.

Microsoft has just released a SAMPLE BSP for iMX6 through Update 11 for WEC2013, so why would you wait for the GuruCE iMX6 BSP? Here are some compelling reasons:

  • One BSP for all iMX6 variants
  • Our BSP supports the iMX6 Solo, Dual Lite, Dual and Quad processor range, so you can scale your HW design up or down without any software development investment!
    We are contemplating to add support for iMX6 Solo Lite as well. Please let us know if you are interested in having this!

  • Production Quality Code
  • All hardware definitions name-synchronized with the iMX6 Reference Manuals and IOMUX tool. Almost all Freescale code re-factored, cleaned up, bug fixed, redundant code removed and restructured. Now the BSP is easily maintainable, well-structured & production ready. If you have worked with BSPs from Freescale or some of our competitors before you know what this means and why this is so important. Code quality and BSP structure is everything!

  • Full source
  • Including DVFS, GPC, Cache routines, SMP, PCIE and PMU code.
    We just don't believe in binary. Luke would never have gotten so far if he had to "use the binary"...

  • Very easy to add support for your custom board
  • All board specific settings in one folder and board file generator included. All you need to support your custom board is an IOMux design file (created with Freescale's IOMux tool for iMX6) and our board file generator that will create a header file with all your board specific settings.

  • Lots of added functionality and fixes:
  • Opal6 Module

    • GPIO driver + SDK library
    • Control any (free) GPIO pin from your application.

    • FlexCAN driver + SDK library
    • Fully configurable FlexCAN driver. Access and control 2 separate CAN buses from your application with full configuration and timing control. Our High Performance FlexCAN driver for real busy CAN buses is available for iMX6 as well.

    • ECSPI driver + SDK library
    • Fully configurable, DMA enabled, Enhanced Configurable SPI driver. All functionality offered by the iMX6 is supported and configurable in our driver.

    • GPT driver
    • Use any GPT from within your application. Full control over counters, interrupts, etc.

    • USB Camera driver
    • Configured and ready for iMX6.

    • Memory Access Utility driver, SDK and application
    • For easy debugging and direct hardware access from within CE. Similar to memtool in Linux.

    • Full SD & eMMC support
    • Including formatting and partitioning in the bootloader.

    • Complete bootloader independence
    • This means you can choose whatever bootloader you fancy. We support eboot out-of-the-box.

    • Power optimizations
    • The BSP and bootloader are both optimized for power. No unnecessary open clock gates, full control of CCM (completely rewritten code), DVFS support, etc.

    • Fully tested DDR3 setup code
    • Per board DDR3 stress testing done (FSL DDR3 Stress Test Tool) and DDR3 configured with optimal settings.

    • Organized catalog and added many configuration settings to catalog
    • Click and forget configuration of your OS Design! Configuration options in catalog: CPU type, RAM size, Cache options, ARM errata options.

    • Serial Debug UART selection in bootloader
    • No more unnecessary recompiling of the entire kernel, just to change or disable the debug output serial port.

    • Included JTAG scripts for Lauterbach TRACE32
    • Just in case you need it.

    Opal6 DevKit

  • The above is of course on top of the standard functionality:
    • Audio (SGTL5000)
    • Camera (CMOS)
    • I2C
    • Ethernet
    • PCIe
    • UARTs (5)
    • USB (Host, Client & OTG)
    • USDHC/SDIO ports (4)
    • Display:
      • HDMI
      • LVDS (including Touch)
      • GPU (HW acceleration)
      • VPU (Video acceleration)
      • Silverlight (OpenGL & DDraw)

  • Supporting the Opal6 module and development board by Device Solutions (iMX6 Dual Lite)
  • Supporting the open source RIoTboard design by Element14 (iMX6 Solo)
  • Supporting the conga-QMX6 modules and development boards by Congatec (iMX6 Solo, Dual Lite, Dual and Quad)
  • Supporting the SABRE Lite board by Element14 (iMX6 Quad)
  • Supporting the BD-SL-iMX6 (formerly known as SABRE-Lite) board by Boundary Devices (iMX6 Quad)
  • Supporting the Sabre-SDP board by Freescale (iMX6 Dual Lite and Quad)
  • And last but certainly not least:
    MVP Logo

  • Dedicated & responsive support from real experts!
  • You connect directly to the highest level support engineers.

Pages

Subscribe to RSS - Michel's blog