Touch calibration with VF50

Hi,

On our instrument we do not have a persistent registry. Nevertheless I have to calibrate our touch screen.

The touch screen calibration values are saved into a file and loaded during startup into the registry. For other processors like T20 I can send an event TouchSettingsChanged to inform the driver to reload the registry settings (https://developer.toradex.com/knowledge-base/resistive-touch-screen). But according to this article this event is not supported for Vybrid modules.

What do I have to change in the registry in terms of order or anything else to make it possible that I can load these settings before the touch driver is loaded?

Thanks.

Dear @andreas

There are multiple ways to accomplish your goal:

Save the registry

If you flush the registry after writing the calibration data once, it will be available for all future reboots.

Write a driver

You can write a driver DLL which enters the information into the registry. Once the driver is created, you can assure that it is loaded before the touch driver using the Order=xx settings in the registry.
This does not work with an ordinary executable application.

Using a regular application

The calibration data is read from within gwes.dll. If you write a regular application, you need to follow some rules in order to guarantee that your application is executed before gwes.dll:

Let’s start with the registry entries:

[HKLM\Init]
Launch25 = "myApp.exe"
Depend25 = binary 0x14 0x00  ; run Launch25 (myApp.exe) after Launch20 (device.dll)
Depend30 = binary 0x19 0x00  ; run Launch30 (gwes.dll) after Launch25 (myApp.exe)

Your application will receive the LaunchXX number as a parameter. Once you have written the registry values, you must signal this to the system in order to continue the launching of the next application.
This is done using the SignalStarted() API. Approximately as follows:

SignalStarted(_wtol(lpszArg));

Best Regards
Andy

Hi Andy,

Thanks for your reply. I’m still trying to implement it as a driver because then I don’t need an extra executable to be loaded. However I can’t open my touchCalibration file on my SD card.

Do you know what minimal loading order number I have to set for the driver to have access to the SD Card? The name of the SD Card should be “Storage Card”, right?

What is loaded first, the drivers defined with an order number or the ones defined with “LaunchXX”?

Thanks.

Drivers with no number are loaded after those that have a valid order configured.
“LaunchXX” keys are for applications or OS components (like device manager or gwes), in this case the loader checks dependencies and run the exes that have no dependencies first, then waits until SignalStarted is called by one of them and check if that satisfied dependency allows other processes to be started.
May I ask why you don’t just save registry? It’s supported by the BSP and would be the simplest solution.
You need to load configuration from SD? Not using internal flash?

Hi,

I finally managed to load the touch calibration from the FlashDisk. We don’t use the registry because we have a centralised place where we store all persistent data from the whole instrument.

Thanks for your support.