2024-04-18 11:36 PM - edited 2024-04-19 12:50 AM
Hi everyone,
been trying to nail the issue down for a while and I hope someone can help
I've got an LIS2DW12 connected using I2C to an STM32L476VGT6, and I'm trying to set it up to detect WAKEUP
events. I've been following ST's official AN5038 to get it in the right mode of operation.
My steps are as follows, in pseudocode:
On cold boot from the firmware, everything works, the accelerometer picks up the motions, triggers the interrupt handler, which jumps to an interrupt handling routine and passes on the event elsewhere. Tip-top.
On warm boot (NVIC_reset() or a hardware RESET button tied to the STM32), about 50% of the time the INT1 pin has a chance of getting tied down to GND and I've not been able to force it to unlatch. This is a serious problem because the devices aren't meant to be babysitted, and should resolve on its own.
On the system side:
On the STM32 side:
On the LIS side:
What am I missing here?
Solved! Go to Solution.
2024-04-30 12:20 AM
Hi @Federica Bossi,
I found the solution a few days ago but only managed to reply to the thread today.
The cause of the problem was in the CTRL7 register.
In cases where resetting the entire board doesn't reset power to the LIS2DW12, the accelerometer registers retain their values. This is expected.
However, resetting the accelerometer using the CTRL2.SOFT_RESET bit (both as explained in AN5038 Ch5.9 and the driver you linked) did not automatically reset the contents of registers even though the delay after the command was extended to 1 ms.
The CTRL7.INTERRUPT_ENABLE bit remained TRUE, and in some cases the accelerometer would be left with a stuck INT1 output pin. The only solution was to force that bit to FALSE on every microcontroller boot. This solved the problem completely.
I'm unsure if this is a known issue that's unreferenced in both the datasheet and the application note.
2024-04-30 12:03 AM
Hi @bmatesin ,
Welcome to ST Community!
Can you try to follow our official example on github and let me know if you still have the issue?
Thanks.
2024-04-30 12:20 AM
Hi @Federica Bossi,
I found the solution a few days ago but only managed to reply to the thread today.
The cause of the problem was in the CTRL7 register.
In cases where resetting the entire board doesn't reset power to the LIS2DW12, the accelerometer registers retain their values. This is expected.
However, resetting the accelerometer using the CTRL2.SOFT_RESET bit (both as explained in AN5038 Ch5.9 and the driver you linked) did not automatically reset the contents of registers even though the delay after the command was extended to 1 ms.
The CTRL7.INTERRUPT_ENABLE bit remained TRUE, and in some cases the accelerometer would be left with a stuck INT1 output pin. The only solution was to force that bit to FALSE on every microcontroller boot. This solved the problem completely.
I'm unsure if this is a known issue that's unreferenced in both the datasheet and the application note.