Guides
Add a peripheral
Tell Flash which parts are on your board, so it works from their datasheets and knowledge.
BMI270 driver tutorial · Part 2 of 5The running example: an M5Stack CoreS3 reading its built-in Bosch BMI270 motion sensor over I2C. Choose your tool below and every step and clip follows it. Start from part 1.
Why add the parts
Flash only knows the parts you add. Adding the BMI270 gives the agent its datasheet, its registers and its start-up sequence, so the driver in part 4 is built from the real part, not from memory.
Add the parts
There are two ways to add a part, and the clip shows both. The ESP32-S3 module goes in with a datasheet you already have. The BMI270 is found by its part number, and Flash fetches its datasheet for you.
In Flash IDE
- Open the Hardware workspace, go to Peripherals and choose Add peripheral.
- With your own datasheet: choose Add with datasheet, then Choose documents and pick the PDF or Markdown file. Name the part, for example esp32s3-wroom-1, and choose Add and prepare.
- By part number: choose Add peripheral again, stay on Find a part and type BMI270. It is not in the Flash catalog, so choose Search parts, pick BMI270 from Bosch Sensortec and choose Add as custom.
- Wait until both parts show Document ready in the list.
Or, in any tool
/peripherals manual "esp32s3-wroom-1" --file "./docs/esp32s3-wroom-1.pdf"/peripherals add-mouser BMI270 --manufacturer "Bosch Sensortec"Keep in mind
Use a part number when a distributor sells the part: Flash finds the exact part and its datasheet. Use your own datasheet for modules, custom parts or documents you already have. The CoreS3 also has an AXP2101 power controller; add it the same way if Flash needs to change the board’s power set-up.
Check what Flash knows
Ask the agent about the parts, as at the end of the clip. It searches both datasheets, separates the sensor’s own pins from the module’s GPIOs, and cites the pages it used.
Ask Flash
Check the BMI270 documentation and list its key registers and important pin numbers. Cite the datasheet pages.Keep in mind
The BMI270 answers at 0x68 or 0x69 depending on how its SDO pin is wired. If your project has no schematic, Flash asks you.