STMicroelectronics / lsm6dso32-pid

lsm6dso32 platform independent driver based on Standard C language and compliant with MISRA standard
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

Buffer page is always changed after writing first byte #5

Open avrland opened 4 months ago

avrland commented 4 months ago

During first usages of FSM, I found out that writing fsm program doesn't work correctly. Page is always being incremented after successful writing of first byte. https://github.com/STMicroelectronics/lsm6dso32-pid/blame/49919136f3011d7243906dd25e69df90501063ed/lsm6dso32_reg.c#L1664C1-L1686C6 Which leads FSM to program error because it's looking for program at selected page before.

That function is slightly different in lsm6dso and it seems to be written correctly. lsb is incremented before first page wrap check. https://github.com/STMicroelectronics/lsm6dso-pid/blob/d009f95ad74be0d8c6befcf4d68fb5729bfa37fb/lsm6dso_reg.c#L1689-L1708

avisconti commented 4 months ago

@avrland is 10db520fe possibly fixing this issue? Can you check it?