Skip to content

Comments

Improved initialization and config upload#13

Merged
qrasmont merged 10 commits intoqrasmont:masterfrom
joelsa:better-config-upload
Mar 29, 2025
Merged

Improved initialization and config upload#13
qrasmont merged 10 commits intoqrasmont:masterfrom
joelsa:better-config-upload

Conversation

@joelsa
Copy link
Contributor

@joelsa joelsa commented Mar 20, 2025

This PR:

  • fixes a TODO by making the prealloc buffer size configurable via const generics
  • let's the driver take in a delay and uses that in the init function
  • updates the Burst struct to take in values larger than 512
  • udates the init function to be more careful and include more checks, heavily inspired by the steps from the official C driver

The reasons for this are:

  • users might have much larger burst sizes
    • for example, I do my i2c development on a Linux machine with an i2c bus where I can do writes of 8192 bytes from userspace and with a custom driver or kernel module I could easily do a multiple of that
  • I found the init function to not properly set up the internal ASIC of the BMI270. In particular, I found:
    • that the Softreset is mandatory before uploading the config
    • the delays are critical, especially the 20ms delay after finishing the config file upload and the 450us after dis- or enabling the advanced power save mode
    • writing of the config file needs to happen in two-bytes increments, there should be an odd number of bytes written in one go

@joelsa joelsa changed the title Improved initialization config upload Improved initialization and config upload Mar 20, 2025
@qrasmont qrasmont self-requested a review March 20, 2025 19:24
@qrasmont
Copy link
Owner

Great! I'll test this ASAP

README.md Outdated
Comment on lines 27 to 30
i2c,
I2cAddr::Alternative,
Burst::Other(255),
delay
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here delay should be the 2nd argument not the last one and it should be Burst::new instead of Burst::Other. Otherwise LGTM!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, will fix it!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the Readme and the basic_read example in the latest commit.

@qrasmont qrasmont merged commit 71f65fa into qrasmont:master Mar 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants