Skip to content
Docs
WebsiteRequest a demo

Guides

Debug on the board

Program the board, check the readings over serial and inspect the running firmware with the debugger.

BMI270 driver tutorial · Part 5 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.

1. Connect the board

Plug the CoreS3 into your computer with a USB-C cable. That one cable gives Flash serial output and JTAG debugging through the ESP32-S3’s built-in USB.

In Flash IDE

  1. Open the Debug workspace and select the board as the target.

2. Program the board and watch the readings

Switch to Debug and ask Flash to program the board and prove the driver works.

Ask Flash
/mode debug Program the board and capture serial output for 20 seconds. With the board flat on the desk, check that acceleration reads about 1 g on Z and rotation stays near 0 °/s, then tilt it and confirm the values follow. Report any resets or errors.

In Flash IDE

  1. Confirm the programming request: check the target and firmware, then choose Flash now.
  2. Follow the readings in the Serial view of the Debug workspace.
Keep in mind
Give every capture a time limit, and say whether Flash may reset the board or send it input. A short capture around one event is easier to check than a long log.

3. Inspect the running firmware

If a value looks wrong, look inside without disturbing the board: attach the debugger instead of resetting it.

Ask Flash
Attach the debugger without resetting the board. Set a breakpoint after the BMI270 read, then show the raw accelerometer registers and the converted values in g.

In Flash IDE

  1. Open GDB in the Debug workspace.
  2. Choose Preview debug setup to check the target, firmware and probe.
  3. Choose Start debugger in Attach mode, or let the agent drive.

4. Fix and check again

Make one focused fix, build, program and repeat the same serial check. Stop when the readings meet your success criterion.

Keep in mind
You have finished the tutorial. A debugging session can also end with a clear blocker and the next check to run: that is a useful result too.

Continue reading