2022-11-15 07:30 AM
Hi,
I use the VL53L5CX in my own developped board .
Everything seems to work, but i can't get the guesture control code from static lib libGesturesMZ.a working (downloaded from STM website).
Initialisation goes fine , all statusses are OK , but the moment i run GW_run(....) the STM goes in HardFault_Handler().
All parameters i send with GW_run are valid and contain data .
Are there people that had the same problems?
Anything i can do to figure out why this is crashing?
these are the steps in software, all steps execute fine with STATUS_Ok but at GW_run() it crashes.
1) vl53l5cx_init
2) gesture_library_init_configure();
-> GW_init(&gest_predictor, &hand_tracker, &sensor_data);
-> HT_set_square_resolution(&hand_tracker, &sensor_data, Params.Resolution);
-> GW_set_frequency(&gest_predictor, &hand_tracker, &sensor_data, 1000.0/Params.RangingPeriod);
-> GW_set_params(&gest_predictor,....
-> GW_set_frequency(&gest_predictor, &hand_tracker, &sensor_data, 1000.0/Params.RangingPeriod);
-> SEN_set_orientation(&sensor_data, Params.SensorOrientation);
3) apps_layer_vl53l5cx_Configure(&L5Dev, &Params);
-> vl53l5cx_set_resolution(p_l5_dev, p_Params->Resolution==16 ? VL53L5CX_RESOLUTION_4X4 : VL53L5CX_RESOLUTION_8X8);
-> vl53l5cx_set_ranging_frequency_hz(p_l5_dev, (1000/p_Params->RangingPeriod));
-> vl53l5cx_set_integration_time_ms(p_l5_dev, p_Params->IntegrationTime);
-> vl53l5cx_set_xtalk_margin(p_l5_dev, 50);
-> vl53l5cx_set_target_order(p_l5_dev, VL53L5CX_TARGET_ORDER_CLOSEST);
->
4) vl53l5cx_start_ranging(&L5Dev);
5) loop
{
vl53l5cx_check_data_ready(&dev,&IsReady);
if(IsReady == 1){
vl53l5cx_get_ranging_data(&L5Dev, &RangingData);
SEN_CopyRangingData(&sensor_data, &RangingData);
GW_run(&gest_predictor, &hand_tracker, &sensor_data); -> crash
}
}
when looking at the hw registers after the crash bfsr_preciserr seems to be set and hfsr_forced is set also.
The last address of the PC was pointing to xTaskIncrementTick() .. this is from RTOS .
Thank you
2022-11-22 10:27 AM
There are muliple complied libraries for different processors.
The code is STSW-IMG035, but there is a qualifier on them for the cortex M0, M3, M33, M4 and M7
I'm guessing there is a mis-match between the ARM chip you are using and the version of the code you have. Carefully check the documentation on which chip you have and compare that to the software you've got.
Good luck,
2022-11-24 02:48 AM
Thanks John
I'm working with Steve directly.
The gesture lib supposes to support M4 core. The customer is using a G4 series STM32 microcontroller.
I will talk to Yann,
Bye
Julien