stm32duino / ISM330DHCX

Arduino library to support the ISM330DHCX 3D accelerometer and 3D gyroscope
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

Code stuck in the init function ism330dhcx_sensor_acquisition_init() #11

Open chen694 opened 4 days ago

chen694 commented 4 days ago

Thank you for providing this library which allows me communicate with the ISM330DHCX on my PWA, running with XMC4700.

The only issue I have encountered so far is with the initialization function ism330dhcx_sensor_acquisition_init(), sometimes (about 1 out of 10 power cycles) the device ID check fails, causing the code to get stuck in the while(1) loop which in turn triggers the watchdog reset of my system, please see the snapshot of the code below. Could you advise on how to resolve this issue? Thank you!

/ Wait sensor boot time / platform_delay(BOOT_TIME);

// Check device ID ism330dhcx_device_id_get(&dev_ctx, &whoamI);

if (whoamI != ISM330DHCX_ID) while (1);

cparata commented 3 days ago

Hi @chen694 , which bus are you using? I2C or SPI? Could you give more information about your hardware setup? Best Regards, Carlo