Showing results for 
Search instead for 
Did you mean: 

MLC Configuration with Standard C Drivers

Associate II

I have some questions regarding loading machine learning core configurations, specifically onto the lsm6dsox chip but it should be the same across devices.

I have generated .ucf and .h files. I've confirmed that the .ucf file works fine when loaded with Unico GUI, with decision tree outputs correctly updating. However, when trying to implement in standard c drivers, it does not work.

I poll the accelerometer and also am sure that it is working correctly. Gyro isn't used for my decision trees. I'm loading my configurations in the same way as shown in the standard c driver examples:


for (int i=0; i<(sizeof(mlc_configuration) / sizeof(ucf_line_t)); i++){

        lsm6dsox_write_reg(&dev_ctx, mlc_configuration[i].address,

                            (uint8_t *) &mlc_configuration[i].data, 1);



The platform specific read and write functions are also working. I also set init for the MLC and write to LSM_ENB_FUNC_EN_B register to enable MLC.

In fact, I'm quite curious about the way configuration works. The lsm6dsox_write_reg functions writes to a specified register, but these registers are already reserved or other functions, as can be seen in the datasheet (e.x. 0x09 is SENSOR_HUB_8). Also, configurations from ucf seem to also frequently write to the same address multiple times. I couldn't find any documentation on the specifics as to how the configuration works, writing to seemingly random registers that are already mapped to other features.

Is there any documentation out there on how the mlc configuration works? The examples are light on comments. Any help is appreciated.

ST Employee

Hi @DHou.1​ ,

there is no application note describing in de, but you might find useful this thread, and also this other one.

Basically, the generated decision tree by Unico is a set of register configurations which is then written inside the right registers of DSOX following the sequence in the .h file. The meaning of this MLC registers are basically meaningless in the sense that they define branches and nodes of the configuration tree obtained -for example- with Weka tool, so at a high level they have no physical meaning, but only computational one.