Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hello,
Since about 2017 we have about 1200 devices running with :
C_SDK version 1.3.2
ThingWorx plataform: 8.2.1
On the device side:
STM32F429 with FREERTOS and communication via cellular network (3G and 4G)
We're currently looking to upgrade to version 9.X for the platform. Consequently, we will also have to migrate the C SDK to version 3.1.1 (the latest).
For memory constraints and reduced computing power of our microcontroller we will not use the different features of the sdk.
USE_OPENSSL OFF
ENABLE_WOLF_SSL OFF (coming soon)
ENABLE_TUNNELING OFF
ENABLE_FILE_XFER OFF
ENABLE_OFFLINE_MSG_STORE_RAM OFF
ENABLE_OFFLINE_MSG_STORE_FILE OFF
We use Lists instead Maps in (twDict.c)
#define TW_DICTIONARY_MODE TW_DICTIONARY_LIST
Our thing connects correctly to the server, binding is performed correctly, properties are sent correctly to the server using :
twApi_AddPropertyToList(proplist, “property1”...
twApi_AddPropertyToList(proplist, “property2”...
twApi_PushProperties(TW_THING, thingName, proplist, -1, FALSE);
But when we try to send properties using :
twApi_SetSubscribedPropertyVTQ(thingName, “xxxx”, value, locaTimestampMiliSeconds, “GOOD”, FALSE, FALSE);
twApi_PushSubscribedProperties(thingName, FALSE);
We get a “Hard fault” error.
Following our tests, this problem appears to be due to memory corruption when retrieving the characteristics linked to the property in the function :
int twSubscribedPropsMgr_PushTypeFromProperty...
jasonFragment = cJSON_GetObjectItem(def->aspects, “pushType”);
following function call:
twDict_Find(tw_api->callbackList, &cbInfoQuery, &cbMatching))
To compare the operation with a different equipment (Linux), we run the example “SteamThing” on a Raspberry pi 4. Everything is OK when using the option:
#define TW_DICTIONARY_MODE TW_DICTIONARY_MAP
In file twDict.c
But when we change TW_DICTIONARY_MODE to TW_DICTIONARY_LIST, We get a “Segmentation fault” error:
Do you have any idea what could be causing this problem?
We wonder if there's a problem somewhere in the list management (list.c file).
Thanks in advance for your help.
Solved! Go to Solution.
Hello,
The problem has been identified and corrected:
My solution (right or wrong?.... but it works)
Before Now
consequently the variable "listEntry" in "struct twList_FindForEachHandlerParams" isn't necessary
Hello,
The problem has been identified and corrected:
My solution (right or wrong?.... but it works)
Before Now
consequently the variable "listEntry" in "struct twList_FindForEachHandlerParams" isn't necessary