Guides
Write a driver
Plan, implement and build a driver for the BMI270 from its datasheet, reviewing each change.
1. Plan from the datasheet
Start from the plan you asked for in part 3. Check it before any code is written: the I2C address, the start-up sequence, the registers and how the result will be verified. Correct anything that does not match your board.
The BMI270 is not a read-and-go sensor: it only measures after its configuration file has been uploaded at start-up. Bosch publishes a reference API that includes that file, so a good plan reuses it and writes only the I2C glue for this board.
2. Implement one step at a time
Switch to Normal and implement the smallest useful step: read the chip ID, which should be 0x24, then stream readings.
/mode normal Implement the planned BMI270 driver with Bosch's BMI270 API and the I2C glue for this board. Read the chip ID first, then print acceleration in g and rotation in °/s over serial ten times per second. Build the firmware.3. Review the changes
Flash asks before editing files, unless you chose to auto-approve edits.
In Flash IDE
- Approve the edits in the chat.
- Review each change in the Firmware workspace.
- Follow the build output until it passes.
4. Build and fix
Flash builds, fixes compile errors in the same loop and reports the result. A clean build means the driver compiles; part 5 proves it on the board.
- Keep the I2C glue, the BMI270 driver and the application separate.
- Ask for the datasheet page behind each register and scale factor.
- If the project has tests, add a host test for the unit conversion.