Hello jorgazam,
Could we know the specific phenomenon that the example on GitHub can't work?
I've attached the STM32 project with the high threshold example. I made that it reads only when there is an interrupt.
As you can see in the GIF that I have attached as well, the interrupt happens all the time, the status never seems to change even if I move all the axes to check where the interrupt is, since in the example it does not specify which axis is used. The limit is set to 0x12.
Hello jorgazam,
Sorry for the delay reply.
Your code will do self test every time when it is powered on. Can you change it to the following code logic and test it again?
rslt = bmm150_interface_selection(&bmm150dev);
rslt = init_bmm150(&bmm150dev);
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
rslt = bmm150_get_interrupt_status(&bmm150dev);
if (bmm150dev.int_status & BMM150_INT_ASSERTED_HIGH_THRES)
{
rslt = bmm150_read_mag_data(&mag_data, &bmm150dev);
compass = atan2(mag_data.y, mag_data.x) * 180 / M_PI;
}
HAL_Delay(100);
}
Hi BSTRobin,
The behavior doesn't seem to change with this change, in any case, the boot only performs it once at the beginning of the main, in what way is it possible that the selftest causes this failure, is it necessary to return to a "normal" state after doing the selftest ?
Hello jorgazam,
Sorry for the delay reply.
After our check, there was a mistake in BMM150 sensor API. The definition of BMM150_INT_ASSERTED_HIGH_THRES in bmm150_defs.h API should be equal to 0x0038 rather than 0x0380.
We will update BMM150 sensor API.