You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm using the LIS3MDL magnetometer connected to I2C with the optional trigger attached to a GPIO pin on my MCU.
With CONFIG_LIS3MDL_TRIGGER enabled, lis3mdl_init calls lis3mdl_init_interrupt.
This function contains a call to lis3mdl_sample_fetch: if (lis3mdl_sample_fetch(dev, SENSOR_CHAN_ALL) < 0) {
However, lis3mdl_sample_fetch contains the following assertion: __ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL);
Therefore, the initialization always results in a fatal error, when CONFIG_LIS3MDL_TRIGGER and CONFIG_ASSERT are both set.
I consider this to be a bug, because everything works fine when CONFIG_ASSERT is not set!
Unless I have missed an important detail, I think it would be fine to remove the assertion to fix this bug.
press blue user button on board and wait a few seconds for fatal error to appear
deactivate CONFIG_ASSERT in prj.conf and retry, the error should be gone
Expected behavior
The LIS3MDL driver should not trip a (pointless?) assertion when setting up the interrupt line.
Impact
With this bug, The CONFIG_LIS3MDL_TRIGGER and CONFIG_ASSERT settings are mutually exclusive.
This is very annoying in complex applications, because assertions have safety critical roles and I cannot just deactivate them.
Logs and console output
These are from my production code, not the test program I linked to, but the error is equivalent:
Describe the bug
I'm using the LIS3MDL magnetometer connected to I2C with the optional trigger attached to a GPIO pin on my MCU.
With CONFIG_LIS3MDL_TRIGGER enabled,
lis3mdl_init
callslis3mdl_init_interrupt
.This function contains a call to
lis3mdl_sample_fetch
:if (lis3mdl_sample_fetch(dev, SENSOR_CHAN_ALL) < 0) {
However,
lis3mdl_sample_fetch
contains the following assertion:__ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL);
Therefore, the initialization always results in a fatal error, when CONFIG_LIS3MDL_TRIGGER and CONFIG_ASSERT are both set.
I consider this to be a bug, because everything works fine when CONFIG_ASSERT is not set!
Unless I have missed an important detail, I think it would be fine to remove the assertion to fix this bug.
To Reproduce
disco_l475_iot1
Expected behavior
The LIS3MDL driver should not trip a (pointless?) assertion when setting up the interrupt line.
Impact
With this bug, The CONFIG_LIS3MDL_TRIGGER and CONFIG_ASSERT settings are mutually exclusive.
This is very annoying in complex applications, because assertions have safety critical roles and I cannot just deactivate them.
Logs and console output
These are from my production code, not the test program I linked to, but the error is equivalent:
Environment:
The text was updated successfully, but these errors were encountered: