lsm6dso
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c
- Domain
- embedded-iot
Research direction
Locate lsm6dso_write_lis2mdl_cx in the LSM6DSO driver sources and inspect its callers and the related lis2mdl_mag_user_offset_set function. Check how the len argument is expected to affect the write operation, then verify that the behavior is covered by the relevant driver checks or examples and that writes with lengths other than one behave correctly.
Written by the indexing model from the issue text.
Description
Device part numbers
lsm6dso
Type of bug
func
static int32_t lsm6dso_write_lis2mdl_cx(void *ctx, uint8_t reg,
const uint8_t *data, uint16_t len)
Describe the bug
the param "len" doesn't use in func "lsm6dso_write_lis2mdl_cx"
Additional context
static int32_t lsm6dso_write_lis2mdl_cx(void *ctx, uint8_t reg,
const uint8_t *data, uint16_t len)
{
axis3bit16_t data_raw_acceleration;
int32_t ret;
uint8_t drdy;
lsm6dso_status_master_t master_status;
lsm6dso_sh_cfg_write_t sh_cfg_write;
/* Configure Sensor Hub to read LIS2MDL. */
sh_cfg_write.slv0_add = (LIS2MDL_I2C_ADD & 0xFEU) >>
1; /* 7bit I2C address */
sh_cfg_write.slv0_subadd = reg,
sh_cfg_write.slv0_data = *data,
ret = lsm6dso_sh_cfg_write(&ag_ctx, &sh_cfg_write);
/* Disable accelerometer. */
lsm6dso_xl_data_rate_set(&ag_ctx, LSM6DSO_XL_ODR_OFF);
/* Enable I2C Master. */
lsm6dso_sh_master_set(&ag_ctx, PROPERTY_ENABLE);
/* Enable accelerometer to trigger Sensor Hub operation. */
lsm6dso_xl_data_rate_set(&ag_ctx, LSM6DSO_XL_ODR_104Hz);
/* Wait Sensor Hub operation flag set. */
lsm6dso_acceleration_raw_get(&ag_ctx, data_raw_acceleration.i16bit);
do {
HAL_Delay(20);
lsm6dso_xl_flag_data_ready_get(&ag_ctx, &drdy);
} while (!drdy);
do {
HAL_Delay(20);
lsm6dso_sh_status_get(&ag_ctx, &master_status);
} while (!master_status.sens_hub_endop);
/* Disable I2C master and XL (trigger). */
lsm6dso_sh_master_set(&ag_ctx, PROPERTY_DISABLE);
lsm6dso_xl_data_rate_set(&ag_ctx, LSM6DSO_XL_ODR_OFF);
return ret;
}
that will cause the API write len is not 1, issue coming, like func "lis2mdl_mag_user_offset_set".
- Dominant language
- C
- Stars
- 883
- Forks
- 539
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from STMicroelectronics/STMems_Standard_C_drivers
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
STMicroelectronics/STMems_Standard_C_drivers#184 · 2 reactions ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
bug
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
question
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in STMicroelectronics/STMems_Standard_C_drivers
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
gbdev/homebrewhub-submit#20 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenPrinting/cups#1772 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
snowballstem/snowball#311 ·