Reading incorrect ADC values after upgrading CeLib


i have updated our project to use the latest version of the ce libraries.
We’re using the celib to read voltages from ADC, but the values are not correct with the exact same code than before.

Apalis iMX6Q 1GB V1.1B
Custom Carrier Board
Custom WEC2013 OS, BSP 1.7

This is the code to setup ADC:

	g_AdcBatBackupHandle = Adc_Init(L"ADC1");
	g_Adc36VHandle = Adc_Init(L"ADC3");

	Adc_SetConfigInt(g_AdcBatBackupHandle, L"BitResolution", 12, ParamStorageType::StoreVolatile);
	Adc_SetConfigInt(g_AdcBatBackupHandle, L"AvgSamples", 8, ParamStorageType::StoreVolatile);

	Adc_SetConfigInt(g_Adc36VHandle, L"BitResolution", 12, ParamStorageType::StoreVolatile);
	Adc_SetConfigInt(g_Adc36VHandle, L"AvgSamples", 8, ParamStorageType::StoreVolatile);

Below is a screenshot, left side is with old celibs, right side with the new one.

Another minor issue: The new BSP 1.7 seems to report it’s version as 1.6.
We’re reading the version with
Sys_GetConfigInt(handle, L"BspVersion", &dwVersion)

The only difference in ADC code between 2.3 and 2.5 is added ““SavePower”” . When enabled (set to1) it Turn ADC power off in Adc_Deinit(). It should be disabled by default but you can force it off by using
Adc_SetConfigInt(hHandle, L"SavePower", 0 , ParamStorageType::StoreToRegistry)

I did some more testing with a simple test program.
AdcTest.7z (3.8 MB)

The problem seems to happen with the release version of celibs.


Another thing which if find strange is that when I link against debug/release dll and use at runtime the “wrong” dll something is wrong.

The combination we’re using is liniking and using the release dll:
toradexcelibraries_2.5-20210803\libs\dll\Toradex_CE800 (ARMV7)Release\TdxAllLibrariesDll.lib
toradexcelibraries_2.5-20210803\libs\dll\Toradex_CE800 (ARMV7)Release\TdxAllLibrariesDll.dll

Any news on this topic?

To summarize the many images in my previous post:

Release version, DLL: Wrong values
Debug version, DLL: Correct values
Release version, static libs: Wrong values
Debug version, DLL: Correct values

When using the release version we get the same constant value for ADC1 and ADC3.
When linking against TdxAllLibrariesDll.dll we can simply replace the dll between restarts of the test application to see this.

Yes, I can confirm a problem with release version of 2.5 libs. We are investigating this issue. Can you use the 2.4 version for now?

yes, we can use the older libs without problems.